One Roll Update and Its Time Constant
One Roll Update and Its Time Constant
Ada re-derives this chapter’s own numbers step by step, at full precision
ADA · CALCULATION AUDIT
One Roll Update and Its Time Constant
The chapter’s complementary filter takes a previous roll of 8.00 deg, a gyro rate of 12.0 deg/s, and an accelerometer estimate of 6.00 deg, blending them with alpha 0.98 every 0.01 s. A single update barely moves the estimate, yet it still converges within seconds. This audit follows one roll update and its 0.5 s time constant to explain why.
Companion to the chapter Complementary Filters and IMU Fusion — every number here comes from that chapter.
The chapter’s complementary filter takes a previous roll of 8.00 deg , a gyro rate of 12.0 deg/s , and an accelerometer estimate of 6.00 deg , blending them with alpha 0.98 every 0.01 s . Calculate this case.
This audit follows one roll update and its 0.5 s time constant to explain why. Check shows this.
The audit conclusion is narrow: alpha 0.98 at 100 Hz is a 0.5 s correction time constant, not an instant fix. That is the right behavior when the accelerometer is trustworthy — but if vibration corrupts the accelerometer, this same slow blend means a bad correction also takes about half a second to wash out, which is exactly why the chapter gates the correction instead ofblending it blindly. Check confirms it.
See the relationship before changing it
The chapter figure below shows: The worked roll update as a living loop: a fast gyro path weighted 0.98, a slow gravity correction weighted 0.02, and a feedback edge that never rests.
Derive the baseline in four named moves
- 1
Name the input. The chapter baseline is 0.98.
- 2
Name the relationship. tau = 0.01 s / (1 - alpha)
- 3
Substitute with units. 0.01 / (1 - 0.98) = 0.500 s
- 4
Read the result. Keep the unit beside the value, then use the result only inside the technical boundary below.
Predict, then change alpha
Try Predict how correction time constant responds when alpha moves. Calculate alpha; compare correction time constant with that prediction.
Observe Return to 0.98. Recheck correction time constant with alpha at its chapter value.
Explain A larger alpha trusts the gyro longer and slows gravity correction.
Check yourself
What should you do before trusting a moved-slider result?
What does this small model leave out?
Technical boundaries
The correction-time estimate keeps the sample interval at 0.01 s while the filter weight changes. It does not model drifting gyroscope bias, accelerometer vibration, nonlinear orientation geometry, varying sample intervals, or magnetic disturbance.
Ada: The complementary filter is just two numbers per step — a fast prediction and a small correction — so let me carry them at full precision and show why one update barely moves while the estimate still converges within seconds. All values come from the worked example above.
The previous roll estimate is 8.00 deg, the gyro rate is 12.0 deg/s, the sample interval is 0.01 s, the accelerometer estimate is 6.00 deg, and alpha is 0.98:
- Gyro prediction:
roll_gyro = 8.00 + 12.0 x 0.01 = 8.00 + 0.12 = 8.120000 deg - Correction blend:
roll_new = 0.98 x 8.120000 + 0.02 x 6.00 = 7.957600 + 0.120000 = 8.077600 deg - Net accelerometer nudge this step:
8.077600 - 8.120000 = -0.042400 deg
So a single 10 ms update pulls only 0.0424 deg toward gravity — the accelerometer’s 2 percent weight is deliberately small. Convergence comes from repetition, which the time-constant estimate makes explicit:
tau = dt / (1 - alpha) = 0.01 / (1 - 0.98) = 0.01 / 0.02 = 0.500000 s- Starting 5.0 deg from the gravity reference, remaining error is
5.0 x exp(-t / tau): - After 0.50 s (one tau):
5.0 x exp(-1) = 5.0 x 0.367879 = 1.839397, about1.84 deg. - After 1.00 s (two tau):
5.0 x exp(-2) = 5.0 x 0.135335 = 0.676676, about0.68 deg. - After 2.50 s (five tau):
5.0 x exp(-5) = 5.0 x 0.006738 = 0.033690, about0.03 deg.
The audit conclusion is narrow: alpha 0.98 at 100 Hz is a 0.5 s correction time constant, not an instant fix. That is the right behavior when the accelerometer is trustworthy — but if vibration corrupts the accelerometer, this same slow blend means a bad correction also takes about half a second to wash out, which is exactly why the chapter gates the correction instead of simply raising alpha.
Every number above is taken from the chapter’s own material and re-derived step by step.