Bad performance of AutoTune and little oscillations on Copter-4.2.1 Quad X

Hello everyone!

My drone:

  1. Copter-4.2.1 Quad X
  2. Props 22’.
  3. Takeoff weight about 11,5kg without payload and 14,5 with payload.
  4. The payload shifts the center of gravity down.
  5. The motors are placed at the vertices of a rectangle with sides 60cm x 80cm.

My problem:

  1. After change Copter 4.0.7 to Copter 4.2.1 or after crash (can not remember what was first) I see in log ATT_ROLL little oscillations.
  2. I made Autotune with AUTOTUNE_AGGR 0.05, then with AUTOTUNE_AGGR 0.075 and finally with AUTOTUNE_AGGR 0.1, but I still see overshots and little oscillations. After each autotune I reduce by 25% PIDs. Log after AutoTune: https://drive.google.com/file/d/1rDcfFo0tdJkTIyCV6MEOGeYCJKcwJmQb/view?usp=sharing

May be Autotune make good tuning, but I have another problem?
Can u give me advice, what I made wrong?
How to be sure that Autotune made correct PIDs?

Personally I don’t think this is the best approach although some advocate it. It’s likely why these were driven down so low from the Initial Parameters Setup values:
ATC_ACCEL_P_MAX,30000
ATC_ACCEL_R_MAX,28000
ATC_ACCEL_Y_MAX,6000
And now you have a lot of overshoot on Pitch and Roll and the rate outputs are noisy. Also the Notch Filter center frequency seems very high for a craft of this size so I would review the pre-filter test flight data again.

Hello

The ATC_RLL and ATC_PIT are extremely high, think this is the reason for oscillation. I would reduce them and tune them step by step manually. See my recommended initial parameters underneath for your tuning

ATC_RAT_RLL_P: 0.265 → 0.12
ATC_RAT_RLL_I: 0.265 → 0.12
ATC_RAT_RLL_D: 0.009 → 0.003

ATC_RAT_PIT_P: 0.265 → 0.11
ATC_RAT_PIT_I: 0.265 → 0.11
ATC_RAT_PIT_D: 0.009 → 0.003

ATC_ANG_RLL_P: 6.0 → 5.0
ATC_ANG_PIT_P: 6.5 → 5.0

In addition I would change ATC_INPUT_TC from 0,3 to 0,1 to have a more direct response of your RC

BR

Harald

Thanks.

I raised:

ATC_ACCEL_P_MAX,50000

ATC_ACCEL_R_MAX,50000

ATC_ACCEL_Y_MAX,9000

Made:

INS_HNTCH_REF, 0.4 (hover_thrust)

INS_HNTCH_FREQ, 124 (peak freq from FFT)

INS_HNTCH_BW, 62 (peak_freq / 2)

INS_HNTCH_ATT,40

I tried to reduce:

ATC_RAT_RLL_P: 0.265 → 0.132298

ATC_RAT_RLL_I: 0.265 → 0.132298

ATC_RAT_RLL_D: 0.009 → 0.0046

ATC_RAT_PIT_P: 0.265 → 0.132298

ATC_RAT_PIT_I: 0.265 → 0.132298

ATC_RAT_PIT_D: 0.009 → 0.0046

ATC_ANG_RLL_P: 6.0 → 5.0

ATC_ANG_PIT_P: 6.5 → 4.5

ATC_INPUT_TC: 0,3 → 0,15

I didn’t understand, it became better or not? =)

I want to remind you that my two batteries are fixed on the bottom of the legs of the drone. On the left leg and on the right leg, 2 kg on each side.

Log here (see last flight):

https://drive.google.com/file/d/1yYX0tJbTDjQ6iUGb6lbBQMa0SKrusPsf/view?usp=sharing

I don’t think so. Center frequency should be 62Hz. You have it set on the 2nd harmonic completely missing the 1st.


It’s not true that you always select the highest magnitude peak. You need to apply some logic to the decision.

So that:

INS_HNTCH_REF, 0.4 (hover_thrust)
INS_HNTCH_FREQ, 62 (peak freq from FFT)
INS_HNTCH_BW, 31 (peak_freq / 2)
INS_HNTCH_ATT,40

You sad at the begining of this topic “Also the Notch Filter center frequency seems very high for a craft of this size so I would review the pre-filter test flight data again.” Now it is normal?

Yes, more typical of a larger craft.

Ok. I will try it. What about last log?

Doesn’t look any better. Large overshoot on both Pitch and Roll.


Try In-Flight Tuning with Rate Roll/Pitch kP on the pot with a center value where it is now with Max 2X and Min 1/2 and try to determine where the improvement lies.

I will try it. Thanks.

  • correctly I understand, that my task is to reduce overshoots by tune kP?
  • what I should do with kD? Now it is seems ok or it should be reduced?

Yes, right. If you had a higher thrust/weight craft I would say lower these in increments
and graph the results but with this craft I’m not sure that’s the right way to go.

leave it for now.

In this log overshots don’t seems so big?

Since params from my last log:

——————

1) Firstly I changed this parameters:

ATC_ACCEL_P_MAX, 50000→30000
ATC_ACCEL_R_MAX, 50000→30000
ATC_ANG_PIT_P, 5→3.5
ATC_ANG_RLL_P, 5→3.5
ATC_ANG_YAW_P, 4→3
INS_HNTCH_FREQ, 124→62
INS_HNTCH_BW, 62→31

