cancel
Showing results for 
Search instead for 
Did you mean: 

LSM9DS1 - Component positioning for magnetometer data coherence

PBogr
Associate

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 !

2 REPLIES 2
Eleon BORLINI
ST Employee

​hi @PBogr​ , which is the detailed HW configuration of your pcb? Please consider that the LSM9DS1 magnetometer must be kept as far as possible magnetic source (high circulating current, RF, etc). Check also if the official ST FW libraries for STM32 can help you to check if your code is compatible with e.g. eCompass library. Regards

PBogr
Associate

Hi Eleon, thanks a lot for your quick answer. I won't be able to give the detailed configuration of my PCB, but I will take your considerations into account, and check those libraries that I didn't see before. It may help.

Though I recently found out that the LSM9DS1 wasn't the only component to get faulty heading and magnetometer data in my test zone, as so I think the issue may not come from it in particular...