LSM9DS1 - Component positioning for magnetometer data coherence
Hi,
I am using a LSM9DS1 IMU on a custom PCB for the development of a dead reckoning feature.
First step is quaternion calculation, and in order for this to be precise and reliable, sensors data have to be too. However, I'm having issues with the magnetometer. Even after having correctly calibrated it for hard and soft iron errors (bias + correction matrix), heading calculation using calibrated magnetometer data seems to be off.
As so I was wondering if it could come from my PCB layout, and in particular the positioning of the LSM9DS1. Are there any restrictions/must-do concerning this position, that could otherwise mess with the magnetometer ? Could there be any other (known) hardware reasons for this issue ?
The code used for IMU initialization can be found there:
https://github.com/kriswiner/LSM9DS1
I just added or modified some parts, such as taking in account soft-iron error for magnetometer calibration, but even raw my issus still stands.
Thank you in advance for any help !
