External Compass Questions

Hi guys,

I have an external HMC5883L compass attached to Navio 2 (https://www.amazon.de/gp/product/B0151G64RU/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1).

The compass is connected through I2C, frequency is set to 400 KHz, APM and Mission Planner can recognize the device. However, APM recognizes it as COMPASS 3, not COMPASS 1 as it should (it is written everywhere that the external compass becomes COMPASS 1 when connected).

After connecting the external compass Mission Planner automatically ticked “externally mounted” for COMPASS 3. Also, after onboard calibration the offsets for first two compasses didn’t change much, and the third one got very low offsets.

Moreover, comparison of magnetic field and throttle curves shows that COMPASS 3 readings are not distorted by the throttle, which I guess indicates low magnetic interference.

So the question is why? Shouldn’t the external compass be COMPASS 1? I blindly believed it was true… and it cost me many hours of pain.

Another question is external compass orientation. It is mounted with X axis pointing to the front. But I figured that the direction was always 90 degrees off from what internal compasses would show. It was triggering “Inconsistent Compasses” error. So I changed the orientation to YAW_90. With these settings there is no more “Inconsistent Compasses” error and “Loiter” mode is stable, which wasn’t the case with other settings. What could be the reason? Is this particular HMC5883L faulty?

I am using RP2, Navio2, APM Copter 3.4, Mission Planner 1.3.41.

Would be very nice to know what’s going on here :slight_smile: Thank you.

Hello Evgeny,

Sorry it took us so long to reply.

This is an implementation detail that shouldn’t really be depended on. AFAIR, external compasses have been set as COMPASS 3 for quite some time.

I don’t think it’s faulty. The values that are getting read look OK. Have you recalibrated the compass after changing orientation? It’s an essential step (we’ll update the docs). After everything’s calibrated, all three compasses should report very similar readings in logs.

Hello George,

Thanks for the feedback.

I see. Nevertheless, even the latest version of MP says that it should be COMPASS 1. This is a little confusing.

As you suggested, I have re-calibrated the compass after changing the orientation and my copter has become much more stable. Before I had issues with compass EKF going to the red zone when rotating the quad (changing YAW direction). Now it is gone! Thanks!

Though, I wonder why the arrows on my external compass are drawn that way. Should one trust these arrows in general or the orientation has to be determined experimentally?

Sure, but historically a lot of accessories has depended on Pixhawk and APM2 as default boards which had had some workarounds and hacks in the codebase. As a result it’s become a little more tedious for other vendors to support compasses. Fast forward to today: unfortunately one needs to understand one might need some time to set right rotation.

I’m sorry but I’m not following. Could you please make a screenshot?

I mean the line “Compass 1 = External if present / else internal”.

It is not such a big deal, but some people might be confused about it.

We contacted the MP dev team and asked to get rid off it. Thanks for noticing!

1 Like