RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude...

59
AOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and quaternions •Recall the fundamental dynamics equations •For both equations, we must relate momentum to kinematics ~ f = d dt ~ p ~ g = d dt ~ h

Transcript of RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude...

Page 1: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Rotational Kinematics

Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and quaternions

•Recall the fundamental dynamics equations

•For both equations, we must relate momentum to kinematics

~f = ddt~p

~g = ddt~h

Page 2: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Translational vs Rotational Dynamics

• Linear momentum= mass × velocity

• d/dt (linear momentum) = applied forces

• d/dt (position) = linear momentum/mass

• Angular momentum= inertia × angular velocity

• d/dt (angular momentum)=applied torques

• d/dt (attitude) = “angular momentum/inertia”

~f = ddt~p ~g = d

dt~h

Page 3: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Translational Kinematics

Newton’s second law can be written in first-order state-vector form as

~r = ~p/m

~p = ~f

Here, ~p is the linear momentum, definedby the kinematics equation; i.e., ~p =m~r

Thus, the kinematics differential equation allows us to integrate the velocity to compute the positionThe kinetics differential equation allows us to integrate the applied force to compute the linear momentumIn general, ~f = ~f(~r, ~p)

Page 4: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Translational Kinematics (2)Consider ~f = m~a expressed in an inertial frame:

mr1 = f1

mr = f ⇔ mr2 = f2

mr3 = f3

Equivalently

p1 = f1

p = f ⇔ p2 = f2

p3 = f3

r1 = p1/m

r = p/m ⇔ r2 = p2/m

r3 = p3/m

We need to develop rotational equations equivalent to the translational kinematics equations

Page 5: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Reference Frame & Vectors

i1i2

i3

~v

v1 v2

v3

Reference frame is dextral triad of orthonormal unit vectors

Vector can be expressed as linear combination of the unit vectorsMust be clear about which reference frame is used

Fi ≡ni1, i2, i3

o~v = v1i1 + v2i2 + v3i3

Page 6: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Orthonormal• Orthonormal means the base vectors are perpendicular

(orthogonal) to each other, and have unit length (normalized)

• This set of 6 (why not 9?) properties can be written in shorthand as

• We can stack the unit vectors in a column “matrix”

• And then write the orthonormal property as

i1 · i1 = 1 i1 · i2 = 0 i1 · i3 = 0i2 · i1 = 0 i2 · i2 = 1 i2 · i3 = 0i3 · i1 = 0 i3 · i2 = 0 i3 · i3 = 1

ii · ij =½1 if i = j0 if i 6= j or ii · ij = δij

nio=ni1 i2 i3

oTnio·nioT

=

⎡⎣ 1 0 00 1 00 0 1

⎤⎦ = 1

Page 7: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Dextral, or Right-handed

• Right-handed means the ordering of the three unit vectors follows the right-hand rule

• Which can be written more succinctly as

• Or even more succinctly as

i1 × i1 = ~0 i1 × i2 = i3 i1 × i3 = −i2i2 × i1 = −i3 i2 × i2 = ~0 i2 × i3 = i1i3 × i1 = i2 i3 × i2 = −i1 i3 × i3 = ~0

nio×nioT

=

⎧⎨⎩~0 i3 −i2−i3 ~0 i1i2 −i1 ~0

⎫⎬⎭ = −nio×

ii × ij = εijk ik

εijk =

⎧⎨⎩ 1 for i, j, k an even permutation of 1,2,3−1 for i, j, k an odd permutation of 1,2,30 otherwise (i.e., if any repetitions occur)

Page 8: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Skew Symmetry

• The []× notation defines a skew-symmetric 3 × 3 matrix whose 3 unique elements are the components of the 3 × 1 matrix []

• The same notation applies if the components of the 3 × 1 matrix [] are scalars instead of vectors

• The “skew-symmetry” property is satisfied since

a =

⎡⎣ a1a2a3

⎤⎦⇒ a× =

⎡⎣ 0 −a3 a2a3 0 −a1−a2 a1 0

⎤⎦

(a×)T = −a×

nio×

=

⎧⎨⎩~0 −i3 i2i3 ~0 −i1−i2 i1 ~0

⎫⎬⎭

Page 9: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Vectors

• A vector is an abstract mathematical object with two properties: direction and length

• Vectors used in this course include, for example, position, velocity, acceleration, force, momentum, torque, angular velocity

• Vectors can be expressed in any reference frame• Keep in mind that the term “state vector” refers

to a different type of object -- specifically, a state vector is generally a column matrix collecting all the system states

Page 10: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Vectors Expressed in Reference Frames

i1i2

i3

~v

v1 v2

v3

~v = v1i1 + v2i2 + v3i3The scalars, v1, v2, and v3, arethe components of ~v expressedin Fi. These components arethe dot products of the vector ~vwith the three base vectors of Fi.Specifically,

