I have a Pixhawk powered quad here which will slowly yaw clockwise or counterclockwise, depending on the current heading. It seems if the heading is less than 180 degrees, it will yaw anticlockwise, and if it's more than 180 degrees it will yaw clockwise. This happens in stabilize, alt hold etc. I'm running AC 3.1.3, but it happened on 3.1.2 too.
I've tried two different mags, a hmc5883L and a 5893L, and they both produce the same yaw rotation. If I disconnect the external mag, I don't get this rotation.
Has anyone seen this or know what is going on?
I have attached a dataflash log showing the behaviour.