3.5.16Guidance, Navigation & Control (GNC)

Mechanization equations — integrating IMU to get position, velocity, attitude

1,899 words9 min readdifficulty · medium1 backlinks

WHAT is an IMU actually measuring?

The key trap is hidden right here: an accelerometer cannot sense gravity. In free fall it reads zero. So gravity must be added back in software.


The three-layer integration chain

ωibbgyro    ATTITUDE CbnfbaccelCbnfn    VELOCITY vn    POSITION\underbrace{\boldsymbol\omega_{ib}^b}_{\text{gyro}} \;\to\; \text{ATTITUDE } C_b^n \qquad \underbrace{\mathbf f^b}_{\text{accel}} \xrightarrow{C_b^n} \mathbf f^n \;\to\; \text{VELOCITY } \mathbf v^n \;\to\; \text{POSITION}

You must get attitude first, because you need it to rotate the accelerometer's body-frame specific force into a navigation frame before you can subtract gravity.


Layer 1 — Attitude: integrating the gyros

WHY a matrix/quaternion and not just angles? Because rotation rates do not simply add up like scalars — orientation lives on a curved space SO(3)SO(3). We propagate the direction-cosine matrix (DCM) CbnC_b^n (body→nav).

Why this step? [ω×]u=ω×u[\boldsymbol\omega\times]\mathbf u = \boldsymbol\omega\times\mathbf u exactly, so stacking three columns gives the whole matrix derivative.

But the gyro measures ωibb\boldsymbol\omega_{ib}^b (vs inertial space), and we want ωnbb\boldsymbol\omega_{nb}^b (vs the nav frame, which itself moves as Earth turns and as we travel over the curved surface):

ωnbb=ωibbCnb(ωienEarth spin+ωenntransport rate)\boldsymbol\omega_{nb}^b=\boldsymbol\omega_{ib}^b-C_n^b\big(\underbrace{\boldsymbol\omega_{ie}^n}_{\text{Earth spin}}+\underbrace{\boldsymbol\omega_{en}^n}_{\text{transport rate}}\big)
  • ωien\boldsymbol\omega_{ie}^n: Earth rotates at Ωe7.292×105rad/s\Omega_e\approx 7.292\times10^{-5}\,\text{rad/s}.
  • ωenn\boldsymbol\omega_{en}^n (transport rate): as you fly north/east, the local "down" tilts because Earth is round.

Layer 2 — Velocity: rotate, remove gravity, correct Coriolis

Term-by-term WHY:

  1. CbnfbC_b^n\mathbf f^b — rotate the felt force into nav axes (needs Layer 1).
  2. (2ωie+ωen)×v-(2\boldsymbol\omega_{ie}+\boldsymbol\omega_{en})\times\mathbf v — Coriolis + transport correction for observing motion in a rotating/curving frame.
  3. +gn+\mathbf g^nadd gravity back (the part the accelerometer could not see). Here gn\mathbf g^n is the plumb-bob gravity (gravitation minus centrifugal), pointing "down".

Layer 3 — Position: integrate velocity on a curved Earth

Over a sphere/ellipsoid, latitude/longitude change at rates that depend on the Earth's radii of curvature (meridian RMR_M, transverse RNR_N):

For a flat-Earth / short-baseline approximation you may drop transport & curvature and just use r˙n=vn,v˙n=Cbnfb+gn,C˙bn=Cbn[ωibb×].\dot{\mathbf r}^n=\mathbf v^n,\qquad \dot{\mathbf v}^n=C_b^n\mathbf f^b+\mathbf g^n,\qquad \dot C_b^n=C_b^n[\boldsymbol\omega_{ib}^b\times]. That's the 80/20 core — memorize this trio; add Earth terms only for long-range navigation.


Worked Example 1 — Static IMU sanity check

