I would like to try to use an IMU to provide accurate heading for an outdoor differential drive rover type robot that uses a RoboClaw motor controller with odometry. The robot will only drive on fairly flat and slightly tilted surface (ie. my driveway). I am attracted to the BNOXXX sensors as they do all of the sensor fusion. I’m not sure that I don’t need just a magnetometer/compass, but from what I’ve read sensor fusion seems to improve accuracy. As the BNOxxx performs dynamic calibration during operation, I am uncertain whether this line of IMUs can be used for rover type robots. Using the BNO055 I experienced the issue of the heading instantaneously changing by large amounts presumably due to the dynamic calibration updating. I tried a BNO085 using the RVC mode, but have experienced heading drift presumably due to gyro drift. I am concerned that when using a magnetometer-included mode that the mag calibration will not be accurate, as when the sensor is installed I cannot rotate the robot out of plane because of it’s weight and size. I can ‘3D’ calibrate the mag up to a level 3 external to the robot and then install it. The datasheet says: “These distortions are referred to as soft and hard iron effects respectively. The offset and distortion to the measured magnetic field is estimated and compensated for continuously while the device is in motion” so it sounds like the sensor should continue to calibrate and compensate for the robot environment. But this has also possibly resulted in the strange jumps in the reported heading. BNO086 sounds attractive as the documentation states it offers ‘interactive calibration’ and less drift however posts I’ve read report the same jumping heading problem. Could you comment on the usability of these sensors in a rover type robot, what might be the best settings for attempting to use them in this manner, or would a different sensor be recommended for this application.
Unless the magnetometer can be calibrated in place, the headings produced will be inaccurate, period.
This problem is solved for ship compasses by small magnets in the compass housing, the positions of which can be adjusted to reduce or eliminate N-S and E-W offsets.
If your rover will be moving mostly in a horizontal plane, you need only rotate it in a circle, recording the raw readings, in order to estimate the X and Y offset corrections and relative axial scale factors.
The correction to the raw readings can be applied after the measurement, and with careful calibration, you can expect headings to be accurate to +/- 3 degrees or so. See GitHub - jremington/magcal_2D: Calibration of 2D magnetometer data · GitHub
Needless to say, only the raw X and Y magnetometer readings from BNO0xx sensors are useful for this approach. To access raw sensor readings on the BNO055, you can use the approach described here: GitHub - jremington/BNO055_Mahony_Fusion: Fusion filter replaces faulty firmware · GitHub
According to the BNO086 data sheet, there is an operating mode to output the raw sensor data. Incidentally the BNO055 and BNO086 appear to have the same basic sensors, only the firmware has changed.