6-DoF IMU
aliases:
- 6-Axis IMU
- Six Degree of Freedom IMU
- Six-axis Inertial Measurement Unit tags:
- electronics/imu
- sensors
6-DoF IMU
What is an IMU?
An inertial measurement unit (IMU) combines motion sensors in one module or package. A typical 6-axis (often called 6-DoF) IMU has:
- 3-axis Gyroscope: (angular rates).
- 3-axis Accelerometer: (specific-force readings).
The common example Bosch BMI088 combines separate 16-bit, three-axis gyroscope and accelerometer sensing blocks in one package.
Data path
flowchart LR
A[3-axis accelerometer] --> I[6-axis IMU]
G[3-axis gyroscope] --> I
I --> B[I2C or SPI bus]
B --> U[Microcontroller]
U --> C[Calibration + timestamps]
C --> F[Sensor fusion]
F --> O[Estimated attitude]
Each sensing block delivers raw digital readings, which a microcontroller reads, converts to physical units, and combines. An ordinary BMI088 is not a plug-and-play source of absolute Euler angles; the host generally performs orientation estimation.
Six axes vs. observable motion
A rigid body has six kinematic degrees of freedom (three translation and three rotation), but six IMU channels do not make position or absolute heading directly measurable:
- Gyroscope integration tracks short-term changes in all three rotational axes.
- Under low linear acceleration, gravity gives roll and pitch reference information.
- Yaw around gravity is unobservable from gyro + accelerometer alone, so it remains relative and can drift.
- Position/velocity obtained through acceleration integration rapidly accumulate error without external aiding.
A magnetometer, GNSS, camera, external tracking system, or system-specific constraints can add reference information. A nine-axis IMU usually adds a three-axis magnetometer, but magnetic interference must then be handled.
Digital connection to a microcontroller
Two common choices:
| Feature | I²C | SPI |
|---|---|---|
| Typical signal wires | SDA + SCL (plus power/ground) | SCK + MOSI + MISO + chip-select(s) (plus power/ground) |
| Device selection | 7-bit addresses | Active-low chip-select lines |
| Wiring | Fewer signal wires; shared bus | More wires; often useful for faster data reads |
| Practical detail | Needs SDA/SCL pull-up resistors | Requires correct mode/timing and chip-select behavior |
For BMI088 specifically, the accelerometer and gyro act as two separately addressed I²C endpoints or two separately selected SPI endpoints. See BMI088 - Hardware Connection for the actual chip pins.
A reliable firmware pipeline
- Configure power, interface mode, measurement range, and output data rate.
- Verify communications and enable both sensor blocks.
- Acquire time-stamped accelerometer and gyroscope samples.
- Convert raw numbers to and using the configured sensitivity.
- Apply axis alignment and gyro / accelerometer calibration.
- Use Sensor Fusion and Filtering to estimate orientation, starting with a Complementary Filter or using a Kalman Filter for IMUs for bias/uncertainty estimation.
See also: IMU Notes · BMI088 - Hardware Connection