Virtual work for generalized torque

5
 1 Vir tual work Notes by Danylo Malyuta. 1.1 Gener ali zed t orq ue ex planat ion This document presents an exhaustive overview of how to compute generalized torques for a 3-D rotating quadcopter (or any other body) whose orientation is expressed in the Tait-Bryan Euler angles,  { ϕ , θ , ψ}. Namely: ˆ x B ˆ z B , z ˆ y B x  y R ψ ψ ψ  x z y , y z x θ θ R θ z  y x , x B z B  y B ϕ ϕ Yaw Pitch Roll R θ x B z B y B Figure 1: Tait-Bryan Yaw-Pitch-Roll convention. Not important for this paper is that the inertial frame  { ˆ x i , ˆ y i , ˆ z I }  is the “world” frame and the frame  { ˆ x B , ˆ y B , ˆ z B }  is the quadcopter body frame. The virtual work principle tells us: δW  = N  i=1 F i · δ r i  (1) If we consider just the quadcopter, then the number of bodies  N  = 1, so: δW  = F  · δ r  (2) If we consider just the torques, then acting the quadcopter (and thus model  just the generalized torques), we can express: F  = τ B x τ B y τ B z  (3) Where  F  is therefore modeled in the  B  fra me, i.e. the body fra me of the quadcopter. What is our goal? It is to nd Q i.e. the vector of generalized torques that we can use in an Euler-Lagrange dynamical equation as the right-hand-side term. How do we do this? One way is to use the denition of generalized forces: Q j  = N  i=1 F i ·  ∂ r i q j =   N =1 F  ·  ∂ r q j  j  = 1,...,n  (4) Where q j  is the  j -th generalized coordinates, of which there are  n  such coor- dinates. In the case of quadcopter attitude, we take the generalized coordinates as the Tait-Bryan Euler angles of Figure  1 , therefore: 1

description

This document explains how to apply virtual work theory to the problem of generalized torques of the Euler-Lagrange equations for the orientation dynamics of a rigid body (such as a quadcopter).

Transcript of Virtual work for generalized torque

  • 1 Virtual work

    Notes by Danylo Malyuta.

    1.1 Generalized torque explanation

    This document presents an exhaustive overview of how to compute generalizedtorques for a 3-D rotating quadcopter (or any other body) whose orientation isexpressed in the Tait-Bryan Euler angles, {, , }. Namely:

    xB

    zB , ~z

    yB

    ~x

    ~yR

    ~x~z

    ~y, ~y

    ~z

    ~x R

    ~z

    ~y

    ~x, ~xB

    ~zB

    ~yB

    Yaw Pitch Roll

    R~xB

    ~zB

    ~yB

    Figure 1: Tait-Bryan Yaw-Pitch-Roll convention.

    Not important for this paper is that the inertial frame {xi, yi, zI} is theworld frame and the frame {xB , yB , zB} is the quadcopter body frame.

    The virtual work principle tells us:

    W =

    Ni=1

    Fi ri (1)

    If we consider just the quadcopter, then the number of bodies N = 1, so:

    W = F r (2)If we consider just the torques, then acting the quadcopter (and thus model

    just the generalized torques), we can express:

    F =

    BxByBz

    (3)Where F is therefore modeled in the B frame, i.e. the body frame of the

    quadcopter.What is our goal? It is to findQ i.e. the vector of generalized torques that we

    can use in an Euler-Lagrange dynamical equation as the right-hand-side term.How do we do this? One way is to use the definition of generalized forces:

    Qj =

    Ni=1

    Fi riqj

    =N=1

    F rqj

    j = 1, . . . , n (4)

    Where qj is the j-th generalized coordinates, of which there are n such coor-dinates. In the case of quadcopter attitude, we take the generalized coordinatesas the Tait-Bryan Euler angles of Figure 1, therefore:

    1

  • q1 = q2 = q3 =

    (5)

    To apply equation 4 we would have to know what ri is. Notably, since F isin the B frame, r has to also be in the B frame. We could for example startout by writing the angular velocity vector, in the B frame:

    = R

    00

    +RR0

    0

    +RRR00

    (6) = (Re1)+ (RRe2) + (RRRe3) (7)

    We would thank that we would be able to do the following in order to obtainr:

    r =

    = (Re1)+ (RRe2) + (RRRe3) (8)

    However, angular velocity is not integrable (see for example sub-section 3.17 of this document). Therefore we cannot do equation 8. We mustfind another way.

    This other way is hidden inside equation 2. Indeed, although we cannotintegrate in time as we do in equation 8, we may do so for an infinitesimallysmall time - which is the case of virtual displacements. Calling

    = r, we can

    write based on equation 7:

    r = (Re1)+ (RRe2) + (RRRe3) (9)

    r = [(Re1) (RRe2) (RRRe3)]

    (10)Hence, using equation 2:

    W = F r = FT [(Re1) (RRe2) (RRRe3)]

    (11)However, we have from virtual work theory that:

    W =

    nj=1

    Qjrj = QT r (12)

    By identification of terms in equations 11 and 12, we have:

    F T[(Re1) (RRe2) (RRRe3)

    ]= QT (13)

    2

  • Finally:

    Q =

    (Re1)T(RRe2)T(RRRe3)

    T

    F = BF (14)We then can use Q = BF for the attitude dynamics of the quadrotor,

    expressed using Euler-Lagrange formalism:

    d

    dt

    (Lq

    ) Lq

    = Q = BF (15)

    1.1.1 Close examination of equation 9

    An important question to ask is: why are we able to write 9 but not 8? Its afterall perhaps the most crucial step in our derivation. We examine this problemwith a quick coding session in Mathematica.

    First lets define the rotation matrices:

    Lets assume that we start out by defining the Euler angles {, , }. Weassign the following functions:

    Which gives:

    3

  • Now what we will do is navely use equation 8 to obtains the three anglesdefining body orientation in the B frame. This gives us:

    And now the deal-breaker: we will go back to the frames of the respectiveEuler angles by using B , the vector of three orientation angles in the B frame.If equation8 is correct, this inverse map will give us back exactly the three Eulerangles (vector = [ ]T ), but if it is not then we will get a different timevariation of the Euler angles than the one we entered in In[53] of Mathematica.Doing this:

    ,Predic

    Predic

    Predic

    Figure 2: Actual and predicted Euler angles.

    On a longer time scale (up to 10 [s]):

    4

  • Figure 3: Actual and predicted Euler angles for a longer period of time.

    From the last two figures we can see that the actual Euler angles {, , }deviate from the predicted Euler angles {Predic, Predic, Predic} that we calcu-late from the body-frame orientation angles that we have calculated by applyingequation 8. This proves that equation 8 is wrong - i.e. we cannot use that re-lationship!

    However, from Figure 2 we can see that {, , } {Predic, Predic, Predic}for very small tune t. Indeed, virtual displacement are actually by definitionfor such a small t that we say the virtual displacement (from Wikipedia) is anassumed infinitesimal change of system coordinates occurring while time is heldconstant. It is called virtual rather than real since no actual displacement cantake place without the passage of time. Therefore we can see from Figure 2that indeed equation 9, which is basically equation 8 taken for an infinitesimallysmall time, is correct and applicable!

    A further observation thats interesting from Figure 3 is that Predic = exactly; Predic is much less equal to ; finally, Predic is grossly wrong. Theequality Predic = is because the axes x

    and xB coincide, which means thegoing from B to is exact!

    5

    Virtual workGeneralized torque explanationClose examination of equation 9