2024-06-26 11:51 PM
Hello Everyone!!!
I am using ISM303DAC in my project E-Compass, I am facing an issue regarding hard iron calibration. in datasheet it is mentioned that we have do hard iron calibration using external processor and has to store those values in the internal registers of sensor. here i don't know how to do the hard iron compensation can anyone please let me know the procedure/steps to do the hard iron calibration if any example is available with you please provide me.
Thank you,
regards,
ANIL.
2024-06-28 12:27 AM
Hi @Anil3 ,
You can use MotionMC library to implement the hard iron compensation.
Here you can find the user manual, let me know if you have any other doubt.
2024-06-28 10:05 PM
Hi @Federica Bossi,
Thanks for your reply!!!
I have used MotionMC library and got calibrated the compass and also received calibration quality as 3 which is good.
Even though it calibrated, compass value are not constant please have a look to the attached excel sheet.
how can i get some constant values?
One more thing is that...for every power cycle i need to re-calibrate the sensor which is not possible as this compass is going to be fixed to a particular position. If i stored the previous values and send it to sensor it might be ok but the magnetic effect will change from place to place. any suggestion that how can i overcome to this issue.
Awaiting for your valuable reply.
regards,
ANIL.
2024-07-04 02:15 AM
Hi @Anil3 ,
In most applications it is necessary to recalibrate if environmental conditions change. it is not recommended to always use the same Hard Iron calibration values.
For compass applications we suggest the MotionEC library.
You can find code examples https://github.com/STMicroelectronics/X-CUBE-MEMS1/tree/main
2024-07-11 12:37 AM
Hello @Federica Bossi
sorry for the delay in reply as i have assigned in another task i haven't gone through this...
As said by you i am using the motionMC library and magnetometer is also getting calibrated.....but i have observed that we are calling the magnetometer calibration algorithm even after it got calibrated...can i Deinit MC library once it got calibrated??
Thank you!!!
regards,
ANIL.
2024-07-19 04:01 AM
Sorry for the late reply as i am being on another task i haven't seen into this for a while.
I am already using the motionMC library and i am also getting output values with an accuracy of 0.5 degree.
In manual it is mentioned that hardiron compensation is done by the library i have calibrated the magnetometer and also got calib.quality as good(3) , I have kept device a side and placed a magnet near to device, the values got deflected. If library is doing hard iron calibration why the values are getting deflected if a magnet is placed near to sensor even after calibration???
regards,
ANIL.
2024-07-23 06:20 AM
Hi @Anil3 ,
The magnetic calibration algorithm is used to compensate for magnetic distortions in the environment around the sensor.
If conditions change such as the proximity of a magnet, the calibration is no longer effective. You need to redo the calibration.