Skip to main content
Visitor II
June 26, 2019
Question

LSM9DS1 - Component positioning for magnetometer data coherence

  • June 26, 2019
  • 2 replies
  • 819 views

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 !

    This topic has been closed for replies.

    2 replies

    ST Employee
    June 26, 2019

    ​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

    PBogrAuthor
    Visitor II
    June 26, 2019

    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...