Intuition The one core idea
Two sensors are each wrong in a different way — one drifts slowly, one is jumpy and noisy — so if you blend them by trusting each only where it is honest , the blend beats both. Everything on the parent page (the complementary filter and the Kalman filter) is just two ways of choosing that trust-blend: one fixed, one that re-tunes itself using how uncertain it currently is.
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.
Definition Sign convention for
θ
We must fix which way is positive before any number means anything. Convention on this page: θ = 0 is perfectly level; nose-up is positive (θ > 0 ), nose-down is negative (θ < 0 ). The rate θ ˙ inherits the same sign — a positive θ ˙ means the nose is tipping up right now. Every formula below uses this one convention.
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, θ ˙ = 0 means it is holding still at whatever tilt it has.
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.
Intuition Why the dot matters here
The two sensors in this chapter measure different levels of this picture. One gives you θ directly (the tilt). The other gives you θ ˙ (the tipping speed), and you must add up those speeds over time to recover the tilt. That "adding up" is the next symbol.
Definition Integrate (add up over time)
To integrate a rate means: chop time into tiny slices of length Δ t , multiply the rate in each slice by Δ t to get a small change, and keep a running total. Symbolically, angle now = angle before + (rate)× Δ t .
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.
Common mistake Why integration is dangerous
If the rate sensor is always off by a tiny amount (a bias ), every tick adds that same small error to the running total. The errors never cancel — they pile up forever. That pile-up is called drift , and it is the whole reason we need a second sensor.
A Gyroscope measures the angular rate θ ˙ — how fast it is rotating right now. In the parent note the gyro's rate is written ω k (omega, "the measured rate at step k ").
An Accelerometer feels the direction of gravity (which always points down). By comparing "which way is down" to the sensor's own frame, it computes an absolute tilt angle, written θ a (the "a" = accel).
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.
Intuition Their errors live in opposite places
Gyro: smooth and instant, but drifts slowly (because we integrate its bias — see item 2). Good for fast / short-term changes.
Accel: never drifts (gravity is a fixed reference), but its reading is corrupted by any non-gravitational linear acceleration . The accelerometer cannot tell gravity apart from the vehicle's own acceleration — so speeding up, turning, or vibrating all masquerade as tilt. Bumps and vibrations are the fast version of this; a sustained maneuver is the slow version. Overall it is trustworthy only for slow / long-term truth, when averaged acceleration is just gravity.
"Fast" and "slow" here mean frequency — the next symbol.
Prerequisite reading if these feel shaky: Attitude estimation (AHRS) and Inertial Navigation Systems show where these sensors sit in a real vehicle.
Definition Frequency (fast vs slow parts of a signal)
Any wiggling signal is a mix of slow wobbles (low frequency) and fast wobbles (high frequency). "Low frequency" = the slow trend; "high frequency" = the quick jitters riding on top.
Definition Low-pass and high-pass filters
A low-pass filter lets the slow part through and blocks the fast jitter (it smooths ). A high-pass filter does the opposite: it keeps the fast changes and throws away the slow trend.
Intuition Why the topic needs these two words
We want to keep the accel only where it is honest (slow trend → low-pass it) and keep the gyro only where it is honest (fast changes → high-pass it). If the two filters are chosen so that they add up to 1 , nothing is double-counted or lost — that is the complementary filter's defining rule.
α (alpha), the trust knob
α is a single number between 0 and 1 that says how much to trust the gyro each step. Its partner ( 1 − α ) says how much to trust the accel. They automatically sum to 1 .
α near 1 : "mostly believe the smooth gyro."
α near 0 : "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 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 H lp + H hp = 1 .
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.
Definition Gaussian (bell curve) and its variance
A Gaussian distribution is the classic "bell curve" of guesses: most likely value in the middle, less likely as you move away. Its width is measured by the variance , and the parent uses these letters:
P = variance of our current estimate (how unsure we are).
Q = variance of process noise (how much the true state randomly wanders between ticks).
R = variance of measurement noise (how jumpy the sensor is).
A big variance = a wide, flabby bell = "I'm very unsure." A small variance = a tall, narrow spike = "I'm confident."
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."
R is noise, not the reading
A larger R means a noisier sensor, so you should trust it less — not more. The letter stands for the spread of the measurement, never its value.
Definition The prior variance
P − (before the measurement)
Before this step's measurement arrives, our estimate already has some uncertainty. We write that pre-measurement variance as P − (P-with-a-minus). It is the "predict" stage's output: the old variance grown by the process noise Q , i.e. P − = P old + Q . The plain P (no minus) is the shrunken variance after fusing the measurement.
The parent's punchline P 1 = P − 1 + R 1 says: inverse variances (called precisions ) add up when you fuse the prior P − with the measurement R . Combining two honest-ish guesses always makes a narrower, more confident bell than either alone. That is why fusion wins.
x ^ and the hat ^
The Kalman filter is written for a general state called x — a stand-in for whatever quantity we are tracking (here x is the angle θ , but the same machinery works for position, velocity, temperature, …). The hat marks it as an estimate :
x ^ (with a hat ) = our estimate of the state, as opposed to its unknown true value x .
x ^ k − (with a minus ) = the estimate before seeing this step's measurement (the "prediction," a.k.a. the prior , whose spread is the P − of item 6). No minus = after the measurement (the "posterior").
Subscript k = "at time step number k ." k − 1 is the previous step.
K
K (capital K) is the Kalman filter's self-tuning trust knob — the smart cousin of α . It also lives in [ 0 , 1 ] and answers: "how far should I move my estimate toward the new measurement?" K = 0 ignores the measurement; K = 1 jumps fully to it.
K vs α
In the complementary filter α is frozen . In the Kalman filter K = P − + R P − is recomputed every step from the current uncertainty P − and sensor noise R . When we are unsure (P − big) K grows → listen to the sensor. When we are confident (P − small) K shrinks → hold our estimate. Freeze K and you are back to a complementary filter.
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 .
Angle theta and rate theta-dot
Integration rate to angle
Accelerometer gives absolute angle
Frequency low-pass high-pass
Gaussian and variance P Q R
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 θ ? θ = 0 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 α = τ / ( τ + Δ t ) come from? Discretizing the first-order low-pass τ y ˙ = θ a − y over one tick Δ t — the carried-forward coefficient is exactly that α .
What do P , P − , Q , R each measure? P = post-fusion estimate variance, P − = prior (pre-measurement) variance, Q = process noise, R = measurement noise — all variances.
Does a larger R mean trust the sensor more or less? Less — larger R = noisier sensor = smaller gain.
What is x in the Kalman filter, and what does the hat mean? x 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 K different from α ? K is recomputed every step from current uncertainty; α is frozen.