5 inch quad initial tuning

I am converting my 5 inch quad from betaflight to ardupilot. The specification is as follow:

  • Frame : iFlight Nazgul
  • FC : SpeedyBee F405V4 stack with 55A ESC
  • GPS : MicoAir M10G-5883
  • Motor : Emax Eco II 1750KV
  • Battery : 6s 1300mAh
  • ToW : 620g (without gopro) - 750g (with gopro9 - haven’t tested yet)

I have managed to hover smoothly in stabilize mode by following TMac’s video. However, there is still a hint of oscillation sound when I punch up the throttle. No oscillation heard when throttle is ramped up smoothly.

Acro mode is quite responsive, with oscillation heard on throttle up. It was sluggish previously, but I fixed it with the help of Gemini Deep Research. It suggested to increase ATC_RAT_PIT_P, ATC_RAT_RLL_P and adding Yaw P/D and it helps.

Gemini further suggested to see whether:

  • esc telemetry is reporting rpm : It is working, I confirm it working by seeing movement in ESC > 0/1/2/3 > RPM log viewer
  • notch filter is able to track RPM correctly : I think it’s working by seeing filter review web tools. Post filter lines are way below pre filter lines.
  • CPU is overloaded : I see load graph in hardware web tools. The load is below 60%.

So now my problems currently are :

  • oscillation in alt hold mode
  • oscillation when throttling in acro mode

I haven’t tried autotune yet.

My questions are:

  1. Can I try autotune with the current state?
  2. How can I remove the oscillation?
  3. Are my observation in ESC RPM and Filter Review correct?
  4. When the battery level enters failsafe threshold, I think it immediately went to RTL mode (cmiiw), because it then climbed upwards (with oscillation audible), although I’ve set it to Land in failsafe tab in Mission Planner. Why is that? Currently I want it to Land, since I’m still tuning the quad. I’ll set it to RTL later when it flies normally in all modes.

I attach the BIN file here. If you see sudden impact in the log, it is caused by me disarming when the quad enter battery failsafe mode.

Please kindly advise. Thanks before

1 Like

Change to using these parameters, suitable for most 5" quads as a good starting point:
Included are some notch filter and logging changes.

ANGLE_MAX,6000
ARMING_CHECK,1
ATC_ACCEL_P_MAX,162000
ATC_ACCEL_R_MAX,162000
ATC_ACCEL_Y_MAX,56000
ATC_ANG_PIT_P,12
ATC_ANG_RLL_P,12
ATC_ANG_YAW_P,6
ATC_RAT_PIT_D,0.001
ATC_RAT_PIT_I,0.06
ATC_RAT_PIT_P,0.06
ATC_RAT_PIT_SMAX,0
ATC_RAT_RLL_D,0.001
ATC_RAT_RLL_I,0.06
ATC_RAT_RLL_P,0.06
ATC_RAT_RLL_SMAX,0
ATC_RAT_YAW_D,0
ATC_RAT_YAW_I,0.018
ATC_RAT_YAW_P,0.18
ATC_RAT_YAW_SMAX,0
BATT_ARM_VOLT,22.10
BATT_CRT_VOLT,21.00
BATT_LOW_VOLT,21.60
GPS_GNSS_MODE,5
INS_HNTCH_BW,30
INS_HNTCH_FREQ,140
INS_HNTCH_HMNCS,1
INS_HNTCH_OPTS,6
INS_LOG_BAT_OPT,4
LOG_BITMASK,180222
MOT_BAT_VOLT_MIN,19.80
PSC_ACCZ_I,0.26
PSC_ACCZ_P,0.13
PSC_VELZ_P,2
SERVO_BLH_AUTO,1
SERVO_DSHOT_ESC,2   <- you are not getting any extended info so no need for "4"

I assume you have a 6S LiPo - advise if your battery is a different chemistry.

Start all your tests in Stabilise mode and AltHold mode, when stable enough move to Loiter. We can get the basics working Ok, then you can go your hardest on Acro mode.
Do all tuning without the camera - fit the camera when the copter can deal with the weight and disturbances.

1 Like

Yes, I am using LiPo.

I’ve tried the params, it hovers great in Stabilize, AltHold, and Acro. No audible oscillation. Thanks a lot.

I still hear a little bit oscillation in roll axis, when I deflect the stick quickly. Pitch axis seems fine though.
Here is the log

Do you have any suggestion? Or should I proceed to autotune?

For the Harmonic Notch Filter - just slightly adjust this one parameter :slight_smile:
INS_HNTCH_ENABLE,0
The noise if very low, so not worth having a notch filter interfere with anything else. It’ll be fine!

Attitude control is excellent, and really you probably wont gain anything by running Autotune.
Give these a try just to smooth out yaw a bit, since it’s hunting just slightly.

ARMING_CHECK,1       <-- really you need this
ATC_THR_MIX_MAN,0.5  <-- this can go higher if you need more stability as throttle increases
ATC_RAT_YAW_D,0.002
ATC_RAT_YAW_I,0.02
ATC_RAT_YAW_P,0.2
PSC_VELZ_P,3

Change this:
GPS1_GNSS_MODE,5
Less is more. That GNSS unit you have can do three constellations at best, in certain circumstances, best to just choose the two good reliable ones.

2 Likes

Harmonic Notch Filter has been disabled. You’re right, it isn’t needed. I don’t feel any difference, and CPU load is decreased.
I’ve enabled arming check all (bitmask 1), it is not set to All previously because I am still testing.

A bit oscillation is still heard when moving the quad in pitch and roll axis. Should I decrease ATC_RAT_PIT_D and ATC_RAT_PIT_P ?

Here is the latest log

There’s actually no sign of oscillations in pitch and roll. Yaw is affected slightly by pitch and roll so that’s probably what you are hearing.
You could just run an Autotune on pitch and roll first, but be prepared to put back the existing pitch and roll params. Fly in Loiter mode, change into Autotune mode, when it’s finished just “reposition” and land/disarm. Updated params will be saved. This is the easiest way.

AUTOTUNE_AGGR,0.1
AUTOTUNE_AXES,3

Then run Autotune on Yaw and see of that fixes everything. Or just run it first without pitch and roll.
AUTOTUNE_AXES,12

This is a common mistake - testing is often when you most need all the arming checks and battery failsafes. Been there done that - seen it done by others many times too.
If an arming check fails work through the issue rather than disabling the check.

3 Likes

Very wise words. +100

1 Like

I haven’t done autotune. However, I’ve taken the quad for a rather long acro session. Control felt locked-in and precise. However, I notice oscillation when I punch the throttle or a gust of wind hit the quad.

Here is the log

Should I proceed to autotune, or there is another param modification that I can try?

Thanks a lot

1 Like

I’ve uploaded flight footage
Oscillation in acro mode is visible at minute 1:02 and 3:45
Loiter mode also has oscillation visible at minute 2:42

1 Like

I finally get the quad flying great in Stab, Acro, AltHold, and Loiter mode. Thanks a lot to @xfacta, @amilcarlucas, and my flying buddy Prof. Rendy :smiley:
You guys rocks :+1:

This is the latest log for others who’d like to see.

2 Likes