Magic behind IMU and its use cases
An IMU or Inertial Measurement Unit is an electronic device that measures and reports an object’s specific force, angular rate, and sometimes the orientation of the object, using a combination of accelerometers, gyroscopes and magnetometers.
Every one of these 3 sensors viz., accelerometer, gyroscope and magnetometer provides 3 axis values as X, Y, Z since we are talking about three dimentional rotation in space.
When someone says 3 axis IMU, they are talking about only accelerometer (X,Y,Z). If someone says 6 axis IMU, they are talking about accelerometer + gyroscope. When someone says 9 axis IMU, they are talking about accelerometer + gyroscope + magnetometer.And if someone says 10 axis, they are talking usually about, above 3 sensors + pressure sensor used for measuring more accurate altitude (height) in case of drones, baloons etc.
Accuracy and rate of output of these axis values differ according to the firmware configuration and the capability or range of the sensor models.
Some of the DIY sensors available from different vendors to use with Microcontrollers.
- MPU9250 or ICM-20948 (9axis) from Invensense with DMP
- BNO055 from Bosch Sensortec with Integrated sensor data fusion
- LSM9DS1 sensors from ST Micro
Now how do we use these X, Y, Z values from each sensors. This is where sensor fusion comes into play. Using different algorithms the XYZ values of sensors are merged and converted to Roll, Pitch & Yaw. To simplify what these are, lets take an example of a motorcycle. We can in general say that, Roll is same as lean angle; Pitch is like wheelie or Stoppie and Yaw is change of direction while riding.
Some of these sensors also come built-in with Sensor fusion (DMP – Digital Motion Processor), so that you don’t have to write code or manage these algorithms while developing product/firmware. Calculated values are provided directly out of the sensor chip itself.
Different algorithms used to represent orientations
- Euler angles : Easier for simple rotations usually for lean or single rotational cases like smartphone orientation.
- Quaternions : More accurate and works for multiple rotations ie, more than 360 degree rotations.
Common filters used specially to predict future values thereby reducing noise and increasing usage accuracy
- Kalman Filter
- Complementary filter
- Mahony & Madwick
What are the common use cases of IMU
- Dynamic suspension
- Motion Capture for Games and Movies
- Lean Angle sensor
- Fitness trackers
- Segway like personal transporter
- Gimbal for cameras for stabilization
- GoPro Hero 8 (stabilization)
- GPS assisted technology for dead reckoning (black spots)
- Aircraft guidance
- Drones, UAV
- Atitude and heading
- Smartphones & Tablets for orientation
- Earthquake detection and warnining systems
- and more…
What are the complicated scenarios?
Several of the scenarios only require data collection in which case accuracy or rate of data aquisition is not very critical thus its simple. But some of them like Aircraft guidance, Dynamic suspension in motorsports etc require sensors with high accuracy and also higher data rates. Also the data needs to be processed and the decisions or actions need to be taken at extreme pace. Thus the sensor models used in different scanarios differ.