For those developers who fly “latest” (aka “master”) we have just changed the default AHRS (Attitude Heading Reference System) from EKF2 to EKF3. Please be careful and report any issues you find either here or directly on discuss.
Please note that we do not recommend that users fly “latest” because it could have issues and the dev team doesn’t have the resources to provide support for this largely untested code. Instead it is best to stick with the stable and beta releases (once they are made available).
EKF3 works better for tailsitters or any other vehicle that spends a lot of time pointing directly upwards or downwards. This is because EKF3 estimates accelerometer biases for all 3 axis while EKF2 only does the vertical axis
EKF2 may work better on vehicles that spin very rapidly because it estimates gyro scale factors while the EKF3 does not. Modern gyro scale factors are nearly always 1.0 though so this is probably not an issue
Even with the change to EKF3, the older EKF2 is still available on most boards and users can switch between them by changing these parameters (and rebooting the autopilot):
AHRS_EKF_TYPE = 2 or 3 depending upon which EKF you want
EK2_ENABLE = 1 to enable EKF2
EK3_ENABLE = 1 to enable EKF3
It is best not to enable both EKF2 and EKF3 at the same time because it could overload the CPU on some autopilots. It is unlikely to crash but it may fly badly.
This change is in preparation for the start of beta testing for ArduPilot-4.1. It is difficult to predict exactly when 4.1 beta testing will begin but it is likely that at least Rover will start in the next month followed by Plane and Copter. Thanks for your patience!
A note of caution for any Plane user flying EKF3 as it currently exists without a compass…on takeoffs the time to get yaw aligned can be many seconds, resulting in very significant heading errors…also, if one lands and disarms, then re-arms a few minutes later, the EKF can actually become unstable to the point of losing control in modes other than manual…see PR #15810 which addresses these issues…
Does it mean the position and velocity estimates are from EKF2 and the roll, pitch and yaw from EKF3? Or all estimates by default are swapped to EKF3? I do not want to be picky just sometimes INS is used for full state estimates while AHRS is the synonym for Euler angle estimates only and a different set of sensors are included in the estimation. What is the difference among IMU, AHRS and INS? | Aceinna Forum
The PR linked below resolve an issue with the CAN GPS ordering issue which I guess is critical to getting GPS-for-Yaw working using CAN F9 GPSs. I’m unsure if there are any other issues…
WRT the comment regarding high spin rates, EKF3 will perform better than EKF2 when there is sustained high yaw rates about the vertical (local gravity) axis in hover. EKF2 can develop roll and pitch errors resulting in a ‘wobble’ and temporary degradation of position hold accuracy.
I am using a drone that had Arducopter 3.6 on it, installed 2 years ago. I have been updating it regularly with new versions of Arducopter, but by default it still uses EKF2.
Txs. If any of the relevant parameters (AHRS_EKF_TYPE, EK2_ENABLE, EK3_ENABLE) have been manually changed at some point then the vehicle will stay on EKF2. 4.1.x changes the default but it doesn’t override what the user has set manually.
Sometimes we see people manually applying a full parameter file from a previous version of the software or even another vehicle. This is really not a good idea and mostly not necessary.