Why magfit's output result is out of parameter range?

I have met a compass issue here

And magfit gave a result out of parameter range, is there any way to configure to do a re-calculation?

As I can’t simply apply those out of range parameters to copter.

Help needed to guide me toward correct way to get magfit work.

EDIT: bin LOG Ardupilot 4.5.6 Mark4 + Acro + Compass Alignment.zip - Google Drive

Tried quite a lot of times (more than 8 flight log, no of them in calibration range), but it still out of range.

Any idea?

Out-of-range, for which calibration method? MagFit has 6 different methods. Please post all the details.

1 Like

Obtained identical results after restricting the log range to flight only.

COMPASS_OFS_X,576.1431
COMPASS_OFS_Y,68.25815
COMPASS_OFS_Z,-157.44572
COMPASS_DIA_X,1
COMPASS_DIA_Y,1
COMPASS_DIA_Z,1
COMPASS_ODI_X,0
COMPASS_ODI_Y,0
COMPASS_ODI_Z,0
COMPASS_MOT_X,0
COMPASS_MOT_Y,0
COMPASS_MOT_Z,0
COMPASS_SCALE,1
COMPASS_ORIENT,4
COMPASS_MOTCT,0

X offset is quite big what means you have a strong magnetic field around.
Try to rotate compass or even relocate it then MagFot it again. Or just buy next 2$ external module.
Is it the only one and external compass?

Don’t know details about six method. All the info is from ArduPilot WebTools — Dev documentation and ArduPilot MAGFit

Just fly the copter and do circles, upload bin to web page, then come out the result, which used to be in range. But I have changing some hardwares and quite a long time from the first calibration.

Recently, those logs fly as the first time. The result from web tool is out of range.

@amilcarlucas Any specific steps or info about 6 different methods?

@Paul_Paku It’s BN880 GPS module. Compass is inside the module.

Here is how I mount the GPS. And the wire(for OpenIPC power) I have cut short, but there is no effect.

BTW, if I didn’t connect(power up) OpenIPC(Camera), the compass calibration result is still out of range.
Really confused, as there is no other difference in hardware.

If I got it correctly the MAGFit results are the offsets from your last calibration.
What influence magnetometer too are other field sources and direction.

Your mag is close to the GPS, which is not ideal. It is better to keep them separated.
Could be your calibration went not so good, as well
And it seems direction is not ideal as well.

Correct any of 3 above, calibrate again, test flight then MAGFit.

I’m not an expert on compass in AP :slight_smile: You may ask others here.

These are the six methods:

  1. No motor comp Offsets
  2. Offsets and scale
  3. Offsets and iron
  4. Battery 1 current Offsets
  5. Offsets and scale
  6. Offsets and iron

They are clearly visible on the webtool

1 Like

Again, most tools are clear for few.

1 Like

Ah, I see :slight_smile:

But I still don’t have clear idea about what detailed info of each methods. Is there any link available for me to read?

Hover the mouse over the ? and you’ll get some information. In really simple terms, look at the orange graph that is right above the parameters. Pick the option with the best (lowest) results.

On this quad I see there is no current monitoring because it isn’t giving you option for “Battery Current”, therefor the COMPASS_MOTx values. Too bad because I find that is often the best result for compass calibration.

1 Like

ArduPilot MAGFit WebTool demo

Video helps, a little.

1 Like

My compasses are not better :slight_smile:

I do not get it …
Offsets are quite big while here it is shown they will change nothing:

Have you flown a figure 8 automated by the lua script that AMC automatically uploads?

Sure not. What is AMC?
I have disabled LUA scripts as I’m not going to use it, it crashed the board few times while enabled, and they are using about 500kB mem, btw.
File used here was from “dancing” with copter around.

@lida2003
I loaded MAGFit results using Mission Planner. Answering YES to the question if I’m sure. What can I say is direction shown with HUD is better by about 20 deg and shows true magnetic North.

So it works somehow even the numbers are out of scale.

Another question is whether it is a matter of MAGFit or if Declination Correction alone would suffice.

And here find a poor-man explanation for 3 types of corrections available:

  • Offsets: Tweaks the basic X, Y, Z offset numbers (COMPASS_OFS_X/Y/Z) to fix simple magnetic pull in your drone, assuming everything lines up nicely and scales evenly—like a quick fix for minor magnet mess from your frame or motors.

  • Offsets and Scale: Adjusts the X, Y, Z offsets and adds a single tweak (COMPASS_SCALE) to balance out how sensitive your compass is overall, still assuming the axes are straight, but handling uneven magnet strength across your drone.

  • Offsets and Iron: Goes all-out by fixing X, Y, Z offsets, plus fine-tuning diagonal (COMPASS_DIA_X/Y/Z) and cross-axis (COMPASS_ODI_X/Y/Z) adjustments to handle tricky magnetic wobbles from non-straight axes or weird metal parts in your drone, giving the best accuracy for complex setups.

So I run MAGFit like that:

One more, fly, dance or whatever with your drone to get “Coverage” marker as long as possible. It’s important that MAGFit has a significant amount of data.

Do not check all 3 methods, just check the best one.

It doesn’t matter at all. Last clicked will be used for file. I read it somewhere, but it was not clearly stated as usual. No, it was in the video to which I provided the link above.

MagFit’s Logic: MagFit analyzes your flight log to determine the best calibration based on the quality and coverage of the data. When you enable all three options, MagFit prioritizes the most detailed and accurate calibration it can compute, which is Offsets and Iron.

Coluld be it’s not worth to use all three as the difference is so small, so better to leave zeros in fields for faster calculations.

@Paul_Paku The video helps a lot, as it explains how to see those curves.

Followed video I realized something that I have missed, and I know why the copter behave strange: "EKF3 IMU1 MAG0 IN-FLIGHT YAW ALIGNMENT" makes auto yaw when takeoff - #14 by lida2003

I will test it soon, but it’s definitely wrong of orientation(Apparently, I have forgot how to mount previously and use that configuration directly). Just see those x-y-z shape, which is wrong.

  • flight data from previous calibration

  • Recently calibration

As I know orientation is not so important as it’s corrected while calibrating. Just keep at least 45 deg angels, 90 are better.
I spent some time verifying my orientations and discovered that it is unsolvable.:slight_smile:
It’s shown as Y180 what is not a true. Same as your’s.

Compass possition - ArduCopter / Copter 4.6 - ArduPilot Discourse