-
Notifications
You must be signed in to change notification settings - Fork 12
Home
Here's a collection of test plans, results, thoughts, and discussion relating to the performance of the FXOS8700/FXAS21002 combination orientation sensor. Select sub-pages for more details on each topic.
List here what's happening, and who is doing it.
- obtain copy of NXP Fusion Library,
- port library to SensESP environment (Bjarne) Presently getting the I2C routines sorted out.
- investigate reason for drifting heading (Daniel?) Magnetic environmental interference is one likely cause.
- investigate reason for over/undershoot in heading response _(Bjarne, Daniel?)
- develop testing methods and plans as needed (all)
- add to this wiki as we learn (ongoing) (all)
The Fusion algorithm is central to the performance of the sensor. A great resource for background info is reference 6 (NXP User Guide to their Sensor Fusion Library) below.
The SensESP orientation sensor is using the Adafruit AHRS code, which is derived from https://github.com/memsindustrygroup/Open-Source-Sensor-Fusion/ This location has lots of info, including that it is based on Freescale's version 4.2.2 Sensor Fusion library. NXP now has version 7.20 released, which includes improved calibration features and faster CPU performance apparently. I've got this version compiling for the ESP32, and am now debugging the I2C comms.
In Resource 6, NXP says "...the equations of motion at the heart of this and many other fusion-based systems assume that all quantities are measured at the same moments in time. This may not even be possible to do, as there is no common set of sampling frequencies that apply to all sensors.The easiest way to deal with this problem is to ignore it via the simple expedient of polling all sensors at a fixed rate, while setting their internal sample rates high enough that you can ignore any sample time jitter. You might even want to sample at a much higher rate so that you can filter raw sensor samples to reduce noise. This approach has been taken by all prior versions of the sensor fusion library. Version 7.00 of the fusion library adds support for sensor hardware FIFOs."
This, and more on pg 45, suggests timing is very important to get good performance. Section 5.4 discusses calibration: version 7 of the library performs magnetic calibration during use. Gyro and accelerometer calibration methods are also provided. Section 5.5 discusses adjustments that can be made to the Kalman filter parameters. Pg 81 states that it is expected for a gyro's zero offset to drift. See section 9.1.4 regarding expectations; getting 2-degree accuracy in heading is challenging. Also, a stationary sensor system isn't expected to work well due to assumptions in the Kalman filter - we need to keep this in mind while testing (in real-life use aboard a boat, not a problem). Section 11 talks about magnetic distortions/errors, and has a good list of references.
Reference 7 has performance graphs for the Fusion library when fed synthetic data from MatLab. Para 4.8.2 suggests that algorithm response to gyro step response is on the order of several seconds. See also tables 15-17 and para 4.8.5 - 4.8.7, which suggests we should get good stability within 1 degree when stationary, and accuracy around 2 degrees.
- https://github.com/SignalK/signalk-imu
- https://www.tindie.com/products/onehorse/ultimate-sensor-fusion-solution-mpu9250/
- kriswiner's Github repositories, including: https://github.com/kriswiner/EM7180_SENtral_sensor_hub/wiki/K.-Limits-of-Absolute-Heading-Accuracy-Using-Inexpensive-MEMS-Sensors and https://github.com/kriswiner/MPU6050/wiki/Affordable-9-DoF-Sensor-Fusion
- Estimation of heading using magnetometer and GPS
- Performance Improvement of Inertial Navigation System by Using Magnetometer with Vehicle Dynamic Constraints
- NXP User Guide to Sensor Fusion Library
- NXP Sensor Fusion Library Datasheet for Kinetis MCUs