lecture notes - modeling of mechanical systems

27
Thomas Bak Lecture Notes - Modeling of Mechanical Systems February 19, 2002 Aalborg University Department of Control Engineering Fredrik Bajers Vej 7C DK-9220 Aalborg Denmark

Upload: ursanwar5875

Post on 27-Oct-2014

55 views

Category:

Documents


3 download

DESCRIPTION

This note discusses modeling of mechanical systems. The book is written for studentsin control. To understand most of the material presented, student readers willrequire only the usual undergraduate courses in vector dynamics and matrix algebra.

TRANSCRIPT

Page 1: Lecture Notes - Modeling of Mechanical Systems

Thomas Bak

Lecture Notes - Modeling ofMechanical Systems

February 19, 2002

Aalborg UniversityDepartment of Control EngineeringFredrik Bajers Vej 7CDK-9220 AalborgDenmark

Page 2: Lecture Notes - Modeling of Mechanical Systems

2 Table of Contents

Table of Contents

1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2. Basic Geometry. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.1 Vectors and Reference Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2 Vector Differentiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2.2.1 Angular Velocity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.2.2 Transport Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

3. Orthogonal Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.1 Direction Cosine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123.2 Euler Angles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.3 Eigenaxis Rotation Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173.4 Quaternions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

4. Kinematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234.1 Kinematic Differential Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

4.1.1 Direction Cosine Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234.1.2 Euler Angles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244.1.3 Quaternions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

Page 3: Lecture Notes - Modeling of Mechanical Systems

1. Introduction 3

1. Introduction

This note discusses modeling of mechanical systems. The book is written for stu-dents in control. To understand most of the material presented, student readers willrequire only the usual undergraduate courses in vector dynamics and matrix algebra.

Page 4: Lecture Notes - Modeling of Mechanical Systems

4 1. Introduction

Page 5: Lecture Notes - Modeling of Mechanical Systems

2. Basic Geometry 5

2. Basic Geometry

This chapter provides mathematical tools and concepts that play essential roles inthe modeling and analysis of dynamic systems. Fundamental concepts in classicalmechanics essential to developing mathematical models of dynamic systems areemphasized. This chapter will also acquaint the reader with some basic definitionsand general results.

2.1 Vectors and Reference Frames

Before discussing the problem analysis of dynamic systems, we require certain basicconcepts from linear algebra, among themvectorsandreference frames.

A vector is formally defined as an element of a vector space1. In the commonlyencountered vector spaceRn (i.e., Euclideann-space), a vector may be specified byn coordinates,(p1, p2, . . . , pn). Vectors can be added together (vector addition) andmultiplied by scalars (scalar multiplication). Vector multiplication is not uniquelydefined, but a number of different types of products, such as the dot product and thecross product.

Let P define a point in a three dimensional Euclidean space (R3) as illustrated inFigure 2.1.

� ��

� � � �

� �

� �

� �

Fig. 2.1.Cartesian coordinate system.

To define the position of the pointP as a vector, a basis (coordinate system or frame)along with its origin must be chosen. A coordinate system is defined by two things.

1 A vector space overRn is a set of vectors for which any vectors and any scalars satisfyspecific properties like commutativity, associativity, additive identity, existence of additiveinverse, etc.

Page 6: Lecture Notes - Modeling of Mechanical Systems

6 2. Basic Geometry

First, a coordinate system originO must be established to specify its position inspace. Second, the orientation of the coordinate system must be chosen.

A simple example of a basis is the standard basis inR3 consisting a right-hand set ofthree mutually orthogonal unit vectors, represented in set notation by (e1, e2, e3)2

as illustrated in Figure 2.1. Such a set of orthogonal unit vectors forms a rectangular(orthogonal) Cartesian coordinate system of a three-dimensional vector space.

In general, sets of vectors are called basis vectors, if they are linearly independentand any vector can be uniquely expressed as a linear combination of these. Con-sequently, a non-orthogonal Cartesian coordinate system consists of straight-lineaxes that are not perpendicular to each other. The most familiar examples of non-Cartesian coordinate systems are thecylindrical andsphericalcoordinate systems.Throughout this text we shall employ a right-hand set of three mutually orthogonalunit vectors as bases of the three-dimensional vector space, unless otherwise stated.

Consider an arbitrary vector~x (e.g. the vector pointing from the coordinate originOto the pointP ). Express~x as a linear combination of the basis vectors (e1, e2, e3);i.e. let

~x = x1e1 + x2e2 + x3e3 ≡3∑

i=1

xiei (2.1)

where the scalar coefficientsxi are called the components of the vector~x. For Carte-sian coordinate systems, thei-th entry of the column vector is the component of the~x vector along thei-th unit vectorei.

Using matrix notation, we can write

~x =[e1 e2 e3

]

x1

x2

x3

(2.2)

When it is clear in context, we can just also write the frame base vector componentsof ~x as the 3×1 column vector

x =

x1

x2

x3

(2.3)

