Stopping Compass mid-flight

Hello,

2 weeks ago our 5 multicopters (voxl2 w/ m10 mro GPS/MAG) were working without fail. This week all 5 will stop listening to the compass mid flight. This results in a position hold that is not accurate, and eventual crash.

2 weeks ago the weather was warmer outside, but the temp is still above the -40 C that is specified on the GPS and MAG sensors.

Things we have tried

  • Calibrated the mags in the cold
  • Swapped out the mags/gps to make sure they werent damaged.

We are at a loss as to why the heading is just lost mid-flight.

Here are some of the logs from when this error occurs

Flew into a tree during mission mode: https://review.px4.io/plot_app?log=11645d56-3353-47cc-9a59-e64324ff9c17

This one was a flyaway in position mode, we took manual control of it:
https://review.px4.io/plot_app?log=ceab0f87-4d12-491a-bb8a-13d192170dad

This is what the flight is SUPPOSED to look like: https://review.px4.io/plot_app?log=ff1d9d17-5ba5-4647-b4a3-29ca98817d1d

Any insight would be great. Thank you!

I can see that PX4 does register a mag fault. I am just unsure exactly why. These drones were flying fine for the last year and now all of them are having issues

@Benja pointed out that mag_test_ratio increases over time

We are thinking this might be more of an IMU issue than a compass heading issue