Just been paid tuning a large quad copter with pixhack v5 and have come across a strange problem that I only noticed after tuning and trying position mode.
The compass can switch 180 degrees. It’s only happened once in the air nearly causing a crash but I switched to stabilised.
Its happening all the time now though (I’m only flying in stabilised mode so I don’t lose control).
I take off yaw a complete circle and compass is fine. However once I land the onscreen compass drifts from good to 180 degrees wrong direction over about 30 seconds.
I’ve tried many 6 axis compass calibrations and the compass orientations are right in the parameters and physically on the machine.
You have extremely bad magnetometer data. Most likely due to interference from current. Try to place the magnetometer as far away as possible from any power cables and twist your power cables
The first thing to look at is to make sure that the correlation between the norm of the measured magnetic field and the measured current is low, or preferably nonexistent.
The red line here should be horizontal