I'm trying to calculate an accurate compass heading using a FXOS8700CQ unit (not on an MCU board).
We are running a Windows Compact 2013 BSP that provides access to data from the FXOS8700CQ unit mounted directly onto our device. The BSP is able to return two structures :
struct COMPASS_READING { short X; short Y; short Z; } from the magnetometer, and
struct ACCEL_READING { short X; short Y; short Z; } from the accelerometer.
I've downloaded the example FreescaleSensorFusionRevision5 from NXP Sensor Fusion|NXP, and the code in the example uses these structures instead :
struct MagSensor { int16 iBs[3]; int16 iBc[3]; float fBs[3]; float fBc[3]; int16 iCountsPeruT; float fuTPerCount; float fCountsPeruT; uint8 iWhoAmI; } and
struct AccelSensor { int16 iGs[3]; int16 iCountsPerg; float fGs[3]; float fgPerCount; uint8 iWhoAmI; }
Additionally, the example applcation FreescaleSensorFusionRevision5 uses header files that are not included in the download (eg I2CFreedom.h, UART.h, FTM.h)
I'm trying to understand if we have enough information available from our BSP in order to be able to run the fusion algorithms, or if I need to take another approach based upon the information that I have available to me.
I've tried using other algorithms based upon calculating pitch and roll (to compensate for tilt) in order to determine a compass heading, but the calculations produce results that are very noisy, and don't seem to bear much relationship to compass heading.
An example file containing the readings that I am receiving is attached.
I'd appreciate any advice that anyone can offer
Original Attachment has been moved to: compass_data.txt.zip