UAV Coordinate Frames and Rigid Body Dynamics
UAV Coordinate Frames and Rigid Body Dynamics
BYU ScholarsArchive
Faculty Publications
2004-01-01
This Report is brought to you for free and open access by BYU ScholarsArchive. It has been accepted for inclusion
in Faculty Publications by an authorized administrator of BYU ScholarsArchive. For more information, please
contact ellen_amatangelo@byu.edu.
Chapter 2
• Some of the on-board sensors take measurements in the body frame, e.g., rate gyros, while
some of the sensors take measurements in the inertial frame, e.g., GPS.
• Most system requirements, e.g., flight trajectories, are specified in the inertial frame.
We begin in two dimensions by considering the two coordinate frames shown in Figure 2.1.
The vector p can be expressed in both the C0 frame (specified by (i0 , j0 )) and in the C1 frame
(specified by (i1 , j1 )). In the C0 frame we have
p = p0x i0 + p0y j0 .
p = p1x i1 + p1y j1 .
3
4
Taking the dot product of both sides with i0 and j0 respectively, and stacking the result into matrix
form gives à ! à !à !
0
4 p x i 0 · i 1 i 0 · j 1 p1x
p0 = = .
p0y j0 · i1 j0 · j1 p1y
Noting that
i0 · i1 = cos(θ)
i0 · j1 = − sin(θ)
j0 · i1 = sin(θ)
j0 · j1 = cos(θ)
gives
p0 = R1→0 p1 ,
where à !
4 cos(θ) − sin(θ)
R1→0 = .
sin(θ) cos(θ)
One interpretation is that R1→0 transforms vectors expressed in frame C1 to an equivalent expres-
sion in C0 .
Inverting R1→0 gives
4
p1 = R1→0
−1
p0 = R0→1 p0 ,
where
à !−1 à !
cos(θ) − sin(θ) 1 cos(θ) sin(θ) T
R0→1 = = = R1→0 .
sin(θ) cos(θ) cos2 (θ) + sin2 (θ) − sin(θ) cos(θ)
UAV Coordinate Frames and Rigid Body Dynamics 5
The inertial frame CI . The inertial coordinate system is an earth fixed coordinate system with
origin at the defined home location. The x-axis of CI points North, the y-axis points East,
and the z axis points toward the center of the earth.
The vehicle frame Cv . The origin of the vehicle frame is at the center of mass of the UAV. How-
ever, the axes of Cv are aligned with the axis of the inertial frame CI . In other words, the
x-axis points North, the y-axis points East, and the z-axis points toward the center of the
earth.
The body frame Cb . The origin of the body frame is also at the center of mass of the UAV. The
x-axis points out the nose of the UAV, the y-axis points out the right wing, and the z-axis
point out the belly. As the attitude of the UAV moves, the body frame remains fixed with
respect to the airframe.
6
The wind frame Cw . To maintain lift, the UAV is required to maintain a positive pitch angle with
respect to the velocity vector of the UAV. It is often convenient to align the body fixed
reference frame with the velocity vector. This is the purpose of the wind frame. The origin
of the wind frame is the center of mass of the UAV. The x-axis is aligned with the projection
of the velocity vector on the x−z plane of the body axis. The y-axis points out the right wing
of the UAV and the z-axis is constructed to complete a right handed orthogonal coordinate
systems.
Figure 2.2 shows the body and the wind axes. The velocity vectory of the UAV points in the
direction of the xw axis which makes a angle α with the xb axis.
Figure 2.2: The body and the wind axes of the UAV. The x-axis of the body frame Cb is aligned
with the body of the UAV, whereas the x-axis of the wind frame Cw is aligned with the velocity
vector of the UAV. The angle between xb and xw is the angle of attack α.
The orientation of an aircraft is specified by three angles, roll (φ), pitch (θ), and yaw (ψ),
which are called the Euler angles. The yaw angle is defined as the rotation ψ about the zv -axis in
the vehicle frame Cv . The resulting coordinate frame is denoted C1 and is shown in Figure 2.3. It
can be seen from the figure that the transformation from Cv to C1 is given by
cos(ψ) sin(ψ) 0
Ryaw (ψ) = Rv→1 = − sin(ψ) cos(ψ) 0 .
0 0 1
UAV Coordinate Frames and Rigid Body Dynamics 7
Cv xv
y1 ψ
C1
ψ x1
yv
z1 zv
The pitch angle is defined as the rotation θ about the y1 axis in C1 . The resulting coordinate frame
is denoted by C2 and is shown in Figure 2.4. It can be seen from the figure that the transformation
x2
θ
x1
y2
C2
y1
C1
θ z2
z1
from C1 to C2 is given by
cos(θ) 0 − sin(θ)
Rpitch (θ) = R1→2 = 0 1 0 .
sin(θ) 0 cos(θ)
The roll angle is defined as the rotation φ about the x2 axis in C2 . The resulting coordinate frame
is the body frame, denoted by Cb , and shown in Figure 2.5. It can be seen from the figure that the
8
x2
xb
y2
φ
C2 Cb
yb
φ
zb
z2
1 0 0
Rroll (φ) = R2→b = 0 cos(φ) sin(φ) .
0 − sin(φ) cos(φ)
Therefore, the complete transformation from the vehicle frame Cv to the body frame Cb is given by
pb = Rv→b pv ,
where
The state variables of the UAV are the following twelve quantities
UAV Coordinate Frames and Rigid Body Dynamics 9
(x, u)
(φ, p)
(θ, q) Roll Axis
(ψ, r)
(y, v)
(z, w)
Pitch Axis
Yaw Axis
The state variables x, y, and h are inertial frame quantities, whereas the velocities u, v, and w are
body frame quantities. Therefore the relationship between position and velocities is given by
x u
d
y = Rb→v v
dt
−h w
u
T
= Rv→b v
w
cθcψ sφsθcψ − cφsψ cφsθcψ + sφsψ u
= cθsψ sφsθsψ + cφcψ cφsθsψ − sφcψ v .
−sθ sφcθ cφcθ w
The relationship between absolute angles φ, θ, and ψ, and the angular rates p, q, and r is
also complicated by the fact that these quantities are defined in different coordinate frames. The
angular rates are defined in the body frame Cb , whereas the roll angle φ is defined in Cb as shown in
Figure 2.5, the pitch angle θ is defined in C2 as shown in Figure 2.4, and the yaw angle ψ is defined
in the vehicle frame C1 as shown in Figure 2.3. Therefore we have
p φ̇ 0 0
q = Rb→b 0 + R2→b θ̇ + R1→b 0
r 0 0 ψ̇
φ̇ 0 0
= I3 0 + Rroll (φ) θ̇ + Rroll (φ)Rpitch (θ) 0
0 0 ψ̇
1 0 −sθ φ̇
= 0 cφ sφcθ θ̇ .
0 −sφ cφcθ ψ̇
Inverting we get
φ̇ 1 sin(φ) tan(θ) cos(φ) tan(θ) p
θ̇ = 0 cos(φ) − sin(φ) q .
ψ̇ 0 sin(φ) sec(θ) cos(φ) sec(θ) r
UAV Coordinate Frames and Rigid Body Dynamics 11
¯
dv ¯¯
m =F
dt ¯I
¯
dω ¯¯
J = M,
dt ¯I
where vcg is the inertial velocity of the center of mass, F is the force exerted on the body in the
inertial frame, ω is the angular velocity, M is the inertial frame torque, m is the mass,
Jx Jxy Jxz
J = Jxy Jy Jyz
Jxz Jyz Jz
¯
is the inertia tensor expressed in the body frame, and da ¯ is the time derivative of a in the inertial
dt I
frame. It is straightforward to argue [5] that if the body is rotating at an angular velocity of ω, then
¯ ¯
d ¯¯ d ¯¯
a = a¯ + ω × a,
dt ¯I dt b
¯
dv ¯¯
m = −ω × mv + F
dt ¯b
¯
dω ¯¯
J = −ω × Jω + M
dt ¯b
where v = (u, v, w)T is the body frame velocity of the center of gravity expressed in the body
frame, ω = (p, q, r)T is the angular velocity about the center of gravity expressed in the body
frame, F = (Fx , Fy , Fz )T is the external force placed on the center of gravity, expressed in the
body frame, M = (L, M, N )T are the torques about the center of gravity, expressed in the body
frame.
12 2.1 Exercises
2.1 Exercises
2.1 Develop a Simulink simulation of the equations of motion given in Equations (2.1)–(2.4).
Place various forces an torques on the UAV and convince yourself that your simulation gives
reasonable results.
Unzip the file homework1.zip. Change the name of the file
uaveom0_empty.m
to
uaveom0.m.
Find the location in the file where it says “UAV dynamics go here.” Delete the zeros and add
the appropriate equations.