which is referred to as therepresentationof the vector~x with respect to the basisvectors (e1, e2, e3). The column matrix in Eq. 2.3 thus implicitly assumes an under-lying reference frame, here (e1, e2, e3). The column matrix in Eq. 2.3 is, however,frequently referred to as just a vector although it should be distinguished from thevector~x itself. Throughout this text, a lowercase boldface symbol indicates a col-umn vector. A subscript may be used to explicitly indicated the reference frame, i.e.xE refers to a representation relative to the frameE.

Care must be taken when performing vector operations if multiple coordinate sys-tems are used. Writing a vector addition as

~x = ~y + ~z (2.4)

2 A vector with unit length is called a unit vector and is denoted using a hat,e

Page 7: Lecture Notes - Modeling of Mechanical Systems

2.2 Vector Differentiation 7

is correct since no coordinate systems have been assigned yet. However, if the vec-tors have specific coordinate systems representation (they refer to different coordi-nate systems), then the following matrix vector addition wouldnot be correct

xE = yE + zF (2.5)

To add they andz representations, these components would first have to be trans-formed (projected) onto the same frame. Next chapter will shown how the directioncosine matrix can be used to perform this transformation.

2.2 Vector Differentiation

2.2.1 Angular Velocity

Before proceeding with vector differentiation we examine angular velocity.

The angular velocity is the time derivative of the angular distanceθ with directione perpendicular to the plane of angular motion. In planar motion it is easy to defineand visualize the concept of angular velocity as is shown in Figure 2.2.

����

��

Fig. 2.2.Angular velocity for planar motion. A positive rotation or rotation rate is defined tobe in the increasingθ (counterclockwise) direction shown.

Angular velocity of a particle in a plane is a scalar and simply describes at whatrate the radius vector locating the particle is orbiting the origin. In the general threedimensional case, the angular velocity is a vector quantity.

Consider a reference frameA with a set of three orthogonal unit vectors (a1, a2, a3)and a reference frameU with a set of three orthogonal unit vectors (u1, u2, u3) asshown in Figure 2.3.

The angular velocity vector of a reference frameU with respect to a reference frameA is denoted by~ωUA. The symbol~ωUA is to be read as the angular velocity ofU with respect to Aor relative to A. The angular velocity vector~ωUA lies alongthe instantaneous axis of rotation of the reference frameU, and it usually changesboth its direction and magnitude continuously with time. We can also consider theangular velocity ofA with respect toU, denoted by~ωAU = −~ωUA.

Expressed in terms of basis vectors ofU we get:

Page 8: Lecture Notes - Modeling of Mechanical Systems

8 2. Basic Geometry

�� � � �

� ��

� �

� �� �

Fig. 2.3. Reference framesA and U. The U frame rotates relative toA with the angularvelocityω.

~ωUA = ω1u1 + ω2u2 + ω3u3 (2.6)

(2.7)

As the unit vectorsui fixed in the reference frameU rotate with an angular velocity~ωUA with respect toA, the rate of change ofui is caused only by~ωUA and it mustbe normal to bothui and~ωUA. Thus, the time derivatives of the unit vectorsui

measured inA are given by{

dui

dt

}

A

= ~ωUA × ui, i = 1, 2, 3 (2.8)

If a reference frameA is inertially fixed, it is called an inertial or Newtonian ref-erence frame. The time derivative measured in an inertial or Newtonian referenceframe is often denoted with an overdot, i.e.˙ui. We may now write

˙ui = ~ωUA × ui, i = 1, 2, 3 (2.9)

2.2.2 Transport Theorem

When computing the velocity of the particle and taking the time derivative of the po-sition vector, one must take into account that the base vector directions of the chosencoordinate system may be time varying also. The following theorem allows one totake the derivative of a vector in one coordinate system, even though the vector itselfhas its components taken in another, possibly rotating, coordinate system.

Example 2.2.1 (Transport theorem).To understand the importance of the transporttheorem, imagine that you are standingstill on Earth’s surface. LetU be an Earthfixed coordinate system with the origin in the center of the Earth. Your positionvector would point from the Earth’s center to your feet on the surface. Your velocity(derivative of your position vector withinU) is zero relative to the Earth fixed frame,U – you are standing still. Now, let’s introduce another coordinate systemA with thesame origin, but this one is non-rotating (inertial). You now wish to calculating thederivative of your position vector in theA frame. Since Earth (U) itself is rotating,your position derivative would be non-zero in theA frame. This is because relativeto A, you are moving at constant speed along a circle about the Earth’s spin axis.¤

Consider a particleP that is in motion relative to a reference frameU, which is itselfin motion relative to an inertial reference frameA, as shown in Figure 2.4.

Page 9: Lecture Notes - Modeling of Mechanical Systems

2.2 Vector Differentiation 9

�� � � �

� ��

� �

� �� �

Fig. 2.4. Reference framesA and U. The U frame rotates relative toA with the angularvelocityω. The particleP is in motion relative toU.

The angular velocity ofU relative toA is denoted by~ω = ~ωUA. The position vectorof the particle from the origin ofU is denoted by~r. Express~r in terms of basisvectors ofU,

~r = r1u1 + r2u2 + r3u3 (2.10)

Then take derivatives inA, which is assumed inertial. Using the chain rule of differ-entiation we get,

