Combining magnetometer and IMU for better absolute heading estimation

Hi,

The magnetometer outputs very jaggy measurements. I want to fuse the information from the magnetometer and the IMU yaw angle via a Kalman filter. If I wanted to do that, I would take the gyro info and insert that into a Kalman filter where I also input the magnetometer measurements.

Just wanted to ask whether this makes sense from your perspective or whether you’d recommend something else. Ideally, I want to have very precise absolute heading predictions.

Thanks!

Hi @C-der-Baum
what you describe is the standard approach for absolute YAW estimation when you have a correctly calibrated magnetometer.
You have two different ways to take it:

  1. use the direct magnetometer reading for getting absolute Earth-referred YAW data (note that this is the magnetic North, not the True North)
  2. use the magnetometer differentially, so the YAW increment step-by-step.

You can find many useful papers online facing this kind of sensor fusion.

Thanks for your reply!

How would I use the magnetometer differentially? I thought, I would take the gyro data (the rate of angular change) as my underlying physical model of how I rotate around yaw/z-axis and take as additional sensor input the magnetometer. Is that what you mean?
By chance, could you refer me to any paper I could read on that?

In any way, thanks!

By “differentially” I mean using the incremental steps from a time T(k) and a time T(k+1), instead of using directly the read value.
It’s one of the possible approaches.

1 Like

Very late replay, but a few observations:

  1. The heading directly from the zed API (eg sens_data.magnetometer.magnetic_heading) is very noisy. I’m not sure why.
    image
  2. I had much more success using the uncalibrated magnetic field data, applying a simple hard iron calibration (see Magnetometer calibration issue on large robot - #4 by thandal), which gives a much more sane result:
    image