An IMU sits flat & still. Accels read fb=(0,0,9.81)\mathbf f^b=(0,0,-9.81) in NED body axes (Down = +z+z), gyros read 0\mathbf 0.

  • Attitude: C˙=C[0×]=0\dot C=C[\mathbf 0\times]=0 → orientation constant. Why? no rotation felt.
  • Velocity (flat-Earth): v˙=Cbnfb+gn=(0,0,9.81)+(0,0,+9.81)=0\dot{\mathbf v}=C_b^n\mathbf f^b+\mathbf g^n=(0,0,-9.81)+(0,0,+9.81)=\mathbf 0. Why? the upward table push (9.81-9.81 in NED "Down") cancels gravity (+9.81+9.81 Down). Vehicle stays put ✔.
Recall Why does a

level accelerometer read 9.81-9.81 on the Down axis, not 00? Because the table pushes it up; specific force points opposite to that support in the Down convention. Free-fall would give 00.


Worked Example 2 — Constant forward acceleration, 1-D

Rocket on a track, no rotation, aligned with nav xx. Accel reads fx=5m/s2f_x=5\,\text{m/s}^2 (gravity handled on other axes).

  1. v˙x=fx=5\dot v_x = f_x = 5. Why? no Coriolis (short run), no gravity on xx.
  2. Integrate: vx(t)=5tv_x(t)=5t. Why? constant accel.
  3. x˙=vxx(t)=12(5)t2=2.5t2\dot x=v_x\Rightarrow x(t)=\tfrac12(5)t^2=2.5t^2. At t=4 st=4\text{ s}: x=40 mx=40\text{ m}, v=20 m/sv=20\text{ m/s}.

Why this matters: shows the clean double-integration — but any tiny accel bias bb produces position error 12bt2\tfrac12 b t^2, growing as t2t^2. That's INS drift.


Worked Example 3 — Attitude drift from a gyro bias

Constant gyro bias ε=0.01rad/s\varepsilon=0.01\,\text{rad/s} about one axis, static vehicle. Attitude error δθ=εt\delta\theta=\varepsilon t. After 10 s10\text{ s}, δθ=0.1 rad5.7\delta\theta=0.1\text{ rad}\approx 5.7^\circ.

Now the projected gravity leaks into horizontal velocity: δagsin(δθ)9.81(0.1)=0.98m/s2\delta a\approx g\sin(\delta\theta)\approx 9.81(0.1)=0.98\,\text{m/s}^2. Why this step? a tilted attitude misrotates gravity, so gg contaminates the horizontal channel — the dominant INS error path.


Flashcards

What does an accelerometer physically measure?
Specific force (non-gravitational contact acceleration), not gravity; static reading is +g+g opposite the support.
Why must attitude be computed before velocity in mechanization?
Accelerometer force is in body axes; you need CbnC_b^n to rotate it into the nav frame before subtracting/adding gravity.
DCM propagation equation
C˙bn=Cbn[ωnbb×]\dot C_b^n = C_b^n[\boldsymbol\omega_{nb}^b\times], the skew-symmetric cross-product matrix of the body rate.
Full nav-frame velocity mechanization equation
v˙n=Cbnfb(2ωien+ωenn)×vn+gn\dot{\mathbf v}^n=C_b^n\mathbf f^b-(2\boldsymbol\omega_{ie}^n+\boldsymbol\omega_{en}^n)\times\mathbf v^n+\mathbf g^n.
What is transport rate ωenn\boldsymbol\omega_{en}^n?
The rotation of the local nav frame as the vehicle moves over the curved Earth surface.
Why does the term 2ωie×v2\boldsymbol\omega_{ie}\times\mathbf v appear?
Coriolis correction for expressing motion in the rotating Earth/nav frame.
Geodetic latitude rate
ϕ˙=vN/(RM+h)\dot\phi=v_N/(R_M+h) — arc-rate over meridian radius of curvature.
Why does raw double-integration of accel fail when static?
It integrates the +g+g specific-force bias, producing fake motion; gravity must be added back in nav frame first.
How does a gyro bias ε\varepsilon corrupt position?
Attitude error εt\varepsilon t tilts the gravity vector, injecting gεt\approx g\varepsilon t horizontal accel → error grows like t3t^3.
Flat-Earth core mechanization trio
C˙bn=Cbn[ωibb×]\dot C_b^n=C_b^n[\boldsymbol\omega_{ib}^b\times], v˙n=Cbnfb+gn\dot{\mathbf v}^n=C_b^n\mathbf f^b+\mathbf g^n, r˙n=vn\dot{\mathbf r}^n=\mathbf v^n.

