Chips at a Glance
| Chip | DoF | Accel Range | Accel Noise (µg/√Hz) |
Gyro Range | Gyro Noise (mdps/√Hz) |
Price (IC) | Notes |
|---|---|---|---|---|---|---|---|
| ST LSM6DSOX | 6 | ±2–16 g | ≈60–90 | ±125–2000 | ≈4–6 | $2–3 | Modern, low power. |
| TDK ICM-20948 | 9 | ±2–16 g | ~230 | ±250–2000 | ≈15 | $6–8 | Includes magnetometer. |
| Bosch BMI270 | 6 | ±2–16 g | ≈100 | ±125–2000 | ≈3–5 | $2–3 | Low drift, ultra-low power. |
| QST QMI8658A | 6 | ±2–16 g | ≈150 | ±16–2048 | ≈13 | $0.69 @1k | Default 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
- g: 9.81 m/s²
- dps: degrees per second
- µg/√Hz: accelerometer noise density
- mdps/√Hz: gyro noise density
- °/hr: gyro bias drift