v1 = ~v·i1, v2 = ~v·i2, v3 = ~v·i3

Since the i vectors are unit vec-tors, these components may alsobe written as

vj = v cosαj , j = 1, 2, 3

where v = k~vk is the magnitudeor length of ~v, and αj is the angle

between ~v and ij for j = 1, 2, 3

Page 11: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Vectors Expressed in Reference Frames (2)

• Frequently we collect the components of the vector into a matrix

• When we can easily identify the associated reference frame, we use the simple notation above; however, when multiple reference frames are involved, we use a subscript to make the connection clear. Examples:

v =

⎡⎣ v1v2v3

⎤⎦

vi denotes components in Fivo denotes components in Fovb denotes components in Fb

Note the absence of an overarrow

Page 12: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Further Vector Notation

• Matrix multiplication arises frequently in dynamics and control, and an interesting application involves the 3 × 1matrix of a vector’s components and the 3 × 1 “matrix”of a frame’s base vectors*

• We frequently encounter problems of two types:––

* Peter Hughes coined the term “vectrix” to denote this object

~v = [v1 v2 v3]

⎧⎨⎩i1i2i3

⎫⎬⎭ = vTi nio= vTi

nio= vTo o = vTb

nbo= · · ·

Given vi and vb, determine the attitude of Fb with respect to FiGiven the attitude of Fb with respect to Fi, and components vi,determine vb

Page 13: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Rotations from One Frame to Another• Suppose we know the components of vector ~v in Fb, denoted vb, andwe want to determine its components in Fi, denoted vi

• In some sense this problem has three unknowns (the components ofvi); hence we expect to form a set of three equations and three unknowns

• Specifically, we note that ~v = vTi

nio= vTb

nboand seek a linear

transformation R such thatnio= R

nbo

• With such a transformation, we can make a substition and have ~v =vTi R

nbo= vTb

nbo

• Since the base vectorsnboare orthonormal, the coefficients on both

sides of the equation must be equal, so

vTi R = vTb ⇒ RTvi = vb

Page 14: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Rotations (2)• Problem reminder: Knowing vb, determine vi

• We have RTvi = vb

• If we knowR, then we just have to solve the linear system to determinevi

• We know that R is a 3× 3 matrix (i.e., R ∈ R3×3), and thatnio= R

nbo

• The latter can be expanded to

i1 = R11b1 +R12b2 +R13b3

i2 = R21b1 +R22b2 +R23b3

i3 = R31b1 +R32b2 +R33b3

• What, for example, is R11?

Page 15: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Rotations (3)• Consider just one of the equations involve the components of R:

i1 = R11b1 +R12b2 +R13b3

Comparing this expression with the definition of the components of avector in a specific frame, we see that

R11 = i1 · b1, R12 = i1 · b2,

and in general,Rij = ii · bj

Using direction cosines, R11 = cosα11, R12 = cosα12, and in general,Rij = cosαij, where αij is the angle between ii and bj

• Thus R is a matrix of direction cosines, and is frequently referred toas the DCM (direction cosine matrix)

Page 16: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Rotations (4)• Another way to describe R is to observe that its rows contain thecomponents of the base vectors of Fi expressed in Fb, and that itscolumns contain the components of the base vectors of Fb expressed inFi

• These observations mean that the rows and columns are mutuallyorthogonal, and since the base vectors are unit vectors, the rows andcolumns are mutually orthonormal

• Recalling earlier notation,nio·nioT

= 1, we can also write R as the

dot product ofniowith

nboT, i.e.,

R =nio·nboT

• So, if we know the relative orientation of the two frames, we cancompute R and solve the required linear system to compute vi

Page 17: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Rotations (5)• Assuming we have computed R, we just need to solve the requiredlinear system to compute vi

• The linear system, RTvi = vb, is easily solved because of the previ-ously observed fact that R is an orthonormal matrix

• If we were to return to the beginning of this development and beginwith

RTnio=nbo

instead ofnio= R

nbo

we would find that the same matrix R satisfies both equations, thusproving that R−1 = RT , which is perhaps the most useful property oforthonormal matrices

• Its application here leads to

vi = Rvb −→ vi = Ribvb

We adopt the notationRib to denote the orthonormal matrix that trans-forms vectors from Fb to Fi

Page 18: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Rotations (6)Summary of Rotation Notation

• Rotation matrix, orthonormal matrix, attitude matrix, and directioncosine matrix are synonymous

• The inverse of the rotation matrix is simply its transpose

• The orthonormal matrix that transforms vectors from Fb to Fi isdenoted Rib:

vi = Ribvb and vb = R

bivi

• The rotation matrix can be computed using

Rib =nio·nboT

and Rbi =nbo·nioT

Rib =

⎡⎣ i1bi2bi3b

⎤⎦ = £ b1i b2i b3i¤

Page 19: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Rotations (7)More Properties of Rotation Matrices

• Since R−1 = RT , RTR = 1 (the identity matrix)

