2023-05-29 06:00 AM - edited 2023-11-20 04:25 AM
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.
Solved! Go to Solution.
2023-06-01 12:11 AM
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 :)
2023-06-01 12:11 AM
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 :)
2023-08-22 09:37 AM - edited 2023-08-22 09:38 AM
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.