PID Quadcopter - Possible improvements

Good morning friends,
after various adjustments and tests I found this setup of my IMU. I would like to ask you if further improvement is possible. The quadcopter is stable even when I move the sticks deeply but has some slight wobble. Do you have any advice for me?

My setup is:
Frame: 680mm
Type: quadcopter
Motors: 340kv
Propellers: 1755
Battery: 2x (4s 6000Mah)
Arducopter v.: 4.1.2

@dkemxr @smartdave @xfacta

Thank you all for your availability

LOG

Set these and do another test flight in ALTHOLD mode, just do some hovering for at least a minute and then some gentle manoeuvres. Let’s see that .bin log file.

ATC_ACCEL_Y_MAX,15000
ATC_INPUT_TC,0.2
ATC_RAT_PIT_FLTD,13.5
ATC_RAT_PIT_FLTT,13.5
ATC_RAT_RLL_D,0.008
ATC_RAT_RLL_FLTD,13.5
ATC_RAT_RLL_FLTT,13.5
ATC_RAT_YAW_FLTE,2
ATC_RAT_YAW_FLTT,13.5
ATC_THR_MIX_MAN,0.1
ATC_THR_MIX_MAN,0.5
BATT_ARM_VOLT,14.70
BATT_CRT_VOLT,14.00
BATT_FS_CRT_ACT,1
BATT_FS_LOW_ACT,2
BATT_LOW_VOLT,14.40
INS_GYRO_FILTER,27
INS_HNTCH_ATT,40
INS_HNTCH_BW,25
INS_HNTCH_ENABLE,1 ← set this then refresh to see more INS_HNOTCH params
INS_HNTCH_FREQ,50
INS_HNTCH_MODE,1
INS_HNTCH_REF,0 ← leave this at 0 till after the next flight and we check FFT
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,0
MOT_BAT_VOLT_MAX,16.80
MOT_BAT_VOLT_MIN,13.20
MOT_THST_EXPO,0.72
PSC_ACCZ_I,0.88
PSC_ACCZ_P,0.44

Thank’s for you reply @xfacta :slight_smile:
I will change the parameters you indicated and try to see how it goes.
But in your parameter list how come you list me twice the same but with different values?
ATC_THR_MIX_MAN,0.1
ATC_THR_MIX_MAN,0.5
Should I try first with one value (0.1) and then with the other (0.5)?
Thank you

sorry a copy/paste mistake there, use the 0.5 value

Hi @xfacta,
i attach my log. There is a little wind today.
My first impression is that the behavior is a bit shaky.
What do you think about it?
Thank’s Shawn

Log

Do you use T-Motor Flame ESCs?

Yes that does seem more wobbly, but if you compare the attitude control between logs over the same timescale, say 30 seconds of flight, the attitude control is kind of similar.
The first log has rapid movements that are probably a bit harder to see with the naked eye.

If you were happy that the wobbliness is not too bad, you could run Autotune and see how it comes up.
Maybe even reduce Autotune aggressiveness and then do a seconds session with default 0.1
AUTOTUNE_AGGR,0.05

You can safely set these for the Harmonic Notch Filter
INS_HNTCH_FREQ,46
INS_HNTCH_REF,0.46
INS_LOG_BAT_OPT,2
watch the decimal places and digits there!

Good morning Shawn @xfacta
my esc is Hobbywing Xrotor Pro 40A, i purchased its why the quality is good i think.
I will try to make the changes you asked me by first trying a constrained take-off on the test bench to see any nervous or uncontrollable reactions.
Thank you

OK, I would set these then do the semi-automatic ESC calibration, then hover in ALTHOLD for a while to make sure the MOT_THST_HOVER is learned.
After that check INS_HNTCH_REF is not higher than MOT_THST_HOVER → it should be about the same or a fraction lower.

MOT_PWM_MAX,2000
MOT_PWM_MIN,1000

https://ardupilot.org/copter/docs/esc-calibration.html#semi-automatic-esc-by-esc-calibration

Hi Shawn @xfacta ,
I have made all the corrections you indicated. I slightly increased the parameter ATC_RAT_RLL_D from 0.008 to 0.01.
Before trying a take-off in the countryside I tried a take-off from the test bench with the drone bound by 4 cables. These cables allow the drone to lift 50 centimeters and move to a limited extent but freedom. I am attaching the link to the .bin file. In your opinion is it prudent to try a take-off in the countryside and an autotune?
Thank you
File.bin

Cant really tell much if that is the bench test with the copter tied down. The attitude control will be affected by the cables.

I would set ATC_RAT_RLL_D and ATC_RAT_PIT_D to about 0.0065 before the next test flight.

Hi @xfacta ,
I made two flights, one with D = 0.0065 (18/02/2022) and one with D = 0.008 (03/03/2022).
What do you think about it?
I also wanted to ask you if the parameters BATT_CRT_VOLT and BATT_low_VOLT take into account the potential drop under load?
Also what is the role and the meaning of the INS_HNTCH_REF parameter?
Thank’s Shawn

Fly 18/02/2022

Fly 03/03/2022

Hi Shawn @xfacta,
I did various tests and autotune and this is my last setup.
I would like your opinion on this and to know if it is possible to improve further. Overall I am satisfied but in Loiter when there is a bit of wind even weak it shows some sways. in Althold instead no (at least to the naked eye).
Very thank’s Shawn

Setup

Last fly

@xfacta i too had same kind issues with multicopter.
In stablize and althold well enough to fly no oscillation and stick control perfect bracking perfect…but when loiter light wind also keep oscillation no perfect loiter.

Your motor outputs are very high, near to maximum, so you will need to closely examine your motor and prop choices for the take-off weight. In the current situation there will be no tolerance of wind or disturbances.
INS_HNTCH_REF needs to be about 0.355
Set these and do another test flight, if it’s OK then run Autotune again, or show us that log.
INS_LOG_BAT_MASK,7
INS_LOG_BAT_OPT,2

EDIT
Also try reducing the Yaw settings a bit
ATC_RAT_YAW_I,0.08
ATC_RAT_YAW_P,0.8

Thanks Shawn @xfacta for your advice. As soon as you make the changes and the flight I will send the log. I chose this setup with 340kv motors, 17 propellers and 4s batteries for various reasons including battery homogeneity among all my drones and long flight time (25 minutes).

Hi Shawn @xfacta ,
i attach my log of the last fly.
LOG
What do you think about it?
Thank’s

Adjust this one slightly
INS_HNTCH_FREQ,44 (was 46)
and you can probably reset these since the harmonic notch filter is working well
INS_LOG_BAT_MASK,0
INS_LOG_BAT_OPT,0

Lower ATC_ACCEL_Y_MAX,8000 (was 13268.82) to minimise any adverse affects yaw might be having on pitch and roll. You could even do a test flight with this change to log the difference, if any.

Then I would run another Autotune now that the notch filter is working well and see what that produces.
I would expect
ATC_ANG_RLL_P and ATC_ANG_PIT_P increase
ATC_RAT_RLL_P/I and ATC_RAT_PIT_P/I slight decrease
ATC_RAT_RLL_D and ATC_RAT_PIT_D maybe increase
Yaw is not as critical and can be done after you are happy with pitch and roll.

I did look over the previous logs too, but I cant decide what manual changes to make to PIDs, let’s see what Autotune does now.