3 compasses installed - problems starting compass calibration, enumeration - missing docs - [SOLVED]

I do need maximum precision.
And how does the enumeration with three compasses work?
Which one really is the internal one?
The table in the above link does not deal with a third compass and seems to leave this somewhat ambiguous.

Disconnect all the external compasses will show you the internal one (for the enumeration.) :slight_smile:

Judging by the table in the link, the enumeration seems to change, depending if an external compass is connected or not:

Configuration Compass #1 Compass #2
Pixhawk + Compass External Internal
Pixhawk (no external compass used) Internal Available

Isn’t there another way to firmly establish which compass is which?

Meanwhile I thought I could establish the distinct mapping of which compass is which by way of COMPASS_DEV_ID, but this seems to change depending on what is hooked up.

So I am still battling bad compass health and am grounded :confused:.

Could somebody please explain how to make the above setup with three compasses work reliably and repeatably? I can’t find this documented anywhere, and am not getting anywhere with trial and error.
Please let me know if any logs would be essential/ helpful in trouble shooting this.
Thank you.

disable the internal one, EKF will only use two first (external) anyway.
-make sure the orientation is correct for them.
if you are unable to calibrate them at the same time, it is most likely related to this:

Even if you calibrate them one at a time, they should work fine, just keep track on which calibration data belong to which…

Thanks Andre-K for pitching in.

I will then gladly stick with just the two external ones…
Trouble is, as I was trying to say in my posts above, I am at a loss how exactly to determine which compass is which one.

The enumeration apparently changes according to the table referenced above.

I just booted up PH again, and am now getting this:
But I seriously doubt that the offsets are correct (as I hadn’t been able to calibrate with all three compasses attached), and would need to know which one really is the internal one, in order to disable it.

According to the table in the above post, it appears that the same compass could

  • at one time (e.g. when the external ones are disconnected) be compass 1,
  • and when one external compass is connected, the internal one would become compass 2.

So what is the Here+ then? Compass 3?
And if I then disable the internal one, does the Here+ become Compass 2?

I am pretty confused on this and would be glad for some clear guidance to get to a solid, reliable and repeatable setup.

Having a serial number to firmly assign this with would help (The thought that the device ID could aid in determining it, did not seem to work.)

What would be a solid way to decipher which one is the internal compass?

Placing a magnet near your PixXXX will show incredible numbers compared to the two external ones :slight_smile:

Alright, that may help in identifying the internal one. I assume I would look at the live stats, find the one that is freaking out and disable that one.

But how would I go about calibrating the two external ones then, given that it doesn’t work to calibrate the compasses having all three connected at the same time?
I would want to ensure that whatever calibration I can acquire actually matches the correct compass.

as @henrik04 wrote, you can test, but a magnet is a huge overkill with potential risk of magnetizing something inside, just bring a screwdriver near.

I do not use that GUI (or mission planner) ., nor does it provide all the data you need to move a calibration with a device when DEV_ID changes.
you can easily read up on compass* in “arducopter parameter” documentation.
for each device, you would store/back up COMPASS_DIA* , COMPASS_ODI* and COMPASS_OFS* - at least before a compassmot, that could populate COMPASS_MOT*
so you could enable and calibrate second compass(now primary), then backup and COMPASS_DIA_Y (and all the others with no digit), do parameter backup , then enable and calibrate primary compass, and then, restore all previously saved params to second compass like:
it’s a easy job in a text editor.

Ok, will use something metallic then instead of a magnet to identify the internal compass.

For testing I have set up the display to show all values that seem relevant, like so:

The values kept on moving. So that when I approach a particular compass with a metallic pen, it is not clear which one is actually reacting…

I noticed that only the values in columns 2 and 3 were moving; the Here+ compass was not connected.
Yet if I connect both the Here and the Here+ NONE of the values are changing at all!
This seems odd, or better put - wrong…

The external compasses are mounted on a stand and 15cm apart from each other, with the internal one being mounted in between and lower.

I have read about the compass parameters in the ardupilot docs a few times, and am familiar with the parameter settings as such, and can read/ edit them in the parameter text file.

The enumeration continues to perplex me :confused::
Call me dense, but in thinking through the procedure you outlined, I am still not really grasping how to firmly identify which one of the two external compasses exactly will have which enumeration.
Only once knowing this I should be able to turn off the correct undesired compass and manually and correctly attribute calibration values (which I can acquire in a separate process while one of the external compasses is disconnected).