——————

2) Then I made test Flight with

ATC_RAT_RLL_P: 0.132298
ATC_RAT_RLL_I: 0.132298
ATC_RAT_RLL_D: 0.0046
ATC_RAT_PIT_P: 0.132298
ATC_RAT_PIT_I: 0.132298
ATC_RAT_PIT_D: 0.0046

Log: 2022-07-12 10-56-20.bin - Google Drive

I saw overshot 5 deg (25%) when drone made Roll from -20 deg to 0 deg:

——————

3) Then I made tune Flight with

ATC_RAT_RLL_I: 0.132298
ATC_RAT_RLL_D: 0.0046
ATC_RAT_PIT_I: 0.132298
ATC_RAT_PIT_D: 0.0046

Log: 2022-07-12 11-11-28.bin - Google Drive

In-Flight Tuning with Rate Roll/Pitch kP 0.11→0.159→0.165→0.17

kP 0.11 overshot 7 deg (35%) when drone made Roll from -20 deg to 0 deg
kP 0.159 overshot 3.5 deg (17.5%) when drone made Roll from -20 deg to 0 deg
kP 0.165 overshot 3.5 deg (17.5%) when drone made Roll from -20 deg to 0 deg
kP 0.17 overshot 3.5 deg (17.5%) when drone made Roll from -20 deg to 0 deg

——————

4) Then I made tune Flight with

ATC_RAT_RLL_I: 0.132298
ATC_RAT_RLL_D: 0.0046
ATC_RAT_PIT_I: 0.132298
ATC_RAT_PIT_D: 0.0046

Log: 2022-07-12 11-50-30.bin - Google Drive

In-Flight Tuning with Rate Roll/Pitch kP 0.1→0.11→0.145→0.189→0.2

kP 0.1 overshot >6 deg (>30%) when drone made Roll from -20 deg to 0 deg

kP 0.11 overshot 5.5 deg (27.5%) when drone made Roll from -20 deg to 0 deg

kP 0.145 overshot 4 deg (20%) when drone made Roll from -20 deg to 0 deg

kP 0.189 overshot 3.29 deg (16.45%) when drone made Roll from -20 deg to 0 deg

kP 0.2 overshot 3.23 deg (16.15%) when drone made Roll from -20 deg to 0 deg

——————

5) Then I made tune Flight with

ATC_RAT_RLL_I: 0.132298
ATC_RAT_RLL_D: 0.0046
ATC_RAT_PIT_I: 0.132298
ATC_RAT_PIT_D: 0.0046

Log: 2022-07-12 12-09-14.bin - Google Drive

In-Flight Tuning with Rate Roll/Pitch kP 0.15→0.2→0.25

kP 0.15 overshot 4.42 deg (22.1%) when drone made Roll from -20 deg to 0 deg

kP 0.2 overshot 2.96 deg (14.8%) when drone made Roll from -20 deg to 0 deg

kP 0.25 overshot 1.67 deg (8.35%) when drone made Roll from -20 deg to 0 deg

——————

6) Then I made tune Flight with

ATC_RAT_RLL_P: 0.25
ATC_RAT_RLL_I: 0.25
ATC_RAT_RLL_P: 0.25
ATC_RAT_PIT_I: 0.25

Log: 2022-07-12 12-36-46.bin - Google Drive

In-Flight Tuning with Rate Roll/Pitch kD 0.004→0.005→0.003

kD 0.05 overshot -1.35 deg (6.75%) when drone made Roll from 20 deg to 0 deg
kD 0.03 overshot -2.27 deg (11.35%) when drone made Roll from 20 deg to 0 deg

——————

7) Lastly:

ATC_RATE_P_MAX,0→100
ATC_RATE_R_MAX,0→100
ATC_RATE_Y_MAX,0→90

Log: 2022-07-12 13-20-46.bin - Google Drive

average overshot 2 deg (10%) when drone made Roll from 20 deg to 0 deg

——————

My issues:

  1. I have overshots when drone make Roll or Pitch from 0 to 20 deg (always). I think it is because of center of mass, which is below the propeller group. If I can reduce these overshots, how?

  2. Why my desRoll about 15 deg? Why it isn’t 20 deg. My ANGLE_MAX is 2000.

  3. I always have oscillations when I scale Roll graph:

@dkemxr @Harald, I would be very grateful if you could help)

Why nobody can help me?

Hello

I try again to help. Coming from the princip of a clasic PID control loop. Overshot normally occurs if the I part is to high. So please try once to keep the kP bug reduce only the I. You may also recuce the Imax.
Give it a try. I think the issue us a too high I in the control loop

BR

Harald

Hi friend, I have followed your problem carefully. I haven’t seen anything that can help for sure. I have had the same problem with a quad that was prepared for high autonomy, taking advantage of the greater efficiency of large motors and propellers. The low weight of the quad and the great thrust power that it has, makes it very difficult to establish typical parameters. I think that this type of requirement is outside the range of the algorithms used for this type of application.
I’m still looking for a reliable solution. Meanwhile I remain observing other solutions that appear out there…
Good luck

pAq