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

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.

Try

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.

Observe

This audit follows one roll update and its 0.5 s time constant to explain why. Check shows this.

Explain

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.

Signal-flow diagram of one complementary filter update. The fast path takes the 12.0 degree per second gyro rate, multiplies by the 0.01 second interval, adds the previous 8.00 degree estimate to form the 8.12 degree prediction, and scales it by alpha 0.98 to 7.9576 degrees. The slow path converts accelerometer readings through atan2 to 6.00 degrees and scales by 0.02 to 0.1200 degrees. A summing node outputs the new 8.08 degree estimate, which feeds back as the next cycle's previous estimate. Chips give the 0.50 second time constant, the 0.32 hertz crossover, and note that yaw never enters the loop.
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. 1

    Name the input. The chapter baseline is 0.98.

  2. 2

    Name the relationship. tau = 0.01 s / (1 - alpha)

  3. 3

    Substitute with units. 0.01 / (1 - 0.98) = 0.500 s

  4. 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.

0.98
Chapter baseline
Correction time constant

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?
Answer: Predict its direction, apply the displayed relationship, keep the units, and compare the reset value with the chapter’s worked baseline.
What does this small model leave out?
Answer: Only alpha moves here. The correction time constant calculation excludes field effects listed below.

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, 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.