EKF diverges when using cheap BN-880 in acrobatic maneuvers

I’m writing a system that uses ArduPlane as a low-cost flight LOGGER in real sized aerobatic aircraft. The software is based on FlightCoach. The components are a cheap Omnibus F4 and a Beitian BN-880 GPS - trying to keep the cost down…

The flight path trace jumps around all over the place during some aerobatic manouevres and I’m trying to find the reasons why. I’ve been trying to use the UAV Log Viewer, but I’m struggling. It’s pretty obvious that the EKF data is getting overwelmed, but why?

I have one setup working well on a low performance aluminium aircraft, but I have another test installation in faster aircraft, which is almost compeletly made from carbon fibre. The flight recorder is mounted on top of the instrument panel inside the cockpit with good visibility of the sky through the canopy when not upside down.

Using GPS.NSats, the number of satellites drops when inverted but mostly stays above 3 satellites.

I’m getting a lot of messages saying AHRS: EKF2 ACTIVE then AHRS: DCM ACTIVE. What does that mean?

I have set the primary altitude sensor for EK3_SRC1_POSZ to GPS and I’m wondering whether barometer would be better.

I’ve checked the BIN file in MagFit and there are variations against the current calibration, so I will be uploading an amended magnometer params to the flight controller.

I’ve uploaded a BIN file to

Can someone have a look at the log and give me some help?

Why is the EKF so bad?

Another thought just occurred to me. The aircraft that I’m having a problem with is a tail dragger, so the accelerometer calibration has been done with the flight recorder level on the bench, but when the logger is mounted in the aircraft it is tilted at 15 degrees when stationary, but levels out when in level flight. Could this be causing a problem with the EKF algorithms?

The accelerometer calibration is not a problem.
But when you go inverted your GPS data goes bad and fouls up the EKF.
It looks like you need at least 6 sats to maintain a usable GPS fix.

Thanks for the reply. I’m bound to lose the GPS satellites when inverted, but it’s only for a few seconds, so I was expecting that the EKF would switch to using the IMU and compass data to do position estimations and then give me a step change to the correct position. Instead it goes crazy - any idea why?

I’m using the GPS as the primary altitude sensor i.e. EK3_SRC1_POSZ = 3, would I be better using the barometer?

Do you know whether good compass calibration is important?