{d~r

dt

}

A

= ~r = r1u1 + r2u2 + r3u3 + r1˙u1 + r2

˙u2 + r3˙u3 (2.11)

The first three terms are the time derivatives of~r projected onto theU frame, i.e.{

d~r

dt

}

U

= r1u1 + r2u2 + r3u3 (2.12)

while the last three terms are found using Eq. 2.9. The result is{

d~r

dt

}

A

={

d~r

dt

}

U

+ r1(~ωUA × u1) + r2(~ωUA × u2) + r3(~ωUA × u3)

={

d~r

dt

}

U

+ ~ωUA × ~r (2.13)

The term{

d~rdt

}A

is the velocity of the particleP with respect to the origin ofU as

seen fromA, while{

d~rdt

}U

is the velocity of the particleP with respect to the originof U measured inU.

Theorem 2.2.1. (Transport Theorem) Let frame U rotate relative to frame A withangular velocity~ωUA and let~r be a vector. The time derivative of~r in the A frameis then related to the derivative of~r in the U frame as

{d~r

dt

}

A

={

d~r

dt

}

U

+ ~ωUA × ~r (2.14)

¤

Theorem 2.2.1 apply to any vector quantity and are of fundamental importance todynamic problems in which a rotating reference frame is involved.

Page 10: Lecture Notes - Modeling of Mechanical Systems

10 2. Basic Geometry

Page 11: Lecture Notes - Modeling of Mechanical Systems

3. Orthogonal Transformations 11

3. Orthogonal Transformations

The objective of this chapter is to describe rotations (or orthogonal transformations)of a rigid body inR3 which has one fixed point but is otherwise free to rotate aboutany axis through the fixed point. A rigid body is by definition a configuration ofpoints for which the mutual distances are preserved during movement and a rotationof a rigid body must thereforepreserve distance. Intuitively, rotations must alsopreserve the natural orientationof R3, i.e. right-handed coordinate systems must betransformed into right-handed coordinate systems.

There is an infinite number of attitude coordinates to choose from analogous tochoosing among the sets of translational coordinates such as Cartesian, polar orspherical coordinates to describe a spatial position of a point. However, describingthe attitude of an object relative to some reference frame does differ fundamentallyfrom describing the corresponding relative spatial position of a point. In Cartesianspace, the linear displacement between two spatial positions can grow arbitrarilylarge. On the other hand orientations can differ at most by a 180 degree rotation, afinite rotational displacement.

The quest for the best rigid body orientation description is a very fundamental andimportant one. It has been studied by such great scholars as Euler, Jacobi, Hamil-ton, Cayley, Klein, Rodrigues and Gibbs and has led to a rich collection of elegantresults. A good choice for attitude coordinates can greatly simplify the mathemat-ics and avoid such pitfalls as mathematical and geometrical singularities or highlynonlinear kinematic differential equations.

Orthogonal transformationsare defined as the group of linear invertible transforma-tions (Jakubczyk and Respondek 1999)

T : R3 7→ R3 (3.1)

that preserve the standard scalar product

〈T~v, T ~w〉 = 〈~v, ~w〉 (3.2)

for any~v , ~w ∈ R3. As the standard scalar product1 induces distance inR3, orthog-onal transformations preserve the distance between any two points. Equation (3.2)also implies that an orthonormal basis remains orthonormal under transformation.Rotationsare now defined as those orthogonal transformations that also preserve theorientation ofR3.

The problem of parameterizing orthogonal transformations has been of interest since1776, when Euler first showed that three parameters are required. Representations

1 R3 with the standard scalar product,〈~v, ~w〉 = ~vT ~w defined is in fact an Euclidian space.

Page 12: Lecture Notes - Modeling of Mechanical Systems

12 3. Orthogonal Transformations

involving more than three parameters are therefore subject to constraints. It was,however, demonstrated by (Stuelpnagel 1964) thatno three-parameter set can beboth global and nonsingular. In order to specify any global attitude at least fourparameters are needed.

3.1 Direction Cosine

Consider a reference frameA with a right-hand set of three orthogonal unit vectors(a1, a2, a3) and a reference frameU with another right-hand set of three orthogonalunit vectors (u1, u2, u3) as shown in Figure 3.1.

�� � � �

� ��

� �

� �� �

Fig. 3.1.Reference framesA andU.

Basis vectors (u1, u2, u3) of U are expressed in terms of basis vectors (a1, a2, a3)of A as follows:

u1 = C11a1 + C12a2 + C13a3 (3.3)

u2 = C21a1 + C22a2 + C23a3 (3.4)

u3 = C31a1 + C32a2 + C33a3 (3.5)

whereCij = ui · aj is the cosine of the angle betweenui andaj andCij is simplycalled the direction cosine.

Using matrix notation, Eq. 3.3 becomes:

u1

u2

u3

=

C11 C12 C13

C21 C22 C23

C31 C32 C33

a1

a2

a3

= CUA

a1

a2

a3

(3.6)

whereCUA is the direction cosine matrix which describes the orientation ofUrelative toA. The components ofCUA are

CUA =