Recall Feynman: explain to a 12-year-old

Imagine you're blindfolded in a car. You can feel pushes when it speeds up, brakes, or turns — but you can't feel the road passing. To guess where you are, you first figure out which way you're facing by tracking every turn (that's the gyro/attitude part). Then you use the pushes you felt to work out how fast you're going, remembering that a push while sitting still is just gravity holding you in the seat — so you subtract that out. Add up your speed over time and you know how far you moved. Tiny mistakes in "which way you're facing" make gravity sneak into your speed guess, so after a while you drift off — that's why cars also use GPS to keep the guess honest.


Connections

  • Strapdown vs Gimbaled INS — strapdown keeps sensors on the body, so mechanization does the "virtual gimbal" in software.
  • Direction Cosine Matrix and Quaternions — the attitude representation being propagated.
  • Coriolis and Centrifugal Effects — origin of the 2ωie×v2\boldsymbol\omega_{ie}\times\mathbf v term.
  • Gravity Model and Geoid — supplies gn\mathbf g^n.
  • Kalman Filter for INS-GNSS Integration — corrects the t2/t3t^2/t^3 drift derived here.
  • Radii of Curvature of the Earth EllipsoidRM,RNR_M,R_N in position rates.

Concept Map

measure rotation rate

measure specific force

rotates body to nav

corrects

corrects

minus Earth & transport

integrates via DCM propagation

added back in software

integrate

integrate

source of corrections

source of corrections

Gyroscopes omega_ib_b

Attitude C_b_n

Accelerometers f_b

f in nav frame

Earth spin omega_ie

omega_nb_b

Transport rate omega_en

Gravity g

Velocity v_n

Position

Rotating curved planet

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, IMU sirf do cheezein "feel" karta hai: gyro se rotation rate aur accelerometer se specific force. Yahan sabse bada point yeh hai ki accelerometer gravity ko sense NAHI karta — jab woh table par rakha ho tab bhi +g+g dikhata hai kyunki table use upar dhakka de raha hai, aur free fall mein zero dikhata hai. Isliye mechanization equations mein gravity ko software se wapas add karna padta hai.

Kaam ka order fixed hai: pehle attitude (CbnC_b^n matrix) nikalo gyro ko integrate karke, kyunki accelerometer ka force body frame mein hai aur usse nav frame mein rotate karne ke liye attitude chahiye. Phir CbnfbC_b^n f^b karke gravity add karo aur Coriolis/transport terms subtract karo — yeh mil gaya velocity rate. Velocity ko integrate karo toh position aa jayegi (curved Earth par latitude/longitude ke liye radius se divide karna padta hai).

Sabse zaroori intuition drift ka hai. Agar accelerometer mein chhota sa bias bb ho, toh position error 12bt2\frac12 b t^2 ki tarah badhta hai. Aur agar gyro mein bias ho, toh attitude thoda tilt ho jaata hai, jisse gravity horizontal channel mein leak karti hai — error t3t^3 ki speed se badhta hai! Isiliye pure INS long time tak accurate nahi rehta, aur GPS/Kalman filter ke saath combine karna padta hai.

Yaad rakhne ka tareeka: A-V-P (Attitude, Velocity, Position) — hamesha isi order mein, aur gravity tabhi hataao jab "down" kaunsa hai woh pata ho. Exam ke liye flat-Earth trio (C˙=C[ω×]\dot C=C[\omega\times], v˙=Cfb+g\dot v=C f^b+g, r˙=v\dot r=v) ratt lo — yahi 80/20 core hai.

Go deeper — visual, from zero

Test yourself — Guidance, Navigation & Control (GNC)

Connections