3

I implemented a tilt-compensated compass using an NXP semiconductor app note link: App Note and hard iron calibration algorithm using Article. I am using LIS3MDL magnetometer chip in my design.

I also have Honeywell HMR3300 and HMC6343 compass modules that I have been using. Since I don't have the proper equipment to test the performance of my design, my design goal was to create a compass that can match the performance of the Honeywell compasses as much as possible. In some locations, my compass performs flawlessly every time it is calibrated.

My issue is this: depending on where the calibration and the test are being done, my compass performs really poorly while the Honeywell compasses perform pretty decently. It's difficult to think that my magnetometer chip is sensing the magnetic field differently from how the Honeywell compasses do, and I am wondering what the issue here could be. I was wondering if anyone has observed anything like this before and was able to debug troubleshoot the problem.

  • I would try this: go to a spot where the device performs poorly, then take one of your honeywell devices and move it as close as it can get to your board and see if its output is affected. – John Birckhead May 11 '23 at 23:08
  • This is hardly an Apples/Apples comparison ($10 part vs. $700 module). But you've got my ear as I'm trying the same. I'm really tempted to provide an answer but it will be incomplete and would have to be edited/developed as new issues come to light. Regardless, are you using a complete soft iron 3 by 3 matrix or are you using [Kris Winer's, er, "scale biases"](https://github.com/kriswiner/MPU6050/wiki/Simple-and-Effective-Magnetometer-Calibration)? – st2000 Jun 03 '23 at 14:22
  • @st2000 I am Kris Winer's method, but I am not implementing the soft iron calibration as it's hard to get the full 3D rotation in my application! So just the hard iron offset is all I am implementing. – HumbleBumble Jun 06 '23 at 21:55
  • So, it is my understanding that Kirs' method assumes all 3 magnetometer sensors are perfectly orthogonal. That when X is pointed at magnetic north, Y and Z should read zero Gauss. Nothing's perfect so the MotionMC software that STMicro uses with their LSMx magnetometers derives a 3by3 soft iron correction matrix. True, the 3 diagonal values are close to 1 (this is essentially Kris' values) and all of the other 6 values are close to zero. – st2000 Jun 06 '23 at 22:43
  • "I am not implementing the soft iron calibration..." I would then strongly recommend you calibrate that particular LSM3 before you install it. Find the soft and hard iron calibration values then install your device. You don't have to perform a "figure 8" calibration. Just make sure you point each magnetometer (X, Y and Z) directly at and directly away from magnetic north. Which might actually be down into the earth depending on how far north you are. Just how did Kris' software tell if you are out of calibration??!? I'll have to take a 2nd look at his github project. – st2000 Jun 06 '23 at 22:47

0 Answers0