2021-03-31 03:58 AM
Hi, we have designed a custom PCB with the LSM9DS1 as IMU, we are receiving data from the accel, mag, and gyro, in the case of the accel I think is easier to know if the measure is ok (we must get 1G in the z-axis), but how could we validate if the data of the magnetometer is correct? , is there any expected value? we are not using an ST microcontroller to interface with the sensor.
Thanks
Solved! Go to Solution.
2021-03-31 06:10 AM
Hi @jg_spitfire ,
please consider first that the Earth magnetic field is about 0.5 gauss, so you should get this result calculating the magnetic field intensity from the 3-axis components.
For the conversion formula from LSB (digits) to physical quantities you can refer to the C drivers on Github for the LSM6DSM1 (lsm9ds1_reg.c).
Considering for example the default Full Scale of 4 gauss, the formula is:
float_t lsm9ds1_from_fs4gauss_to_mG(int16_t lsb)
{
return ((float_t)lsb * 0.14f);
}
For a general check of the (correct) performances of the magnetic sensor, you can run the self test as reported in the lsm9ds1_self_test.c example.
If my reply answered your question, please click on Select as Best at the bottom of this post. This will help other users with the same issue to find the answer faster.
-Eleon
2021-03-31 06:10 AM
Hi @jg_spitfire ,
please consider first that the Earth magnetic field is about 0.5 gauss, so you should get this result calculating the magnetic field intensity from the 3-axis components.
For the conversion formula from LSB (digits) to physical quantities you can refer to the C drivers on Github for the LSM6DSM1 (lsm9ds1_reg.c).
Considering for example the default Full Scale of 4 gauss, the formula is:
float_t lsm9ds1_from_fs4gauss_to_mG(int16_t lsb)
{
return ((float_t)lsb * 0.14f);
}
For a general check of the (correct) performances of the magnetic sensor, you can run the self test as reported in the lsm9ds1_self_test.c example.
If my reply answered your question, please click on Select as Best at the bottom of this post. This will help other users with the same issue to find the answer faster.
-Eleon
2021-03-31 06:31 AM
Hi, so I should get 0.5 gauss in each axis?
2021-03-31 06:33 AM
No, only as vector sum of the 3 axis components, i.e. the sqrt(mag_x^2+mag_y^2+mag_z^2).
-Eleon
2021-03-31 06:41 AM
Where did you get that info, do you have any application document where specifies that?
2021-03-31 06:42 AM
It is the Earth magnetic field...
-Eleon
2021-03-31 06:49 AM
sorry, I mean, is there an application note where specify these specs, calibrations methods, etc?, I found that you have some tools but for your ST boards so I asked for the documents because I am not using an ST board
2021-03-31 07:18 AM
Hi @jg_spitfire ,
specifically for the there is unfortunately no application note for the LSM9DS1...
However, for the specific magnetic sensor component in the LSM9DS1 I would suggest you the AN5069 Application note for the LIS2MDL, where there are a few more examples about the magnetic output and the device configurations.
-Eleon
2021-03-31 07:32 AM
thanks!