Servers by jDrones

3 compasses installed - problems starting compass calibration, enumeration - missing docs - Help please!


(TI) #1

I am setting up a Pixhawk 2.1 hexacopter, and am trying to calibrate the three compasses.
After having figured out a workaround to at least initiate the calibration, I’m now struggling with “Bad Compass Health”. lists as compass #1 the external one, and as compass #2 an internal one.

I have externally mounted a Here compass and a Here+ module - which to my understanding also has a compass integrated, correct?

When they are all connected, I am unable to initiate the calibration procedure (using MP, and Copter V3.5.7).

To even start the calibration, I had to first disconnect both external ones, then calibrate only the internal one and reboot.
Afterwards I could connect either one of the two external ones, but had to do it one after the other (with leaving the one not getting calibrated disconnected).

Is this normal? I thought I should have been able to calibrated them all at once.

I assume the compasses are enumerated as follows - correct?

  • No. 1 = Here
  • No. 2 = PH 2.1 internal
  • No. 3 = Here+ (RTK module)

What really keeps me from moving on now, is that after doing this, I am still unable to arm, and am getting “Bad Compass Health” messages on the yaapu telemetry, in combination with “Error pos / ver variance” (while on the bench).
(In MP > initial Setup > Mandatory Hardware > Compass) Compass #2 offsets shows up as yellow with X: -124, Y: 545, Z: 47 (the others are green).

Do the above error message result from the high Y - offset value?
And which compass really is #2? If it is really the internal one, how can this error be corrected? (It is “standard-mounted” on top of the center plate, and centered, and close to the CG.)

What must I do to get flying? Any help is much appreciated! Thanks!

(henrik04) #2

One would need to understand the reason of three compasses. The internal one is most of the time useless as it is disturbed by many factors. Having an external compass and and external RTK is good if you need RTK precision.
So disable the internal one and see how it goes… :slight_smile:

(TI) #3

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.

(henrik04) #4

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

(TI) #5

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?

(TI) #6

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.

(Andre-K) #7

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…

(TI) #8

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?

(henrik04) #9

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

(TI) #10

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.

(Andre-K) #11

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.

(TI) #12

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…

(mike kelly) #13

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.

(TI) #14

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?

(mike kelly) #15

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.

(TI) #16

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?

(Javier Beringola) #17


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.

(TI) #18

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?

(MickeM) #19

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: