cancel
Showing results for 
Search instead for 
Did you mean: 

Getting true north with the LIS2MDL and LSM6DSO sensors.

ALT.1
Associate

I use LIS2MDL and LSM6DSO sensors (with MotionMC and MotionEC libraries) for getting true north direction. I tested this configuration on IKS01A3 board and it works. But on my custom board, I'm having trouble with getting true north direction. After calibration the resulting azimuth differs from the true one by 70-150 degrees. Tilting the sensor plane by 5 degrees or more in the X or Y axes also affects the observed azimuth. Could this be due to incorrect routing of my custom board? I'm concerned about I2C line vias. Could vias be a source of parasitic magnetic induction? Power is also routing under the LIS2MDL (pic2). Any ideas are greatly appreciated.


_legacyfs_online_stmicro_images_0693W00000bl3Z1QAI.png
_legacyfs_online_stmicro_images_0693W00000bl3ZBQAY.png

1 ACCEPTED SOLUTION

Accepted Solutions
Federica Bossi
ST Employee

Hi @ALT.1​ ,

Looking at your layout I notice that you put traces under the device, this is not suggested by ST.

Please follow the guidelines reported in TN0018 as reference material concerning PCB design.

In addition, are you implementing both hard iron and soft iron compensation? We suggest you to do both.

Then, please check that all the axes of both the devices are concordant and ENU (right-hand-rule).

If these suggestions help you, please mark my answer as "Best Answer" by clicking on the "Select as Best" button, this can be helpful for Community users to find this solution faster :)

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
Federica Bossi
ST Employee

Hi @ALT.1​ ,

Looking at your layout I notice that you put traces under the device, this is not suggested by ST.

Please follow the guidelines reported in TN0018 as reference material concerning PCB design.

In addition, are you implementing both hard iron and soft iron compensation? We suggest you to do both.

Then, please check that all the axes of both the devices are concordant and ENU (right-hand-rule).

If these suggestions help you, please mark my answer as "Best Answer" by clicking on the "Select as Best" button, this can be helpful for Community users to find this solution faster :)

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Rstua.1
Senior

I noticed you asked for True North.  If all you wanted was Magnetic North, you have your answers.

But for True North, you will need to remove the Magnetic Declination for the position you are taking the Magnetic North reading at. 

In short, you will need the latitude and longitude of where the reading is being taken.  Using that you will need to calculate the Magnetic Declination and subtract that from your Magnetic North reading to get True North.

Magnetic Declination varies around the world and varies over time.  For example, the recent Magnetic Declination around Sao Paulo, Brazil is about -23 degrees.