In a previous post, we showed the effects of magnetic and gyroscopic perturbations on the inertial sensor of the Yocto-3D-V2. The standard method used for sensor data fusion could in some cases find itself undermined, to the point of making the measures useless. Therefore, we recently added in the Yocto-3D-V2 firmware the possibility to choose between several fusion methods, in order to enlarge the application range where this product can be used.
The ideal fusion algorithm
The BNO055 sensor of the Yocto-3D-V2 is actually made of three distinct sensors:
- A 3D accelerometer
- A 3D magnetometer
- A 3D gyroscope
To be able to deduce in real time an orientation, these three measures must be combined:
- The accelerometer can measure the absolute inclination
- The combination of the accelerometer and of the magnetometer enables the obtention of an absolute 3D compass (compensated for inclination)
- The gyroscope enables real-time measures of orientation changes , faster than possible with the two previous methods, and without being perturbed by temporary variations in the acceleration or magnetic field.
It's this complete method that the BNO055 calls NDOF (nine degrees of freedom).
Non-ideal situations
The ideal algorithm works well when all the BNO055 sensors are operational. However, things go wrong sometimes in real life...
Magnetic perturbations
When external elements perturb the lines of the magnetic field, the fusion algorithm tries to correct the orientation value in an erratic way, although the gyroscopic orientation could be correct. In this case, we would prefer an estimate of the position based only on the gyroscope, which would be better, even if we need to periodically reset the orientation by software.
Gyroscopic drift
Gyroscopes are highly efficient when they are well calibrated. They can self-calibrate very easily when the sensor remains idle (or in a simple translation at constant speed). But if the sensor is used during an extended period without ever being idle, for example on a ship, the gyroscope starts to drift little by little and to make up moves that don't exist, and which are embedded in the fusion algorithm. If reactivity is not of the essence, we might prefer in this case a position estimate which doesn't use the gyroscope but only the compass.
BNO055 fusion modes
Thus, you can now find in the Yocto-3D-V2 configuration (after updating your firmware and your VirtualHub) a new setting enabling you to select between several fusion modes:
Yocto-3D-V2 configuration interface
Here are briefly the characteristics of each mode:
- NDOF: It's the ideal fusion algorithm for ideal conditions: all the sensors are used to correct each other. It's also the only method which was available on the Yocto-3D-V2 until now.
- NDOF_FMC_OFF: A variant of the first algorithm, but (re)calibrating the compass less quickly (FMC_OFF means fast magnetic calibration OFF).
- IMU: A fusion algorithm which doesn't use the compass, based only on inertial measures (accelerometer and gyroscope). The position is updated very quickly, but as there is no absolute reference for orientation, the orientation indication is not an absolute value but relative to the starting position. You should use this algorithm when the compass is perturbed.
- COMPASS: A fusion algorithm without gyroscope, designed to work as 3D compass. Use this algorithm if you have problems of gyroscopic drift and you need a correct absolute orientation. In this mode, the gyroscope always returns a zero angular velocity.
- M4G: A variant of the preceding algorithm where the orientation is detected only through the magnetometer, but which on top emulates gyroscopic measures with magnetic field differential measures. (M4G means magnetometer for gyroscope). In this mode, no compass self-calibration is applied, the magnetometer values are used as is.
If you have a doubt between two modes for your application, nothing beats an experiment: try them and see which one gives you the best results.