Improve EKF2 filter parameters with Motion Capture


I have a quadcopter flying with motion capture, and the EKF2 sometimes diverges. It can happen when the quadcopter is on the ground, and then not happen for 20 minutes. When the issue happens, the estimated local position diverges in a parabolic shape, which seems to indicate that the filter relies on the accelerometer only. The position snaps back after a few seconds, but by that time, the estimated position has already diverged by 20 m, which causes a crash if the quadcopter is flying.

The issue may be that the wifi signal drops for a fraction of a second, which is enough to cause the EKF2 to reject vision position data. A better reception by the wifi dongle may improve the issue, but I think the EKF2 may be more robust by tuning the filter parameters. The filter should recover and use vision data much faster.

Here are the current EKF2 parameters. I tried reducing EKF2_EVP_NOISE, setting the correct EKF2_EV_DELAY. I do not understand EKF2_EV_GATE. EKF2_EV_POS_X is correct. I reduced EKF2_EVA_NOISE.

@Charles_Blouin Posting a log of the vehicle diverging will help to identify the issue