Trying to Understand Internal & Exernal Compasses

I am unsure if I have my compass settings correct, and for the life of me, I haven’t been able to understand how all the settings are working together, or if in fact they are. Particularly, if my external (addon) compasses are being used or not, and in which order.

When I installed ProfiCNC Hex Board with Orange Cube, I also installed two additional compases; a NEO-M8N GPS module with compass, and 3DR GPS and compass that came with my original Pixhawk1. The NEO-M8N is plugged into the GPS1 port on the Hex Board, and the 3DR is plugged into the GPS2 port of the Hex Board.
6c020e1e33c24df39aad72c864b39920

I’ve searched my .params for COMPASS_DEV_ID, and I show three compasses, but I think those are the internal compasses. In other words, these are physically located inside my Orange Cube? - is this correct?
3compasses
Then I show two External compases; COMPASS_EXTERNAL & COMPASS_EXTERN2
compassextern
These, I think are my external compasses I added - right?

Where it gets strange to me is when I physically disconnect the two additional, externally mounted GPS/Compass units I added, COMPASS_DEV_ID2 & COMPASS_DEV_ID3 get “removed” (value changes from “1” to “0”) and COMPASS_EXTERN2 remains (value is still “1”).
compass_DEVremoved)
compass_externremoved
On the “Compass” page of Mission Planner looks like:

SO to me anyway, this looks like after disconnecting the two gps/compass units I added, I have two compasses, one as COMPASS_DEV_ID & one as COMPASS_EXTERNAL, but then on the “Compass” page in Mission Planner, it still shows three, which further confuses my understanding of what is going on.

Can anyone explain how this is working to me? I’ve searched and read about the compass .params quite a bit, but it’s just not making clear sense to me.

Then the real question I have, which got me started into this: My parameter, COMPASS_TYPEMASK is set to “32”. When I looked up this parameter in the Complete Parameters List, I see:

COMPASS_TYPEMASK: Compass disable driver type mask

Note: This parameter is for advanced users
This is a bitmask of driver types to disable. If a driver type is set in this mask then that driver will not try to find a sensor at startup

I’ve also searched the forums quite a bit about this, but I don’t understand what “32” is disabling, if anything. Basically, is this right?

Look at the HD ID screen. It tells you what compass’s are found and what Bus it’s on.
Like this:

1 Like

I2C are external, SPI are internal. If your screen looks different than this install the latest MP beta!

2 Likes

Ok, making a lot more sense now, thanks. It looks like the COMPASS_DEV_ID’s are each physical unit, so one for internal, and the two Id’s for the GPS/compass units I added.

Here’s with the compasses not installed:


and here’s after I plug them in:

(Sorry mine doesn’t look as neat and tidy as yours)

So from this, I can deduce that when I don’t have the two external GPS/compasses installed, the Cube’s compass is COMPASS_DEV_ID, but then I plug in the external units, the Cube’s compass (devid 590114) is changed to be COMPASS_DEV_ID3. Does this mean my external compasses are being used as a priority? Does it not matter at all? In other words, should I be worried about changing the order of compass, as in setting my “Primary compass” setting on the “Compass” page to be “Compass3”? I just want to understand the best I can what is going on.

Then I still have the question as to whether or not my COMPASS_TYPEMASK (has a value of “32”) setting is correct. “32” was not something I entered, it was just there after I installed the Cube’s firmware.

External compass’s will always move to the primary compass position.

“32” will disable the driver for a LIS3MDL compass which will make no difference to you. I’m not sure why it would be set, I don;'t see anything in Hwdef file that would default that. But, no matter.

1 Like

ok, I think I’ll change it to “0” then. … Just to be retentive about it. :slight_smile:

I wouldn’t change those settings manually. They are detected. This is a Cube Orange? Never mind I see why it’s showing that internal compass. If you showed the entire HD ID screen it would be more clear.

Yes, and… ok, ya, you’re probably right. Maybe there’s a reason and maybe it detected something I am not aware of… I’ll keep it as “32.”

The exception to this is CAN compasses, they get discovered last. So if you have an internal and a can external, the can will be compass 2

1 Like

Thanks for that info Dave!

All I use is CAN gps’s now and I have noticed the ordering. Same with CAN baros. They will show last

Yes, this is better in the Beta with compass but Baro needs a similar ordering option to the compass in the daily builds. Tonight been playing with multiple Baro and its not easy to get them to behave on CAN

What issue are you seeing?

There is no way to easily select the Baro sensors when you have a mix of CAN and SPI. While those do show in the GND prams you can’t identity what sensor is what or what bus and all config still relates to SPI

I know there is a pull request in to try and do something similar to the new MAG config.

That would be perfect.

We are heading to wards needing a sensors page in MP for all of these to be housed under one plaice.

GPS config for CAN
Multiple GPS config for blending ect
Mag config
Baro config