MAG 2 SELFTEST FAILED - Pixhawk 3 Pro

#1

Hello.

I am using the new Pixhawk 3 Pro flight controller PX4 firmware.
After flashing and configuration and calibration QGC shows the following error:
Critical: PREFLIGHT FAIL: MAG 2 SELFTEST FAILED
No matter how many times and where I calibrate it.
I am attaching the CAL_ parameters I’ve got.

#2

I’m facing the same issue with the stable version of PX4 and Pixhawk 3 Pro.
The selftest failed error shows on one of the internal magnetometer only if I calibrate the system with an external ublox compass/gps module attached on the GPS port.
If I perform the complete calibration on the board alone, the system seems to work properly.

I’m still looking for the root cause and a solution to the problem.

#3

Hi,
I have the same issue with Pixhawk 3 PRO.
You are resolved? A question: but you calibrate system without del GPS module and then you connect it at flight controller (Pixhawk 3 Pro)?
In my case If I try to start the motors when the “flight controller” status is “Ready, no GPS” (blue blinking) everything is ok. In this case, the state passes, rightly to “Armed no GPS” (Blud solid). The problem arises when the status of the flight controller changes to “Ready, GPS lock” (Green blinking). From this moment the engines can no longer be started (armed). Why? The moment I try to arm the motors, I get an error (Red Blinking) with error “PREFLIGHT CHEK MAG2 FAILED”.
The calibration took place with Flight Controller connected to the “external” GPS-COMPASS.

I would be grateful if you could help me in this regard? Could it depend on the external GPS-COMPASS?

Thank you so much!

#4

I only use the Pixhawk 1 and unless you need multiple compasses; but when I have a GPS with a built-in compass, I disable CAL_MAG1_EN (and CAL_MAG2_EN in your case). Recalibrate as needed.

Good luck.

#5

Hi @rollys
I had this idea too. But I do not understand. In my case I can’t find the CAL_MAG2_EN property and I can’t disable it.
What do you think about it?
Hear there is a part of log:
https://review.px4.io/plot_app?log=68e0592d-20f5-43c5-91fc-80ed99f63053
I thank you for your kindness.

#6
  • What version firmware are you using?
  • Maybe try changing CAL_MAG2_ID, 329482 to 0 ?
  • You can always try reloading the stack with Master/Dev version the before calibrating, go to
  • Parameters and make sure only CAL_MAG0_EN is Enabled

Good luck.

#7

Hi @rollys,
my version firmware is 1.8.2
I have attempted to set CAL_MAG2_ID to 0… But nothing is changed.
I’m sorry, what do you mean exactly with: “You can always try reloading the stack with Master/Dev version the before calibrating”.

CAL_MAG_EN is enabled with interna mag, if I remember correctly.

Thank you very much for your kindless.

#8
  • Open QGroundControl
  • Click the Firmware tab
  • Click Advanced settings
  • Click Developer Build (master) in the drop-down menu then click OK.
  • When it comes up, click on the Parameters tab
  • Type CAL_MAG and disable MAG1 and 2.
  • Powercycle then go through your sensor calibrations.

Good luck

#9

Hi @rollys,
You are kind of helping me. At this moment, before doing what you have suggested to me, I’ve tried to reset all parameters and repeat all calibrations. Calibration was completed, even if during compass calibration I’ve obtained a warning of large offset for mag. Anyway, at this moment I am always able to arm the motors, but I still get “MAG 2 SELF TEST FAILURE” … What do you suggest? Could I try to test a flight or I should to follow your suggestion and install dev firmware (assuming the risk to not be able to arm motors anymore?).
Anyway, still thank you for your support.

#10

Personally, I would not attempt any flight until it’s resolved. Large offset warning will happen when there’s more than one compass/magnetometer installed. If and when you decide to reload the firmware, just confirm you see it loading px4fmu-v4_default.px4, which is what I understand to be the compatible version for this Pro 3.

Good luck.

#11

Hello @rollys ,
OK, I agree with you. We are talking about vehicles that fly, and any anomaly requires us to stay on the ground.
Only thing, I apologize, but I’m still not an expert on this platform, as I can be sure to install that firmware version. Do I have to download it? However, then on what environment should I perform compile? I suppose it has to be compiled with a target compiler for the architecture of the flight controller microcontroller. Or the one I download is a binary version that I can upload via QGroundControl? However, how do I do it?
Sorry for the many questions.

Thank you so much, really!

#12

Just follow the firmware upgrade procedure. During the upgrade, you’ll see what version is being uploaded, i.e. “http://px4-travis.s3.amazonaws.com/Firmware/master/px4fmu-v4_default.px4

#13

i had this message yesterday after calibrating a fixed-wing pixhack v5 setup (internal mag and external mag/gps). the qgroundcontrol artificial horizon and compass were frozen - not reading.
.
the cal was done with a usb (not wireless), so the FC was powered from the usb. somewhere in the process i also powered the FW main battery power (cant recall when). anyways, i unplugged the usb and cycled the main aircraft battery, i think i included the airspeed sensor to make sure all was ok, and the mag sensor error went away. the qgroundcontrol instruments began working.
.
may be completely coincidental to your problem, but there it is for your consideration.

#14

Hi @rollys.
Thank you,
I had some commitments. These days I proceed as you recommended.
Again my thanks.
I keep you updated.

#15

Hi @1Gump,
I do not know. I tried all the combinations a bit. In these days I will resume working on it and understanding better. Will update.
I also thank you for your contribution.
Very kind.

#16

Hello guys,
I am suffering with the same issue. Were you able to fix it? Do you think that disabling the other two magnetometers is safe for flying?

Thank you

#17

In my opinion disabling magnetometers is not the correct way to fix it. It is just a workaround and could be safe critical for flying.
Last PX4 firmware (1.9.0 RC1) seems to fix at least my issue, give it a try.
If you are not familiar with release candidate versions just wait a few days, PX4 team is going to release the 1.9.0 stable version soon.