Guidance, Navigation and Control · Theory · M2
M2-T2 — Rigid-Body Equations of Motion for Any Vehicle
One law, force equals mass times acceleration, and one choice: the frame it is written in. The choice decides whether the equations are short or full of cross terms.
Every vehicle in this course obeys the same two laws, one for the motion of its centre of mass and one for its rotation. They are simple in an inertial frame and awkward there, because the forces and the inertia of a vehicle are most naturally described in axes that move with it. Writing the laws in those moving axes adds terms that look like invented forces and are not. This lesson derives them once, for any rigid body, and then reduces them to the two-dimensional equations of Hopper that the rest of the course uses.
Learning objectives
After this lesson, you should be able to:
- State Newton's law for translation and Euler's law for rotation, and say in which frames they hold.
- Use the transport theorem to write them in rotating body axes, and identify the ω×v and ω×Jω terms.
- Reduce the three-dimensional equations to the planar model of Hopper and say what each term of it represents.
- Verify a model by computing the same flight in two frames.
The intuition
UAV M1-T5: Six-degree-of-freedom UAV dynamics writes out the twelve equations of a rigid vehicle and UAV M5-T1: UAV equations of motion sets them in a ladder of models for a multirotor. Both take the equations as given. This lesson answers a question they leave open: where do the cross terms come from, and why do they appear in one frame and not in another? The answer is general, so the same derivation serves a rover, an aircraft, a spacecraft and Hopper.
Two laws, one body
A rigid vehicle has six degrees of freedom: three for where its centre of mass is, three for how it points. Two laws govern them.
- Newton's law for translation. The sum of the forces on the vehicle equals its mass times the acceleration of its centre of mass. Gravity, thrust, aerodynamics and ground contact are the forces.
- Euler's law for rotation. The sum of the moments about the centre of mass equals the rate of change of the angular momentum. Thrust off the centre line, an aerodynamic moment and a reaction wheel are the moments.
Both laws are true in an inertial frame, one that does not accelerate or turn. They are not true, as written, in a frame that turns.
Why a moving frame at all
Three things make the vehicle's own axes the natural place to work. The inertia matrix of a rigid vehicle is constant in body axes and changes with attitude in any other. Thrust and aerodynamic forces act along body axes and are given in them. And the sensors measure in them: a gyroscope reports rotation about the body axes, an accelerometer reports along them. The price is that these axes turn, and the laws must be corrected for it.
The cross terms are bookkeeping, not forces
A vector that does not change can still have changing components in a frame that turns. The figure shows one velocity and two ways of writing it. Seen from the inertial axes the numbers are constant. Seen from the body axes they change whenever the body turns, though nothing has accelerated. When the body-axes equations are written, this rotation of the axes appears as extra terms, in the translational equation and in the rotational one. No force acts on the vehicle because of them. They record the motion of the axes.
Hopper, in the plane
Hopper moves in a vertical plane: sideways, up, and pitching. In a plane the rotation is about one fixed axis, and the cross terms simplify drastically. In an inertial frame there are none at all, which is why Hopper's model, written in the inertial axes, is only six short equations. The same flight, written in body axes, has two cross terms. The worked example computes the flight both ways and shows that they agree to 10⁻¹³ m, and that dropping the cross terms moves the answer by 10 m.
A model can be written in any frame. The frame changes the form of the equations, not what they predict. If two frames give different flights, one of them has a mistake.
Definitions
- Mass , velocity
- The mass of the vehicle (kg) and the velocity of its centre of mass (m/s).
- Angular velocity
- The rotation of the body relative to the inertial frame, with components along the body axes (rad/s). In the plane, one component .
- Inertia
- The 3×3 inertia matrix about the centre of mass, constant in body axes (kg m²). Hopper's pitch inertia is 60 kg m².
- Force and moment
- The total external force (N) and the total moment about the centre of mass (N m).
- Angular momentum
- The rotational equivalent of momentum (kg m²/s).
- Subscripts and
- A derivative taken by an observer in the inertial frame, , or in the body frame, .
Newton's and Euler's laws, true in an inertial frame:
The transport theorem says how a derivative differs between the inertial frame and a frame that turns with angular velocity :
Applying it to both laws, with the components of every vector taken along the body axes, gives the equations of motion in body axes:
Hopper's planar model in inertial axes is the specialization to a vertical plane with a single thrust force along the tilted body axis. Its state is lateral and vertical position, pitch, their rates, and mass. With the thrust tilted by the pitch and the gimbal angle :
Derivation: the transport theorem, the body-axes laws and the planar reduction
Everything rests on one fact about a turning frame. Derive it, then apply it twice.
Let be the rotation matrix that turns inertial components into body components. A vector with body components has inertial components , since the inverse of a rotation is its transpose.
Differentiate the product by the product rule. The first term is the rate of change of the body components, the second comes from the matrix itself turning.
The rate of change of a rotation matrix is set by the angular velocity in body components, where is the matrix that does the cross product with . Transposing flips the sign, because that matrix equals minus its own transpose.
Substitute. The inertial derivative, written in body components by applying , is the body-component derivative plus . This is the transport theorem.
Set in Newton's law. The force is already in body components, which is how thrust and aerodynamics are given.
Set in Euler's law. Because is constant in body axes, its derivative is zero and .
The planar reduction
Now restrict to a vertical plane. Let be the axis along the body, the axis across it, the angle of from vertical, and .
Resolve the inertial velocity along the two body axes of the figure.
Differentiate. Each has the body-axes component of the inertial acceleration plus a term from the changing angle: and . These are the two components of in the plane, with the sign set by the orientation of this angle.
Replace the inertial accelerations by force over mass. These two equations, with the pitch equation, are Hopper in body axes.
In the inertial axes there is no turning frame and no cross term. The thrust is tilted from vertical by the pitch plus the gimbal angle, and gravity is constant. This is the form the library uses.
The pitch equation completes the model. The moment about the centre of mass has two parts. The gimbal torque is the thrust times the lever arm, , from thrust applied a distance from the centre of mass at an angle to the body axis. The aerodynamic moment is destabilizing and proportional to the pitch, . In the plane the gyroscopic term vanishes, because the rotation is about a principal axis, so and are parallel.
The cross terms record that the axes turn. In a plane with an inertial frame there are none; in body axes there are two; in three dimensions with an asymmetric body there is the gyroscopic term as well.
A worked example
Check the planar reduction by computing one flight twice. A body of 100 kg is pushed by a constant thrust of 1100 N with a gimbal angle of 0.002 rad, under gravity. It starts at 50 m height with a pitch of 0.1 rad, a pitch rate of 0.05 rad/s and a velocity of (2.0, 0.5) m/s. Integrate it for 5 s in the inertial axes and in the body axes, and compare.
- Write both models. The inertial model is the three Hopper equations above for a constant and , with the pitch equation (no aerodynamic term, to keep the check to the frames). The body-axes model is the two velocity equations of the derivation, with the forces along and across the body: and , plus the kinematics that turn body velocity back into position rate.
- Start both from the same state. The body-axes starting velocity is the inertial one resolved along the body axes with the formulas of the derivation.
- Integrate both with a fourth-order Runge-Kutta step of 1 ms (the integrator of the next lesson).
- Compare. The positions and the pitch agree to 10⁻¹³ m over the whole 5 s, and the final velocity, converted back from body axes, agrees to the printed digits. The two models are one model.
- Drop the cross terms. Running the body-axes model with and removed ends the flight 10.5 m from the correct end point. At a pitch rate of 0.05 to 0.2 rad/s and 20 m/s of speed the neglected acceleration is 1 to 4 m/s², up to 40% of gravity: far from a small correction.
import math
from gnckit import rk4_step, integrate
g, m, T, J, l = 9.81, 100.0, 1100.0, 60.0, 1.0 # a thrusting body with a constant gimbal angle
delta = 0.002
def inertial(t, s): # s = [x, z, theta, vx, vz, q]
x, z, th, vx, vz, q = s
ax = T / m * math.sin(th + delta)
az = T / m * math.cos(th + delta) - g
return [vx, vz, q, ax, az, T * l * math.sin(delta) / J]
def body(t, s, cross=1.0): # s = [x, z, theta, va, vc, q]: velocity along and across the body axis
x, z, th, va, vc, q = s
Fa = T * math.cos(delta) - m * g * math.cos(th)
Fc = T * math.sin(delta) + m * g * math.sin(th)
vx = va * math.sin(th) + vc * math.cos(th)
vz = va * math.cos(th) - vc * math.sin(th)
return [vx, vz, q, Fa / m + cross * q * vc, Fc / m - cross * q * va, T * l * math.sin(delta) / J]
s0 = [0.0, 50.0, 0.1, 2.0, 0.5, 0.05] # inertial initial state
va0 = s0[3] * math.sin(s0[2]) + s0[4] * math.cos(s0[2])
vc0 = s0[3] * math.cos(s0[2]) - s0[4] * math.sin(s0[2])
_, a = integrate(inertial, s0, 5.0, 0.001)
_, b = integrate(body, [0.0, 50.0, 0.1, va0, vc0, 0.05], 5.0, 0.001)
_, c = integrate(lambda t, s: body(t, s, 0.0), [0.0, 50.0, 0.1, va0, vc0, 0.05], 5.0, 0.001)
th = b[-1][2]
vx_b = b[-1][3] * math.sin(th) + b[-1][4] * math.cos(th)
vz_b = b[-1][3] * math.cos(th) - b[-1][4] * math.sin(th)
print(f'inertial axes: x = {a[-1][0]:.6f} m, z = {a[-1][1]:.6f} m, theta = {a[-1][2]:.6f} rad')
print(f'body axes: x = {b[-1][0]:.6f} m, z = {b[-1][1]:.6f} m, theta = {b[-1][2]:.6f} rad')
print(f'largest difference over 5 s: {max(abs(p[0] - r[0]) for p, r in zip(a, b)):.1e} m')
print(f'velocity: inertial ({a[-1][3]:.6f}, {a[-1][4]:.6f}); from body axes ({vx_b:.6f}, {vz_b:.6f}) m/s')
print(f'the same flight with the cross terms q*vc and -q*va dropped ends {math.hypot(c[-1][0] - a[-1][0], c[-1][1] - a[-1][1]):.2f} m away')inertial axes: x = 45.110427 m, z = 61.274390 m, theta = 0.808333 rad body axes: x = 45.110427 m, z = 61.274390 m, theta = 0.808333 rad largest difference over 5 s: 8.5e-14 m velocity: inertial (21.921639, 1.454040); from body axes (21.921639, 1.454040) m/s the same flight with the cross terms q*vc and -q*va dropped ends 10.50 m away
In robotics
The choice of frame, and the equations that follow from it, differ by field and by vehicle.
- Aircraft and missiles. Flight-dynamics texts write the equations in body axes: the aerodynamic forces and moments are given in them, the inertia is constant, and the sensors measure in them. The cross terms are the familiar style terms of the force equations and the gyroscopic terms of the moment equations that couple roll, pitch and yaw. Module 10 uses them.
- Multirotors. UAV M5-T2: Quadrotor dynamic modelling uses the same equations with four rotor thrusts as the forces. A multirotor near hover has small rates, so the cross terms are small there, which is why a hover model can omit them and an aggressive manoeuvre cannot.
- Spacecraft. With no air and little external moment, Euler's equation alone governs the attitude, and the gyroscopic term is the whole story: it is why a spinning body about its intermediate axis tumbles (next lesson and module 11).
- Ground robots. A wheeled robot's motion is planar and its kinematic model (see Navigation M1-T3: Robot Motion Models for Navigation) drops the force equations altogether and works with velocities. That is a modelling decision: the full equations reduce to it when tyres hold the speed to what is commanded.
- Variable mass. Hopper burns propellant. The equations above treat the thrust as the only force, which is exact when the exhaust leaves with the relative velocity that defines the thrust. The mass then enters through , and the mass loss through its own equation (next lesson).
Two habits carry over to any new vehicle. First, state the frame in which every equation is written. Second, test a new model with an independent calculation: the same flight in a second frame, as above, or a quantity that must be conserved (the subject of M2-T5: Simulation You Can Trust). A model that passes both is far more likely to be right than one that was only plausible.
Common misconceptions
“Centrifugal and Coriolis forces are real forces that act on the vehicle.”
They are the cross terms of a turning frame. An inertial observer sees no such force: the vehicle simply continues in a straight line. The terms appear because the axes turn, and they are moved to the force side of the equation only to keep the form .
“The ω×v term is a small correction that may be dropped.”
It is the main way rotation couples to translation, and it is large in manoeuvres. At 0.2 rad/s and 20 m/s it is 4 m/s², 40% of gravity. In the worked example, dropping it moves the end of a five-second flight by 10 m. In a hover with small rates it is small, and that is the only place it may be neglected.
“The derivative of an Euler angle is the body rate.”
Only in the plane, where . In three dimensions the three body rates and the three Euler-angle rates are related by a matrix that depends on the attitude and becomes singular at ±90° pitch. That is why attitude is propagated with quaternions (next lesson).
“A planar model is the three-dimensional one with some terms removed.”
It is the three-dimensional model with a restriction: rotation only about one axis, motion only in one plane. The gyroscopic term disappears because that axis is a principal axis, not because it is small. If the real vehicle rolls or yaws, the planar model is wrong in kind.
“If the equations look right, they are right.”
Equations with a sign error in a cross term look equally plausible. Only a test can tell: the same flight in a second frame, a quantity that must be conserved, or a limiting case with a known answer (a thrust-free fall must follow a parabola). Build the test before trusting the model.
Key takeaways
- Newton's law for the centre of mass and Euler's law for the rotation hold in an inertial frame. They give six equations for six degrees of freedom.
- The transport theorem relates derivatives in two frames: . Applying it gives the body-axes equations with and .
- Body axes make the inertia constant and match the sensors and thrust; the price is the cross terms. They are bookkeeping for the turning axes, not forces.
- Hopper in the vertical plane, in inertial axes, is six short equations with no cross terms; in body axes it has two.
- The same flight in two frames must agree. That is a test of a model, and dropping the cross terms shows how much they matter.
- State the frame of every equation, and test a new model against a second frame or a conserved quantity before trusting it.
References and further reading
Each source is marked free or paid. Free to read does not mean free to reuse: the course resources page lists every source with its licence.
- B. L. Stevens, F. L. Lewis and E. N. Johnson, Aircraft Control and Simulation, 3rd edition, Wiley, 2016, the chapter on kinematics and dynamics. A full derivation in body axes, with the cross terms. Paid book.
- MIT 16.07 Dynamics (OpenCourseWare) , the lectures on rotating frames and on rigid-body dynamics. Free; licence CC BY-NC-SA 4.0.
- J. How, MIT 16.333 Aircraft Stability and Control (OpenCourseWare) , the lectures on the equations of motion. Free; licence CC BY-NC-SA 4.0.
- B. Wie, Space Vehicle Dynamics and Control, 2nd edition, AIAA, 2008, the chapter on rigid-body dynamics, for Euler's equations in the spacecraft setting. Paid book.
Knowledge check
Three questions. Write an answer, then reveal the explanation. Your answers stay in your browser.
Question 1
A vehicle rotates at q = 0.3 rad/s and moves at 20 m/s across its body axis (vc = 20 m/s, va = 0). In body axes, what extra acceleration along the body axis appears from the rotation, and how does it compare with gravity?
Explanation
The cross term is q·vc = 0.3 × 20 = 6 m/s² along the body axis, about 0.6 g. The vehicle is not accelerating in any inertial sense because of it: the body axis is turning towards the direction of motion, so the component of the velocity along it grows. An engineer who drops the term predicts an acceleration along the axis that is 6 m/s² too low. This is why the term is only negligible near hover, where q is small.
Question 2
Hopper has θ constant and not zero, so its body axes are tilted from the inertial axes but not turning. Do the body-axes and inertial-axes equations then differ by cross terms?
Explanation
No. The cross terms are proportional to q = θ̇, which is zero when θ is constant, so the two sets of equations coincide apart from a fixed rotation of the axes by θ. What matters is that the axes turn, not that they are tilted. This also shows why the cross terms are small near a steady hover, where the attitude changes slowly.
Question 3
A torque-free asymmetric body with inertias (1, 2, 3) kg m² spins at ω = (0.1, 2.0, 0.1) rad/s about nearly its intermediate axis. Use Euler's equations to find dω/dt, and say what it implies.
Explanation
With no moment, J ω̇ = −ω × Jω, which gives ω̇ = ((Jy − Jz) ωy ωz / Jx, (Jz − Jx) ωz ωx / Jy, (Jx − Jy) ωx ωy / Jz) = (−0.200, 0.010, −0.067) rad/s². The small rates about x and z start to change at once, at rates that are large compared with the 0.1 rad/s they started from, because they are driven by the large spin about y. A spin about the intermediate axis is unstable: the next lesson shows it by integration, and module 11 uses it.
What’s next
Related content
Nothing below is required to finish this lesson.
- BeforeM2-T1: Frames for Flight: ECI, ECEF, Geodetic, NED, Body and Wind
Convert a position between geodetic, ECEF and local NED coordinates, and state when the rotation of the Earth and the variation of gravity may be neglected.
- LabM2-L1: Trim and Linearize Hopper
Find the gimbal angle and thrust that hold Hopper in hover with an off-centre mass, linearize about that point, and show where the linear model stops matching the simulator.
Other courses on this site treat neighbouring topics from their own angle:
- UAV M1-T4: UAV coordinate frames
- UAV M1-T5: Six-degree-of-freedom UAV dynamics
- UAV M5-T1: UAV equations of motion
- UAV M5-T2: Quadrotor dynamic modelling
- Linear Algebra M7-T3: Three-Dimensional Rotation Matrices
- Linear Algebra M7-T8: Euler Angles and Quaternions
- Linear Algebra M8-T4: Jacobian Matrices
- Navigation M1-T3: Robot Motion Models for Navigation
- Robot Learning M7-T2: System Identification
This course leaves the following to the pages that already teach them:
Get notified when the next lesson and new labs are released.
One email per new lesson or lab.