• The determinant of R is unity: det R = 1

• One of the eigenvalues of R is +1

• Every rotation corresponds to a rotation about a single axis a throughan angle Φ; this fact implies that Ra = a, and hence a is the eigenvectorcorresponding to the unity eigenvalue

• Rotations multiply; i.e., if Rab relates frames Fa and Fb, and Rbc

relates frames Fb and Fc, then

Rac = RabRbc

Page 20: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Rotational Kinematics Representations

• The rotation matrix represents the attitude• A rotation matrix has 9 numbers, but they are

not independent• There are 6 constraints on the 9 elements of a

rotation matrix (what are they?)• Rotation has 3 degrees of freedom• There are many different sets of parameters that

can be used to represent or parameterizerotations

• Euler angles, Euler parameters (aka quaternions), Rodrigues parameters (aka Gibbs vectors), Modified Rodrigues parameters, …

Page 21: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Euler Angles

• Leonhard Euler (1707-1783) reasoned that the rotation from one frame to another can be visualized as a sequence of three simple rotations about base vectors

• Each rotation is through an angle (Euler angle) about a specified axis

• Consider the rotation from Fi toFb using three Euler angles, θ1, θ2,and θ3

• The first rotation is about the i3axis, through angle θ1

• The resulting frame is denotedFi0 or

ni0o

• The rotation matrix from Fi toFi0 is

Ri0i = R3(θ1)

Ri0i = R3(θ1) =

⎡⎣ cos θ1 sin θ1 0− sin θ1 cos θ1 00 0 1

⎤⎦ ⇒ vi0 = R3(θ1)vi

Page 22: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Visualizing That “3” Rotation

Ri0i = R3(θ1) =

⎡⎣ cos θ1 sin θ1 0− sin θ1 cos θ1 00 0 1

⎤⎦ ⇒ vi0 = R3(θ1)vi

i1θ1

θ1

i2i02

← i3 and i03 are out of the page

i01

Page 23: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Euler Angles (2)• The second rotation is about thei03 axis, through angle θ2

• The resulting frame is denotedFi00 or

ni00o

• The rotation matrix from Fi0 toFi00 is

Ri00i0 = R2(θ2)

The notation for the simple rota-tions is Ri(θj), which denotes a ro-tation about the ith axis. The sub-script on R defines which axis isused, and the subscript on θ de-fines which of the three angles inthe Euler sequence used

Ri00i0 = R2(θ2)

=

⎡⎣ cos θ2 0 − sin θ20 1 0

sin θ2 0 cos θ2

⎤⎦vi00 = R2(θ2)vi0 = R2(θ2)R3(θ1)vi

Ri00i = R2(θ2)R3(θ1)

is the rotation matrix transformingvectors from Fi to Fi00

For an Ri rotation, the ith row andcolumn are always two zeros anda one. The other two rows andcolumns have cos θ and sin θ in aneasily memorized pattern

Page 24: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Euler Angles (3)• The third rotation is about the i001axis, through angle θ3

• The resulting frame is denoted Fbornbo

• The rotation matrix from Fi00 toFb is

Rbi00 = R1(θ3)

Rbi00 = R1(θ3)

=

⎡⎣ 1 0 00 cos θ3 sin θ30 − sin θ3 cos θ3

⎤⎦Note that the cos θ terms are on thediagonal of the matrix, whereas thesin θ terms are on the off-diagonal

vb = R1(θ3)vi00

= R1(θ3)R2(θ2)R3(θ1)vi

Rbi = R1(θ3)R2(θ2)R3(θ1)

is the rotation matrix transformingvectors from Fi to Fb

θ3

θ3

i002

i003

b2

b3

← i001 and b1 are out of the page

Page 25: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Euler Angles (4)We have performed a 3-2-1 rotation from Fi to Fi00

Rbi = R1(θ3)R2(θ2)R3(θ1)

=

⎡⎣ 1 0 00 cθ3 sθ30 −sθ3 cθ3

⎤⎦⎡⎣ cθ2 0 −sθ20 1 0sθ2 0 cθ2

⎤⎦⎡⎣ cθ1 sθ1 0−sθ1 cθ1 00 0 1

⎤⎦=

⎡⎣ cθ1cθ2 sθ1cθ2 −sθ2−cθ3sθ1 + cθ1sθ2sθ3 cθ1cθ3 + sθ1sθ2sθ3 cθ2sθ3cθ1sθ2cθ3 + sθ1sθ3 sθ1sθ2cθ3 − cθ1sθ3 cθ2cθ3

⎤⎦We can select arbitrary values of the three angles and compute a rotationmatrix. For example, let θ1 = π/3, θ2 = π/7, and θ3 = π/5:

R =

⎡⎣ 0.450484 0.780262 −0.433884−0.573114 0.625371 0.5295760.684547 0.010099 0.728899

⎤⎦Conversely, given a rotation matrix, we can extract the Euler angles