It would be great, if I could arrive at a trustworthy calibration soon so this project can move forward.

Could someone please try to outline this deductive process in more detail?

P.S.: The easiest of course would be, if the calibration procedure would work while all three compasses are connected…

1 Like

I can’t tell you specifically about the Here combo you want to use but…

Most I2C compass units on the market use the same compass chip … with the same I2C address. So you can’t use more than one externally because they have the same address on the I2C bus and they must have unique addresses.

Test your compass by looking at the data coming in via the mag parameters on the MIssion planner data display. The extra parameters are available on the hud by right clicking.

Thanks for the input.

The extra parameters are available on the hud by right clicking.

Do you mean the ones I have configured to display in the above screenshot, or are there other ones I should be looking at?

In the Here combo installation, I would assume I am not the only one using a “regular” Here compass, since it has the safety switch. And the combination with the Here+, for RTK functionality does not seem like an exotic setup either.

Would you know how to go about changing the I2C address? Maybe this takes care of the problem?

Most you can’t change the address…that’s the problem.
But troubleshoot by watching the data coming in with only one installed. Then install the second and see if the data stops. Install the second by itself and see if it works. If they both work but not together then they are probably on the same address.

BTW you can’t use the HUD display to check compass because if the compass are not working Ardupilot will estimate the direction from other sensors. So you must look at the mag data values.

Ok, that approach should allow me to establish if there are overlapping I2C adresses, thank you.

Which mag data exactly should I be looking at?

Still, it would seem odd, that the setup described would lead to such an adress conflict. Maybe Hex Aero could pitch in with first hand info?

1 Like


Or you are really confused or I don’t understand what you own. Let me put this clear.

Here+ rover GPS has an internal compass. ( You speak about another Here and say about 2 compasses??? Not all all!)
Pixhawk 2.1 has 2 internal compasses.

So, your compass inside here+ is primary compass and externally mounted. The other 2 are the internal inside Pixhawk 2.1 and OBVIOUSLY are NOT external. So deselect external there, that is wrong.

So, to summarize. From left to right. Here+ compass is 1 and external, internal is 2 and internal is 3.

Hope is all clear help you definitely.

Hello Javier,
thanks for pitching in.
Setting things as you suggest does not bring about the desired results, and I not sure that what you outline is correct, for the following reasons:

  1. The (regular) Here GNSS module per the specs I found has 2 redundant compass modules installed: 1x HMC5983 und 1x LIS3MDL
  2. The PH2 docs (Pixhawk-2_TechSpecs_2016-03.pdf) state that the PH2 has 2 combined modules installed, serving as Accelerometer, Gyroscope, Magnetometer
  3. The specs for the Here+ tell me that a MPU9250 is installed, providing Gyro + Accelerometer + Compass

So you are correct - I am thoroughly confused.
And I am still not flying nor can accurately calibrate the compasses and keep getting “bad compass health”.

I momentarily had hoped that disconnecting the external display and/ or setting parameter NTF_DISPLAY_TYPE back to “0” as referenced here would help, but the problem remains.

To reiterate, with:
Pixhawk 2.1, 3.5.7
Here GNSS connected to GPS1
Here+ GNSS connected to GPS2

I cannot even start the calibration routine in Mission Planner.
MP HUD and Frsky telemetry/ MAVlink messages keep telling me “Bad compass health” (even if I try the above with Here+ disconnected).

Any competent input is greatly appreciated, as two weeks later, I still have not been able to get in the air due to not being able to get a compass calibration/ configuration I trust in, despite of having followed the procedures as documented and having done extensive research.

What’s wrong here and what needs to be done to make it work?

Have you tried calibrating only the Pixhawk 2.1’s two internal compasses at the same time and make that work? Compass 1 and 2.

And the same with only the external Here-compass? Compass 1 External.

And the same with only the external Here±compass? Compass 1 External.

Do you get these three above to work as they should, by them selves then I would start calibration with only the two internal and Here+. Compass 1 (External and primary) and 2 and 3 as Internal.

I have done this on some copters and on one of them there were interference with one of the internal Pixhawk 2.1-compasses. I had to soften up that one. Then the calibration was successful.

