EKF or hardware glitch caused step change in attitude estimate

Hi everyone,

Yesterday we flew our tailsitter VTOL in multicopter stabilise mode. A few seconds after takeoff at ~1m altitude, the attitude estimation made a step change in all 3 axes. From one logging point to the next, the Yaw changed 270deg, roll 25deg and pitch 15deg. Attitude controller responded appropriately to its given inputs and caused a hard landing, luckily not too badly damaged.
Firmware is based on PX4 1.9.0 with some minor changes to attitude control, but no changes to attitude estimation. Hardware is Holybro Pixhawk 4.

@Paul_Riseborough or anybody else, do you have any insight into why this may happen? How can I tell if it was hardware or software?

Log is here:

Thanks in advance!

You need to fix your magnetometer, it has lots of interference form the lift system. There may well be other issues that were masked by that issue. See plot of measured field strength.

Thanks Paul!
So the magnetometer can affect roll/pitch estimation?

Yes it does, so very important to have good quality mag data

That’s good to know, thank you very much!