Error: Large change in Mag_Field

hi guys

I’m collecting an infinite number of crashes. Fortunately, all this happens at 2/3 meters above sea level so they are never destructive but it is not beautiful :slight_smile:

I state that I use HERELINK + PixHawk Cube 2.1 with QGC last formware (the one that includes Solex)

some things emerge from the self-analysis but at the moment what worries me most is to solve this error message:

  • Test: Compass = FAIL - Large change in mag_field (54.61%)

It must be said that the compass calibration was accurate and performed in the open field (countryside) away from EM and RF sources (and I assure you that the flight field is not built on a landfill of radioactive elements or on the usual Indian cemetery typical of films horror) :smiley:

I don’t know how to get the compass back into the correct parameters
(NOTE: I use 3 compasses, 2 of which internal 1 external … GPS with> 15 sat + 1.1 HDOP value)

do you have any info about it? thank you

(Obviously before asking for help I brushed all posts but I found many interventions all interesting but sometimes conflicting with each other)

is normally because of power wires/current affecting the mag.

thanks Michael

I suspected. Using Herelink, I have the Air Unit 1 cm away from the PixHawk Cube and probably, despite the excellent shielding of the aluminum Air Unit, it could cause some RF problems; also because this system is given for 20 km so I think that even around 25mW (EU standard) it can cause some spurious

Now I export the Air Unit as much as possible, then I will write something shortly

Thanks again

Hi Michael

I now return from some test flights and after moving the Herelink Air Unit under the center plate, it is now about 10 cm from the Cube and with sufficient carbon as a separation (at least 2 plates)

The system in flight has performed well and we also say that today I have not made any holes in the ground :slight_smile:

However the “mag” problem has not been solved (as evidenced by the log that I have downloaded at the moment)

FAIL - Large change in mag_field (62.23%)
Max mag field length (585.01)> recommended (550.00)

But when I had the Air Unit near the Cube, warning messages continued to arrive while now I only have 3 warnings at take-off and then another 3 normalization messages … here they are

(in red)
WARNING - EKF2 IMU1 ground mag anomaly, yaw re-aligned
WARNING - EKF2 IMU0 ground mag anomaly, yaw re-aligned
WARNING - EKF2 IMU2 ground mag anomaly, yaw re-aligned

(in black)
EKF2 IMU1 tilt alignment complete
EKF2 IMU0 tilt alignment complete
EKF2 IMU2 tilt alignment complete

this only happens in the seconds following take-off and then no more problems and no anomaly notification in at least 8 flights of 5/10 minutes each

The usual toilet effect but I’ll work on that later

Is there anything I can do to fix this annoyance?

thanks for your interest

Put a .bin log file on some filesharing site and post the link here so we can check it

given you are most likely running an external mag, i dont think the air unit is the issue. it will be motor wires or battery wires. a log would be nice as well yes.

thanks Michael and xfacta for this divine help :smiley:

Today I still made flights and the toilet effect does not end and the 3 warning messages followed by the 3 normalization messages are still evident
The system flies even if not well … sending forward, it goes right … the compass is hyper calibrated and perfectly in line with the bow, however the most annoying problem is that at the end of any Pitch / Roll translation, after releasing the stick there, he does not apply the brake immediately but always makes a circle to find the position … then he stops hovering … then to trivialize, moving forward with the stick and releasing it, he draws a “P”. …sympathy :smiley:

if you don’t mind taking a look at the .bin, I’ll put it in the link below


In conclusion, for the frame, I can say that the Cube is mounted perfectly above the center plate in the center (therefore center of gravity) … in the wafer that forms the bottom plate and upper plate there is the DB … so the Cube is exactly a few centimeters above the DB but with 3mm carbon … in this configuration I have never had problems but it is also towards which I only recently completely converted to the PixHawk system (I come from experiences with DJI … never again !! )

Thanks again :wink:

That link doesnt seem to work

thanks Xfacta for noticing me … I corrected it … however I propose it again here (entering the site, the download is at the bottom right)


What size props have you got? and what is the size (wheelbase) and takeoff weight of the whole aircraft?

First up recalibrate the compasses if you haven’t already: set the craft up outside, well up off the ground if you can like on a wooden table, no magnetic interference and good GPS signal. Wait a while for IMU heat to stabilise and ensure you’ve got a good 3D fix - then run the Compass calibration.

For the Compass issues you could try disabling Compass1 and 2 and just leave Compass 3 (external) as active, but I probably wouldn’t.Compasses look surprisingly consistent in that log. It’s probably best to try the Compass/Motor calibration again - You need to set up current monitoring before you do that.

There’s some other issues though.
Definitely set these correctly even if you have to do a more thorough voltage calbiration:
These were very wrong:

If you have conventional ESC’s that allow for calibration then set these:
Usually you only set them for ESCs that work with a specific PWM range and cant be calibrated.

Seems to be some oscillation in the motor outputs, although pitch and roll are tracking desired very well. PIDs are high, were they derived from Autotune? or manually set?
You could try these and see if stability smooths out a bit:

After all that do another test flight and post another log.
Remeber to tell us some more details about the aircraft too.

Hi Shawn

I’m really impressed with your availability and I’m really grateful to you. This is truly a beautiful environment where you can grow thanks to people like you

The configuration is a quadcopter with 900 wheelbase and 16 "propellers and 5.4 pitch (the T-Motor) and about 4.3 Kg without payload (with gimbal and sensors, 6,3Kg)

As for the compass I anticipated your advice and I disabled 1 and 2 leaving only the external 3 of Here v2 GNSS and it’s all much more drivable.
On subsequent flights, using only the external compass, it goes straight and has no particular deviations; we can say that it has changed enormously compared to before.
I had performed the Compass / Motor calibration test and the value was around 30% which seems to me to be normal

But I also thank you for providing me with additional information that for some reason I had left out. Strange the value of 19.8V that frankly I have never entered; the maximum voltage, having 2 10,000mA batteries in 6S-1P is 25.2V but the limit set for the warning is 22.1V and Critical is 21.6V so I don’t understand where the value of 19,8V can be reported
To tell the truth I recently got closer to the PixHawk world so I have not yet developed a great knowledge of all the Mavlink instructions so I rarely go to modify the instructions and I rely only on the graphic part; however this is very interesting

As for the ESCs they are programmable and they are FullPower from 40A … however during the first adjustments they seemed unbalanced but from some flight, after having calibrated them (again), the auto-analysis shows me regular (GOOD) and with imbalance within The standard; I don’t know if this should still involve some action on my part

As for PIDs, they were initially derived from Autotune but then slightly modified; however it is still a temporary calibration but I will try to insert and modify as recommended by you.

One thing I don’t understand is related to the behavior before the Brake … I try to explain myself … when I perform for example a pitch / roll movement, I expect that immediately after the release of the stick, the Quad applies the brake compensating immediately; unfortunately I have a very annoying delay on the brake in the sense that after releasing the stick, the Quad applies the brake after about 1 or 1.5 seconds. So this thing causes a further unwanted travel and at the expense of precision (sevo compensate by hand at the end of each movement)
I don’t know the parameter (if any) to make the brake intervene faster by reducing or canceling this delay between stick and brake release

Thanks again a lot for the info and advice