BjarneBitscrambler / OrientationSensorFusion-ESP

Files for performing orientation sensor fusion using NXP version 7 algorithm, ported to Espressif platforms.
BSD 3-Clause "New" or "Revised" License
23 stars 12 forks source link

Improve Magnetometer SNR by Sampling Twice #7

Closed BjarneBitscrambler closed 3 years ago

BjarneBitscrambler commented 3 years ago

Looking at the I2C transactions with a scope, it is apparent that there is sufficient time to perform additional reads of the magnetometer during each fusion cycle. Currently one one read is performed, and because the magnetometer portion of the FXOS8700 does not have a FIFO, that read only obtains a single data point. It should be feasible to perform a magnetometer read before and after the block read of the accelerometer, and possibly also after the gyro read. Thus there might be 2 or 3 data points per fusion cycle, which would improve the signal to noise ratio if they are averaged.

BjarneBitscrambler commented 3 years ago

No - this approach does not noticeably improve the performance of the heading readings. Several long-term stability recordings showed that the standard deviation of readings collected every 1.0 second for about 10 hours was about 0.8 degrees, and this did not change when performing 5 magnetometer readings per fusion cycle and averaging them.

Here's a histogram comparing the 1- and 5-sample approaches: Histogram of 1- and 5-samples per fusion cycle