Page 26: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Euler Angles (5)To extract Euler angles from a given rotation matrix, equate elementsof the two matrices:

Rbi =

⎡⎣ cθ1cθ2 sθ1cθ2 −sθ2−cθ3sθ1 + cθ1sθ2sθ3 cθ1cθ3 + sθ1sθ2sθ3 cθ2sθ3cθ1sθ2cθ3 + sθ1sθ3 sθ1sθ2cθ3 − cθ1sθ3 cθ2cθ3

⎤⎦=

⎡⎣ 0.450484 0.780262 −0.433884−0.573114 0.625371 0.5295760.684547 0.010099 0.728899

⎤⎦Choose the easy one first:

R13 : −sθ2 = −0.433884⇒ θ2 = sin−1 0.433884 = 0.448799 ≈ π/7

R11 : cθ1cθ2 = 0.450484⇒ θ1 = 1.047198 ≈ π/3

Quadrant checks are generally necessary for the second and third calcu-lations.

Exercise: Select another Euler angle sequence and determine the valuesof the three θs that give the numerical R above.

Page 27: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Euler Angles (6)We just developed a 3-2-1 rotation, but there are other possibilities

• There are 3 choices for the first rotation, 2 choices for the secondrotation, and 2 choices for the third rotation, so there are 3×2×2 = 12possible Euler angle sequences

• The Euler angle rotation sequences are

(1− 2− 3) (1− 3− 2) (1− 2− 1) (1− 3− 1)(2− 3− 1) (2− 1− 3) (2− 3− 2) (2− 1− 2)(3− 1− 2) (3− 2− 1) (3− 1− 3) (3− 2− 3)

• The two left columns are sometimes called the asymmetric rotationsequences, and the two right columns are called the symmetric sequences

• The roll-pitch-yaw sequence is an asymmetric sequence (which one?),whereas the Ω-i-ω sequence (what is this?) is a symmetric sequence

Page 28: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Euler Angles (7)• The three simple rotation matricesare

R1(θ) =

⎡⎣ 1 0 00 cos θ sin θ0 − sin θ cos θ

⎤⎦

R2(θ) =

⎡⎣ cos θ 0 − sin θ0 1 0sin θ 0 cos θ

⎤⎦

R3(θ) =

⎡⎣ cos θ sin θ 0− sin θ cos θ 00 0 1

⎤⎦

(1,0,0) in 1st row and columnCosines on diagonal, Sines on off-diagonal, negative Sine on row “above” the 1st row

(0,1,0) in 2nd row and columnCosines on diagonal, Sines on off-diagonal, negative Sine on row “above” the 2nd row

(0,0,1) in 3rd row and columnCosines on diagonal, Sines on off-diagonal, negative Sine on row “above” the 3rd row

Page 29: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Roll, Pitch and Yaw• Roll, pitch and yaw are Euler angles and are sometimes defined as a

3-2-1 sequence and sometimes defined as a 1-2-3 sequence• What’s the difference?

The 3-2-1 sequence (we did earlier) leads to

Rbi =

⎡⎣ cθ1cθ2 sθ1cθ2 −sθ2−cθ3sθ1 + cθ1sθ2sθ3 cθ1cθ3 + sθ1sθ2sθ3 cθ2sθ3cθ1sθ2cθ3 + sθ1sθ3 sθ1sθ2cθ3 − cθ1sθ3 cθ2cθ3

⎤⎦where θ1 is the yaw angle, θ2 is the pitch angle, and θ3 is the roll angle

The 1-2-3 sequence leads to

Rbi =

⎡⎣ cθ2cθ3 sθ1sθ2cθ3 + cθ1sθ3 sθ1sθ3 − cθ1sθ2cθ3cθ2sθ3 cθ1cθ3 − sθ12θ2sθ3 sθ1cθ3 + cθ1sθ2sθ3sθ2 −sθ1cθ2 cθ1cθ2

⎤⎦where θ1 is the roll angle, θ2 is the pitch angle, and θ3 is the yaw angle

Page 30: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Roll, Pitch, Yaw (2)• Note that the two matrices are not the same• Rotations do not commute• However, if we assume that the angles are small (appropriate for

many vehicle dynamics problems), then the approximations of the two matrices are equal

3-2-1 Sequence

cos θ ≈ 1 and sin θ ≈ θ

⇒ Rbi ≈

⎡⎣ 1 θ1 −θ2−θ1 1 θ3θ2 −θ3 1

⎤⎦where θ1 is the yaw angle, θ2 is thepitch angle, and θ3 is the roll angle

1-2-3 Sequence

cos θ ≈ 1 and sin θ ≈ θ

⇒ Rbi ≈

⎡⎣ 1 θ3 −θ2−θ3 1 θ1θ2 −θ1 1

⎤⎦where θ1 is the roll angle, θ2 is thepitch angle, and θ3 is the yaw angle

