One Roll Update and Its Time Constant

Ada re-derives this chapter’s own numbers step by step, at full precision

foundations
math-foundations
calculation-audit
analytics-ml
Ada 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.

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, about 1.84 deg.
  • After 1.00 s (two tau): 5.0 x exp(-2) = 5.0 x 0.135335 = 0.676676, about 0.68 deg.
  • After 2.50 s (five tau): 5.0 x exp(-5) = 5.0 x 0.006738 = 0.033690, about 0.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.