Should I use EKF2?

I’ve read about the advantages of new EKF2 Estimation System but don’t know how and where to make best use of it. Don’t even know if it would make sense to run it with my small autopilot. I fly some copters on GPS, while some on Flow sensor and Rangefinder.
I think the questions I have are:

  • Is it recommended to use EK2 in the control loops? (AHRS_EKF_TYPE=2)
  • If so, is it better to use multiple IMU’s? (EK2_IMU_MASK=3 and EKF_ENABLE=0)

The autopilot that I have is the 3DR Pixhawk Mini. I believe that it has two IMU’s that could make use of the new EKF2 system. Below some spec and link to more info on it.

Main Processor: STM32F427 Rev 3
IO Processor: STM32F103

Accel/Gyro/Mag: MPU9250
Accel/Gyro: ICM20608
Barometer: MS5611
There is a note that most likely answers the question about the number of IMU’s it has: “Improved sensors, both primary and secondary IMU MPU9250 and ICM20608 respectively”.

Could anyone give me his opinion and recommendation? Should I enable EKF2 or stick with the proven legacy EKF which I believe is the default?

EKF2 if far from new. EKF3 isn’t even that new although it will be default soon. Just load Arducopter current Stable (4.0.7 today) and you will be fine.

Thank you Dave. I’m using 4.0.5 – shouldn’t I be fine?
I am not able to chase newest versions because I have to have additional modifications to the code done outside. Moving to 4.0.5 was already a big move for me and will probably stick with it for 1 to 2 years in all of my copters.

If EKF2 is a new default, is the information below from AP site out of date? I’m quite sure that EK2_ENABLE was not 1 (not sure though). I’d expect that there would be a note there, that versions 4.0.x and up are set up that way already.

Here you go: Using EKF2
1. Enable the new EKF by setting EK2_ENABLE = 1. EKF2 will now be running in parallel and logging, etc but it will not be used by the control loops.
2. To use it in the control loops, set AHRS_EKF_TYPE = 2
3. The use of multiple IMU’s, is controlled by the EK2_IMU_MASK parameter:
- To use only IMU1, set EK2_IMU_MASK = 1 (this is the default)
- To use only IMU2, set EK2_IMU_MASK = 2
- To run dual EKF2 using IMU1 and IMU2, set EK2_IMU_MASK = 3 and turn off the legacy EKF by setting EKF_ENABLE = 0

Elsewhere, for using a Flow Sensor the instruction requires EK2_GPS_TYPE=3. To me this indicates that one must make sure that EK2 is enabled. The instruction is not saying though whether EK2 should be used in the control loops too (AHRS_EKF_TYPE = 2) or it is used for logs only. All this is very confusing to me. This is why I’m hoping for an educated answer or a link to info that will make it clear to me.

It’s enabled be default in 4.0.5 Here is a screen shyot of a fresh flash of 4.0.5 on a FC I have on the bench. The type is set and it’s enabled for use.

Thank you Dave. I’ll reload my modified 4.0.5, and see what the defaults are. I’m afraid I already did a lot of damage trying to follow all of those instructions.
At least I’ve learned what IMU, EKFs and AHRS are.

Do you fly with flow sensors and rangefinders? If so, do you know if GPS should be disabled (EK2_GPS_TYPE=3)?
I know it should be disabled for testing, but cannot find any info whether one should do normal flights with GPS disabled. What I’d like is to fly by Flow and Rangefinder but automatically revert back to GPS if there is fault from the Flow Sensor. Don’t know if the value of 3 does that.
Any experience here?

I don’t but there is some info here:

That’s what I followed during testing phase. But it ends with:
" If it holds location then congratulations, you have succeeded and can now start experimenting with height changes and moving it around in the loiter mode".

I assume this is it, but still not sure whether it reverts back to GPS if there is fault from the flow sensor. Not sure “how much” EK2_GPS_TYPE=3 disables the GPS. Is it running in the background ready to jump in in case of trouble, or it is disabled for good?