-
Notifications
You must be signed in to change notification settings - Fork 12
Accuracy
For use as an electronic compass, feeding data to instruments such as a radar, an accuracy on the order of +/- 2 degrees seems acceptable. Returning to the same heading at a later time should produce the same reading, within +/- 2 degrees. Heading readings over a full 360-degree rotation should vary linearly and be within about +/- 2 degrees of the actual heading.
Place the sensor on a rotating test fixture. Step the test fixture through a full 360-degree rotation, pausing at known positions (corresponding to the spokes on the test fixture) to record the measured heading. Calculate the differences between headings, which is the measured step size, and compare them to the actual step size of 11.25 degrees.
The measured steps were generally within 2 degrees of the actual step size. The deviation varies approximately sinusoidally over the full 360 degrees, suggesting that a large component of the error is systematic rather than random. A plot follows:
Place the sensor on a rotating test fixture. Point the sensor's X-axis at a geographical feature and record the sensor's reading. Rotate the fixture in both directions, stopping with the sensor pointed at the same feature and record the reading again. Repeat several times. For this test I chose a visually easy-to-locate feature seen from outside my house: the Mt Work summit, approx 11 km distance, at magnetic bearing 311.7 degrees according to GoogleMaps, and measured as 311.0 +/- 1 degrees with hand-bearing compass.
The first trial was unsuccessful. The heading was not close to what was expected, and varied widely over a 10 minute period. See the following graph. I speculate that this was caused by not calibrating the magnetic sensor for the new outside test location. Even after several rotations and manipulations, the reported reading still wandered.
A following trial was successful. Prior to this trial, I ran the Sensor Fusion Toolbox software, performed a magnetic calibration of the sensor while at the test location, and saved the calibration to non-volatile storage. On starting the test firmware, the median heading was within 0.7 degrees of what was expected, ranging about +/- 1.5 degrees around that value over a 20 minute period and with interspersed rotations followed by repointing the sensor at the geographical reference. See the following graph.
I had initially believed the wandering heading to be due to the temperature change in moving from indoors (approx 17 C) to outdoors (approx 6 C), however even after 10 minutes outside the heading during the initial test had not stabilized. Checking with the Toolbox software showed that Magnetic Interference was detected (i.e. calibration was unsuited to the location), so the sensor was recalibrated and retested successfully. I do not know why it was insufficient to simply move the sensor around in order to calibrate it (as was tried in the first attempt); instead it functioned only after saving the new calibration to NVM. The actual calibration values were indeed quite different:
Date | Hard Iron V[x] | V[y] | V[z] |
---|---|---|---|
13 Nov 2020 | 14.90 | -17.30 | -45.50 |
28 Nov 2020 | -13.30 | -48.90 | -44.20 |
Further testing of this is needed. This also suggests that several functions should be added to the fusion code wrapper: one to indicate when magnetic interference is detected; and one to save a new magnetic calibration. It might also be useful to add a function to read the FXOS8700 temperature register, as it is uncertain to what extent the cooler outside temperature contributed to the need to recalibrate.
Once performing well, the absolute accuracy of the sensor was quite satisfactory.