Primary compass not found, mag inconsistent ! Pixhawk 4

#1

Hello everyone !
I am getting “primary compass not found or mag inconsistent error by QGC”. It gets solved after I do the compass calibration especially via USB. However every time I connect my battery and do some bench testing I have to perform this step. Please can someone guide me regarding this !
Thank you !

#2

Which version are you using? Can you try if this still happens with latest master?

#3

I use stable 1.8.1. Yes I will try with latest master

#4

I bet I am not the only person curious about this. @Vrinda if you have the time, could you please post your experience moving from 1.8.1 and head of master? Do you find that this behavior improves?

#5

Does it mean that if you do the calibration with the battery only, the issue remains after calibration?
Do you reboot the drone after mag calibration?

#6

Yes with battery the issue remains. Yes I do reboot !

#7

@langrind , I will keep you posted :slight_smile:

#8

Update: So currently, once I started flying the drone, it does not give me the error. Thus am sticking to stable 1.8.1

#9

What type is your external compass? Usually you get this error when there is something wrong with the connection to the external compass.

In the Mavlink console you can type

sensors status

And see if you have the expected external compass with priority 255.

Or type

listener sensor_mag 

And ensure that first magnetometer shows “true” for is_external

As for the “mags inconsistent” we run into that a lot. It means the difference between all the external and internal magnetometers is greater than a set value. You can increase this value (COM_ARM_MAG) from 0.15 to something higher (0.20) and see if you aircraft still flies ok.

Also, make sure you do you calibration away from any possible magnetic interference - DC power sources (maybe your USB cable) or ferrous objects (car frame or engine block). I try to get 2.5-3 turns in for each step of calibration. DC power cables on your aircraft can also interfere with magnetometers since they can induce a magnetic field.

1 Like
#10

Thank you very much @dlwalter ! I will do as you suggested and keep you posted.