Complementary Filter
Adjust the blend between a noisy accelerometer and a drifting gyro to see how their fused tilt estimate changes.
Raise σ to make the accel trace jitter, raise drift to make the gyro trace wander off. Watch the fused estimate stay near truth.
What you are looking at
- Faint trace
- The true tilt.
- Red trace
- The accelerometer’s noisy estimate.
- Gyro trace
- The smooth estimate that can drift.
- Fused trace
- The combination of the two sensor estimates.
Try this
- Set α near 0.99 and raise gyro drift to see the fused tilt follow the drift.
- Move α toward 0.50 to see more accelerometer noise come through.
Key idea
The gyro handles fast changes smoothly. The accelerometer provides a long-term reference to gravity.