EKF3 failsafe for unknown reason (Copter survived)

Hi,

I had a very strange incident with the EKF. I was flying the drone in Stabilze mode making circles very fast until the EKF gave up. The drone roll sharply to the right but recovered fast. Then it was very difficult for me to bring it back as it was trying to fly away. I’m suprised this issue happened when I was flying in Stabilize mode since the autopilot should be running without GPS or Compass assistance. This all feels like a bug in the code.

On top of this, I was also having issues calibrating the compass. I was getting a lot of compass variances in previous flights until it went away after several calibrations and firmware reflash of the autopilot and GPS module.

I equipped my drone with a CubeOrange using Copter-4.4.3 and GPS Here3 with the latest firmware.

Here is the flight log, I’ll appreciate if anyone can deterimine the cause of this.
Flight_log_EKF_failsafe

Thank you in advance!

1 Like

The compass is used. Use Magfit to calibrate the compass and generate the Compass Motor offsets.

Doubt that. Unless it’s your code.

@dkemxr thanks for your response. Sure I can try this. Is there a difference between Magfit and Mission planner’s compass calibration? Also, after looking deeper into the flight log I found that the roll, pitch, and yaw estimates of the EKFs diverege singificantly when maneuvering in a tight circle. Can this divergance be cause by uncalibrated compass alone? Thanks

A significant difference. Magfit calculates offsets from dynamic inputs. It should be considered as mandatory after a basic calibration and completely replacing the old Compass Mot procedure.

Unrelated but ESC RPM is typically a better reference for the notch filter than FFT.

2 Likes

First job will be check prop balance and similar.
Although IMU 0 and 1 are showing vibrations that are not normally considered bad, but X and Y axis is more significant than Z axis.
The real problem is apparent in IMU 2 where there is no built in dampening.
X axis vibrations are high, but Y axis and Z axis vibes are way beyond high !

Some might choose to disable IMU2, but that wont cure the bad vibrations, and I believe that IMU 0 and 1 would still be affected.
The compass errors and warnings will mostly be because of the vibrations

Despite all that the IMU-calcuated position and GPS position still closely aligns - which speaks volumes for the internal damping of the Cube.

AFTER you’ve fixed anything that could be causing vibrations (prop and motor balance, wiring… endless list)
you can adjust these parameters for the next test flight:

ARMING_CHECK,1
ATC_THR_MIX_MAN,0.1    //  until vibrations confirmed fixed by flight data
GPS_GNSS_MODE,67       // this suits your region - wait, what region?
FFT_ENABLE,0
INS_HNTCH_FREQ,80
INS_HNTCH_BW,20
INS_HNTCH_HMNCS,3
INS_HNTCH_MODE,3       //use ESC data
INS_HNTCH_OPTS,2
INS_LOG_BAT_OPT,4

I could not see your vibration/noise data properly being a .log, so if you want to you can send me a .bin log via PM if you are allowed. It wont be shared.
Maybe just say what region you are in - you had an odd looking selection of GNSS constellations, so I specified something (USA) but my guess could be wrong.

Once this is all under control, we can get back to checking compass calibration - it’s likely there’s not so much of an issue after all.

1 Like