AnsweredAssumed Answered

Attempting to calibrate FXOS8700CQ without NXP MCU

Question asked by Evan Ryker on Jan 28, 2018
Latest reply on Feb 9, 2018 by Mike Stanley



I am working to design a robot that maps out relative heights on a circle approximately 4 feet in diameter. I'm using the FXOS8700CQ mounted on a small arm. The arm rotates ~360 degrees, and a small ball caster on the end of the arm allows it to pivot up and down with the changing height on the surface. We want to record the pitch of the arm from the FXOS8700CQ approximately every 3 degrees of rotation, to get roughly 120 readings.


We are using the sensor fusion library to filter the results from the FXOS8700CQ. This is returning more stable results that previous filters we've tried, but we're not quite getting the results we need yet. The filtered results are smooth, but they are moving (falling) without the robot moving (mostly the compass).


I believe this is due to the sensor not being properly calibrated. Previously we'd been using MotionCal software to calibrate the sensor (hard- and soft-iron matrices), but those values don't appear to work correctly with the fusion library. We want to use the Sensor Fusion Toolbox for calibration.


The issue here is that we're not using an NXP MCU, we're using an ESP32. We're also not writing the calibration matrices to the EEPROM, I'm simply writing them into the cal[] array in NXPMotionSense.cpp, like so:


cal[0] = 0; //accelerometer offsets
cal[1] = 0;
cal[2] = 0;

cal[3] = 0; //zero-drift for gyro
cal[4] = 0;
cal[5] = 0;

cal[6] = 30.32;  //hard-iron offsets
cal[7] = 7.19;
cal[8] = 72.75;

cal[9] = 45.74; //magnetic field

cal[10] = 0.988; //soft-iron map
cal[11] = 0.951;
cal[12] = 1.068;
cal[13] = 0.023;
cal[14] = 0.010;
cal[15] = -0.050;


Here is my question. I saw something about using Serial UART to communicate with the Sensor Fusion Toolbox if we were using something other than a NXP MCU. However, I was unable to figure out how to select a serial COM port, or what values the Sensor Fusion Toolbox expected from the sensor in order to perform a calibration. Could anyone point me in the right direction?