Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

ROTATION MATRICES, DIRECTION COSINE MATRIX (DCM)

We use rotation matrix for the transformation from navigation frame to the body frame axes, or reverse.
Properties of rotation matrix

A rotation matrix is a special orthogonal matrix. By definition, a special orthogonal matrix has these
properties:

RRT = I

Where RT is the transpose of R and I is the identity matrix, and

det R = 1.

From those properties we have few other consequences which are helpful:

1. R is normalized: the squares of the elements in any row or column sum to 1.


2. R is orthogonal: the dot product of any pair of rows or any pair of columns is 0.
3. The rows of R represent the coordinates in the original space of unit vectors along the coordinate
axes of the rotated space.
4. The columns of R represent the coordinates in the rotated space of unit vectors along the axes of
the original space.
Properties 1 and 2 are useful for verifying that a matrix is a rotation matrix. If you manipulate a matrix,
and you want to make sure that you still have a rotation matrix, sum the squares of any row or column. If
the result is not 1, then you have surely done something wrong. If the result is 1, chances are you are on
the right track.

Property 3 is useful for forward motion. Now that we have the formal properties of a rotation matrix, let's
talk about the properties that apply, by convention, to 3D graphics programming.

DCM in terms of Euler angles

The idea behind Euler angles is to split the complete rotation of the coordinate system into three simpler
constitutive rotations, in such a way that the complete rotation matrix is the product of three simpler
matrices. Notice that the outer matrix will represent a rotation around one of the axis of the reference
frame, and the inner matrix represents a rotation around one of the moving frame axis. The middle
matrix represents a rotation around an intermediate axis called line of nodes.

 cos  sin  0 cos  0  sin   1 0 0 


DCM  C1C2C3 C3   sin  cos  0 C2   0
 1  
0  C1  0 cos sin 
 0 0 1  sin  0 cos   0  sin cos 

cos cos  cos sin  sin   sin cos  cos sin  cos   sin sin  
DCM   sin cos  sin sin  sin   cos cos   cos sin   sin sin  cos  
  sin  cos  sin  cos  cos  

We can now calculate relationship between angular velocities and Euler angles:
1   1 0 0   0  1 0 0  cos  0  sin    0 
   0   0 cos     
sin     0 cos  sin    0 1 0   0 
 2   
 3  0  0  sin  cos    0  0  sin  cos    sin  0 cos    

1      sin   1 0  sin     


    cos    sin  cos    0 cos 
  
sin  cos    
 2   
 3    sin    cos  cos   0  sin  cos  cos    

1 0  sin  
J 1 
 0 cos  sin  cos  
0  sin  cos  cos  

 
1 sin  tan  cos  tan  
J  J 1   0  sin  
1
cos 
 sin  cos  
0
 cos  cos  


Problem: it is not defined for cos   0   k
2
DCM in terms of Quaternions

Quaternions (Euler symmetric parameters) have proven very useful in representing rotations due to
several advantages above the other representations.


n - unit vector of axis
 - angle of rotation
         
r '  nn  r   r  nn  r cos   r  n sin 

By definition we have:

e0  cos
2
 e1 
 
e  e2   n sin
2
e3 
  
e0 , e  e0  e1i  e2 j  e3 k
2 2 2 2 2
e0  e  e  e0  e1  e2  e3  1

cos   2e0  1  e0  e1  e2  e3
2 2 2 2 2


n sin   2e0 e

And now we can use quaternion represetation for vectort of axis and angle so we get:
  2
 2 2 2
   
r '  r e0  e1  e2  e3  2ee  r   2e0 r  e  DCM r

Where:

e0 2  e12  e2 2  e3 2 2e1e2  e0 e3  2e1e3  e0 e2  


 
DCM   2e1e2  e0 e3  2e2 e3  e0e1  
2 2 2 2
e0  e1  e2  e3
 2e e  e e  2e2 e3  e0e1  e0  e1  e2  e3 
2 2 2 2
 1 3 0 2

We can now calculate relationship between angular velocities and quaternions:


 e1 e0  e3 e2   e1 e0 e3  e2 

W e    e2 e3 e0 e1  W ' e    e2
  e3 e0 e1 
 e3  e2 e1 e0   e3 e2  e1 e0 

1
e e,    W e  
T

2
1
e ' e,  '  W ' e   '
T

e0  T  e1  e2  e3 
 e1 e0 e3  e2  1    
 e 
1
    e    1  e0  e3 e2   1 
1
 e3 e0 e1   
e2  2  2  2 2  e e0  e1   2 
   e3 e2  e1 e0   3  
3
  3 
e3   e2 e1 e0   

  e11  e2 2  e3 3  0   1   2   3  e0 


 e  e  e     3   2   e1 
1 0 1 3 2 2 3  1 1 0
 
2  e31  e0 2  e1 3  2  2   3 0  1  e 2 
    
 e21  e1 2  e0 3   3  2  1 0   e3 
Conversion formulae between representations
Initial Values of Transformation Matrices

Initial values of inertial coordinates are given by the following set of equations:

X I  R cos  cos 
YI  R sin  cos 
Z I  R sin 
R  RE  H 0

Initial Missile to Normal Earth-fixed frame is defined from launch azimuth and elevation angle, supposing
that bank angle is zero:

cos EL 0  sin EL   cos AZ sin AZ 0 cos EL cos AZ cos EL sin AZ  sin EL 


(Tb
)   0
NED 0 1 0   sin AZ cos AZ 0    sin AZ cos AZ 0 
 sin EL 0 cos EL   0 0 2  sin EL cos AZ sin EL sin AZ cos EL 

Initial value of the Inertial to missile transformation matrix is given by simple transformation (having in
mind that Inertial and Geocentric Earth-fixed frames are coincident):

(TIb )0  (TNED
b
)0 (TINED )0

Having in mind that, from a definition of Euler angles:


 cos  cos  cos  sin   sin    a11 a12 a13 
T   cos  sin   sin  sin  cos  cos  cos   sin  sin  sin  sin  cos    a21 a22 a23 
b
I 
 sin  sin   cos  sin  cos   sin  cos   cos  sin  sin  cos  cos  a31 a32 a33 

From this matrix equation, we can define following equations:

  sin 1 ( a13 )
  tan 1 (a 23 / a 33 )
  tan 1 (a12 / a11 )

Initial values of quaternions can be defined from the quaternion definition equations:

e 0  cos(  / 2) cos( / 2) cos( / 2)  sin(  / 2) sin( / 2) sin( / 2)


e1  cos(  / 2) cos( / 2) sin( / 2)  sin(  / 2) sin( / 2) cos( / 2)
e 2  cos(  / 2) sin( / 2) cos( / 2)  sin(  / 2) cos( / 2) sin( / 2)
e 3   cos(  / 2) sin( / 2) sin( / 2)  sin(  / 2) cos( / 2) cos( / 2)

It is supposed that at time zero, inertial platform axes are coincident with missile axes (zero error
angles), so initial value of the Inertial to Platform transformation matrix is defined as:

TIp  TIb
angle2quatConvert rotation angles to quaternion
dcm2quatConvert direction cosine matrix to quaternion
quat2angleConvert quaternion to rotation angles
quat2dcmConvert quaternion to direction cosine matrix

quatconjCalculate conjugate of quaternion


quatdivideDivide quaternion by another quaternion
quatinvCalculate inverse of quaternion
quatmodCalculate modulus of quaternion
quatmultiplyCalculate product of two quaternions
quatnormCalculate norm of quaternion
quatnormalizeNormalize quaternion
quatrotateRotate vector by quaternion

You might also like