2019-05-30 09:03 AM
Hi,
From what I've been told, the LIS3MDL magnetometers self-calibrate upon turning on. I have taken some readings from 3 different LIS3MDL's and plotted the values in a similar way to the beginning of this tutorial:
https://thecavepearlproject.org/2015/05/22/calibrating-any-compass-or-accelerometer-for-arduino/
My plots, which I will include, show quite significant hard and soft iron distortions. So, it seems that the magnetometers are not correctly calibrating when powered on / are not calibrated.
How could I go about calibrating them?
The data points here I took by taking 750 readings with a 0.1 sec delay between each. I moved the magnetometer around in the air to trace a small sphere. Red = XY, Blue = XZ, Green = YZ. In the 3d plot, I projected the XY, XZ, and YZ points onto each axis (XY projected onto the Z axis, XZ projected onto the Y axis, YZ projected onto the X axis). While the black points are simply plotting the (X, Y, Z) into 3d space. From what I have read, if the magnetometer is calibrated correctly: for the 2d plot, each ellipse should be a circle and they should all be overlapping each other with the center at the origin; and for the 3d plot, each projection should be a circle and the black points a sphere - instead they are clearly ellipses & ellipsoid, and again should be centered on the origin.
Ex.1A - Readings from magnetometer A in 2dEx.2A - Readings from magnetometer A in 3d
Ex. 1B - Readings from magnetometer B in 2d
Ex. 2B - Readings from magnetometer B in 3d
Plz let me know if i'm being stupid - i'm no expert in this stuff. Actually I was only introduced to this a few days ago, so I could very well be misunderstanding something.
Thanks
2019-06-07 08:38 AM
Hi,
>> How could I go about calibrating them?
Did you already use the X-CUBE-MEMS1 eCompass calibration algorithm library? --> https://www.st.com/resource/en/user_manual/dm00396079.pdf
Regards