IMU

On this page 7

An IMU (inertial measurement unit) is a sensor package that measures linear acceleration and angular rate along three axes, and often the magnetic field as well, so that a robot can estimate its own orientation, velocity and motion without any external reference. Among the sensors used in robotics, it is the one that answers the question “how am I moving right now” at the highest rate and with the lowest latency.

Because an IMU senses motion from the inside, it never loses sight of a landmark and works in darkness, fog or an empty hall. Its weakness is the mirror image of that strength: every estimate is built by integrating noisy measurements, so errors accumulate over time. For this reason an IMU is almost always paired with other sensors such as encoders, cameras or LiDAR.

How an IMU measures motion

An IMU contains a three-axis accelerometer and a three-axis gyroscope, which together give six degrees of freedom of measurement, hence the common label 6-DoF IMU. Adding a three-axis magnetometer produces a 9-DoF unit. In most robots these elements are MEMS devices, tiny silicon structures etched on a chip, sampled by a microcontroller at rates from about 100 Hz to several kHz.

The accelerometer measures specific force, which is acceleration minus gravity. At rest it reports about 9.81 m/s² pointing upward, which is why it can estimate tilt. The gyroscope measures angular velocity in degrees or radians per second; integrating it once gives orientation change. To obtain position, the accelerometer signal must be rotated into the world frame, gravity removed, and the result integrated twice, which is where the difficulty begins.

The table below summarizes what each sensing element contributes and where it fails.

ElementMeasuresStrengthMain weakness
AccelerometerSpecific force in m/s²Absolute tilt reference from gravityCannot separate gravity from motion; vibration noise
GyroscopeAngular rate in °/sSmooth, fast rotation trackingBias causes heading drift
MagnetometerMagnetic field in µTAbsolute heading referenceDistorted by motors, steel and currents
Temperature sensorDie temperatureEnables bias compensationOnly indirect benefit
Sensing elements inside an IMU

Error sources and drift

The defining limitation of an IMU is drift: small errors grow without bound once they are integrated. A constant gyroscope bias produces an orientation error that grows linearly with time, while an accelerometer bias produces a position error that grows with the square of time. A seemingly tiny bias of 0.01 m/s² yields roughly half a meter of position error after ten seconds of pure dead reckoning.

Datasheets describe these errors with a few standard parameters, typically derived from an Allan variance analysis of a long static recording. Knowing what each parameter means is essential for choosing a unit and tuning a filter.

ParameterTypical unitConsumer MEMS rangeWhat it affects
Bias instability°/hAbout 2 to 20 °/hLong-term heading drift
Angle random walk°/√hAbout 0.1 to 1 °/√hShort-term orientation noise
Velocity random walkm/s/√hAbout 0.02 to 0.2 m/s/√hVelocity noise after integration
Scale factor errorppm or %About 0.1 to 1 %Error proportional to rate
Axis misalignmentmrad or °Fractions of a degreeCross-coupling between axes
Key IMU error parameters

Further error sources include temperature-dependent bias, sensitivity to vibration, saturation when the measurement range is exceeded, and timing jitter between samples. A common practical fix is a static calibration at startup, when the robot stands still for one or two seconds and the gyroscope bias is estimated and subtracted.

Grades of IMU and how to choose one

IMUs span several performance grades, and the price difference between them covers several orders of magnitude. The right grade depends on how long the robot must rely on inertial data alone, not on the best accuracy money can buy.

GradeTypical gyro bias instabilityTechnologyTypical robotic use
ConsumerAbove about 10 °/hMEMSHobby drones, small mobile robots
IndustrialAbout 1 to 10 °/hCalibrated MEMSAMRs, legged robots, manipulators
TacticalAbout 0.1 to 1 °/hHigh-end MEMS or FOGOutdoor vehicles, survey robots
NavigationBelow about 0.01 °/hRing laser or fiber-optic gyroscopeLong autonomous missions without GNSS
IMU performance grades

Beyond the grade, practical selection criteria include the measurement range (for example ±2 g to ±16 g and ±250 to ±2000 °/s), the output data rate, the interface such as SPI, I2C or CAN, hardware timestamping, and whether the vendor provides factory temperature calibration. Legged and aerial robots need a high range and a high rate; slow indoor robots benefit more from low bias.

Fusing IMU data with other sensors

Raw IMU data become useful through sensor fusion, which combines the fast but drifting inertial signal with slower absolute references. The simplest method is a complementary filter, which trusts the gyroscope at high frequencies and the accelerometer at low frequencies. Widely used alternatives are the Madgwick and Mahony filters for orientation, and the extended Kalman filter for full state estimation.

In mobile robots, the IMU is typically fused with wheel encoders for odometry, while in visual-inertial systems it complements a camera. The IMU fills the gaps between camera frames, recovers metric scale and survives fast motion that blurs images, whereas the camera bounds the drift. LiDAR-inertial odometry uses the IMU in the same way to correct motion distortion within a single scan.

Partner sensorWhat the IMU addsWhat the partner corrects
EncoderDetects wheel slip and rotation in placeVelocity drift of integration
CameraHigh-rate motion between frames, metric scalePosition and heading drift
LiDARDeskewing of scans during motionLong-term pose drift
GNSSSmooth pose between fixesAbsolute position outdoors
How an IMU complements neighboring sensors

Common mistakes in IMU integration

Many problems attributed to a poor sensor are in fact integration errors made during mechanical or software setup.

  • Wrong frame conventions: mixing up axis order, handedness or the sign of gravity makes the filter diverge immediately.
  • Poor mounting: placing the unit far from the center of rotation or on a vibrating bracket adds centripetal and vibration errors.
  • Unsynchronized timestamps: a few milliseconds of offset between the IMU and a camera noticeably degrades visual-inertial odometry.
  • Trusting the magnetometer indoors: steel structures and motor currents can distort heading by tens of degrees.
  • Skipping extrinsic calibration: the rotation and translation between the IMU and other sensors must be measured or estimated.

In plain words

An IMU is the robot’s sense of balance, much like the inner ear in a person. It feels when the robot speeds up, slows down, tilts or turns, and it does so hundreds of times per second without needing to see anything.

The catch is that it only feels changes in motion. To know where it is, the robot has to add up all those small changes, and tiny mistakes add up too. That is why an IMU is always teamed with other sensors that occasionally tell it where it really is.

A real-world example

A warehouse robot carries shelves across a smooth concrete floor at about 1.5 m/s. Its wheels sometimes slip on dust or spilled plastic film, so wheel encoders alone report turns that did not happen or miss turns that did. The engineers mount an industrial-grade 6-DoF IMU near the center of the chassis and sample it at 400 Hz.

An extended Kalman filter fuses the gyroscope with the encoder data and with occasional LiDAR scan matching. When a wheel slips, the gyroscope reports the true rotation rate and the filter discounts the wheel reading. The result is noticeably smaller heading error between LiDAR corrections, fewer localization recoveries and smoother docking at charging stations.