Compasses...........................again

Here is my problem or probably i should say my short comprehension of how the system behaves about compasses.

I have 2 external compasses connected to the second I2C port of my PH 2.1 (maybe i should connect one to the gps port i2c and one to the second i2c port)

PH 2.1 has 2 additional internal compasses too.

Now how can i be certain that the system uses the 2 external compasses (if it is possible) and not the external ones?

I tried to set compass 1 and compass 2 on mission planner as external and disable (not use) the third compass, but this doesn’t work, the internal compasses are still there (at least one) and the 2 external behave erratically.

So at the bottom of the problem i think i don’t have a very clear picture on how to force the system to use a particular compass and how to check to make sure it does.

Hope my doubts are clear enough, if not i’ll answer to any question to make it clearer.

I know this argument has been talked about thousands of times and i read all the previous discussion but i couldn’t really understand how the system works and based on what algo the compasses are choosen.

regards,

Corrado

Internal compasses are prone to interference by the very nature of being mounted amongst a whole bunch of electronics. PH2.1 the same as PH1. You can use them but you do need to be careful.
This is why the GPS’s have traditionally had a compass with them because the GPS has to be mounted high with a clear sky view.

@anon67614380 to your question. Ardupilot uses one compass only. The others are for redundancy.
If you have 2 external compasses then put them on different I2C bus’s.
I am assuming they are the same compass, so they would have the same hard coded ID.

As Mike says, AP only uses one compass at a time (i.e. no blending). If the first one fails (which is very unlikely) it will fall back to the next one. All this means that there really isn’t any advantage to having lots of compasses on the vehicle - I’d just stick with one external compass. By the way, I’ve once had a compass fail in flight and my vehicle flew fine anyway.

The COMPASS_USE2, COMPASS_USE3 parameters can be used to disable the internal compasses.

In general it’s not good to set the COMPASS_EXTERNALx parameters manually. These values are normally automatically set on startup when AP is looking for all the connected compasses.

Thank you. So compass_use2 and compass_use3 will always disable internal compasses or will disable second and third after the first one externally mounted is picked up as first?

I am just trying to understand fully how they work.

If for example i have 2 external compasses and use compass_use2 and compass_use3 to disable compass 2 and 3, won’t the system disable my second external and first internal?

I understand i am making a bit of confusion here but i couldn’t find a doc or a post where it is clearly explained how all of this works.

For example, external compasses have priority? if i have one, will it always picked up as first compass?

Corrado,

Yes, you’ve got it right. External compasses are normally first in the “list”. i.e. they will have the lowest numbers and be used before the internal compasses.

So if you have two external compasses, you might only want to set COMPASS_USE3 = 0 to disable the internal compass.

We only support up to 3 compasses so if there are more, they’re simply not used.

Thank you very much.

Corrado

Just one other little thing, if i want the system to re-discover all magnet what should i do?

Meybe put DEV_ID to zero and reboot?