IMU Cheat-Sheet

Quick comparison of common accelerometer+gyro chips and a friendly summary of Kalman, Madgwick, and Mahony fusion—focused on practical use.

Chips at a Glance

Chip DoF Accel Range Accel Noise
(µg/√Hz)
Gyro Range Gyro Noise
(mdps/√Hz)
Price (IC) Notes
ST LSM6DSOX6±2–16 g≈60–90±125–2000≈4–6$2–3Modern, low power.
TDK ICM-209489±2–16 g~230±250–2000≈15$6–8Includes magnetometer.
Bosch BMI2706±2–16 g≈100±125–2000≈3–5$2–3Low drift, ultra-low power.
QST QMI8658A6±2–16 g≈150±16–2048≈13$0.69 @1kDefault LPF BW ≈ ~61.7 Hz at 224.2Hz

Fusion Algorithms

Kalman

Pros Optimal if noise modeled; explicit uncertainty.

Cons Needs Q/R tuning; heavier math.

$$\theta_k = \theta_{k-1} + \omega_k\Delta t + K(\theta_{\text{acc}}-\theta_{k-1})$$

Suitability (balancing robot): Strong if you model gyro bias and process/measurement noise; most accurate but more complex to tune and compute.

Madgwick

Pros Lightweight, fast convergence.

Cons β tuning critical.

$$\dot{q} = \tfrac12 q \otimes \omega - \beta \frac{\nabla f(q)}{\|\nabla f(q)\|}$$

Suitability (balancing robot): Good for full 3D attitude; for 1‑axis pitch control it works, but β must track sample rate and noise—often more than needed.

Mahony

Pros Simple PI feedback; integral cancels bias.

Cons Needs Kp/Ki tuning.

$$\dot{q} = \tfrac12 q \otimes (\omega + K_p e + K_i \int e\,dt)$$

Suitability (balancing robot): Excellent for pitch estimation—low compute, handles gyro bias via integral term; widely used on MCUs.

Complementary

Pros Very simple; tunable cutoff; low compute.

Cons Fixed-frequency assumption; phase lag around cutoff.

$$\theta_k = \alpha\,(\theta_{k-1} + \omega_k\,\Delta t)\; +\; (1-\alpha)\,\theta_{\text{acc}}$$

With time-constant \(\tau\) and sample time \(\Delta t\): \(\alpha = \tfrac{\tau}{\tau + \Delta t}\). High-pass gyro, low-pass accel.

Suitability (balancing robot): Ideal baseline for 1‑axis tilt—robust and trivial to implement; choose cutoff ≈ 1–5 Hz for typical robots.

Units Quick Reference