OK, I found time to work on this and am documenting what I find.
There is some weirdness going on in the (current state of the) documentation for COMPASS_TYPEMASK.
The docs imply there are 16 bits in the mask (0-15) but skip one (number 10).
Still, not such a terrible thing. 16 bits sounds about right (I wonder how this will be modified when there are more magnetometers to support) and perhaps there is a good reason for skipping the10th digit (maybe it’s considered unlucky in binary or something).
Now, for more fun. My mags are:
On the GPS, a LIS3MDL, as mentioned in the MRO site.
On the board, one Invensense MPU-9250 3-axis accelerometer/gyroscope/magnetometer and one ST LIS3MDL magnetometer as mentioned in the MRO site.
This, immediately makes it hard to disable specific devices at the driver bitmask level, since I have two LIS3MDL, one internal and one external. To make matters more fun, the Invensense MPU-9250 is not mentioned in the docs, though, of course it is detected.
So, I started by disabling everything and then enabling one at a time. Sure enough, I got a hit when I enabled AK8963, which I could have figured out if I had the brains to google info for the MPU-9250.
Now, how do I know what I detect? To the best of my knowledge, the only bootup messages MP shows are under the “Messages” tab and they do not say much, other than report the GPS model. What I do, is fire up the tuning screen and plot my, my2 and my3 and see what gets displayed and moves when I move the vehicle (if there is another way I would love to hear it please). The problem is, I have no idea which mag was the compass 3 which caused the trouble to begin with. I presume it was the AK8963, since it is the odd one out but I don’t know how to check it. If I enable all mags, I get them all detected but I have no idea how the board decides which one is external (since the external one is the same as the same as one of the internals) and no idea how it decides which one of the internals is 2 and which is 3.
So, to recap, at the moment, I have fixed the vehicle, disabled the AK8963, changed MOT_PWM_TYPE to 2 and did a compass calibration (indoors). The weather is atrocious but am expecting to go fly in the next few days. If anyone has any ideas, now would be a terrific time to tell me
I will report back after I fly.