Rbi ≈ 1−

⎡⎣ θ3θ2θ1

⎤⎦× ⇒ ⇐ Rbi ≈ 1− θ×Rbi ≈ 1−

⎡⎣ rollpitchyaw

⎤⎦×

Page 31: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Perifocal Frame

• Earth-centered, orbit-based, inertial

• The P-axis is in periapsis direction

• The W-axis is perpendicular to orbital plane (direction of orbit angular momentum vector, )

• The Q-axis is in the orbital plane and finishes the “triad”of unit vectors

• In the perifocal frame, the position and velocity vectors both have a zero component in the W direction

P

P

Q

Q W

vr ×

Page 32: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

A One-Minute Course on Orbital Mechanics

ων

iΩI

J

K

n

Equatorial plane

Orbital plane

Orbit is defined by 6 orbital elements (oe’s): semimajor axis, a; eccentricity, e; inclination, i; right ascension of ascending node, Ω; argument of periapsis, ω; and true anomaly, ν

Page 33: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Inertial Frame to Perifocal Frame

R3(Ω) =

⎡⎣ cosΩ sinΩ 0− sinΩ cosΩ 00 0 1

⎤⎦

R1(i) =

⎡⎣ 1 0 00 cos i sin i0 − sin i cos i

⎤⎦

R3(ω) =

⎡⎣ cosω sinω 0− sinω cosω 00 0 1

⎤⎦

Rpi = R3(ω)R1(i)R3(Ω) =

⎡⎣ cωcΩ− ci sω sΩ ci cΩ sω + cω sΩ si sω−sω cΩ− ci cω sΩ ci cω cΩ − sω sΩ si cω

si sΩ −si cΩ ci

⎤⎦

• Use a 3-1-3 sequence

• Right ascension of the ascendingnode Ω about K: R3(Ω), rotates Ito n (the ascending node vector)

• Inclination i about the node vec-tor: R1(i), rotates K to W (theorbit normal direction)

• Argument of periapsis ω aboutthe orbit normal: R3(ω), rotates n

to P (the periapsis direction)

Page 34: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Orbital Reference Frame

• Same as “roll-pitch-yaw”frame, for spacecraft

• The o3 axis is in the nadir direction

• The o2 axis is in the negative orbit normal direction

• The o1 axis completes the triad, and is in the velocity vector direction for circular orbits

• In the orbital frame, position and velocity both have zero in the o2 direction, and position has zero in the o1direction as well

• You will find the rotation from perifocal to orbital easier to visualize if you make yourself two reference frames

v

r−

w−

1o

2o3o

Page 35: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Perifocal Frame to Orbital Frame• Use a 2-3-2 sequence

• 270 about Q: R2(270), rotates

W to −P (the nadir direction)

• 90 about the nadir vector:R3(90

), rotates o2 to −W (thenegative orbit normal direction)

• Negative true anomaly −ν abouto2: R2(−ν), rotates o3 to thetransverse direction

Rop = R2(−ν)R3(90)R2(270

) =

⎡⎣ −sν cν 00 0 −1−cν −sν 0

⎤⎦

R2(270) =

⎡⎣ 0 0 10 1 0−1 0 0

⎤⎦

R3(90) =

⎡⎣ 0 1 0−1 0 00 0 1

⎤⎦

R2(−ν) =

⎡⎣ cos ν 0 sin ν0 1 0

− sin ν 0 cos ν

⎤⎦

Page 36: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Inertial to Perifocal to Orbital

Rpi = R3(ω)R1(i)R3(Ω) =

⎡⎣ cωcΩ− ci sω sΩ ci cΩ sω + cω sΩ si sω−sω cΩ− ci cω sΩ ci cω cΩ − sω sΩ si cω

si sΩ −si cΩ ci

⎤⎦Rop = R2(−ν)R3(90

)R2(270) =

⎡⎣ −sν cν 00 0 −1−cν −sν 0

⎤⎦Roi = RopRpi

=

⎡⎣ −su cΩ− cu ci sΩ −su sΩ+ cu ci cΩ cu si−si sΩ si cΩ −ci

−cu cΩ+ su ci sΩ −cu sΩ− su ci cΩ −su si

⎤⎦where u = ω + ν

Page 37: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

An Illustrative ExampleIn an inertial reference frame, an Earth-orbiting satellite has positionand velocity vectors:

~r = −6000~I+ 10, 000~J+ 5, 000 ~K [km]

~v = −5~I− 2~J+ 1 ~K [km/s]

The orbital elements are (using elementary astrodynamics)

a = 12, 142 km, e = 0.22026, i = 23.986,Ω = 46.469,ω = 321.80, ν = 113.98

We can use i, Ω, and ω to compute Rpi as

Rpi =

⎡⎣ 0.95089 0.18060 −0.25139−0.094620 0.94286 0.319460.29472 −0.27998 0.91364

⎤⎦Then we can rotate position and velocity into Fp:

