About one month ago, I described a situation where EKF3 position (vertical and horizontal) was going mad here: EKF3 Position going mad - Bug in 4.1.0-beta3 or defective Cube Orange?
My hope, that this was fixed with beta5 could not be confirmed. Perhaps the “collapsing baro variance” was fixed but the weird position estimation after a lane switch still happened. Unfortunately this time it happened after getting airborne and the drone crashed.
Configuration also here was using “GPS for Yaw” (RTCM proxied through the Pixhawk Orange).
First, the drone should take off and ascend to 10 m. But right after spinning up the motors and leaving the ground, the copter shot to the right and climbed with high speed. Some seconds later it staggered somehow and was intercepted by a tree.
Comparing the horizontal POS estimation (red) with the GPS track (blue), you see an extremely oscillating EKF3 position estimation:
Looking at the lat and lon values of GPS and POS you also see the differences and the oscillations in POS which after about 5 minutes recovered again:
The phase with the weird POS values was between two EKF lane switches, marked in the following diagram at 10:31:38.417 and 10:36:18.409:
The lane switches followed the errors “EKF_PRIMARY-2” and “EKF_PRIMARY-1” also logged at 10:31:38.417 and 10:36:18.409.
Looking at the recorded altitudes, you can see a big difference between a successful flight about 10 minutes before …
and the crash flight:
Here, at the moment of the “EKF3 lane switch 2” the estimated vertical position (POS.alt) jumped down from about 61 to 0 meters (relative altitude from 0 to -61 m).
If you zoom out, you can see that the POS.alt is continously going down to -1019 meters until the next EKF3 lane switch also recovers this error.
Taking a more detailed look at the Acc, Gyro, Baro, GPS and Mag data of the redundant sensors, you can see that they are all almost consistent. Only the mag data of the internal compass drifted away a certain amount from the mag data of the external compasses at take-off due to the high current deforming the magnetic field near the power cables (and close to the Pixhawk Cube Orange). This may have been the cause for the “EKF3 lane switch 2” at take-off. But it does NOT explain, why the POS estimations of the new primary line produced these weird oscillating values letting the drone go mad after the lane switch.
You can find the log-file here: https://kopterkraft.com/downloads-static/00000001.BIN
One week earlier, I also had these weird POS values (oscillating horizontal position and continuously decreasing altitude) during a certain phase, where the drone was just sitting on the ground:
In that log file you also find several EKF3 lane switches but in that case, the last switch was to lane 1 before the POS values started going mad. So I see no pattern. In that case, the vertical position estimation reached already -3197 meters before I disconnected the power.
The log file can be downloaded here:
https://kopterkraft.com/downloads-static/2021-07-07%2012-06-56.bin
A certain part of that log, also LOG_REPLAY was set to 1, if this helps…