quadplane ekf issues, gyro scale factor drift, compass issues

we have a quadplane running arduplane 4.0.9 stable. We have had 2 successful flights. The vehicle flew excellent on flight 4, but the flight 5 was odd and nearly lost control of the vehicle in both QSTABALIZE and FBWA mode. No hardware or software changes were made between the flights. The only parameter deliberately changed was Q_VELZ_MAX,350

The takeoff in hover of flight 5 was fine, then about 20 sec after transition, lots of EKF errors occurred in mission planner and the plane was nearly uncontrollable.

All the hardware appears to be healthy from the logs. The two known issues on the vehicle are vibration during transition and compass problems. This may be the root issue, but why was flight 4 not affected?

know issues

  1. vibration is high on flight 4 but did not appear to be an issue. vibration is higher on flight 5 and may have contributed to EKF issues.

    • what is the cause of the gyro scale factor and bias drift on flight 5 - NKF2.GSX/Y/Z, NKF1.GX/Y/Z
  2. know interference with the compass - ekfcompv

    • what is the cause of the compass values - NKF2.MX/MY/MZ drift on flight 5 but not flight 4

zipped logs

https://drive.google.com/file/d/1dc20WTgDFRhbie1AajBcJ5IgLTguvDxp/view?usp=sharing

hardware

Just a quick update, I turn compass auto rotate, COMPASS_AUTO_ROT,2, and during the calibration the mRo compass chip appears to be installed upside down. I say that because the flight controller and external gps/mag are installed up with the arrow pointing forward. The new orientation Mission Planner set during calibration is COMPASS_ORIENT,12 (which is pitch180). Once I set this, both the internal mRo Control Zero and the external compass agree and the EKF errors are gone.

So, I guess ardupilot was able to cope with a mis-oriented compass for flight 4, but could not for flight 5?