I had an issue a couple of days ago flying in altitude hold mode. The mission was very simple, it was performed above a flat surface using a sonar as range finder pointing down, a cube orange, and the 4.0.5 version. When I was about to land the CH3, throttle, was not making it goes down (around time 100 in the plot below)
Figure1, altitude by barometer and pilot altitude command
The altitude started to slightly increase (yellow line above) regardless the CH3 was completely down (red line above) and in a desperate try we switched to land mode (104 seconds), but the drone kept on climbing. Even switching back to altitude hold mode at about 110 seconds and commanding it to go back did not help. Eventually, at 25 m at about 125 seconds we engaged the kill switch.
We noticed that the cause was that the EKF failed to estimate the altitude, the innovation for the altitude was huge and kept on growing (NKF3.IPD). Actually the drone, the control, thought that it was going down instead of up. NKF1.PD (green plot below) tells that the drone though it was as about -10 m when we switched to land mode; recall that PD is position down so a positive value indicates negative altitude.
Figure2, EK2 first instance altitude estimation and Kalman filter innovation
I have seen this problem before and it usually happens when the accelerometer is affected since they are fused with the barometer for the altitude estimation; we configure EK2_ALT_SOURCE to 0 for not using the range finder in the estimation. The barometer looks good as it can be seen in Figure 1. Even the second instance of the EKF is estimating correctly (NKF6.PD green line in Figure 3) the altitude:
Figure 3, Comparison of altitude estimation between the two instances of the EK2
The vibrations do not look bad (Figure 4), so I do not know what else can affect the accelerometers.
One theory is temperature but I am not sure. Any comments?
The log can be download from the link below:
Thank you in advance!