rp = [−5156.3 11594 0.037610]Tvp = [−5.3670 − 1.0932 − 2.7899× 10−7]T

Page 38: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

An Illustrative Example (continued)We can use ν = 113.98 to compute Rop as

Rop =

⎡⎣ −0.91369 −0.40642 00 0 −1

0.40642 −0.91369 0

⎤⎦We can then multiply RopRpi to get Roi, or we can use i, Ω, andu = ω + ν to compute Roi:

Roi =

⎡⎣ −0.83036 −0.54821 0.099858−0.29472 0.27998 −0.913640.47291 −0.78808 −0.39406

⎤⎦Then we can rotate position and velocity into Fo:

ro = [−0.66151 − 0.037610 − 12, 689]Tvo = [5.3481 2.7899× 10−7 − 1.1824]T

Page 39: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Differential Equations of Kinematics• Given the velocity of a point and initial

conditions for its position, we can compute its position as a function of time by integrating the differential equation

• We now need to develop the equivalent differential equations for the attitude when the angular velocity is known

• Preview:

• d/dt (attitude) = “angular momentum/inertia”

~r = ~v

θ =

⎡⎣ 0 sin θ3/ cos θ2 cos θ3/ cos θ20 cos θ3 − sin θ31 sin θ3 sin θ2/ cos θ2 cos θ3 sin θ2/ cos θ2

⎤⎦⎡⎣ ω1ω2ω3

⎤⎦ = S−1ω

Page 40: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Euler Angles and Angular Velocity

One frame-to-frame at a time, just as we did for developing rotationmatrices

• 3-2-1 rotation from Fi to Fi0 to Fi00 to Fb

• 3-rotation from Fi to Fi0 about i3 ≡ i03 through θ1

• The angular velocity of Fi0 with respect to Fi is

~ωi0i = θ1 i3 = θ1 i

03

•We can express ~ωi0i in any frame, but Fi and Fi0 are especially simple:

ωi0ii = [0 0 θ1]

T

ωi0ii0 = [0 0 θ1]

T

• Keep the notation in mind: ωi0ii is the angular velocity of Fi0 withrespect to Fi, expressed in Fi

Page 41: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Euler Angles and Angular Velocity (2)

• 2-rotation from Fi0 to Fi00 about i02 ≡ i002 through θ2

• The angular velocity of Fi00 with respect to Fi0 is

~ωi00i0 = θ2 i

02 = θ2i

002

• We can express ~ωi00i0 in any frame, but Fi0 and Fi00 are especially

simple:

ωi00i0i0 = [0 θ2 0]T

ωi00i0i00 = [0 θ2 0]T

• Keep the notation in mind: ωi00i0i0 is the angular velocity of Fi00 withrespect to Fi0 , expressed in Fi0

Page 42: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Euler Angles and Angular Velocity (3)

• 1-rotation from Fi00 to Fb about i001 ≡ b1 through θ3

• The angular velocity of Fb with respect to Fi00 is

~ωbi00= θ3i

001 = θ3b1

• We can express ~ωbi00in any frame, but Fi00 and Fb are especially

simple:

ωbi00

i00 = [θ3 0 0]T

ωbi00

b = [θ3 0 0]T

• Keep the notation in mind: ωbi00b is the angular velocity of Fb withrespect to Fi00 , expressed in Fb

Page 43: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Adding the Angular Velocities

Angular velocities are vectors and add like vectors:

~ωbi = ~ωbi00+ ~ωi

00i0 + ~ωi0i

•We have expressed these three vectors in different frames; to add themtogether, we need to express all of them in the same frame

• Typically, we want ωbib , so we need to rotate the 3×1 matrices we justdeveloped into Fb

• We have

ωi0ii = ωi

0ii0 = [0 0 θ1]

T ⇒ need Rbi0

ωi00i0i0 = ωi

00i0i00 = [0 θ2 0]T ⇒ need Rbi00

ωbi00

i00 = ωbi00

b = [θ3 0 0]T ⇒ need Rbb = 1

• We previously developed all these rotation matrices, so we just needto apply them and add the results

Page 44: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Complete the Operation

What happens when θ2 → nπ/2, for odd n ?

What happens when the Euler angles and their rates are “small”?

Carry out the matrix multiplications and additions

ωbib = ωbi00b + ωi

00i0b + ωi

0ib

and obtain

ωbib =

⎡⎣ θ3 − sin θ2 θ1cos θ3 θ2 + cos θ2 sin θ3 θ1− sin θ3 θ2 + cos θ2 cos θ3 θ1

⎤⎦=

⎡⎣ − sin θ2 0 1cos θ2 sin θ3 cos θ3 0cos θ2 cos θ3 − sin θ3 0

⎤⎦⎡⎣ θ1θ2θ3

⎤⎦= S(θ)θ

or

θ = S−1(θ)ω =

