← Back to the chapter · Next detail →
Technical detail · Complementary Filters: Sensor Trust
Under the Hood: rectangle and trapezoidal integration
Each 10 ms interval contributes an area under the gyro rate curve. The following figure compares a rectangle with a trapezoid for one interval.
The shaded interval in Figure 6 runs from ω[k−1] = 10.0 °/s to ω[k] = 12.0 °/s over Δt = 0.01 s. Averaging the two rates gives a trapezoidal angle increment of 0.11°. Using the newer rate for the whole interval gives a rectangle of 0.12°, an excess of 0.01°. Starting from 8.00°, those rules give 8.11° and 8.12° respectively; the worked update uses the rectangle rule. A smaller interval reduces this geometric difference, but both rules integrate any bias in the rate samples. Better numerical integration improves the motion estimate without removing drift.