Unexpected Heading Change Upon Switching Mode from PosHold to Stabilize

This is a quadcopter using ArduPilot 4.5 with 24” propellers. I was testing the mode transitions between stabilize and PosHold, and upon transitioning from PosHold to stabilize I lost control of the heading and basically forced it to land, miraculously without damage. I attached a picture showing the EKF_STATUS_REPORT.compass_variance vs time: the last transition event from PosHold to stabilize was the point where I lost control. The full logs are also attached. I understand that PosHold mode relies on GPS and magnetometer, while stabilize mode doesn’t use either… but I really don’t know what’s going on here or how to rectify it. Any input is much appreciated.

Edit: forgot to mention that I am only using the external compass (Here 4 CAN GPS/Magnetometer), with the compass internal to the Pixhawk Cube Orange FC being disabled since I was having compass issues (“compasses inconsistent”) prior to this incident when both compasses were enabled. I attached the picture of the compass setup from the Mission Planner screen, for completeness. I had done a fresh compass calibration outside prior to this loss of yaw control issue because the issue happened before and I thought a compass recalibration would do the trick… but unfortunately it did not.

Link to a .bin flight log. None of the files linked are useful. And that’s old firmware. Update and troubleshoot from there. Use Loiter, Position Hold could be deprecated for what usefulness it has.

1 Like

Will do, thank you.