EKF Error While Trying to Autotune

Hello everyone,

I’ve assembled a quadcopter with the following specifications:

  • T Motor MN7005 230KV Motor
  • Air 40A ESC
  • T motor 24in prop
  • Pixhawk 2.4.8 Flight Control Board (FCB)
  • Here 3+ GNSS connected via CAN to FCB

I conducted several flights with default parameters, including an auto mission covering 2 km. The copter performed adequately but exhibited suboptimal attitudes. After a while, I began experiencing EKF Line switch and EKF yaw reset errors. The flight mode switched immediately to stabilize, leading to a landing. This occurred multiple times, prompting me to initiate the tuning process.

I meticulously followed the tuning procedures, initializing with all initial parameters. During the first flight, I observed noticeable vibrations in the frame, prompting a manual tune to elevate the vehicle. Subsequent testing for extreme stick inputs indicated stability. However, upon attempting Autotune, I encountered EKF errors, causing Autotune to fail.

At this point, I’m uncertain if there are specific considerations I should address. I am unfamiliar with the usage of the new ArduPilot web tools for setting magfit, PID review, and other configurations. Any support or guidance you can provide would be greatly appreciated.

@xfacta @dkemxr @Leonardthall @OlivierB @andyp1per

LOGS : LOGS - Google Drive
Thank you.

You probably can improve the order in which you are doing the configuration steps:

Thanks Amil, Great work BTW i have gone through this a bit insightful.

Vibrations

Motor 1 working harder than the rest - not sure if that is a weight issue or some frame/motor mount misalignment

AUTOTUNE_AGGR,0.1
BATT_FS_CRT_ACT,1
GPS_GNSS_MODE,5
INS_ACCEL_FILTER,10
INS_HNTC2_ENABLE,0
INS_HNTCH_BW,15
INS_HNTCH_FREQ,35
INS_HNTCH_FM_RAT,0.7
INS_HNTCH_REF,0.33
INS_LOG_BAT_OPT,4
MOT_THST_EXPO,0.74
PSC_ACCZ_I,0.8
PSC_ACCZ_P,0.4

Recheck your MOT_SPIN_ARM and MOT_SPIN_MIN after setting all those, the changed MOT_THST_EXPO will affect those slightly.

Is the throttle stick spring-centered? If so PILOT_THR_BHV,1 or 7

Dont worry about doing Auto missions until tuning is completed.

And again: vibrations!

Thanks , I’ll for sure check it. Yesterday I updated my fcb from 2.4.8 to cube orange and found the vibration levels reportrd in the log reduced from 25 to less than 10. Will update the logs

Good move - I was thinking about suggesting a more reliable flight controller for a copter with 24 inch props.

Hello,
Today, I successfully conducted a few flights, incorporating some manual adjustments before engaging in the autotune process. I attempted to set harmonic notches to the best of my knowledge using ArduCopter web tools. Subsequently, I executed autotune in the pitch axis, achieving positive results. Upon inspecting the pitch response post-tuning, it was deemed quite satisfactory. However, a log analysis revealed that the R*out values in pitch exceeded 0.1, a parameter that many forums suggest should remain below this threshold.

Nevertheless, despite this observation, the tuned pitch demonstrated a high level of responsiveness.

Thanks

LOG: log_50_2024-1-12-14-42-16.bin - Google Drive

If this is still the copter with 24inch props, all the parameters I gave before still apply.
I had the frequency wrong because I had to guess a bit before because the batch logging wasnt enabled, but now it is I can say for sure you want:

BATT_FS_CRT_ACT,1
GPS_GNSS_MODE,5
INS_ACCEL_FILTER,10
INS_HNTC2_ENABLE,0   // no need for another notch filter, disable it
INS_HNTCH_BW,20
INS_HNTCH_FREQ,46
INS_HNTCH_FM_RAT,0.7
INS_HNTCH_REF,0.34
MOT_THST_EXPO,0.74
PSC_ACCZ_I,0.8
PSC_ACCZ_P,0.4

Which will give you this:

Around 46Hz is the motor/prop base frequency, even though it’s not very apparent because of the strong 2nd harmonic.
The anomaly here is that double peak in the 2nd harmonic, at about 76Hz (it will be in the base harmonic too, but not very obvious). That is because you’ve got one motor running at quite a different output from the others. This would be something to try and fix.

The Autotune worked OK despite that, copy the new values over to the other axis. If you get that motor output issue fixed, then run Autotune again on pitch and roll in one session.

Hello,

I conducted several flights today. Following the auto-tune process for roll and yaw axes, the drone appears to be stable in flight with satisfactory attitudes. I’ll certainly test out the notch suggestions you provided, although I came across the post a bit late. Attached are the flight logs from today after completing the auto-tune for all three axes. Could you please provide feedback on the overall PID performance? I’m still uncertain about the values for Rout, Pout, and Yout.

Thanks

LOG : log_54_2024-1-13-10-46-10.bin - Google Drive