Sunday 23 June 2019

Electronic Compasses for Voyager

Electronic Compasses for Voyager

I'm losing count, but I think its about 5 different compass devices I've trialled during the development of the Voyager Controller - so far.

The image below shows a mild case of the problem of compass accuracy.
The leg with a bearing of about 350 degrees from first to second waypoints shows the boat heading off on a bearing of about 330 degrees with about 20 degrees error.
It still gets there, but its not good.

A successful voyage under motor, but poor compass accuracy

Measuring the boat's heading accurately has been quite difficult.
Overall, I suspect it all comes down to calibration, and the built-in mechanisms to manage calibration in a way that actually works in the environment in which it will be used.
The following is a list of the different compass devices that made it into the Voyager Controller and my thoughts about them.
These notes represent my understanding of what's going on. If I can be corrected, then good.

MPU-9250 - August 2016

This is quite a good low-cost IMU device for measuring 9 degrees of freedom including 3-axis magnetic sensing. It requires all sensor fusion and calibration management to be handled by the host processor.
The problem I had was that I could not get any sensor fusion and calibration software sample that I could find to work satisfactorily. (This may be attributed to my impatience or incompetence).
I'm sure it may be possible, but there are more complete (and expensive) devices available which perform the sensor fusion and calibration maintenance on board.

Note: I now use the MPU-9250 device as magnetic rotation angle sensors. This is where a rotating device (like the Wingsail) has a magnet held near the MPU-9250, and its angle is measured. The magnet can easily swamp the effect of the earth's magnetic field and the resulting accuracy of the rotational measurement seems to be within 1 or 2 degrees.

BNO 055 - October 2017

This was the first IMU I tried with built-in sensor fusion.
The sensor fusion worked quite well, but magnetic calibration was not being maintained and it kept drifting off.

BNO 080 - October 2018

This seems to have improved accuracy over the BNO 055. Its built-in calibration processes continuously seem to perform calibration of the compass as it moves.
The problem that I could not solve, was that it continues to perform those calibrations when its not moving then starts drifting off for no apparent reason.
The end result seems to be that with the boat sitting stationary on ground, and after preforming some calibration motions to achieve a high-level of calibration, it simply starts to drift off by 20 or 30 degrees.
My understanding is that this behaviour can't be controlled.

Ultimate Sensor Fusion Solution - LSM6DSM + LIS2MD - April 2019


This device has been the most successful yet.
It incorporates onboard sensor fusion processing and calibration management.
One key point is that the calibration is well controlled, and seems to be better behaved.
Small movements of the boat seem to be enough to maintain the compass calibration.
It is also possible to save a calibration state, and reload it for a warm start.
I found the documentation and sample code to operate this device couldn't be directly used in my environment without the need to gain a better understanding of the operation of the device. Once I had gained enough understanding of the device, I was able to alter the sample drivers software to suit my requirment. This wasn't really necessary with most of the other devices I've used.

No comments:

Post a Comment