inertial measurement unit (IMU)
An inertial measurement unit, almost always called an IMU, is a tiny sensor package that tells a robot how it is moving and which way it is tilted — without looking at the outside world at all. It bundles together two or three sensors on one little chip: an accelerometer that feels pushes and the pull of gravity, a gyroscope that feels turning, and often a magnetometer that feels the Earth's magnetic field like a compass. The same kind of chip sits inside your phone, quietly noticing when you flip the screen sideways.
Each sensor alone is incomplete, but together they paint a richer picture of motion. The accelerometer can sense which way is down because gravity always tugs that way, but it gets confused when the robot itself speeds up or shakes. The gyroscope is excellent at catching quick spins and turns, but over time its readings slowly wander off. By combining them, the IMU lets a robot keep a running sense of its own orientation — whether it is upright, leaning, or rolling over — even in pitch darkness or thick fog where cameras would fail.
Because it senses only the robot's own body, an IMU is a proprioceptive sensor, and a fast, cheap, ever-available one. The catch is that small errors pile up: if you try to track position by adding up acceleration over and over, the guess drifts further from the truth every second. That is why robots rarely trust an IMU on its own; they fuse it with outward-looking sensors like GPS or cameras, letting each correct the other's weaknesses.
A self-balancing two-wheeled robot reads its IMU hundreds of times a second to catch the instant it starts tipping, then drives the wheels to stay upright — much as you twitch to keep your balance on one foot.
An IMU's speed and constant availability make it ideal for fast balance reflexes.
A 6-axis IMU has an accelerometer and gyroscope; a 9-axis one adds a magnetometer for a compass heading.