Then try the same with Here and two internal.

Then with Here and Here+.

This should give some indication on where the problem is.

Have you made a good and stable accelerometer calibration? I think they are as a reference for the compass calibration. I mean that the accelerometer calibration is done slow and precise with some seconds of waiting before “pressing any key” to continue (to let the position stabilize).

I dont know which internal Pixhawk 2.1-compass should be skipped when using two external ones.

For me, the external have always been compass 1. Havent used two external compasses.

I dont know how you rotate the copter when calibratint, but I have to move back from table-lamps I have.

I dont know if any of the above helps… but when I am looking for a failure or find a problem, I mostly use the “exclusion ability”. But sometimes it ends up in this forum. :wink:

Thanks Mike for your hints.

Yes, this works (I connected via USB and left the Here & Here+ disconnected); it results in two compasses being “calibratable”, with “Compass 1” set to primary.

Yes, this works:

  • with “Compass 1” set to primary,
  • Compass No. 1 set to “use” and to “Externally mounted”
  • Compass No. 2 set to “use” (not “Externally mounted”)
    Starting the calibration procedure, a progress bar is only shown for Mag 2 (despite two compasses being in use

This works, too:

  • Compass 3 as primary
  • Compass No. 3 set to “use” and to “Externally mounted”
    It remains unclear to me which one the third compass in this case is: The internal or the Here+?

With only the Here+ connected, I can also calibrate when set up as follows:

  • Compass one as primary
  • Use compass 1 & 2 & 3, with compass 1 set to external
    This allows me to start a calibration, with Mag 3 moving forward. But again - who knows which one this really is…

The core of the issue remains:
If I hook up both the Here and the Here+, it seems that no matter which primary compass I choose and no matter what combination of “use this compass” I set:
I cannot initiate a calibration, and all I get are “Bad compass health” warnings, which keep me from arming and moving on.

These are no 25 $ banggood items, but the whole FC/ Nav setup is around a 1000 $ - so I am starting to be frustrated about a lack of clear documentation/ instructions to achieve a working, reliable setup?
Conflicting infos and unsuccessful trial and error leaves me deadlocked at this point.
I would be grateful, if @proficnc could chime in with first hand info to address and resolve the issues outlined above.

I understand that PH is often not plug-and-play, but I thought that running a Hex.aero-produced PH 2.1, and two GNSS modules with compass should be a straightforward process…

Ok, quick update, with some promising progress:

  • Tested with another Pixhawk - no improvement.
  • switched around the Here with the Here+ (changed cables to be able to swap GPS ports) - issue persists.
  • Reset parameters to default - was able to initiate calibration with the Here+ showing progress on Mag 1 and 2, the internal one on Mag 3 (and the Here connected to GPS2 not showing any movement in the calibration bars)…

Now will need to boil down which parameter(s) foul this up so bad, that I can neither initiate a proper calibration nor fly (due to bad compass health). Still would prefer to use the regular Here as compass No 3 - and not the internal one…

For now, I am glad this has left the deadlock stage. Once I have found the culprit parameter, will I update.

Well, weeks later and after looong times of trial and error, today I made it to the bottom of the issue - an odd parameter conflict.

Part of the UAV has a Teraranger One rangefinder integrated. When I initially configured the ArduCopter parameters for the FC, the rangefinder was connected. As the build progressed, I had temporarily uninstalled it, since the structure it was integrated in was in the way. It was during this phase of the build, I was attempting the compass calibration - unsuccessfully.

Through changing parameters bit by bit, and after countless times of rebooting and re-checking if compass calibration could be initiated after the change made, I found the following:

  • If the rangefinder is NOT connected while the param RNGFND_TYPE is set to 14, the compass calibration cannot be started (and MP will report bad compass health, keeping the aircraft from arming. If you set it to “0”, compass calibration can take place as expected).
  • If param RNGFND_TYPE is set to 14, the rangefinder has to be connected, only then compass calibration can be initiated!

It may be a rare case, but maybe this resolution helps someone.

What remains unresolved, is a documented enumeration of the compasses, so that it is clear “which one is which”.

I wish there was some process to speed up dealing with such undesired behavior.
Does anyone know of a tool to be alerted of such conflicts, or of any way to check a log which flags such a “hindrance” - without being a full-on programmer?