Derivation and Integration of Equations of Motion.pdf - Cal Poly
Derivation and Integration of Equations of Motion.pdf - Cal Poly
Derivation and Integration of Equations of Motion.pdf - Cal Poly
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Chris Atkinson<br />
Aero 400 – Flight Simulation – Final Project<br />
March 11, 2002<br />
<strong>Derivation</strong> <strong>and</strong> Implementation <strong>of</strong> the <strong>Equations</strong> <strong>of</strong> <strong>Motion</strong> for Flight Simulation<br />
<strong>Derivation</strong><br />
Translational<br />
The translation <strong>of</strong> the aircraft is calculated from Newton’s second law <strong>of</strong> motion, which states that the force on<br />
an object is equal to the time rate <strong>of</strong> change <strong>of</strong> the linear momentum <strong>of</strong> the object relative to an inertial reference point.<br />
If F G is the force vector on the aircraft, m is the mass <strong>of</strong> the aircraft, <strong>and</strong> V G i<br />
is the velocity <strong>of</strong> the aircraft relative to an<br />
inertial reference point expressed in body coordinates,<br />
G G<br />
V = V<br />
i<br />
k,<br />
b<br />
G<br />
G d mV i<br />
F =<br />
dt<br />
( )<br />
If we assume that the mass <strong>of</strong> the aircraft is constant <strong>and</strong> that the earth is an inertial reference point, then<br />
, where V G<br />
k,<br />
b<br />
is the velocity <strong>of</strong> the aircraft relative to the earth in body coordinates.<br />
G<br />
G<br />
F = m dt<br />
dV k , b<br />
According to the Coriolis Theorem, the rate <strong>of</strong> change <strong>of</strong> the a vector in rotating coordinate system is the rate<br />
<strong>of</strong> change <strong>of</strong> the components <strong>of</strong> that vector plus the rotation <strong>of</strong> the coordinate system relative to an inertial reference<br />
frame cross the vector. If u, v, <strong>and</strong> w are the components <strong>of</strong> V G k,<br />
b<br />
, <strong>and</strong> G ωb,<br />
e<br />
is the rotation <strong>of</strong> the body frame with<br />
respect to earth (inertial reference frame),<br />
⎛ ⎡u<br />
⎤ ⎞<br />
G ⎜<br />
F m<br />
⎢<br />
v<br />
⎥ G ⎟<br />
= ⎜ <br />
⎢ ⎥<br />
+ ωb, e<br />
× Vk , b ⎟<br />
⎜ ⎢w⎥<br />
⎟<br />
⎝ ⎣ ⎦ ⎠<br />
If we exp<strong>and</strong> the cross product <strong>and</strong> separate the components <strong>of</strong> the force we get the following equations where<br />
p, q, <strong>and</strong> r are the components <strong>of</strong> G ωb,<br />
e<br />
.<br />
Solving for u , v , <strong>and</strong> w , we get,<br />
x<br />
y<br />
z<br />
( )<br />
( )<br />
( )<br />
F = m u + q w − r v<br />
F = m v + r u − p w<br />
F = m w + p v − qu<br />
Fx<br />
u<br />
= + r v − q w<br />
m<br />
Fy<br />
v<br />
= + p w − r u<br />
m<br />
Fz<br />
w<br />
= + qu − p v<br />
m
Rotational<br />
Newton’s second law also states that the moment on an object is equal to the time rate <strong>of</strong> change <strong>of</strong> the<br />
angular momentum <strong>of</strong> the object relative to an inertial reference frame. If T G is the moment vector on the aircraft, I, is<br />
the moment <strong>of</strong> inertia matrix <strong>of</strong> the aircraft, <strong>and</strong><br />
G ωi<br />
, is the rotation <strong>of</strong> the aircraft with respect to an inertial reference<br />
point,<br />
G<br />
⎡ I<br />
x<br />
−I xy<br />
−I<br />
xz ⎤<br />
G d ( I ω i )<br />
⎢<br />
T =<br />
I I<br />
xy<br />
I<br />
y<br />
I<br />
⎥<br />
= yz<br />
dt<br />
⎢<br />
− − ⎥<br />
⎢ I<br />
xz<br />
I<br />
yz<br />
I ⎥<br />
⎣<br />
− −<br />
z ⎦<br />
G G<br />
ω = ω<br />
i<br />
b,<br />
k<br />
Again, we assume that the moment <strong>of</strong> inertia matrix is constant <strong>and</strong> that earth is an inertial reference point,<br />
,<br />
Again, using the Coriolis Theorem,<br />
G d<br />
T =<br />
G<br />
( I ωb,<br />
e )<br />
dt<br />
Carrying out the multiplication, we get,<br />
⎡ p<br />
⎤<br />
G<br />
T I<br />
⎢<br />
q<br />
⎥ G G<br />
= <br />
⎢ ⎥<br />
+ ω × I ω<br />
⎢⎣ r<br />
⎥⎦<br />
b, e b,<br />
e<br />
⎡ p I<br />
x<br />
− q I<br />
xy<br />
− r<br />
I<br />
xz ⎤ ⎡ p I<br />
x<br />
− q I<br />
xy<br />
− r I<br />
xz ⎤<br />
G ⎢<br />
T q I<br />
y<br />
p I<br />
xy<br />
r I<br />
⎥ G ⎢<br />
yz ω q I<br />
b,<br />
e y<br />
p I<br />
xy<br />
r I<br />
⎥<br />
= − − <br />
⎢ ⎥ + × ⎢<br />
− −<br />
yz ⎥<br />
⎢r I − p I − q<br />
I ⎥ ⎢r I − p I − q I ⎥<br />
⎣ z xz yz ⎦ ⎣ z xz yz ⎦<br />
Exp<strong>and</strong>ing the cross product <strong>and</strong> separating the components <strong>of</strong> the moment vector, L, M, <strong>and</strong> N, we get,<br />
2 2<br />
( r − q )<br />
2 2<br />
( p − r )<br />
2 2<br />
( q − p )<br />
L = p I − q I − r<br />
I + qr I − pq I + I − qr I + pr I<br />
x xy xz z xz yz y xy<br />
M = q I − p I − r<br />
I − pr I + I + pq I + pr I − qr I<br />
y xy yz z xz yz x xy<br />
N = r I − p I − q<br />
I + pq I + I − pr I − pq I + qr I<br />
z xz yz y xy yz x xz<br />
For an aircraft <strong>of</strong> st<strong>and</strong>ard configuration, I xy = I yz = 0, so the equations simplify to,<br />
L = p<br />
I − r<br />
I + qr I − pq I − qr I<br />
x xz z xz y<br />
2 2<br />
( p − r )<br />
M = q<br />
I − pr I + I + pr I<br />
y z xz x<br />
N = r<br />
I − p<br />
I + pq I − pq I + qr I<br />
z xz y x xz
If we solve the rotational equations for p , q , <strong>and</strong> r , we get,<br />
2 2<br />
( ) ( )<br />
L I + N I + pq I I − I I + I I + qr I I − I − I<br />
p<br />
=<br />
I I<br />
z xz x xz y xz z xz y z xz z<br />
2<br />
x z − I xz<br />
2 2<br />
( ) ( )<br />
M + pr I − I + r − p I<br />
q<br />
=<br />
I<br />
z x xz<br />
y<br />
( ) ( )<br />
N + pq I − I + p − qr I<br />
r<br />
=<br />
I<br />
x y xz<br />
z<br />
The three translational <strong>and</strong> three rotational equations <strong>of</strong> motion are the bases for the equations <strong>of</strong> motion in the<br />
flight simulator.<br />
F<br />
<br />
m<br />
Fy<br />
v<br />
= + p w − r u<br />
m<br />
F<br />
<br />
m<br />
x<br />
u = + r v − q w<br />
z<br />
w = + qu − p v<br />
2 2<br />
( ) ( )<br />
L I + N I + pq I I − I I + I I + qr I I − I − I<br />
p<br />
=<br />
I I<br />
z xz x xz y xz z xz y z xz z<br />
2<br />
x z − I xz<br />
2 2<br />
( ) ( )<br />
M + pr I − I + r − p I<br />
q<br />
=<br />
I<br />
z x xz<br />
y<br />
( ) ( )<br />
N + pq I − I + p − qr I<br />
r<br />
=<br />
I<br />
x y xz<br />
z
Implementation<br />
Translational<br />
In the flight simulator, the forces on the aircraft is the sum <strong>of</strong> the external forces, aerodynamic forces, <strong>and</strong><br />
gravitational forces.<br />
F = F + F + m g<br />
x x ext, b x aero, b x,<br />
b<br />
F = F + F + m g<br />
y y ext, b y aero, b y,<br />
b<br />
F = F + F + m g<br />
z z ext , b z aero, b z,<br />
b<br />
Using the translational equations <strong>of</strong> motion derived above, we can solve for the acceleration <strong>of</strong> the aircraft.<br />
F<br />
<br />
m<br />
Fy<br />
v<br />
= + p w − r u<br />
m<br />
F<br />
= + −<br />
m<br />
x<br />
u = + r v − q w<br />
z<br />
w qu p v<br />
The acceleration <strong>of</strong> the aircraft is integrated over time with an initial velocity to get the velocity <strong>of</strong> the aircraft.<br />
∫<br />
∫<br />
∫<br />
u = u<br />
dt + u<br />
v = v<br />
dt + v<br />
0<br />
0<br />
w = wdt + w<br />
The velocity <strong>of</strong> the aircraft is then converted into earth coordinates <strong>and</strong> integrated with an initial position to<br />
get the position <strong>of</strong> the aircraft in earth coordinates.<br />
0<br />
⎡x<br />
⎤ ⎡u<br />
⎤<br />
⎢ e<br />
y<br />
⎥<br />
= C<br />
⎢<br />
b<br />
v<br />
⎥<br />
⎢ ⎥ ⎢ ⎥<br />
⎢⎣ z<br />
⎥⎦ ⎢⎣ w⎥⎦<br />
⎡cosθ cosψ sinφ sinθ cosψ − cosφ sinψ cosφ sinθ cosψ + sinφ sinψ<br />
⎤<br />
C =<br />
⎢<br />
cosθ sinψ sinφ sinθ sinψ cosφ cosψ cosφ sinθ sinψ sinφ cosψ<br />
⎥<br />
⎢<br />
+ −<br />
⎥<br />
C = C<br />
⎢⎣<br />
−sinθ sinφ cosθ cosφ cosθ<br />
⎥⎦<br />
b e b T<br />
e b e<br />
∫<br />
∫<br />
∫<br />
x = x<br />
dt + x<br />
0<br />
y = y<br />
dt + y<br />
z = z<br />
dt + z<br />
0<br />
0
Rotational<br />
The moments on the aircraft in the flight simulator are the sum <strong>of</strong> the external moments <strong>and</strong> aerodynamic<br />
moments.<br />
L = L + L<br />
ext<br />
ext<br />
ext<br />
aero<br />
M = M + M<br />
N = N + N<br />
The rotational equations <strong>of</strong> motion derived above are used to calculate the angular accelerations <strong>of</strong> the aircraft.<br />
aero<br />
aero<br />
2 2<br />
( ) ( )<br />
L I + N I + pq I I − I I + I I + qr I I − I − I<br />
p<br />
=<br />
I I<br />
z xz x xz y xz z xz y z xz z<br />
2<br />
x z − I xz<br />
2 2<br />
( ) ( )<br />
M + pr I − I + r − p I<br />
q<br />
=<br />
I<br />
z x xz<br />
y<br />
( ) ( )<br />
N + pq I − I + p − qr I<br />
r<br />
=<br />
I<br />
x y xz<br />
z<br />
aircraft.<br />
The angular accelerations are integrated with an initial angular velocity to get the angular velocity <strong>of</strong> the<br />
∫<br />
∫<br />
∫<br />
p = p<br />
dt + p<br />
q = q<br />
dt + q<br />
r = r<br />
dt + r<br />
0<br />
0<br />
0<br />
The angular velocities are then converted into Euler axes <strong>and</strong> integrated with initial Euler angles to get the<br />
Euler angles <strong>of</strong> the aircraft.<br />
⎡ψ<br />
⎤ ⎡ p⎤<br />
⎢ ˆ ε<br />
θ<br />
⎥<br />
= C<br />
⎢<br />
b<br />
q<br />
⎥<br />
⎢ ⎥ ⎢ ⎥<br />
⎢ <br />
⎣φ<br />
⎥⎦ ⎢⎣ r ⎥⎦<br />
⎡0 sinφ secθ cosφ secθ<br />
⎤<br />
ˆ<br />
C ε b<br />
=<br />
⎢<br />
0 cosφ<br />
sinφ<br />
⎥<br />
⎢<br />
−<br />
⎥<br />
⎢⎣<br />
1 sinφ tanθ cosφ tanθ<br />
⎥⎦<br />
∫<br />
∫<br />
∫<br />
ψ = ψ<br />
dt + ψ<br />
θ = θ<br />
dt + θ<br />
φ = φ dt + φ<br />
0<br />
0<br />
0
Angle <strong>of</strong> Attack <strong>and</strong> Sideslip Angle<br />
To calculate the angle <strong>of</strong> attack <strong>and</strong> sideslip angle <strong>of</strong> the aircraft, we must first calculate the air velocity <strong>of</strong> the<br />
aircraft in body coordinates. The air velocity is equal to the ground velocity <strong>of</strong> the aircraft minus the wind velocity<br />
converted into body coordinates. The acceleration <strong>of</strong> the aircraft relative to the air is calculated by taking the derivative<br />
<strong>of</strong> the air velocity <strong>and</strong> applying the Coriolis Theorem.<br />
G G G b<br />
dV d ( Ce<br />
Vatm,<br />
e )<br />
V = V − C V<br />
b<br />
T , b k , b e atm,<br />
e<br />
u = u − u<br />
T<br />
v = v − v<br />
T<br />
T<br />
atm<br />
atm<br />
w = w − w<br />
atm<br />
G G<br />
G <br />
k , b<br />
VT , b<br />
= −<br />
dt dt<br />
u = u + q w − r v − u<br />
− q w + r v<br />
T atm atm atm<br />
v = v + r u − p w − v<br />
− r u + p w<br />
T atm atm atm<br />
w = w + p v − qu − w<br />
− p v + qu<br />
T atm atm atm<br />
The angle <strong>of</strong> attack <strong>and</strong> sideslip angle can then be calculated from the components <strong>of</strong> the air velocity. The rate<br />
<strong>of</strong> change <strong>of</strong> the angle <strong>of</strong> attack <strong>and</strong> sideslip angles is calculated by taking the derivatives <strong>of</strong> the angles.<br />
−1<br />
wT<br />
α = tan<br />
uT<br />
u w<br />
− u<br />
w<br />
α<br />
=<br />
T T T T<br />
2 2<br />
uT<br />
+ wT<br />
β = sin<br />
−1<br />
2 2 2<br />
T<br />
+<br />
T<br />
+<br />
T<br />
⎛<br />
1 ⎜ v u u + v v + w w<br />
β = v<br />
cos β<br />
⎜<br />
−<br />
⎜ u v w ( u + v + w<br />
⎝<br />
)<br />
v<br />
T<br />
u v w<br />
T T T T T T T<br />
T<br />
3<br />
2 2 2 2 2 2 2<br />
T<br />
+<br />
T<br />
+<br />
T T T T<br />
⎞<br />
⎟<br />
⎟<br />
⎟<br />
⎠<br />
Aerodynamic Forces<br />
The atmospheric forces <strong>and</strong> moments on the aircraft are calculated using linear Taylor expansions <strong>and</strong> stability<br />
derivatives. The derivatives are non-dimensional <strong>and</strong> must be dimensionalized using the airspeed, wing planform area,<br />
span, <strong>and</strong> chord. The aerodynamic forces are assumed to be in stability axes <strong>and</strong> must be converted to body<br />
coordinates.<br />
2 2 2<br />
T<br />
=<br />
T<br />
+<br />
T<br />
+<br />
T<br />
V u v w<br />
( α<br />
L )<br />
δ<br />
1 2<br />
x aero, s<br />
= − ρ<br />
2 T D<br />
+<br />
1 D<br />
α + δe<br />
e<br />
F V S C C C<br />
F V<br />
⎛<br />
S C C<br />
b<br />
p C<br />
b<br />
r C C<br />
⎝<br />
1 2<br />
y aero, s<br />
= ρ<br />
2 T ⎜ y<br />
β +<br />
y<br />
+<br />
pˆ<br />
y<br />
+<br />
rˆ<br />
y<br />
δa +<br />
β δ y<br />
δr<br />
a δr<br />
2VT<br />
2V<br />
T<br />
F V<br />
⎛<br />
S C C C<br />
c<br />
C<br />
c<br />
q C<br />
⎝<br />
1 2<br />
z aero, s<br />
= − ρ<br />
2 T ⎜ L<br />
+<br />
1 L<br />
α +<br />
L<br />
α +<br />
aˆ<br />
L<br />
+<br />
α<br />
qˆ<br />
L<br />
δ<br />
δ e<br />
e<br />
2V<br />
T<br />
2V<br />
T<br />
⎞<br />
⎟<br />
⎠<br />
⎞<br />
⎟<br />
⎠<br />
F<br />
= C F<br />
b<br />
aero, b s aero,<br />
s<br />
b<br />
C s<br />
⎡cosα<br />
0 −sinα<br />
⎤<br />
=<br />
⎢<br />
0 1 0<br />
⎥<br />
⎢ ⎥<br />
⎢⎣<br />
sinα<br />
0 cosα<br />
⎥⎦
L V<br />
⎛<br />
Sb C C<br />
b<br />
p C<br />
b<br />
r C C<br />
⎝<br />
1 2<br />
aero<br />
= ρ<br />
2 T ⎜ l<br />
β +<br />
l<br />
+<br />
pˆ<br />
l<br />
+<br />
rˆ<br />
l<br />
δa +<br />
β δ l<br />
δr<br />
a δr<br />
2V<br />
T<br />
2V<br />
T<br />
⎛<br />
c c<br />
M V Sc C C C C q C<br />
¡<br />
⎝<br />
1 2<br />
aero<br />
= ρ<br />
2 T ⎜ m<br />
+<br />
1 m<br />
α +<br />
m<br />
α +<br />
aˆ<br />
m<br />
+<br />
α<br />
qˆ<br />
m<br />
δ<br />
δ e<br />
e<br />
2V<br />
T<br />
2V<br />
T<br />
N V<br />
⎛<br />
Sb C C<br />
b<br />
p C<br />
b<br />
r C C<br />
⎝<br />
1 2<br />
aero<br />
= ρ<br />
2 T ⎜ n<br />
β +<br />
n<br />
+<br />
pˆ<br />
n<br />
+<br />
rˆ<br />
n<br />
δ<br />
a<br />
+<br />
β δ n<br />
δr<br />
a δr<br />
2V<br />
T<br />
2V<br />
T<br />
⎞<br />
⎟<br />
⎠<br />
⎞<br />
⎟<br />
⎠<br />
⎞<br />
⎟<br />
⎠<br />
Load Factor (g’s)<br />
The load factor <strong>of</strong> the aircraft is calculated by dividing the sum <strong>of</strong> the non-gravitational forces in the z<br />
direction by the weight <strong>of</strong> the aircraft.<br />
Fz aero, b<br />
+ Fz ext,<br />
b<br />
n = −<br />
mg<br />
<strong>Integration</strong><br />
All numerical integration for the equations <strong>of</strong> motion is performed using the Adams-Bashforth-Moulton<br />
method.<br />
1<br />
x =<br />
∫<br />
x dt → x<br />
1 2<br />
( 3<br />
n<br />
= xn−<br />
+ x n<br />
− x n−1<br />
) dt<br />
The equations <strong>of</strong> motion are written in C++ as a Simulink S-Function for use in the <strong>Cal</strong> <strong>Poly</strong> Pheagle Flight<br />
Simulator. A previous implementation <strong>of</strong> the equations <strong>of</strong> motion was used as a template.