In this article, we share a lot of information necessary for the purchase of your IMU according to your specifications.
You will find out how an IMU works and how to interpret its parameters.
At the end of the article, you will also find links to tests and resources.
Definition – What Is An IMU?
An inertial measurement unit (IMU) is an electronic component included in the family of sensors. It measures the acceleration of the sensor, the angular velocity and its orientation using a combination of accelerometers, gyroscopes, and magnetometers.
The Type I IMU is made up of accelerometers and gyroscopes, while the Type II IMU includes additional magnetometers.
Accelerometers, gyroscopes, and magnetometers measure data relating to a single axis (X: pitch, Y: roll, Z: yaw). In order to obtain information for the 3 axes, you must integrate three components of each (accelerometers, gyroscopes, and magnetometers) for a Type II IMU. A typical IMU sensor is 9 DoF (degree of freedom) including:
- 3 accelerometers
- 3 gyroscopes
- 3 magnetometers
Some IMUs may have additional degrees of freedom with a temperature sensor, a GPS sensor, a pressure sensor, etc.
Based on acceleration, calculations of attitude, speed, and position can be performed.
Thanks to gyroscopes, the angular position can be calculated.
This data, provided by the IMU, is essential in mobile robotics. Indeed, they complement the LiDAR measurements and the odometric measurements.
Physics – How does an IMU work?
To understand how an IMU works, you must first analyze each subcomponent:
Sub-Component 1: The Accelerometer
An accelerometer is an electromechanical device used to measure acceleration forces. These forces can be:
- Static, like the force of gravity
- Dynamics like the forces of movement or vibration
Acceleration is the measure of the change in speed or speed divided by time. For example, a bicycle that accelerates from stopping at 30 km / h in five seconds has an acceleration of 6 km / h per second (30 divided by 5).
Sub-Component 2: The Gyroscope
A gyroscope is a device used to measure or maintain orientation and angular speed. It is a rotating wheel, or a disc, in which the axis of rotation is free to take any orientation by itself.
During rotation, the orientation of this axis is not affected by the inclination or rotation of the support, depending on the conservation of the angular momentum.
Sub-Component 3: Magnetometer
A magnetometer is a device that measures magnetism:
- His direction
- His strength
- The relative change of a magnetic field at a given location
A compass is one such device that measures the direction of an ambient magnetic field. In this case, the Earth’s magnetic field.
ROS – IMU Data Transfer
All ROS-compatible IMU sensors publish their data on the topic/imu in the sensor_msgs / Imu.msg message format:
std_msgs / Header header
geometry_msgs / Quaternion orientation
float64 [9] orientation_covariance
geometry_msgs / Vector3 angular_velocity
float64 [9] angular_velocity_covariance
geometry_msgs / Vector3 linear_acceleration
float64 [9] linear_acceleration_covariance
Orientation
3D rotations and orientation can be represented using the form of Euler angles or in the form of a Quaternion.
Euler Angles
The Euler angles are composed of three angular values for the X, Y and Z axes. Each rotation value is applied sequentially, that is to say successively.
Advantage
Euler angles have an intuitive format “readable to the naked eye”.
Limitation
In some configurations, the Euler angles suffer from a loss of freedom.
Indeed, during the successive application of the three rotations, it is possible that the first or the second rotation results in the third axis pointing in the same direction as one of the preceding axes so that the third value of rotation cannot be applied around a single axis.
Quaternions
Quaternions can be used to represent the orientation or rotation of an object.
Its representation consists of four numbers (referenced in the unit as x, y, z & w).
You should keep in mind that these quantities do not represent angles or axes and that you normally never need to access them directly.
Advantage
Quaternion rotations do not suffer from the loss of a DoF.
Limitation
A single quaternion cannot represent a rotation greater than 180 degrees in any direction and is not intuitively understandable.
Angular Velocity
The angular speed is represented by a three-dimensional vector (x, y, and z), the values of the angular speed depending on the axes x, y, and z.
Linear Acceleration
The linear acceleration is represented by a three-dimensional vector (x, y, and z), the values of linear acceleration depending on the axes x, y, and z.
Covariance
With regard to the sensors, the covariance is the coefficient of confidence relative to the accuracy of the sensor.
Covariance can be static based on sensor performance or continuously updated by changing over time based on the estimate of accuracy. It’s the same for IMU, they can have a static or dynamic covariance.
Each parameter has an associated covariance coefficient, hard-coded or processed by the sensor software, indicating how reliable the value can be.
Overview Of IMU Features
Energy Consumption
To determine the energy requirements of your robotic project, you must take into account the mode and duration of the operation of your machine.
These parameters are important if the sensor operates on battery:
- Supply voltage in volts
- Operating current in amperes
- Wattage
Sensor Specifications
The digital resolution describes the overall detection capacity of your sensor and consists of two parts:
1. The distance => amount of movement that the sensors can take into account:
- In the case of an accelerometer, this is measured in G forces.
- Gyroscopes are classified according to the angular speed of rotation that they can quantify in degrees/second.
- Magnetometers measure their capacities in µT, which can vary depending on the axis of the sensor (x, y, z).
2. Sensitivity => absolute number representing the smallest amount of change that can be measured and detected. For sensors, this is directly related to the number of bits reserved for the sensor in question. The more bits, the higher the sensitivity.
Zero gravity offset: the value of the accelerometer when no external force is applied, which is the minimum error detected.
Zero rate offset: the value of the gyroscope in the absence of angular movement, which may depend on the temperature.
Data rates: the number of measurements made during a given period of time. When choosing your IMU, make sure that the supported sensor rates match the needs of your applications.
Noise density: defined in units per square root bandwidth, typically:
- ug/sqrt (Hz) for accelerometers
- deg/s sqrt (Hz) for gyroscopes
Bandwidth: the range of frequencies in which an accelerometer or gyroscope operates.
Interfaces: what cable and communication protocol does the IMU and your embedded system use?
Temperature range: minimum and maximum ambient temperature sensors can operate safely to provide accurate measurements.
Output Parameters
Static precision: the precision of the sensor output when the device is relatively stable/stationary.
Dynamic precision: this is the precision of the sensor output when the device is in motion.
Rotation error: the difference between the output vector and the real vector, measured in degrees.
Heading Error: the difference between the output of the yaw axis and its actual value, measured in degrees.
Heading Drift: error accumulated over time.
RAW Accel / Gyro / Mag: the raw output of each sensor before any treatment.
Calibrated Accel / Gyro / Mag: output from each sensor after sensor fusion has been used to process and clean each signal.
Calibration
After examining the parameters of the sensor outputs, there is something else you need to consider: calibration. The calibration options you choose depend on your budget and the needs of your project.
Nominal: nominal calibration uses average values for the sensor to give it an average performance.
Per-device: calibration by the device allows you to calibrate certain factors, such as the gain of the sensor, specific to each component. Depending on your application, you can choose to calibrate according to a single axis or several axes if your project.
Dynamic: If you find that the nominal calibration is acceptable, the output of your sensor can be further improved dynamically in the field. The characteristics of the sensor vary depending on the temperature and can be adjusted as the sensor is used in its final application.
Data Fusion Algorithms
The Kalman Filter
The Kalman filter is a model implementation:
- First, based on its model, the filter makes an assumption about the next sensor output value
- He then takes the measured value and compares it with his assumption
- Finally, he updates his model to make more precise assumptions for the next measurement.
Each sequence of data from the sensors is used to statistically improve the model in order to calculate the outputs. At the same time, the accuracy of the sensors is also judged.
The model depends on the sensor error and the application in question. For mobile robotic systems, real-world knowledge also tells us that physical objects move smoothly and continuously in space, rather than teleporting through space as samples of GPS coordinates might indicate.
This means that if a sensor that has consistently given excellent values consistently starts to tell you unlikely things (like GPS / radio systems when you enter a tunnel), the credit rating of the sensors decreases in a few iterations of a few milliseconds until it begins to measure consistent values again.
It’s better than just averaging because the Kalman filter can support most of its sensors which become temporarily inaccurate. At least one sensor is required which transmits relatively precise values. It ensures the proper functioning of the robot until the other sensors operate again.
The Kalman filter is an application of the more general concepts of Markov chains and Bayesian Inference, which are mathematical systems that iteratively refine their assumptions using evidence.
PID Filters
Simpler robotic systems can be fitted with PID filters. They can be considered as primitive Kalman filters supplied by a single sensor, all the iterative settings being cut and replaced by three fixed values (KP, ki, and kd).
It is a correction system that adjusts the input through the control loop to obtain the correct output.
Even when PID values are set automatically or manually, the whole process of “setting” (adjusting, stealing, judging, repeating) is an outsourced version of Kalman with a human doing the step of spreading beliefs.
Custom Filters
Real systems are often hybrid, somewhere in between.
ROS Packages For IMU
If you implement your robot software under ROS, it will be easier to buy sensors compatible with ROS. This means that the manufacturers have already developed a ROS package to make the sensor interact with ROS. This will save you time.
With regard to the IMU, the sensor will publish the raw or processed data, depending on the implementations of your IMU, on the topic/imu. Then on ROS, you can subscribe to the topic to get data to use it for navigation, for example.
Some ROS packages are already implemented and up to date:
- imu_transformer: This package provides a node / nodelet combination which can be used to transform IMU data from one TF frame to another
- imu_tools:
- Imu_filter_madgwic: Filter that merges the angular velocities, accelerations and (optionally) magnetic readings of a generic IMU device in an orientation based on the algorithm of Sebastian Madgwick
- Imu_complementary_filter: Filter that merges the angular velocities, accelerations and (optionally) magnetic readings of a generic IMU device in a quaternion to represent the orientation of the device on the global frame, based on the algorithm of Roberto G. Valenti
- rviz_imu_plugin: a plugin for rviz that displays sensor_msgs:: Imu messages
- imu_utils: Package that tracks IMU performance on Matlab
How To Choose Your IMU?
Make your choice according to the requirements of your project. The cheapest IMU provides only raw values, while the UM7 filters the processed values and publishes them directly in a ROS message.
The performance is quite similar even for the most expensive IMUs. The difference is in the additional services and implementations:
- Integrated calculations
- Integrated filters (very efficient: IMU SBG Systems )
- Integrated microcontroller
- Map library (Arduino, Raspberry pi, etc.)
- ROS compatibility
- Interface
- Integration with GPS data ( Ellipse 2 Micro INS inertial unit from SBG Systems )
What Is The Performance of the IMU?
An IMU sensor is a useful component to add to your robot. It will give you information on attitude, orientation, position, speed, acceleration, rotational speed if the values are calculated.
However, you should keep in mind that the IMU is subject to drift errors. Indeed, errors accumulate over time since the new values are based on the previous ones.
In addition, the IMU, using the magnetic field to calculate values, can be altered by other magnetic fields (motor, metallic structure, etc.) which can give huge errors.
You can implement fixes and filters to reduce this error, but the IMU error will continually drift and increase.
One way to solve this problem is to take into account the value of covariance (confidence coefficient), which can change over time if it is dynamic.
Another way is to add a GPS sensor. Indeed, the GPS signal can update the value of the IMU and correct its drift error.
Looking for real results, you will find online a test of online visualization of the data of an IMU and of an EMG sensor connected to a wrist, which will give you an overview of the error of the IMU (parts 2.1 and 3.1).
This other article lists and describes all the biases of the IMU leading to errors.
Conclusion: Advantages And Disadvantages Of IMU
Benefits Of An IMU
- The inertial navigation system is independent of all external information and does not consume too much energy
- The inertial navigation system can provide the location, speed, altitude, angle data, and resulting navigation information is continuous
- High-frequency measurement and good stability
Limits Of IMU
- Using information from the integrated navigation system, positioning error increases over time and long-term accuracy is low
- Long initial alignment time required before each use
- Time information cannot be given