u1 · a1 u1 · a2 u1 · a3

u2 · a1 u2 · a2 u2 · a3

u3 · a1 u3 · a2 u3 · a3

(3.7)

The direction cosine matrix is also called the rotation matrix or coordinate trans-formation matrix toU from A. Such a coordinate transformation is symbolicallyrepresented as

Page 13: Lecture Notes - Modeling of Mechanical Systems

3.1 Direction Cosine 13

CUA : U ← A

For brevity, we often useC for CUA. Because each set of basis vectors ofA andU consists of orthogonal unit vectors, the direction cosine matrixC is orthonormalmatrix; thus, we have

C−1 = CT (3.8)

which is equivalent toCCT = I = CTC (3.9)

In general, a square matrixA is called an orthogonal matrix ifAAT is a diagonalmatrix, and it is called an orthonormal matrix ifAAT is an identity matrix.

A important property of the orthonormal matrix (and thus the direction cosine ma-trix) is that its determinant is 1. From Eq. 3.9 it follows that

det(CCT) = det(I) = 1 (3.10)

SinceC is a square matrix this can be written as

det(C) det(CT) = 1 (3.11)

As det(C) = det(CT), this reduces to

det(C)2 = 1 ⇔ det(C) = ±1 (3.12)

If the two coordinate frames are right-handed, thendet(C) = +1 (Goldstein 1980).The space of matrices satisfying Eq. 3.10 anddet(C) = +1 is called thespecialorthogonal groupand is denoted bySO(3).

Equation (3.10) implies six constraints onC matrix leaving at most three degreesof freedom. This means that there are six redundant elements among the nine com-ponents of matrixC. This is why in practice the elements of the direction cosinematrix are rarely used as coordinates to keep track of an orientation; instead lessredundant attitude parameters are used. The biggest asset of the direction cosinematrix is the ability to easily transform vectors from one reference frame to another.

We useCAU to denote a coordinate transformation matrix toA from U or a directioncosine matrix ofA relative toU. In analogy to Eq. 3.7, we have

CAU =

a1 · u1 a1 · u2 a1 · u3

a2 · u1 a2 · u2 a2 · u3

a3 · u1 a3 · u2 a3 · u3

(3.13)

We thus have the following intimate relationship betweenCUA andCAU :

CTUA = CAU (3.14)

In a standard coordinate transformation setting, theC matrix is typically not re-stricted to projecting one set of base vectors from one reference frame onto another.Rather, the direction cosine’s most powerful feature is the ability to directly project(or transform) an arbitrary vector, with components written in one reference frame,into a vector with components written in another reference frame.

Page 14: Lecture Notes - Modeling of Mechanical Systems

14 3. Orthogonal Transformations

Given an arbitrary vector~r expressed in theA andU frames as follows:

~r = r1a1 + r2a2 + r3a3 (3.15)

= r′1u1 + r′2u2 + r′3u3 (3.16)

We now have

r′1 = u1 · ~r = u1 · (r1a1 + r2a2 + r3a3) (3.17)

r′2 = u2 · ~r = u2 · (r1a1 + r2a2 + r3a3) (3.18)

r′3 = u3 · ~r = u3 · (r1a1 + r2a2 + r3a3) (3.19)

Written in matrix form we get

r′1r′2r′3

=

u1 · a1 u1 · a2 u1 · a3

u2 · a1 u2 · a2 u2 · a3

u3 · a1 u3 · a2 u3 · a3

r1

r2

r3

(3.20)

The components of a vector~r are thus transformed toU from A using the directioncosine matrixCUA, which was defined in Eq. 3.7 for the transformation of basisvectors.

Another common problem is cascading frames. Given several frames, each definedrelative to the previous one it is desired to replace the sequence of transformationsby a single transformation. LetrA be a vector,~r, defined relative to reference frameA. The orientation of a frameB relative toA is given byCBA while the orientationof a frameC relative toB is given byCCB . The representation of the vector~r in theC frame is then given by

rC = CCBCBArA = CCArA (3.21)

where the direct transformation matrix from the first to the last cascading referenceframe is found by matrix multiplications of each relative transformation matrix. Theorder of the composition of successive rotations is very important.

The direction cosine matrix is the most fundamental, but highly redundant, methodof describing a relative orientation. As was mentioned earlier, the minimum numberof parameter required to describe a reference frame orientation is three.

Example 3.1.1 (Elementary rotations).Three elementary rotations respectively aboutthe first, second, and third axes of the reference frameA are described by the fol-lowing rotation matrices:

C1(θ1) =

1 0 00 cos θ1 sin θ1

0 − sin θ1 cos θ1

C2(θ2) =

cos θ2 0 − sin θ2

0 1 0sin θ2 0 cos θ2

C3(θ3) =

cos θ3 sin θ3 0− sin θ3 cos θ3 0

0 0 1

Page 15: Lecture Notes - Modeling of Mechanical Systems

3.2 Euler Angles 15

whereCi(θi) denotes the direction cosine matrix representing a rotation about thei-th axis ofA with an angleθi.

Note that the axis of rotation is unchanged by the rotation in each of the three cases,i.e. inC1(θ1) the1-st axis is unchanged as the rotation is about this axis.¤

