Magnetometer

Hello, is there a clear guide anywhere on how to setup magnetometers the correct way?

I want to test a 3DR external mag. i attached it and checked that i2c sees it correctly with i2cdetect command, and it does.

I do the calibration of all 3 compasses (2 on board + external one) and i get all green numbers for all 3 magnetometers. The external one gets wayy lower numbers on calibration so i guess it would function better.

All this done, set the 3rd magnetometer to external and rot 180° roll.

After all configured and restarted no matter what i do, the system works ONLY if i enable compass one (i think the one integrated on the mpu). All other combinations give “bad compass health”.

All the calibration has been done away from building and from any source of interference.

What i reall do not understand it is why i can’t tell the unit to use mag 2 or mag 3 and disable 1.

Is there something else i need to do to have the magnetometers work?

regards,

Corrado

Reverse the order:

Set the Mag3 ext and rot 180° (if mandatory)

Do the calibration,

You can do what you want by editing parameters with Mission Planner (choose the working compass)

Marc

That is what i did, set everything than do the calibration.

Calibration ends successfully but the only time i don’t get “bad mag health” is when i select the first internal magnetometer, any other solution with magnetometer 1 disabled gives me bad health.

Corrado

did you reboot after every time you change compass number?
compass health means there is no information coming from compass; it also occurs if you change the compass and haven’t rebooted;

Yes i did, now i have the 2 onboard compass both with green numbers but only number 1 works, if i select number 2 and deselect number 1 i get bad compass.

Do i have to reboot everytime i switch from a compass to the other too?

Corrado

yes

Thank you Benedikt, very useful as usual.

Will try and report back.

Corrado

1 Like

Ok, attached external 3DR magnetometer, set roll 180 and external. Did the calibration and restarted, now it works!!!

So every change in the compass menu needs a restart in order to work!!!

Thank you again!!!