Chapter 2 - Kinematics
2.1 Reference frames
2.2 Transformations between BODY and NED
2.3 Transformations between ECEF and NED
2.4 Transformations between BODY and FLOW
“The study of dynamics can be divided into two parts: kinematics, which treats only geometrical
aspects of motion, and kinetics, which is the analysis of the forces causing the motion”
2
Overall Goal of Chapters 2 to 8
The notation and representation are adopted from:
Fossen, T. I. (1991). Nonlinear Modeling and Control of Underwater Vehicles, PhD thesis, Department of Engineering Cybernetics, NTNU, June 1991.
Fossen, T. I. (1994). Guidance and Control of Ocean Vehicles, John Wiley and Sons Ltd. ISBN: 0-471-94113-1.
Represent the 6-DOF dynamics in a compact matrix-vector form according to:
J
M
C
D
g
g
0
wind
wave#
#
2.1 Reference Frames
ECI {i}: Earth centered inertial frame; non-accelerating frame (fixed in space) in which Newton’s laws of motion apply.
ECEF {e}: Earth-Centered Earth-Fixed frame; origin is fixed in the center of the Earth but the axes rotate relative to the inertial frame ECI.
NED {n}: North-East-Down frame; defined relative to the Earth’s reference ellipsoid (WGS 84). BODY {b}: Body frame; moving coordinate frame fixed to the vessel.
xb- longitudinal axis (directed from aft to fore) yb- transversal axis (directed to starboard) zb-normal axis (directed from top to bottom)
N E D e x y l z e e BODY ECEF/ECI NED et e x y y x z i i e e i,ze ECEF/ECI
4
2.1 Reference Frames – Body-Fixed
Reference Points
• CG - Center of gravity
• CB - Center of buoyancy
• CF - Center of flotation
CF is located a distance LCF from CO in the x-direction
The center of flotation is the centroid of the water plane area Awpin calm water. The vessel will roll and pitch about this point.
u
u1nn1 un2n2 u3nn3
un u1n,u2n,u3n Coordinate-free vector
n
i i 1, 2, 3 are the unit vectors that definen Coordinate form of uinn
forces and linear and positions and DOF moments angular velocities Euler angles
1 motions in the x-direction (surge) X u x 2 motions in the y-direction (sway) Y v y 3 motions in the z-direction (heave) Z w z 4 rotation about the x-axis (roll, heel) K p 5 rotation about the y-axis (pitch, trim) M q 6 rotation about the z-axis (yaw) N r
2.1 Reference frames and 6-DOF motions
xb yb u (surge) r (yaw) v (sway) (heave) w (roll) p (pitch) q
The notation is adopted from:
SNAME (1950). Nomenclature for Treating the Motion of a Submerged Body Through a Fluid.
The Society of Naval Architects and Marine Engineers, Technical and Research Bulletin No. 1-5, April 1950, pp. 1-15.
6
2.1 Reference Frames - Notation
Generalized position, velocity and force ECEF position: pb/e e x y z 3 Longitude and latitude en l S 2 NED position: pb/n n N E D 3 Attitude (Euler angles) nb S3 Body-fixed linear velocity vbb/n u v w 3 Body-fixed angular velocity bb/n p q r 3 Body-fixed force: fb b X Y Z 3 Body-fixed moment mb b K M N 3 pb/n n or p b/n e ) nb , vb/n b bb/n , fbb mbb #
2.2 Transformations between
BODY and NED
Special orthogonal group of order 3:
SO
3
R
|
R
33,
R
is orthogonal and det
R
1
Orthogonal matrices of order 3:
O
3
R
|
R
33,
RR
R
R
I
RR RR I, detR 1 Rotation matrix: Since R is orthogonal, R1 R to R from to from Example:8
a
:
S
a
Cross-product operator as matrix-vector multiplication:
S S 0 3 2 3 0 1 2 1 0 , 1 2 3
where is a skew-symmetric matrix S S
2.2 Transformations between
BODY and NED
2.2 Transformations between
BODY and NED
Eulers theorem on rotation:
R11 1 cos 12 cos R22 1 cos 22 cos R33 1 cos 32 cos R12 1 cos 12 3sin R21 1 cos 21 3sin R23 1 cos 23 1sin R32 1 cos 32 1sin R31 1 cos 31 2sin R13 1 cos 13 2sin R, I33 sin S 1 cos S 2 where 1,2,3, || 1 vnb/n Rbnvbb/n, Rbn : R, #
10
2.2.1 Euler Angle Transformation
Three principal rotations:
(2) Rotation over pitch angle about . Note that . y v =v 2 2 1 x2 x3 y3 y2 u3 u2 v2 v3
(1) Rotation over yaw angle about . Note that . z w =w 3 3 2 x1 x2 z1 z2 u1 u2 w1 w2 U U
(3) Rotation over roll angle about . Note that . x u =u 1 1 2 z =z0 b z1 y1 y =y0 b v=v2 v1 w=w0 w1 U 1, 0, 0 0, 1, 0 0, 0, 1 Rx, 1 0 0 0 c s 0 s c Ry, c 0 s 0 1 0 s 0 c Rz, c s 0 s c 0 0 0 1
2.2.1 Euler Angle Transformation
Linear velocity transformation (
zyx
-convention):
Small angle approximation:
where Rbnnb cc sc css ss ccs sc cc sss cs ssc s cs cc Rbnnb I33 Snb 1 1 1 Rbnnb1 Rnbnb Rx,Ry,Rz, Rbnnb : Rz,Ry,Rx, p bn/n Rbnnbvbb/n #
12
NED positions (continuous time and discrete time):
2.2.1 Euler Angle Transformation
Component form:
Euler
integration pbn/n Rnbnbvbb/n #
N ucoscos vcossinsin sincos wsinsin coscossin
Ė usincos vcoscos sinsinsin wsinsincos cossin
D usin vcossin wcoscos
#
# #
pbn/nk 1 pbn/nk hRbnnbkvbb/nk #
Angular velocity transformation (
zyx
-convention):
2.2.1 Euler Angle Transformation
where
1. Singular point at 90o
Small angle approximation: Notice that:
T1nb 1 0 s 0 c cs 0 s cc Tnb 1 st ct 0 c s 0 s/c c/c Tnb 1 0 0 1 0 1 T1nb Tnb nb Tnbbb/n # b/n b 0 0 Rx, 0 0 Rx,Ry, 0 0 : T1nbnb #
14
ODE for Euler angles: ODE for rotation matrix
2.2.1 Euler Angle Transformation
Component form:
p qsintan rcostan
qcos rsin q sin cos r cos cos , 90 o # #
# + algorithm for computation
of Euler angles from the rotation matrix
where
Euler angle attitude representations:
Rbnnb nb ,, nb Tnbbb/n # R b n RbnSbb/n # Sbb/n 0 r q r 0 p q p 0 #
Summary: 6-DOF kinematic equations:
2.2.1 Euler Angle Transformation
Component form:
3-parameter representation
with singularity at 90o
N ucoscos vcossinsin sincos
wsinsin coscossin
Ė usincos vcoscos sinsinsin
wsinsincos cossin D usin vcossin wcoscos
#
# #
p qsintan rcostan
qcos rsin q sin cos r cos cos , 90 o # # # nb ,, J pbn/n nb Rb n nb 033 033 Tnb vbb/n bb/n #
16
2.2.2 Unit Quaternions
4-parameter representation:
-avoids the representation singularity of the Euler angles -numerical effective (no trigonometric functions)
Q q|qq 1,q ,, 3 and 1,2,3
R, I33 sin S 1 cos S 2
Unit quaternion (Euler parameter) rotation matrix (Chou 1992):
cos 2 1,2,3 sin 2 q 1 2 3 cos 2 sin 2 Q Rbnq : R, I33 2S 2S2
2.2.2 Unit Quaternions
Linear velocity transformation
where
Rbnq
1 222 32 212 3 213 2
212 3 1 221 32 223 1
213 2 223 1 1 212 22
Component form (NED positions):
Rbnq1 R
b nq qq 1
NB! must be integrated under the constraint or 2 1 2 2 2 3 2 1 N u1 222 232 2v12 3 2w13 2 Ė 2u12 3 v1 212 232 2w23 1 D 2u13 2 2v23 1 w1 212 222 # # # p bn/n Rnbqvbb/n #
18
2.2.2 Unit Quaternions
Angular velocity transformation
Tqq 12 1 2 3 3 2 3 1 2 1 , TqqTqq 14I33 where 12 1p 2q 3r 1 1 2 p 3q 2r 2 1 2 3p q 1r 3 1 2 2p 1q r # # # # Component form: NB! nonsingular to the price of one more parameter
Alternative representation (Kane 1983)
The equations are derived using
q Tqqbb/n # q 1 2 I33 S bb/n #
R
bn
R
bnS
bb/n
4-parameter representation
Nonsingular but one more ODE is needed
Summary: 6-DOF kinematic equations (7 ODEs):
Component form:
q ,1,2,3 12 1p 2q 3r 1 1 2 p 3q 2r 2 1 2 3p q 1r 3 1 2 2p 1q r # # # #2.2.2 Unit Quaternions
N u1 222 232 2v12 3 2w13 2 Ė 2u12 3 v1 212 232 2w23 1 D 2u13 2 2v23 1 w1 212 222 # # # J pbn/n q Rbnq 033 043 Tqq vbb/n bb/n #20
Discrete-time algorithm for unit quaternion normalization
qq 12 22 32 2 1
2.2.2 Unit Quaternions
Algorithm ( Discrete- TimeNormalizationoftheUnit Quaternions ) 1. k 0.Computeinitialvaluesofqk 0.
2. Forsimplicity,EulerIntegrationimpliesthat
qk1 qkhTqqkbb/nk #
wherehisthesamplingtime.
3. Normalization
qk1 qk1
qqk1q
qk1
qk1qk1 4. Letk k1andreturntoStep2.
Acontinuoustimealgorithmforunitquaternionnormalizationcanbeimplementedbynotingthat
d dtq
q 2qT
qqbb/n 0 #
Continuous-time algorithm for unit quaternion normalization:
If q is initialized as a unit vector, then it will remain a unit vector.
However, integration of the quaternion vector q from the differential equation
will introduce numerical errors that will cause the length of q to deviate from unity.
In Simulinkthis is avoided by introducing feedback:
q Tqqnbb 2 1 qqq d dt q q 2qT qqnb b 1 qqqq 1 qqqq 0 if q is initialized as a unit vector 0 (typically 100 x 1 qq
Change of coordinates (x=0 gives )
x x1 x linearization about x=0 gives x x
qq 1
2.2.2 Unit Quaternions
d
22
2.2.3 Quaternions from Euler Angles
Ref. Shepperd (1978)
Algorithm (QuaternionsFromEulerAngles)
1. Given the Euler angles , , and . Let the transformation matrix Rbn according to be written : Rbn :
R 11 R 12 R 13 R 21 R 22 R 23 R 31 R 32 R 33 2. The trace of Rbe is computed as : R 44 trRbn R 11 R 22 R 33
3. Let 1 i 4 be the index corresponding to : R ii maxR 11,R 22,R 33,R 44 4. Compute p i corresponding to Index i of Step 3 according to :
p i 12R ii R 44 where the sign ascribed to p i can be chosen to be either positive or negative .
5. Compute the other three p i- values from :
p 4p 1 R 32 R 23 p 2p 3 R 32 R 23 p 4p 2 R 13 R 31 p 3p 1 R 13 R 31 p 4p 3 R 21 R 12 p 1p 2 R 21 R 12
by dividing the 3 equations containing the component p i with the known value of p i ( from Step 4 ) on both sides .
6. Compute the Euler parameters q ,1,2,3 according to :
p 4/2 and j p j/2 j 1,2,3
2.2.4 Euler Angles from Quaternions
Require that the rotation matrices of the two kinematic representations are equal:
q ,1,2,3 cc sc css ss ccs sc cc sss cs ssc s cs cc R11 R12 R13 R21 R22 R23 R31 R32 R33
Algorithm: One solution is:
atan2R32,R33 sin1R 31 tan1 R31 1 R312 ; 90o atan2R21,R11 # # #
where atan2(y,x) is the 4-quadrant arctangent of the real parts of the elements of x and y, satisfying:
atan2y,x
24
2.3 Transformation between
ECEF and NED
ECEF {e}-frame NED {n}-frame Longitude: l (deg) Latitude: (deg) Ellipsoidal height: h (m)
A point on or above the Earth’s surface is uniquely determined by:
h
NED axes definitions:
N - North axis is pointing North
E - East axis is pointing East
D – Down axis is pointing down in the normal direction to the Earth’s surface
2.3.1 Longitude and Latitude transformations
The transformation between the ECEF and NED velocity vectors is:
Two principal rotations:
1. a rotation l about the z-axis
2. a rotation ( ) about the /2 y-axis.
en l, S2 Rneen Rz,lRy, 2 cosl sinl 0 sinl cosl 0 0 0 1 cos 2 0 sin 2 0 1 0 sin 2 0 cos 2 Rneen
coslsin sinl coslcos
sinlsin cosl sinlcos
cos 0 sin
pbe/e Renenpbn/e RneenRbnnbvbb/e #
26
2.3.1 Flat Earth Navigation
For flat Earth navigation it can be assumed that the NED tangent plane is fixed on the surface of the Earth-that is, l and are constants, by assuming that the
operating radius of the vessel is limited:
en l, S2
en constant Rn
e
en Ro constant
Rneen
coslsin sinl coslcos
sinlsin cosl sinlcos
cos 0 sin
pbe/e Renenpbn/e RneenRbnnbvbb/e #
Satellite navigation system measurements are given in the ECEF frame: Not to useful for the operator.
Presentation of terrestrial position data is therefore made in terms of the ellipsoidal parameters longitude l, latitude and height h.
Transformation:
2.3.2
Longitude/Latitude from ECEF
Coordinates
and height h
en
l
,
p
be/e
x
,
y
,
z
pbe/e x,y,z pbe/e x,y,z28
N
re2re2cos2rp2sin2
2.3.2 Longitude/Latitude from ECEF
Coordinates
l
atan
yxee
tan zpe 1 e2 N N h 1 h cosp N # #while latitude and height h are implicitly computed by:
p
be/e
x
,
y
,
z
Parameters Comments
re 6 378 137 m Equatorial radius of ellipsoid (semimajor axis)
rp 6 356 752 m Polar axis radius of ellipsoid (semiminor axis)
e 7. 292115 105 rad/s Angular velocity of the Earth
e 0. 0818 Eccentricity of ellipsoid
e
1
rrpe
22.3.2
Longitude/Latitude from ECEF
Coordinates
Algorithm (Transformationof x e,y e,z e tol ,,h )
1. Compute p x e2 y e2.
2. Compute the approximate value 0 from :
tan 0 z p e1e 21 3. Compute an approximate value N from :
N r e2
r e2cos2 0 r p2sin2 0 4. Compute the ellipsoidal height by :
h cosp
0 N 0 . 5. Compute an improved value for the latitude by :
tan z p e 1e 2 N 0 N 0 h
1
6. Check for another iteration step : if | 0 |< tol where tol is a small number , then the iteration is complete . Otherwise set 0 and continue with Step 3 .
30
2.3.3 ECEF Coordinates from
Longitude/Latitude
Ref. Heiskanen (1967)
The transformation from for given heights en l, h to is given by
x y z N hcoscosl N hcossinl rp2 re2 N h sin pbe/e x,y,z
2.4 Transformation between BODY and Flow
FLOW axes are often used to express hydrodynamic data. The FLOW axes are found by rotating the BODY axis system such that resulting x-axis is parallel to the freestream flow.
In FLOW axes, the x-axis directly points into the relative flow while the z-axis remains in the reference plane, but rotates so that it remains perpendicular to the x-axis. The y-axis completes the right-handed system.
xb - xstab zb yb U xflow
32
2.4.1 Definitions of Course, Heading and
Sideslip Angles
The relationship between the angular variables course, heading, and sideslip is important for maneuvering of a vehicle in the horizontal plane (3 DOF) .
The terms course and heading are used interchangeably in much of the literature on guidance, navigation and control of marine vessels, and this leads to confusion.
Definition (Course angle χ): The angle from the x-axis of the NED frame to the velocity vector of the vehicle, positive rotation about the z-axis of the NED frame by the right-hand screw convention
Definition: Heading (yaw) angle : The angle from the NED x-axis to the BODY x-axis, positive rotation about the z-axis of the NED frame by the right-hand screw convention.
Definition: Sideslip (drift) angle β: The angle from the BODY x-axis to the velocity vector of the vehicle,
positive rotation about the BODY z-axis frame by the right-hand screw convention
arcsin Uv small Uv
Remark: In SNAME (1950) and Lewis (1989) the sideslip angle for marine craft is defined according to:
βSNAME = -β
The sideslip definition follows the sign convention used by the aircraft community, for instance as in Nelson (1998) and Stevens (1992). This definition is more intuitive from a guidance point-of-view than SNAME (1950).
Note that the heading angle equals the course angle ( = χ) when the sway velocity v = 0, that is when there is no sideslip.
Course angle:
Sideslip (drift) angle:
2.4.1 Definitions of Course, Heading and
Sideslip Angles
34 Ry, cos 0 sin 0 1 0 sin 0 cos , Rz, Rz, cos sin 0 sin cos 0 0 0 1 u v w Ry,Rz, U 0 0 u Ucoscos v Usin w Usincos # # # or vstab Ry,vb vflow Rz,vstab # # xb - xstab zb yb U xflow
2.4.2 Sideslip and Angle of Attack
U u2 v2 #
2.4.2 Sideslip and Angle of Attack
Extension to Ocean Currents
For a marine craft exposed to ocean currents, the concept of relative velocities is introduced. The relative velocities are:
ur u uc vr v vc wr w wc # # # Ur ur2 vr2 wr2 # ur Urcosrcosr vr Ursinr wr Ursinrcosr # # # r tan1 wurr r sin1 vr Ur # # Hence,
36
Lift and drag forces can then be computed as a function of forward speed and transformed back to BODY coordinates.
u Ucoscos v Usin w Usincos # # # Linear approximation: u U, v U, w U
BODY to FLOW axes:
u,v,w,p,q,r flow U,,,p,q,r flow TU TU diag1, 1/U, 1/U, 1, 1, 1 xb - xstab zb yb U xflow
2.4.2 Sideslip and Angle of Attack
TUMTU1flow TUNTU1flow TU #