3.2 Euler Angles

One scheme for orienting a rigid body to a desired orientation involves successivelyrotating three times about the axes of the rotated, body-fixed reference frame. Thefirst rotation is about any axis. The second rotation is about either of the two axes notused for the first rotation. The third rotation is then about either of the two axes notused for the second rotation. There are 12 sets of Euler angles for such successiverotations about the axes fixed in the body.

It is also possible to bring a rigid body into an arbitrary orientation by performingthree successive rotations that involve the axes fixed in an inertial reference frame.This scheme will then provide another 12 sets of Euler angles2 for the so-calledspace-axis rotations. Because the coordinate transformation matrices for the body-axis rotation and the space-axis rotation are intimately related to each other, weoften only consider the 12 sets of body-axis rotations. Consider three successivebody-axis rotations that describe the orientation of a reference frameU relative toa reference frameA. A particular sequence chosen here is symbolically representedas

C3(θ3) : W ← A (3.22)

C2(θ2) : V ← W (3.23)

C1(θ1) : U ← V (3.24)

where each rotation is described as

C3(θ3) =

cos θ3 sin θ3 0− sin θ3 cos θ3 0

0 0 1

C2(θ2) =

cos θ2 0 − sin θ2

0 1 0sin θ2 0 cos θ2

C1(θ1) =

1 0 00 cos θ1 sin θ1

0 − sin θ1 cos θ1

whereW andV are two intermediate reference frames with basis vectors. The threeanglesθ1, θ2, andθ3, are called Euler angles.

The sequence of rotations toU from A results is a rotation matrix toU from A,defined as2 Leonard Euler (1707-1783), first introduced the concept of three successive rotations to

describe orientation. Euler used space fixed angles to describe the orientation of an orbitalplane

Page 16: Lecture Notes - Modeling of Mechanical Systems

16 3. Orthogonal Transformations

CUA ≡ C1(θ1)C2(θ2)C3(θ3)

=

c2c3 c2s3 −s2s1s2c3 − c1s3 s1s2s3 + c1c3 s1c2

c1s2c3 + s1s3 c1s2s3 − s1c3 c1c2

(3.25)

where ci = cos θi and si = sin θi. This sequence is called (3-2-1) Euler angles,following the rotation order. First a rotation about the 3rd axis, then a rotation aboutthe new 2nd axis and finally a rotation about the 1st axis as shown in Figure3.2.Relative attitude is easy to visualize using the Euler angles for small angles.

���

Fig. 3.2.(3-2-1) Euler Angle sequence.

Example 3.2.1 (Orbiter reference frame).The space shuttle orbiter reference frame,is defined as follows. Three successive rotations of a coordinate frame form an ini-tially aligned state to a final orientation define the attitude of the shuttle. Theserotations are performed about the body axes of the body in a specific sequence.Each axis has, by convention been given a number which refers to a rotation aboutthat axis in accordance with the right hand rule. A rotation about the body x axis iscalled a one rotation; a rotation about the body y axis is called a two rotation; and arotation about the body z axis is called a three rotation.

Any sequence of these rotations can represent shuttle attitude. By convention,NASA use a (2-3-1) rotation sequence for the orbiter which equates to a pitch-yaw-roll, as illustrated in Figure 3.3.¤

Performing three successive rotations about the 3rd, 2nd and 1st body axis, does notyield the same orientation as if instead the rotation order is (1-2-3) or (2-3-1). Ingeneral, there are 12 sets of Euler angles, each resulting in a different form for therotation matrixCUA. For example, we may consider the (2-3-1) sequence

CUA ≡ C1(θ1)C3(θ3)C2(θ2)

=

c2c3 s3 −s2c3

−c1c2s3 + s1s2 c1c3 c1s2s3 + s1c2

s1c2s3 + cls2 −s1c3 −s1s2s3 + c1c2

(3.26)

Note that for small (infinitesimal) Euler angles ofθ1, θ2 andθ3, the direction cosinematrices in Eqs. 3.25 and 3.26 are identical and become

C ≈

1 θ3 −θ2

−θ3 1 θ1

θ2 −θ1 1

(3.27)

Page 17: Lecture Notes - Modeling of Mechanical Systems

3.3 Eigenaxis Rotation Theorem 17

� �

� �� �

� �

� ���� � � ��� � �

� ��� � � � ��� � ���

� ��� � � ����� � ���

� ���� � � ��� ��� �

� ��� � ����� �

� �� � ��� ����� � � �

������� � �

Fig. 3.3.Shuttle reference system. A (2-3-1) rotation sequence for the orbiter which equatesto a pitch-yaw-roll.

That is, the rotation sequence of Euler angles becomes unimportant for infinitesimalrotations, whereas rotation sequence is important for finite rotations.

Another very popular set of Euler angles is the (3-1-3) set as illustrated in Figure 3.4.

These angles are commonly used by astronomers to define the orientation of orbitplanes of the planets relative to the Earth’s orbit plane. In the (3-1-3) sequence thethird axis is used twice, and the rotation matrix toU from A becomes

