Using the MAGFit tool to do post-dive compass calibration

I stumbled across this very nifty ArduPilot MAGFit tool that will take a BIN (dataflash log) file and do post-dive compass calibration. There is a nice write-up and video here: New MAGFit compass calibration WebTool - Blog - ArduPilot Discourse

I ran this tool on a dive log and it calculated new compass calibrations which appear to be MUCH better than the existing calibration. Here is a chart showing the mean field error for the original and proposed calibrations (lower is better):

The calibrations across the bottom:

  • existing calibration (by far the worst)
  • adjust offsets
  • adjust offsets and scale
  • adjust offsets and compensate for motors (tied for best)
  • adjust offsets and scale and compensate for motors (tied for best)

I look forward to diving with these new parameter settings.

Caveat: the requires GPS information in the BIN file.

Has anybody tried this tool and had anything to report?



Hi @clyde

Yes, that is great, I’ve been recommending a log calibration for people with yaw drift issues.

Btw, I have a simpler implementation of it in

This one allows inputting lat/lon manually if the log doesn’t have GPS =]



I’m seeing different calculations when I enable motor comp. I wonder how much that helps? We shall see…

1 Like