# Compass inconsistent

**URL:** <https://discuss.px4.io/t/compass-inconsistent/11827>\
**Category:** Flight Testing & Log Analysis\
**Created:** [July 7, 2019, 1:39pm UTC](https://discuss.px4.io/t/compass-inconsistent/11827 "2019-07-07T13:39:12Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![fabien102](https://discuss.px4.io/letter_avatar_proxy/v4/letter/f/22d042/32.png) [@fabien102](https://discuss.px4.io/u/fabien102)\
**Post date:** [July 7, 2019, 1:39pm UTC](https://discuss.px4.io/t/compass-inconsistent/11827/1 "2019-07-07T13:39:12Z")

</div>

Hello,

I am using a Pixhawk Cube and I have some problems to arm my vehicule.  
The error message is “preflight failed compass inconsistent” or “accel inconsistent - check cal” or " Primary compass not found".  
I redo the calibration several time with only the USB link and the GPS Here 2 Combo connected. There is no magnetic interference when I do calibration because my battery is far from the pixhawk  
Sometimes it woks for a while but the problem reappears.

How can I solve this problem ?

Is there a way to disable compass from preflight check ?

I tried to disable the parameter CAL\_MAG1\_EN (and other number) but it did not change anything.

Thank you

---

<div class="post-metadata">

**Author:** ![Dorine\_Chakhtoura](https://discuss.px4.io/user_avatar/discuss.px4.io/dorine_chakhtoura/32/4147_2.png) [@Dorine\_Chakhtoura](https://discuss.px4.io/u/Dorine_Chakhtoura)\
**Post date:** [July 7, 2019, 1:58pm UTC](https://discuss.px4.io/t/compass-inconsistent/11827/2 "2019-07-07T13:58:32Z")

</div>

I’m having the same problem here regarding the inconsistency

---

<div class="post-metadata">

**Author:** ![Dave84](https://discuss.px4.io/user_avatar/discuss.px4.io/dave84/32/10033_2.png) [@Dave84](https://discuss.px4.io/u/Dave84)\
**Post date:** [July 7, 2019, 2:32pm UTC](https://discuss.px4.io/t/compass-inconsistent/11827/3 "2019-07-07T14:32:24Z")

</div>

Good day, just check which compass is external and internal, you can check it with mag listener using the nsh console

---

<div class="post-metadata">

**Author:** ![fabien102](https://discuss.px4.io/letter_avatar_proxy/v4/letter/f/22d042/32.png) [@fabien102](https://discuss.px4.io/u/fabien102)\
**Post date:** [July 7, 2019, 3:26pm UTC](https://discuss.px4.io/t/compass-inconsistent/11827/4 "2019-07-07T15:26:24Z")

</div>

![listener%20mag](https://discuss.px4.io/uploads/default/original/2X/9/90ef7c8cb99d7da91ae1fb8a216096dcc886bd73.png)

When I do the command “ls /obj”. I have sensor\_mag0; sensor\_mag1 and sensor\_mag2.

I don’t see any compass which is external (see photo attached) . But I can see only one instance (0) for the three magnetometers. I don’t know how to listen another topic as the command “listener sensor\_mag2” did not match any known topics

---

<div class="post-metadata">

**Author:** ![Dave84](https://discuss.px4.io/user_avatar/discuss.px4.io/dave84/32/10033_2.png) [@Dave84](https://discuss.px4.io/u/Dave84)\
**Post date:** [July 7, 2019, 3:37pm UTC](https://discuss.px4.io/t/compass-inconsistent/11827/5 "2019-07-07T15:37:49Z")

</div>

Just try install the firmware 1.9.0

---

<div class="post-metadata">

**Author:** ![fabien102](https://discuss.px4.io/letter_avatar_proxy/v4/letter/f/22d042/32.png) [@fabien102](https://discuss.px4.io/u/fabien102)\
**Post date:** [July 7, 2019, 3:42pm UTC](https://discuss.px4.io/t/compass-inconsistent/11827/6 "2019-07-07T15:42:43Z")

</div>

I use the GPS Here 2 Combo

> **[The Cube & Here 2 Combo (Black & Standard Carrier Board) - Pixhawk2](http://www.proficnc.com/all-products/156-gps-module.html)**
>
> Here 2
> 1.New Smart Chip2.Fast Switch to CAN Mode3.More Units, More Powerful4.Colorful LED, More choices5.Small Change, Big Role

---

<div class="post-metadata">

**Author:** ![fabien102](https://discuss.px4.io/letter_avatar_proxy/v4/letter/f/22d042/32.png) [@fabien102](https://discuss.px4.io/u/fabien102)\
**Post date:** [July 7, 2019, 4:21pm UTC](https://discuss.px4.io/t/compass-inconsistent/11827/7 "2019-07-07T16:21:19Z")

</div>

I upload the firmware 1.9.1 the stable release and the problem still persist.

At the end, I want to upload a custom firmware but this one does not work also…

---

<div class="post-metadata">

**Author:** ![Dave84](https://discuss.px4.io/user_avatar/discuss.px4.io/dave84/32/10033_2.png) [@Dave84](https://discuss.px4.io/u/Dave84)\
**Post date:** [July 7, 2019, 4:24pm UTC](https://discuss.px4.io/t/compass-inconsistent/11827/8 "2019-07-07T16:24:06Z")

</div>

Just try install ardupilot… maybe is more compatible.  
I will do a test with my cube and gps here and i will let you know

---

<div class="post-metadata">

**Author:** ![fabien102](https://discuss.px4.io/letter_avatar_proxy/v4/letter/f/22d042/32.png) [@fabien102](https://discuss.px4.io/u/fabien102)\
**Post date:** [July 7, 2019, 7:21pm UTC](https://discuss.px4.io/t/compass-inconsistent/11827/9 "2019-07-07T19:21:06Z")

</div>

Calibration on ardupilot is not really easy, I tried my best but still the same error ☹

When I look to the artificial horizontal it is completely tilted.

The error log is Critical : Prefligth Fail Compass 1 uncalibrated and Critical : Preflight Fail : Compzss Sensors inconsistent

---

<div class="post-metadata">

**Author:** ![Dave84](https://discuss.px4.io/user_avatar/discuss.px4.io/dave84/32/10033_2.png) [@Dave84](https://discuss.px4.io/u/Dave84)\
**Post date:** [July 8, 2019, 4:20am UTC](https://discuss.px4.io/t/compass-inconsistent/11827/10 "2019-07-08T04:20:39Z")

</div>

just send me pls a pic about the way you have installed your fc and gps module.

---

<div class="post-metadata">

**Author:** ![fabien102](https://discuss.px4.io/letter_avatar_proxy/v4/letter/f/22d042/32.png) [@fabien102](https://discuss.px4.io/u/fabien102)\
**Post date:** [July 8, 2019, 5:49am UTC](https://discuss.px4.io/t/compass-inconsistent/11827/11 "2019-07-08T05:49:59Z")

</div>

To calibrate I have only the pixhawk link to my PC with a micro USB-USB link. I tried to calibrate with QGC on linux, MAC or Windows.

I also tried to calibrate with the GPS plug on GPS 1 pin. I use scotch to fix it during calibration.

In my final setup I have a modem RFD 868+, a DC battery 36 V, some castle becs which are near the Pixhawk

 ![PIX](https://discuss.px4.io/uploads/default/original/2X/2/2b16c65a4e3cc88f10caf36420a441ab637d8cb2.jpeg)

---

<div class="post-metadata">

**Author:** ![fabien102](https://discuss.px4.io/letter_avatar_proxy/v4/letter/f/22d042/32.png) [@fabien102](https://discuss.px4.io/u/fabien102)\
**Post date:** [July 8, 2019, 6:15am UTC](https://discuss.px4.io/t/compass-inconsistent/11827/12 "2019-07-08T06:15:10Z")

</div>

When I upload the firmware it said found device PX4 FMU V2. I have an error before I can upload a firmware (I download the last version of QGC)

Should not be px4 fmu v3 ? for a pixhawk Cube ?  
Otherwise I used the command make px4\_fmu-v3\_default upload.

I also tried on another pixhawk with another GPS linked and same errors. The two pixhawks work well before yesterday. ![errorflash](https://discuss.px4.io/uploads/default/original/2X/e/ec3510c9d09bbb2287d85a273966b1bd52b09e7a.png)

---

<div class="post-metadata">

**Author:** ![Dave84](https://discuss.px4.io/user_avatar/discuss.px4.io/dave84/32/10033_2.png) [@Dave84](https://discuss.px4.io/u/Dave84)\
**Post date:** [July 9, 2019, 9:36am UTC](https://discuss.px4.io/t/compass-inconsistent/11827/13 "2019-07-09T09:36:18Z")

</div>

pixhawk cube use px4 fmu v3, you can install it using the option in QGC “custom firmware”, you can find the file in px4 firmware releases.  
Just in case you still have the same error, you have corrupted the bootloader with the previous installation, and for recover it you need a swd/jtag programmer

---

<div class="post-metadata">

**Author:** ![Dave84](https://discuss.px4.io/user_avatar/discuss.px4.io/dave84/32/10033_2.png) [@Dave84](https://discuss.px4.io/u/Dave84)\
**Post date:** [July 9, 2019, 9:39am UTC](https://discuss.px4.io/t/compass-inconsistent/11827/14 "2019-07-09T09:39:53Z")

</div>

For calibrate you fc and mags, better install the fc on a frame and the gps on a stand.

---

<div class="post-metadata">

**Author:** ![dlwalter](https://discuss.px4.io/user_avatar/discuss.px4.io/dlwalter/32/3011_2.png) [@dlwalter](https://discuss.px4.io/u/dlwalter)\
**Post date:** [July 9, 2019, 10:31pm UTC](https://discuss.px4.io/t/compass-inconsistent/11827/15 "2019-07-09T22:31:56Z")

</div>

Yes, you need to mount your external compass on the aircraft and ensure it is as far away as possible form all DC power lines. You also need to set your autopilot and external magnetometer orientation during the calibration. If they aren’t oriented the same they will show different measurements of the 3D magnetic field hence the “mags inconsistent”.

The “MAGS INCONSISTENT” warning means that the magnetic field measured by all the magnetometers (external and internal) are too far off from each other. You can change the threshold for this by adjusting the COM\_ARM\_MAG parameter.

Also, when you calibrate, make sure you are far away from any ferrous objects (engine blocks, fences, etc) and DC power lines.

---

<div class="post-metadata">

**Author:** ![dlwalter](https://discuss.px4.io/user_avatar/discuss.px4.io/dlwalter/32/3011_2.png) [@dlwalter](https://discuss.px4.io/u/dlwalter)\
**Post date:** [July 9, 2019, 10:44pm UTC](https://discuss.px4.io/t/compass-inconsistent/11827/16 "2019-07-09T22:44:16Z")

</div>

I would try the following command:

```
icm20948 info

```

And see if the driver for the external IMU is running.

```
icm20948 -X -M start

```

Will start the driver (external, magnetometer only) if it is not running. If it doesn’t find the device there may be a wiring issue.

This command gets run at startup here:

> <https://github.com/PX4/Firmware/blob/226f3c0999c2977b9f8b5ed0d0de8a74c3e98b0c/boards/px4/fmu-v3/init/rc.board_sensors#L64>

If you have access to the serial output you should see this command getting run at boot up.

---

<div class="post-metadata">

**Author:** ![Justhanging](https://discuss.px4.io/user_avatar/discuss.px4.io/justhanging/32/8197_2.png) [@Justhanging](https://discuss.px4.io/u/Justhanging)\
**Post date:** [November 19, 2021, 6:35pm UTC](https://discuss.px4.io/t/compass-inconsistent/11827/17 "2021-11-19T18:35:23Z")

</div>

> [@dlwalter](#):
>
> COM\_ARM\_MAG

Hi, I’m seeing the same problems with my FMUs, did COM\_ARM\_MAG work for you? I noticed that suggestion was in this thread.

---

<div class="post-metadata">

**Author:** ![dlwalter](https://discuss.px4.io/user_avatar/discuss.px4.io/dlwalter/32/3011_2.png) [@dlwalter](https://discuss.px4.io/u/dlwalter)\
**Post date:** [November 22, 2021, 7:05pm UTC](https://discuss.px4.io/t/compass-inconsistent/11827/18 "2021-11-22T19:05:51Z")

</div>

Yes, increasing COM\_ARM\_MAG works. Just be advised that you are allowing the aircraft to arm with a less trust worthy magnetometer reading. I would try small increases and go with the small value you can consistently arm with.
