I saw strange issue then I changed RTL mode during landing back to STAB and then to LOITER.
Copter started to gain altitude in small jumps. I was like a dead loop, so I switched to stabilize (thankfully I had it configured) and landed.
The issue appears to be an EKF estimation issue rather than anything directly related to the flight mode changes. It’s very possible though that the flight mode changes affected either the barometer or the vibration levels that led to the EKF becoming unhappy.
From looking at the logs we see an EKF lane change and then soon after the vibration failsafe triggers, then we see the odd climbs in altitude of the vehicle and then finally the pilot switches to Stabilize mode and a few seconds later the EKF recovers.
The vibration levels do not appear to be extremely high especially in the Z-axis so I suspect the issue is actually the barometer. I wonder if this vehicle’s barometer is perhaps suffering from interference? Maybe the barometer isn’t covered by a piece of foam or perhaps this is a very small vehicle where the airflow from the motors directly affects the barometer?
Here’s a screen shot of the log showing the barometer altitude vs throttle and we see a very direct correlation. The EKF estimated altitude lags behind which is unusual. The EKF’s altitude should move with the baro because the EKF uses the low lag, high rate IMUs for it’s base estimation and then uses the barometer for only longer-term corrections.
Yes, I think you’re right that it’s actually baro interference. The EKF can’t tell which is the issue, vibration or baro.. normally it’s vibration but in this case, it’s more likely to be the baro