IMU Overview
What Is an IMU
An IMU (Inertial Measurement Unit) is a sensor module that measures the acceleration and angular velocity of an object. It is one of the core sensors for robot navigation, attitude estimation, and motion control, found in virtually all mobile robot platforms.
Sensor Components
Accelerometer
Principle: Based on a MEMS spring-mass system. When the sensor accelerates, the proof mass displaces due to inertia, and the displacement is detected via capacitance changes.
Where:
- \(k\) is the spring stiffness
- \(\Delta x\) is the proof mass displacement
- \(m\) is the proof mass
Measurement: Specific force, i.e., gravity + motion acceleration:
Effect of Gravity
An accelerometer at rest measures the gravitational acceleration \(g \approx 9.81 \, \text{m/s}^2\). When using an accelerometer for navigation, the gravity component must be subtracted from the measurement, which requires precise knowledge of the sensor's attitude.
Gyroscope
Principle: Based on the Coriolis effect. A vibrating proof mass in a rotating reference frame experiences a Coriolis force:
Where:
- \(m\) is the vibrating mass
- \(\boldsymbol{\omega}\) is the angular velocity
- \(\mathbf{v}\) is the vibration velocity
MEMS gyroscopes keep a proof mass vibrating in one direction. When rotation exists, the Coriolis force produces displacement in the perpendicular direction, detected via capacitance to obtain angular velocity.
Measurement: Three-axis angular velocity \((\omega_x, \omega_y, \omega_z)\), in deg/s or rad/s.
Magnetometer
Principle: Uses the Hall effect or magnetoresistive effect to measure the Earth's magnetic field direction.
Measurement: Three-axis magnetic field strength, used to compute heading (Yaw).
Limitations:
- Interfered by ferromagnetic materials (hard iron/soft iron errors)
- Indoor magnetic fields are non-uniform
- Requires calibration (ellipsoid fitting)
IMU Configuration Classification
| Type | Sensor Combination | Measurable Quantities | Representative Products |
|---|---|---|---|
| 6-axis | Accelerometer + Gyroscope | Acceleration, angular velocity | MPU6050, BMI088 |
| 9-axis | Accelerometer + Gyroscope + Magnetometer | Acceleration, angular velocity, heading | BNO055, MPU9250 |
| 10-axis | 9-axis + Barometer | Above + altitude estimation | BMP388 combo |
IMU Noise Model
IMU accuracy is affected by multiple noise sources. Understanding the noise model is crucial for sensor fusion.
Main Noise Types
graph TD
A[IMU Noise Sources] --> B[Deterministic Errors]
A --> C[Random Errors]
B --> B1[Bias<br>Constant offset]
B --> B2[Scale Factor Error]
B --> B3[Cross-Axis Coupling]
C --> C1[Angle Random Walk ARW<br>White noise]
C --> C2[Bias Instability]
C --> C3[Rate Random Walk RRW<br>Low-frequency drift]
Gyroscope Noise Model
Continuous-time model:
Where:
- \(\tilde{\omega}(t)\) is the measurement
- \(\omega(t)\) is the true angular velocity
- \(b_g(t)\) is a slowly drifting bias
- \(n_g(t)\) is Gaussian white noise, \(n_g \sim \mathcal{N}(0, \sigma_g^2)\)
Bias modeled as a random walk:
Accelerometer Noise Model
Similar structure to the gyroscope, but acceleration is integrated twice to obtain position, so errors accumulate faster:
Drift Problem in Inertial Navigation
Position error in pure inertial navigation (IMU only) grows with the square of time. Consumer-grade MEMS IMUs produce meter-level drift within seconds, so they must be fused with other sensors (GPS, LiDAR, vision).
Key Noise Parameters
| Parameter | Symbol | Unit (Gyro) | Unit (Accel) | Meaning |
|---|---|---|---|---|
| Angle/Velocity Random Walk | ARW / VRW | deg/sqrt(h) | m/s/sqrt(h) | White noise intensity |
| Bias Instability | BI | deg/h | ug | Minimum detectable bias change |
| Bias Repeatability | Turn-on bias | deg/h | mg | Bias variation per power-on |
| Scale Factor Error | SF error | ppm | ppm | Proportional measurement error |
Allan Variance Analysis
Allan variance is the standard method for characterizing IMU noise, identifying noise components by computing variance at different averaging times \(\tau\).
Where \(\bar{y}_k\) is the average of the \(k\)-th interval of length \(\tau\).
Allan Variance Curve Interpretation
On a \(\log \sigma\) vs. \(\log \tau\) plot, different noise types correspond to different slopes:
| Noise Type | Slope | Characteristic |
|---|---|---|
| Quantization noise | -1 | Appears at short \(\tau\) |
| Angle Random Walk (ARW) | -1/2 | White noise, read at \(\tau = 1s\) |
| Bias Instability (BI) | 0 | Minimum point of the curve |
| Rate Random Walk (RRW) | +1/2 | Appears at long \(\tau\) |
| Rate ramp | +1 | Deterministic trends like temperature drift |
import numpy as np
import allantools
# Compute Allan variance from IMU static data
# data: static samples from one gyroscope axis
# rate: sampling rate (Hz)
(taus, adevs, errors, ns) = allantools.oadev(
data, rate=rate, data_type="freq"
)
# ARW: Allan deviation at tau=1
# BI: Minimum Allan deviation value
Sensor Fusion Pipeline
graph LR
A[Accelerometer] --> D[Attitude Estimation]
B[Gyroscope] --> D
C[Magnetometer] --> D
D --> E[Complementary Filter<br>or EKF]
E --> F[Roll, Pitch, Yaw]
F --> G[Fusion with External Sensors]
G --> G1[GPS -> Position]
G --> G2[LiDAR -> SLAM]
G --> G3[Camera -> VIO]
G --> G4[Wheel Odometry -> Velocity]
Attitude Representation
| Representation | Parameters | Advantages | Disadvantages |
|---|---|---|---|
| Euler angles | 3 | Intuitive | Gimbal lock |
| Rotation matrix | 9 | No singularities | Parameter redundancy |
| Quaternion | 4 | No singularities, computationally efficient | Less intuitive |
| Rotation vector/axis-angle | 3 | Minimal parameterization | Singular near 0 degrees |
Quaternion update:
IMU Grade Classification
| Grade | Gyro Bias Stability | Representative Product | Application | Price |
|---|---|---|---|---|
| Consumer | >10 deg/h | MPU6050, BMI160 | Smartphones, remotes | $1-5 |
| Industrial | 1-10 deg/h | BMI088, ADIS16465 | Drones, robots | $10-100 |
| Tactical | 0.1-1 deg/h | HG1120, STIM300 | Missiles, high-precision navigation | $1K-10K |
| Navigation | <0.01 deg/h | HG9900 | Inertial navigation systems | $50K+ |
| Strategic | <0.001 deg/h | Ring laser gyro | Submarines, ICBMs | $100K+ |
References
- Quaternion kinematics for the error-state Kalman filter - Joan Sola
- Strapdown Inertial Navigation Technology - Titterton & Weston
- Bosch BMI088/BNO055 Datasheets
- InvenSense MPU6050 Datasheet
- Allan Variance Analysis Tutorial: IEEE Std 952-1997