Hi,
I ran the ecompass demo present in KW36Z boards and I got different results in few scenarios.
1. when I compared the magnetometer values with a compass application from my smart phone. As per datasheet, I found FXOS8700C location and aligned the board in same direction as smart phone but the resulting angle were totally different? Why is this behavior?
2. I also need to obtain x,y,z values from accelerometer. When i calibrate the board and run the demo the accelerometer values are not following a pattern, it shoots negatives and positive in random manner irrespective of the direction i move the board. I checked both raw values from sensor data and averaged value as well.
I have read the documentation and my goal is achieve the angle at which the board is moving and x,y axis precisely. I tried all possible ways but couldn't figure.
Edit: Would be great if you could me what could go wrong in calibration? Cause one out of 10 calibration barely matches compass reading. I have calibration drone hardware but never faced any such issues. And I needed value in range of 0 to 360 so I added this piece of code in ecompass.c file
if( g_Yaw_LP < 0 )
{
g_Yaw_LP += 360.0; // convert negative to positive angles
}
Thanks and Regadrs
Niranjan
Hello,
Among the modifications made to the SW, did you removed the Magnetometer_Calibrate function ?
Just to confirm, did you roll the board on all orientations to get max and min values as it asked in the demo code you are using ?
Could you please check this document as well ? You can try using those functions as a base and adapt those to your KW36 example
Hope it helps,
Regards,
Estephania
Hi,
No, i did not remove the calibration functions. Yes, I did roll the board in all orientations and got max and min values. Once the calibration is done, the output values greatly differ in values.
Should I change any register values? [Default one in sdk code file is * XYZ_DATA_CFG Sensor Data Configuration Register */] And I am using the same.
I tested few times in lab environment and there was a community post which mentioned I should carry out the testing where no nearby ferromagnetic materials are present. I did try that as well. But still readings were wrong. It would be great if someone could from NXP could test the calibration condition and upload a video or something for us to understand better.
I could not see any document in your attachment. Please check.
This query seems to be a common problem since many posts I could see related to this.
Thanks and Regards
Niranjan