I am using pixhawk 3 pro with an external GPS running on PX4 firmware.
I am facing mag sensor inconsistency even after calibrating the pixhawk multiple times. Hence I decided to disable the internal compasses so that I could arm the drone.
Based on this post(PixRacer - 3 compasses (external, 2x internal)?), my understanding is that Mag0 is the external compass by default. Hence I re-installed the firmware. Enabled the Mag0 with ‘No Rotation’ and also set it as the Primary magnetometer. Mag1,Mag2 and Mag3 were disabled by setting the parameter CAL_MAGx_EN as DISABLED, where x is 1,2 or 3.
This yielded a working set-up where I could arm the drone and the compass was pointing in the right direction. However, the next time, I switch on the pixhawk, I now find that there has been an automatic switch. Mag0 is set to Internal Mag which is ENABLED. Mag1 is set as NO ROTATION which is disabled and the compass direction in the flight mode display is wrong. Also Mag2 and Mag does not even have a CAL_MAGx_EN parameter to disable it. The Primary Mag is still set to Mag0. So I do the correction of setting the Mag0 back to external(NO ROTATION) and Mag1 to Internal Mag.
The airframe I am using is Traxxas Stampede vxl 2wd. Even though I am able to arm the drone, due to this compass issue, the direction of the compass shown in the map is wrong and it results in the wrong direction of motion while we try navigating from one waypoint to another.
This issue has happened multiple times. I am not sure what is causing this. I would really appreciate if someone could point out what I am doing wrong and how this issue can be resolved.
Please find attached the pic of the parameter set of the mags.