Reverting to EKF2

I’m currently using ArduPlane 4.3.4 on a Matek board and I’m facing an issue trying to set EKF2 as my default estimator. I followed the usual steps in Mission Planner to change the EKF_TYPE parameter to 2 for EKF2. However, after saving and rebooting the board, the setting reverts back to EKF3.

Here’s what I’ve tried so far:

  • Ensured that I properly saved the parameter change in Mission Planner.
  • Checked for any related parameters that might be affecting EKF_TYPE.
  • Restarted the board multiple times to see if the setting persists.

Despite these steps, the setting keeps reverting back to EKF3. I’m unsure if this is a known issue or if I’m missing something. I’d appreciate any insights or suggestions from the community.

Thank you in advance for your assistance!

Is there any reason you want older EKF2 estimator instead of EKF3?
I wouldn’t be surprised if EKF2 was dropped from public builds especially in a new board that never had EKF2.

Thank you for your response.

The primary reason I’m interested in using EKF2 is that with EKF3, I experience position glitches during inverted flight. Notably, during loops where the load factor tends to decrease at the peak, the pressure near the Pixhawk seems to increase. This seems to cause a problem where the barometer’s input becomes dominant, especially when I lose GPS. Consequently, my loops don’t appear round even if flown correctly. When I was using EKF2 on a mini Pixhawk, this wasn’t an issue, and my loops appeared round.

If I’m restricted to using EKF3, would it be possible to reduce the lanes to 1 to prevent the glitches and achieve a behavior closer to EKF2? Alternatively, do you think this might be a simple configuration issue related to barometer filtering and position sources?

Any guidance would be greatly appreciated.

1 Like

My understanding is that the ekf doesnt just glitch, you need to feed it bad data to get it to go bad. that usually means a fault or interference somewhere with a sensor throwing off its estimations.

1 Like

Can you post a log where the glitch manifests?
If EKF3 is actually glitching it is quite a serious issue.
If you can safely recreate the issue with LOG_REPLAY set to 1 it could help to identify the issue if it isn’t in your setup.

1 Like

I hope you are using the FC as a logger other than that I can’t tell anything from the kmz.

Thank you for your continuous feedback and assistance. I’d like to clarify that, unfortunately, I don’t have a flight controller equipped with an SD card slot. Thus, I can only provide the .tlog files from my last two flights. In the most recent flight, I configured the parameters as follows:

  • EK3_SRC1_POSZ = 3
  • EK3_SRC2_POSZ = 0
  • EK3_SRC3_POSZ = 0

I made this change to prevent the EKF from falling back on the barometer during negative flight conditions without GPS. Regrettably, as I don’t have the static pressure port located at an optimal position on the aircraft, I cannot consistently rely on the barometer.

Additionally, during vertical flight, (a few cases) the attitude estimate seems to reset the pitch to zero — a situation I never encountered with EKF2.

Are you able to check the .tlog files to get a better understanding of the glitches I’m experiencing? Your expertise and guidance on this matter would be invaluable.

Link to .tlog files:

Hi Lupus,

I finally managed to fly another board with the SD card and I am now able to attach here the .BIN file.

I still can see some glitches on the altitude estimation (just two).

Is the whole system working right or am I missing something in the configuration?