3.5.20 · D1Guidance, Navigation & Control (GNC)

Foundations — Sensor fusion — complementary filter (simple), Kalman filter (optimal)

2,374 words11 min readBack to topic

This page assumes you know nothing. We will name every squiggle the parent note used, draw the picture it stands for, and say why the topic cannot live without it. Read top to bottom — each item is built only from the ones above it.


1. Angle and its rate of change

Picture a drone tipping forward. is the angle the body makes with level ground. is the speed of the tipping — a big means it is whipping over fast, means it is holding still at whatever tilt it has.

Figure — Sensor fusion — complementary filter (simple), Kalman filter (optimal)
Figure 1 — The drone tilted by pitch (orange arc) above level ground, with the tipping speed (plum arrow) shown as the direction of rotation. Nose-up is drawn as positive, fixing our sign convention visually.


2. Integration — turning rate into angle

Think of a car's speedometer (, the rate) and its odometer (, the total). You never read distance off the speedometer directly — you accumulate speed over time. Same here: a rate sensor tells you the tipping speed; you accumulate it to know the tilt.


3. The two sensors: gyroscope and accelerometer

Figure — Sensor fusion — complementary filter (simple), Kalman filter (optimal)
Figure 2 — Over 10 seconds: the true angle (ink), the gyro estimate slowly wandering away because its bias is integrated (teal drift), and the accelerometer bouncing noisily around the truth but never drifting (orange jitter). This picture is why fusion exists — each sensor's weakness is the other's strength.

Prerequisite reading if these feel shaky: Attitude estimation (AHRS) and Inertial Navigation Systems show where these sensors sit in a real vehicle.


4. Frequency, low-pass and high-pass


5. The blend weight and its meaning

  • near : "mostly believe the smooth gyro."
  • near : "mostly believe the drift-free accel."

Here (tau) is a time constant — "how many seconds of gyro do I trust before I let the accel pull me back."

Figure — Sensor fusion — complementary filter (simple), Kalman filter (optimal)
Figure 3 — The trust knob in action: as slides from 0 to 1, weight shifts smoothly from the accel (orange) to the gyro (teal). The two weights are mirror images that always add to 1, which is the discrete echo of .


6. Uncertainty as a number: variance and the Gaussian

Everything above used a fixed trust knob. The Kalman filter upgrades this by tracking how uncertain it is as a number. To do that we need three ideas.

Figure — Sensor fusion — complementary filter (simple), Kalman filter (optimal)
Figure 4 — Two bell curves being fused: a wide "unsure prior" (teal) and a tighter "measurement" (orange) combine into a bell (plum) that is taller and narrower than either. Narrower = more confident — this is the geometric meaning of "precisions add."


7. The estimate hats and the gain

The deeper theory of why multiplying two Gaussians and picking the minimum-variance blend is "optimal" comes from Bayesian estimation; the multi-dimensional bookkeeping comes from State-space models; and the version for non-straight-line systems is the Extended Kalman Filter.


How these foundations feed the topic

Angle theta and rate theta-dot

Integration rate to angle

Gyro drift problem

Gyroscope gives rate

Accelerometer gives absolute angle

Frequency low-pass high-pass

Blend weight alpha

Complementary filter

Gaussian and variance P Q R

Precisions add

Kalman gain K

Kalman filter optimal


Equipment checklist

Cover the right side and test yourself. If any answer surprises you, re-read that item above.

What does the dot in mean?
Rate of change per second — how fast the angle is changing.
What is our sign convention for ?
is level, nose-up is positive, nose-down is negative — and shares the same sign.
Why does integrating a gyro cause drift?
A tiny constant bias gets added every tick and the errors pile up instead of cancelling.
Which sensor gives an absolute, drift-free angle, and what corrupts it?
The accelerometer, via the fixed direction of gravity; any non-gravitational linear acceleration (bumps, turns, thrust) corrupts the tilt reading.
In which frequency band is the gyro trustworthy?
High frequency (fast, short-term changes).
What rule must a complementary filter's two filters satisfy?
They must sum to 1 (unity DC gain, no double-counting).
Where does come from?
Discretizing the first-order low-pass over one tick — the carried-forward coefficient is exactly that .
What do , , , each measure?
= post-fusion estimate variance, = prior (pre-measurement) variance, = process noise, = measurement noise — all variances.
Does a larger mean trust the sensor more or less?
Less — larger = noisier sensor = smaller gain.
What is in the Kalman filter, and what does the hat mean?
is the general state being tracked (here the angle); the hat marks it as our estimate, not the true value.
How is the Kalman gain different from ?
is recomputed every step from current uncertainty; is frozen.