⎡⎣ 0 sin θ3/ cos θ2 cos θ3/ cos θ20 cos θ3 − sin θ31 sin θ3 sin θ2/ cos θ2 cos θ3 sin θ2/ cos θ2

⎤⎦⎡⎣ ω1ω2ω3

⎤⎦

Page 45: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204 Kinematic Singularity in the Differential Equation for Euler Angles

• For this Euler angle set (3-1-2), the Euler rates go to infinity when cos θ2 → 0

• The reason is that near θ2 = π/2 the first and third rotations are indistinguishable

• For the “symmetric” Euler angle sequences (3-1-3, 2-1-2, 1-3-1, etc) the singularity occurs when θ2 = 0 or π

• For the “asymmetric” Euler angle sequences (3-2-1, 2-3-1, 1-3-2, etc) the singularity occurs when θ2 = π/2 or 3π/2

• This kinematic singularity is a major disadvantage of using Euler angles for large-angle motion

• There are attitude representations that do not have a kinematic singularity, but 4 or more scalars are required

Page 46: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Linearizing the Kinematics Equation

Exercise: Repeat these steps for a 1-2-3 sequence and for a symmetric sequence.

ωbib = S(θ)θ

=

⎡⎣ θ3 − sin θ2 θ1cos θ3 θ2 + cos θ2 sin θ3 θ1− sin θ3 θ2 + cos θ2 cos θ3 θ1

⎤⎦=

⎡⎣ − sin θ2 0 1cos θ2 sin θ3 cos θ3 0cos θ2 cos θ3 − sin θ3 0

⎤⎦⎡⎣ θ1θ2θ3

⎤⎦If the Euler angles and rates are small, then sin θi ≈ θi and cos θi ≈ 1:

ωbib ≈

⎡⎣ θ3θ2θ1

⎤⎦≈

⎡⎣ 0 0 10 1 01 0 0

⎤⎦⎡⎣ θ1θ2θ3

⎤⎦

Page 47: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Refresher: How To Invert a MatrixSuppose you want to invert the n× n matrix A, with elements Aij

The elements of the inverse are

A−1ij =Cji|A|

where Cji is the cofactor, computed by multiplying the determinant ofthe (n− 1)× (n− 1) minor matrix obtained by deleting the jth row andith column from A, by (−1)i+j

This formulation is absolutely unsuitable for calculating matrix inversesin numerical work, especially with larger matrices, since it is computa-tionally expensive

One normally uses LU decomposition instead

Elementary row reduction is essentially LU decomposition

Note: In most cases, we do not need the inverse anyway; we need thesolution to a linear system

Page 48: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Matrix Inversion ApplicationLet us invert the matrix

S(θ) =

⎡⎣ − sin θ2 0 1cos θ2 sin θ3 cos θ3 0cos θ2 cos θ3 − sin θ3 0

⎤⎦In row reduction, we augment the matrix with the identity matrix:⎡⎣ − sin θ2 0 1 1 0 0

cos θ2 sin θ3 cos θ3 0 0 1 0cos θ2 cos θ3 − sin θ3 0 0 0 1

⎤⎦and apply simply row-reduction operations to transform the left 3 × 3block to the identity, leaving the inverse in the right 3× 3 block

In this case, we must swap the first row with one of the other two rows,say the 3rd row, which amounts to a permutation by :

P =

⎡⎣ 0 0 10 1 01 0 0

⎤⎦ Note that P−1 = P

Page 49: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Matrix Inversion Application (2)⎡⎣ cos θ2 cos θ3 − sin θ3 0 0 0 1cos θ2 sin θ3 cos θ3 0 0 1 0− sin θ2 0 1 1 0 0

⎤⎦Multiply row 2 by sin θ3/ cos θ3 and add to row 1.

Multiply row 1 by − sin θ3/ cos θ3 and add to row 2.⎡⎣ cθ2 cθ3 + cθ2sθ3 tan θ3 0 0 0 tan θ3 10 cθ3 + sθ3 tan θ3 0 0 1 − tan θ3−sθ2 0 1 1 0 0

⎤⎦Divide row 1 by cθ2 cθ3 + cθ2sθ3 tan θ3 and simplify

Multiply resulting row 1 by sθ2, add to row 3, and simplify

Divide row 2 by cθ3 + sθ3 tan θ3 and simplify⎡⎣ 1 0 0 0 sθ3/cθ2 cθ3/cθ20 1 0 0 cθ3 −sθ30 0 1 1 sθ3 tan θ2 cθ3 tan θ2

⎤⎦

Page 50: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Euler’s Theorem

00.5

1-0.5 0 0.5 1

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

The most general motion of a rigid body with a fixed point is arotation about a fixed axis.

• The axis, denoted a, is called the eigenaxis or Euler axis

• The angle of rotation, Φ, is called the Euler angle or the principal Eulerangle