CUA = C3(ψ)C1(θ)C3(φ)

=

cψcφ− sφcθsψ sφcψ + cφcθsψ sθsψ−cφsψ − sφcθcψ −sφsψ + cφcθcψ sθcψ

sφsθ −cφsθ cθ

(3.28)

where cψ = cos ψ, sψ = sin ψ, etc.

The (3-1-3) Euler angles are called longitude of the ascending node, inclination andargument of the perihelion.

In general, Euler angles have an advantage over direction cosines in that three Eu-ler angles determine a unique orientation, although there is no unique set of Eulerangles for a given orientation.

3.3 Eigenaxis Rotation Theorem

The following theorem has been very fundamental in the development of severaltypes of attitude coordinates and is generally referenced to Euler (Goldstein 1980).

Page 18: Lecture Notes - Modeling of Mechanical Systems

18 3. Orthogonal Transformations

Fig. 3.4. (3-1-3) Euler Angle Illustration. First a rotation about the 3rd axis ofφ, then arotation about the 1st axis ofθ and finally a rotation about the new third axis ofψ.

Theorem 3.3.1 (Euler’s Eigenaxis Rotation).A rigid body or coordinate refer-ence frame fixed in a pointP can be brought from an arbitrary initial orientationto an arbitrary final orientation by a single rotation,θ about the principal axisnthrough the pointP .

Euler’s eigenaxis rotation theorem states that by rotating a rigid body about an axisthat is fixed to the body and stationary in an inertial reference frame, the rigid-bodyattitude can be changed from any given orientation to any other orientation. Such anaxis of rotation, whose orientation relative to both an inertial reference frame andthe body remains unchanged, is called the Euler axis or eigenaxis. Proof of Euler’sEigenaxis Rotation theorem is given in (Goldstein 1980).

Let the eigenaxis rotation beθ. Thge eigenaxis unit vectore be written in theA andB frames as

e = e1a1 + e2a2 + e3a3 (3.29)

= e1b1 + e2b2 + e3b3 (3.30)

Following the theorem, the eigenaxis is unchanged by the rotation and the rotationis then characterized by

e1

e2

e3

=

C11 C12 C13

C21 C22 C23

C31 C32 C33

e1

e2

e3

(3.31)

To parameterize the direction cosine matrixC in terms ofei andθ, a sequence ofEuler’s successive rotations is used as follows:

1. Rotation frameA with R to align thea1 axis with e. Let A′ be the new frameafter this rotation, i.e. we have

CA′A = R =

e1 e2 e3

R21 R22 R23

R31 R32 R33

(3.32)

Page 19: Lecture Notes - Modeling of Mechanical Systems

3.4 Quaternions 19

2. Now rotation frameA′ into A′′ around the directione through an angleθ,

CA′′A′ = C1(θ) =

1 0 00 cos θ sin θ0 − sin θ cos θ

(3.33)

3. RotateA′′ through the inverse matrixR−1 = RT to compensate for the rotationin 1. The frameA′′ should now be aligned withB, sinceCBA′′ = R−1.

These three successive rotations can be combined as

CBA = RTC1(θ)R

=

cθ + e21(1− cθ) e1e2(1− cθ) + e3sθ e1e3(1− cθ)− e2sθ

e221(1− cθ)− e3sθ cθ + e22(1− cθ) e2e3(1− cθ) + e1sθ

e3e1(1− cθ) + e2sθ e3e2(1− cθ)− e1sθ cθ + e23(1− cθ)

(3.34)

where cθ = cos θ and sθ = sin θ. This is the parameterization of the direction cosinematrixC in terms ofe andθ. By defining

e =

e1

e2

e3

and E =

0 −e3 e2

e3 0 −e1

−e2 e1 0

(3.35)

Eq. 3.34 may be expressed as

C(e, θ) = cos θI + (1− cos θ)eeT − sin θE (3.36)

whereI is the identity matrix.

By inspection of Eq. 3.34, the inverse transformation from the direction cosine ma-trix to the eigenaxis rotation elements is found to be

cos θ =12(C11 + C22 + C33 − 1) =

12(tr C − 1) (3.37)

and

e =

e1

e2

e3

=

12 sin θ

C23 − C32

C31 − C13

C12 − C21

if θ 6= 0,±π,±2π, . . . (3.38)

3.4 Quaternions

In this section the representation of rotations in terms of quaternions is discussed.Such a representation is not just concise and elegant but also yields a very efficientway of handling compositions of rotations. The mathematical theory of quaternionswas first developed by (Hamilton 1866). Quaternions are also known as hypercom-plex numbers and denoted byH.

Page 20: Lecture Notes - Modeling of Mechanical Systems

20 3. Orthogonal Transformations

Consider again Eulers eigenaxis rotation about an arbitrary axis fixed both in a body-fixed reference frameB and in an inertial reference frameA.

Then we define the four quaternions as follows:

q1 = e1 sin(θ/2) (3.39)

q2 = e2 sin(θ/2) (3.40)

q3 = e3 sin(θ/2) (3.41)

q4 = cos(θ/2) (3.42)

