Major Inflight 4.1 Dev Issue - EFK3 Issue?

Hey All,

I setup a mission in mission planner and went out for a flight this evening. Upon reaching my destination, I decided to hit RTL to bring her home. All was going well and then I decide to try out cruise. However, in this mode the plane starts veering off the left (when cruise should hold its heading). I then get a message pop up saying, ‘EKF3 Lane Switch 0’, now it starts veering off to the right, then left and the message is ‘AHRS DCM ACTIVE’, then EKF LANE SWITCH 1’, then it veers to the right and I get ‘AHRS: EKF3 ACTIVE’, then to the left and AHRS: DCM ACTIVE. At this point I decide to hit RTL as cruise is not happy. Then I go into Auto so the plane tries to go back to the mission but then I come back to RTL. RTL looks like it is happy but then starts veering off to the left, then the right and the suddenly massively increases the pitch quite suddenly. (AHKS: EKF3 ACTIVE during this point). RTL then start veering off to the left again and brings the plane around 180 degrees. I then switch to manual to bring this puppy home. I notice in manual I’m getting constant messages about AHRS: EKF3 ACTIVE and AHRS: DCM ACTIVE and EKF3 LANE SWITCH 0.

I try RTL again a bit further into the flight and the thing happened.

Logs are here: https://drive.google.com/file/d/1hcht4oG7hDp0bNQkDvuAFXkpUOOAMZu-/view?usp=sharing

Youtube video of the issue: https://youtu.be/w5UZMgnNN-0

https://drive.google.com/file/d/1hcht4oG7hDp0bNQkDvuAFXkpUOOAMZu-/view?usp=sharing

I guess I have the very similar situation. Do you have a compass onboard?

Yes I do have a compass onboard.

I don’t have compass. but it act very similar. have you any answers ?

What version are you flying? I think this is due to the ‘new’ EFK algorithm that the devs are working on, sounds like it is not quite there yet. You / me might be better off downgrading to a stable version.

We can wait for the devs to respond to this. In future, if you have logs you can share with the Devs it would help them diagnose the issue and this fix it.

it is 4.1beta3, I have sent a log twice and waiting for someone can give some answers. I can’t go back to stable version. there are some function that I need only available on the 4.1 later. here are my logs. maybe you can take a look. what did you set this param EK3_SRC1_YAW?

My suggestion at this point then is to not use any modes until a stable version is released. You could try reading the following documentation; https://ardupilot.org/copter/docs/common-apm-navigation-extended-kalman-filter-overview.html

Try turning off EFK3 and only use EFK2. I’ve never done this or tested it but perhaps this could give you stable modes

AHRS_EKF_TYPE: set to “2” to use EKF2 for attitude and position estimation, “3” for EKF3.

What ekf did you use on that video? The link you show is for copter, is that okay for the fixed wing airplane?

I had the default on so it uses all of them. Yes you can use that setting for Plane.

You have a large Z axis accel bias of 0.3 m/s/s develop during flight that the EKF was not compensating fully for. During straight and level flight the Z accel shoudl average around -9.8, yours is around -9.5

In addition to this the EKF was having difficulty coping with longer periods of time flying straight and level with no compass which looks like it could be the vulnerability that is fixed by the following change that will be merged soon - https://github.com/ArduPilot/ardupilot/pull/18008. This change has shown significant improvements for some people that are flying without compass.

Thanks for your response. It is my understanding that I am flying with a compass, are you saying that my compass is not configured correct? The GPS module that I have contains both GPS and compass…

I had a similar experience with EKF3 switching to DCM, but mine shot up instead of side to side. It went back to ekf3 after about 3 seconds and there wasn’t another error (I landed it immediately.) Log showed EKF3 thought the copter was dropping out of the sky and compensated and the DCM failsafe kicked in. No clue what caused it. Haven’t flown it since. If others are having similar issues with EKF3, I’ll start flying again with EKF2 and see what happens.

Mine shot up as well at one point. yes it would be interesting to see if switching to EKF2 resolves the issue, I will be doing this test shortly as well.

My apologies - I had another log with the same file name from another user on my drive. I’ll have a look at your log and update the response.

@craigy72 I had another look at it - this time using the correct log file :blush:

Plot below shows z accel bias estimate had flatlines at a value of over 0.25 m/s/s which isn’t consistent with the Z accel data

This incorrectly estimated bias resulted in a offset error in the vertical velocity and position estimate

Without a log gathered using LOG_REPLAY=1 and LOG_DISARMED I will be unable to identify the root cause, however this type of error has been associated in the past with a build up of errors in the covariance matrix that should be significantly improved by the reworked covariance prediction equations added by https://github.com/ArduPilot/ardupilot/pull/18008 that has been merged into master and the copter 4.1 beta6 release

Thanks very much for the reply and taking the time to investigate this. I will install beta 6, turn on the additional logging, re-test and share the results.

these changes will be in the plane 4.1.0beta4 (and copter 4.1.0beta6) release

When can we expect beta 4? The latest build is still from Jul 12th.

beta4 was released a few minutes ago, it will take a few hours for the build servers to catch up