Here the black axes arethe base vectors of the in-ertial frame, and the red,blue, and yellow axes arethe base vectors of a bodyframe, rotated abouta = [

√2/2

√2/2

√2/2]T

through angle Φ = π/4

Why no subscript on a?

Page 51: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Euler’s Theorem (2)Any rotation matrix can be expressed in terms of a and Φ:

R = cosΦ1+ (1− cosΦ)aaT − sinΦa×

Since a is an eigenvector of R with eigenvalue 1,

Ra = a

Check this result:

Ra =£cosΦ1+ (1− cosΦ)aaT − sinΦa×

¤a

= cosΦ1a+ (1− cosΦ)aaTa− sinΦa×a= cosΦa+ aaTa− cosΦaaTa− sinΦa×a= cosΦa+ a− cosΦa− sinΦa×a (aTa = 1)

= cosΦa+ a− cosΦa (a×a = 0)

= a

Also note that the trace of R is simply

traceR = 1 + 2 cosΦ

Page 52: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204Extracting a and Φ from R,

and Integrating to Obtain a and ΦGiven any rotation matrix we can compute the Euler axis a and angle Φusing:

Φ = cos−1∙1

2(trace R− 1)

¸a× =

1

2 sinΦ

¡RT −R

¢What does one do about the sinΦ = 0 case?

One can show that the kinematics differential equations for a and Φ are:

Φ = aTω

a =1

2

∙a× − cot Φ

2a×a×

¸ω

So, this system of equations also has kinematic singularities, at Φ = 0and Φ = 2π

Page 53: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Quaternions (aka Euler Parameters)

Define another 4-parameter set of variables to represent the attitude:

q = a sinΦ

2

q4 = cosΦ

2

The 3×1 matrix q forms the Euler axis component of the quaternion, alsocalled the vector component. The scalar q4 is called the scalar component.Collectively, these four variables are known as a quaternion, or as theEuler parameters.

The notation q denotes the 4× 1 matrix containing all four variables:

q =£qT q4

¤

Page 54: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Quaternions (2)

R(q) and q(R) :

R =¡q24 − qTq

¢1+ 2qqT − 2q4q×

q4 = ±12

√1 + trace R

q =1

4q4

⎡⎣ R23 −R32R31 −R13R12 −R21

⎤⎦

Differential equations ˙q :

˙q =1

2

∙q× + q41−qT

¸ω = Q(q)ω

Note that there is no kinematic singularity with these differential equa-tions

Page 55: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204Typical Problem Involving

Angular Velocity and Attitude

• Given initial conditions for the attitude (in any form), and a time history of angular velocity, compute R or any other attitude representation as a function of time – Requires integration of one of the sets of

differential equations involving angular velocity

Page 56: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Spherical Pendulum Problem

Illustration from Wolfram Research Mathworld

mathworld.wolfram.com/SphericalCoordinates.html

• Use a rotation from Fi to Fr us-ing two Euler angles, θ, and φ

• The first (3) rotation is about thei3 axis, through angle θ

• The second (2) rotation is aboutthe eθ ≡ θ axis through φ

• The three unit vectors havederivatives:

˙er = sinφθeθ + φeφ,

˙eθ = − sinφθer − cosφθeφ,

˙eφ = −φer + cosφθeθ

Page 57: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Linearization for Small Φ

As with Euler angles, we are frequently interested in small attitude mo-tions.

If Φ is small, then q = a sin(Φ/2) ≈ aΦ2 , and q4 ≈ 1

Hence, for small Φ,

R =¡q24 − qTq

¢1+ 2qqT − 2q4q×

≈ (1− 0)1+ 2(0)− 2q×≈ 1− 2q×

Compare this expression with the previously developed R ≈ 1 − θ× forEuler angles. What is the equivalent expression for the (a,Φ) representa-tion?

Small rotations are commutative:

RcbRba ≈£1− 2q×2

¤ £1− 2q×1

¤= 1− 2q×2 − 2q×1

Page 58: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204

Other Attitude Representations

• We have seen direction cosines, Euler angles, Euler angle/axis, and quaternions

• Two other common representations – Euler-Rodriguez parameters

– Modified Rodriguez parameters

p = a tanΦ

2

R = 1+2

1 + pTp(p×p× − p×)

p =1

2(ppT + 1+ p×)ω

σ = a tanΦ

4

R =1

1 + σTσ

£(1− (σTσ)2)1+ 2σσT − 2(1− (σTσ)2)σ×

¤σ =

1

2

∙1− σ× + σσT − 1 + σ

21

¸

Page 59: RotationalKinematics - Virginia TechAOE 5204 Rotational Kinematics Description of attitude kinematics using reference frames, rotation matrices, Euler parameters, Euler angles, and

AOE 5204Typical Problem Involving

Angular Velocity and Attitude

• Given initial conditions for the attitude (in any form), and a time history of angular velocity, compute R or any other attitude representation as a function of time – Requires integration of one of the sets of

differential equations involving angular velocity