whereθ is the rotation angle about the Euler axis,e. Similar to the the eigenaxisvector, we define a vectorq13 = (q1, q2, q3) such that

q13 = e sin(θ/2) (3.43)

The quaternions are not independent of each other, but constrained by the relation-ship

qT13q13 + q2

4 =1 (3.44)

Note that this constraint geometrically describes a four-dimensional unit sphere.Any rotation described through the quaternion has a trajectory on the surface of thisconstraint sphere.

From the definition in Equation 3.39 to 3.42 it is clear that no rotation3 is representedby a unit quaternion [

q13

q4

]=

[0 0 0 1

]T

The direction cosine parameterized in terms of quaternions is found by substitutingEqs. 3.39 to 3.42 into Eq. 3.34 while using thatsin θ = 2 sin(θ/2) cos(θ/2) andcos θ = cos2(θ/2)− sin2(θ/2) = 2 cos2(θ/2)− 1 = 1− 2 sin2(θ/2).

The result is, as follows:

C(q13, q4)

1− 2(q22 + q2

3) 2(q1q2 + q3q4) 2(q1q3 − q2q4)2(q2q1 − q3q4) 1− 2(q2

1 − q23) 2(q2q3 + q1q4)

2(q3q1 + q2q4) 2(q3q2 − q1q4) 1− 2(q21 + q2

2)

(3.45)

It is clear from Eq. 3.45 that changing the sign on the quaternion does not change thedirection cosine. All quaternion components appear in quadratic product pairs, thuschanging the signs of all components has no effect on the resultingC matrix. Givena certain orientation, there are actually two sets of quaternions that will describethe same orientation. This is due to the non-uniqueness of the principal rotationelements themselves.

Similar to Eq. 3.35, the expression for the direction cosine may be simplified bydefining a skew symmetric matrixQ,

Q =

0 −q3 q2

q3 0 −q1

−q2 q1 0

(3.46)

3 Corresponds to an identity direction cosine matrix

Page 21: Lecture Notes - Modeling of Mechanical Systems

3.4 Quaternions 21

The result is that Eq. 3.45 may be written as

C(q13, q4) = (q24 − qT

13q13)I + 2q13qT13 − 2q4Q (3.47)

The quaternion transpose is defined as

q∗ =[−q13

q4

]

such thatC(q∗) = CT(q).

Given a direction cosine matrixC the quaternion can be found as follows:

q4 = (1 + tr C)12 for 0 ≤ θ ≤ π (3.48)

q13 =1

4q4

C23 − C32

C31 − C13

C12 − C21

if q4 6= 0 (3.49)

A very important composite rotation property of the quaternion is the manner inwhich they allow two sequential rotations to be combined into one overall compositerotation,

C(q13, q4) = C(q′′13, q′′4 )C(q′13, q

′4) (3.50)

Using Eq. 3.45 in Eq. 3.50 and equating corresponding elements leads to followingelegant transformation that bi-linearly combines the two quaternions

q1

q2

q3

q4

=

q′′4 q′′3 −q′′2 q′′1−q′′3 q′′4 q′′1 q′′2q′′2 −q′′1 q′′4 q′′3−q′′1 −q′′2 −q′′3 q′′4

q′1q′2q′3q′4

(3.51)

which is known as the quaternion multiplication rule in matrix form. The4 × 4orthonormal matrix in Eq. 3.51 is called the quaternion matrix. Eq. 3.51 can alsobe written in a more compact form:

q13 = q′′4q′13 + q′4q′′13 + q′13 × q′′13 (3.52)

q4 = q′4q′′4 − (q′13)

Tq′′13 (3.53)

These transformations provide a simple, nonsingular and bilinear method to com-bine two successive rotations described through quaternions. For other attitude pa-rameters such as the Euler angles, this same composite transformation would yielda very complicated, transcendental expression.

Page 22: Lecture Notes - Modeling of Mechanical Systems

22 3. Orthogonal Transformations

Page 23: Lecture Notes - Modeling of Mechanical Systems

4. Kinematics 23

4. Kinematics

Kinematics is mainly concerned with the geometry of motion without considerationsof masses and forces. Essentially, Kinematics is a collection of vector/matrix meth-ods to describe positions, velocities and accelerations of particles and rigid bodies,as viewed from various reference frames. The subject of kinematics does not involveany forces associated with the motion but address the relative orientation betweentwo reference frames as these evolve over time. A thorough working knowledge ofkinematics is a prerequisite to the successful formulation of the equations of motionof particles and rigid bodies.

Throughout this chapter, we will speak of the orientation of a reference frame fixedin a body to describe the orientation of the body itself.

4.1 Kinematic Differential Equations

In the preceding section, we have studied the problem of describing the orientationof a reference frame (or a rigid body) in terms of the direction cosine matrix. In thissection, we treat kinematics in which the relative orientation between two referenceframes is time dependent. The time-dependent relationship between two referenceframes is described by the so-called kinematic differentia1 equations. In this section,we derive the kinematic differential equations for the direction cosine matrix, Eulerangles, and the quaternions.

4.1.1 Direction Cosine Matrix

Consider two reference framesA andB, which are moving relative to each other.The angular velocity vector of a reference frameB with respect to a reference frameA is denoted by~ωBA. The direction cosineC is defined such that

bi = C(t)ai (4.1)

or

ai = CT(t)bi (4.2)

Taking time derivatives of Eq. 4.2 in theA frame, and denoting it by an overdot, weget

Page 24: Lecture Notes - Modeling of Mechanical Systems

24 4. Kinematics

0 = C(t)bi + CT(t)˙bi (4.3)

The last term may be found using Theorem 2.2.1,

0 = C(t)bi + CT(t)(ωBA(t)× bi) (4.4)

By introduction of the skew symmetric matrix

S(ωBA) =

0 −ω3 ω2

ω3 0 −ω1

ω2 ω1 0

(4.5)

and taking transpose in Eq. 4.4 we get the direction cosine kinematic equation

C(t) = −S(ωBA(t))C(t) (4.6)

Given an arbitrary time history ofωBA, Eq. 4.6 represents a rigorously linear differ-ential equation which can be integrated to yield the instantaneous direction cosinematrix. A major advantage of the kinematic differential equation is that it is linearand universally applicable. There are no geometric singularities present in the at-titude description or its kinematic differential equations. However, this advantagecomes at the cost of having a highly redundant formulation. Several other attitudeparameters will be presented in the following sections which include a minimalnumber (3) of attitude parameters. However, all minimal sets of attitude coordinateshave kinematic differential equations which contain some degree of nonlinearityand also embody geometric and/or mathematical singularities. Only the quaternionswill be found to retain a singularity free description and possess linear kinematicdifferential equations analogous to the direction cosine matrix.

4.1.2 Euler Angles

Like the kinematic differential equation for the direction cosine matrixC, the orien-tation of a reference frameB relative to a reference frameA can also be described byintroducing the time dependence of Euler angles. Consider the rotational sequenceB from A symbolically represented as

C3(θ3) : A′ ← A (4.7)

C2(θ2) : A′′ ← A′ (4.8)

C1(θ1) : B ← A′′ (4.9)

The time derivatives of Euler angles, called Euler rates, are denoted byθ3, θ2 andθ1. These successive rotations are also represented as

~ωA′A = θ3a3 = θ3a′3 (4.10)

~ωA′′A′ = θ2a′2 = θ2a

′′2 (4.11)

~ωBA′′ = θ1a′′1 = θ1b1 (4.12)

(4.13)

In theB frame, the angular velocity may thus be expressed as

Page 25: Lecture Notes - Modeling of Mechanical Systems

4.1 Kinematic Differential Equations 25

ω1

ω2

ω3

=

θ1

00

+ C1(θ1)

0θ2

0

+ C1(θ1)C2(θ2)

00θ3

=

1 0 − sin θ2

0 cos θ1 sin θ1 cos θ2

0 − sin θ1 cos θ1 cos θ2

θ1

θ2

θ3

(4.14)

The inverse relationship can be found through inversion,

θ1

θ2

θ3

=

1cos θ2

cos θ2 sin θ1 sin θ2 cos θ1 sin θ2

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

0 sin θ1 cos θ1

ω1

ω2

ω3

(4.15)

which is the kinematic differential equation for the (3-2-1) sequence. Ifω1, ω2

andω3 are known as functions of time, then the orientation ofB relative toA asa function of time can be determined by solving Eq. 4.15. Numerical integration ofEq. 4.15, however, involves the computation of trigonometric functions of the an-gles. Also note that Eq. 4.15 becomes singular whenθ2 = π/2. Such a mathematicalsingularity problem for a certain orientation angle can be avoided by selecting a dif-ferent set of Euler angles, but it is an inherent property of all different sets of Eulerangles.

Different Euler sequences results in similar (but different) kinematic differentialequations.

4.1.3 Quaternions

The quaternion kinematic equation is given by

q13 =12

(q4ω − ω × q13) (4.16)

q4 = −12ωTq13 (4.17)

The kinematic differential equation in Eq. 4.16 may be integrated numerically todetermine the orientation in terms of quaternions. Quaternions have no inherentgeometric singularity as do Euler angles. Moreover, quaternions are well suited forreal-time computation because only products and no trigonometric relations existin the quaternion kinematic differential equations. There are a number of numericalmethods available for solving Eq. 4.16. Methods include Taylor series expansion,the rotation vector concept, Runge-Kutta algorithms, and the state transition matrix.

Page 26: Lecture Notes - Modeling of Mechanical Systems

26 4. Kinematics

Page 27: Lecture Notes - Modeling of Mechanical Systems

REFERENCES 27

References

Goldstein, H. (1980).Classical Mechanics(2nd ed.). Addison-Wesley.Hamilton, W. R. (1866).Elements of Quaternions. London: Longmans, Green.Jakubczyk, B. and W. Respondek (1999).Geometric Nonlinear Control. Aal-

borg, Denmark: Lecture notes, Aalborg University, Department of ControlEngineering.

Stuelpnagel, J. D. (1964). On the parametrization of the three-dimensional rota-tion group.SIAM review 6, 422–430.