PID values after Autotune

Hello!
I have a problem with a completely unstable drone during Loiter mode. I’m flying a large ZD850 7kg hexacopter with 15 “propellers. The problem occurred after the Autotune was write new parameters, especially the Yaw axis. I used Large Vechicle MagCal for compass calibration. When I switch to Loiter mode, the drone is flying somewhere.
Replacing the 16” propeller only made matters worse. I miraculously landed in Althold mode.

Default PID values:

Autotune PID values:

Here are the logs from Pixhawk 4:
https://drive.google.com/drive/folders/1FnN4aQeRWNzKoUdnOj0Jir8nOKp55RmL?usp=sharing

Thanks!

1 Like

These are very weird PIDs, normally caused by vibration during the tune, or underpowered drone.
I can’t check the logs right now, but I will do later today!

I just want to leave this note:

  • Always check your PIDs after the autotune before flight
  • The drone should hover in stabilize on standard parameters on 50% or less throttle
  • For the people checking the logs, check the vibrations!

As I said, will update you on this question later!

1 Like

I have reset all setting in Mission planner and placed new values for props 16":
MOT_THST_EXPO= 0,71
INS_GYRO_FILTER= 22,7
ATC_ACCEL_P_MAX= 68650
ATC_ACCEL_R_MAX= 68650
ATC_ACCEL_Y_MAX= 21500
MOT_THST_HOVER= 0,25
ACRO_YAW_P= 2,4
ATC_RAT_PIT_FLTD= 11,35
ATC_RAT_PIT_FLTT= 11,35
ATC_RAT_RLL_FLTD= 11,35
ATC_RAT_RLL_FLTT= 11,35
ATC_RAT_YAW_FLTE= 2
ATC_RAT_YAW_FLTT= 11,35

Tomorrow is the first flight with the new settings. Keep your fingers crossed for it to succeed!

This isn’t right. Make it the same as P. And your filters look a bit low for a 16" propped craft. Try 14Hz. And you didn’t set motor scaling for 6S. Or for anything for that matter, they are at zero.

I would also set AutoTune Aggression to default 0.1.

2 Likes

Thanks, I made a mistake while rewriting. I have already corrected.
You say 14Hz, I divided the value of INS_GYRO_FILTER by two so I got 11.35Hz, it is too low?

I also entered the values for 6s:
BAT_VOLT_MAX= 25,2
BAT_VOLT_MIN= 19,8

Why AUTOTUNE_AGGR to default value, will it not be too aggressive?

Use the Tuning Plug-in in Mission Planner. Connect the craft and hit Alt>A.

Generally no. Too low of an aggression value can produce unstable results.

Before running Auto Tune configure the Dynamic Notch filter.

2 Likes

Just got back from a test flight. In loiter mode, the aircraft becomes unstable and makes circular movements. In althold mode, the drone requires a trim because it veers to the left. I am posting the logs below. How can I solve unstable Loiter mode?

https://drive.google.com/drive/folders/1FnN4aQeRWNzKoUdnOj0Jir8nOKp55RmL?usp=sharing

For AltHold, the trim procedure is documented here.
In Loiter, circling around is called toilet bowl, and is usually caused by magnetometer troubles. But, I see your setup has two GPSs, and they perform almost identical. 18-19-20 locked sats. Your FC may switch between them, and since a regular GPS has a 1.5m accuracy, your copter may hunt for positions that are 3m apart. Either unplug the secondary for the tuning, or use some aluminium foil to hamper its reception so it’s Nsats is always lower then the primary. Or, if you handle uCenter well, set the backup to ignore sats lower then, say, 20deg above horizon. Default is 5, 20 lowers the Nsats, GPS remains perfectly useful for backup and in most conditions it’s solution will actually be better :slight_smile:
Back to the magnetometer. I’ve checked your MagX and MagY against pitch and roll and they track perfectly. But MagZ is pretty noisy against yaw, on your primary. Actually your secondary mag is less influenced. And the 3rd looks useless.
It’s a Pixhawk4. If it has the Holybro GPS/buzzer/LED/switch combo as primary, the LED inside can be the culprit for both mag noise and the constant and regular19-20 oscillation in Nsats. And the connectors are ugly, so let’s hope everything is doable in software and duct tape.
For starters, move 2nd mag to primary and viceversa, and stick some aluminium foil around the edge of the blinking GPS. Don’ cover the whole top. Just the sides and like 5mm from edge on top.

1 Like

Thank you so much!
I also will try change GPS_AUTO_SWITCH on Use best, now I have Blend.

I posted a new log from todays flying. Firstly I have changed the GPS_AUTO_SWITCH on Use best and it seems working pretty well. Please let me know what are you thinking!

https://drive.google.com/drive/folders/1FnN4aQeRWNzKoUdnOj0Jir8nOKp55RmL?usp=sharing

The tuning is reasonable, (attitude versus desired attitude), especially considering PIDs are at defaults. This is how multirotors should be, and those that wont fly and wobble uncontrollably likely have hardware issues or mismatched components. Very small quads are bit of an exception, but that’s another story.
I would choose different filter values as per this sheet, but yours will work OK too.

Ideally you’d set up the Harmonic Notch filter too, I’ll put the steps down below.
And then run Autotune again. That might fix these little tiny wobbles you have in attitude

There’s also a slight weight imbalance you can see in this graph


Motors 1,4,6 working a bit harder.

Since you’ve got a reasonable sized aircraft, I’d definitely set these for safety:
BATT_FS_CRT_ACT,1
BATT_FS_LOW_ACT,2
FENCE_ACTION,1
FENCE_ALT_MAX,70 <-adjust to suit local conditions
FENCE_ENABLE,1
FENCE_RADIUS,200 <-adjust to suit local conditions
FENCE_TYPE,3

This will have the side effect of making you wait for a good 3D fix and home position can be set.

Also try setting
GPS_GNSS_MODE,65
GPS_GNSS_MODE2,65
or use 67 if you have SBAS available.
The reasoning is too many constellations (and sats) can slow down the GPS update rate. I’ve seen better performance just using the constellations that suit your region.

EDIT: I meant to say, you’ve also got some X and Y axis vibrations, mostly Y axis, which normally indicates prop balance. Z axis was good.

=============================
HNOTCH phase 1
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,0

  • hover test >1 minute, check FFT

HNOTCH phase 2
INS_HNTCH_ENABLE,1 <- set this then refresh params to see the rest
INS_HNTCH_MODE,1
INS_HNTCH_REF, hover_thrust
INS_HNTCH_FREQ, peak freq from FFT
INS_HNTCH_BW, peak_freq / 2
INS_HNTCH_ATT,40
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,2

  • hover & dynamic test >1 minute, check FFT results

HNOTCH phase 3
INS_LOG_BAT_MASK,0
INS_LOG_BAT_OPT,0

  • no extra logging, assumes HNOTCH is working great

Let us know if you need any help with that.

1 Like

Create your own discussion subject. The one here is PIDs after Autotune, and some GPS/Loiter toilet bowl - where you specifically say you’ve not done Autotune yet

Ok sorry for that .I will make another thread

Thank you for your comprehensive answer! I will definitely use yours suggestions and finally turn on Autotune. Now I need some time to get it all figured out. Thanks a lot!

I did phase one. I posted the results of two flights, one after the other.

First flight:


Second flight:

You’ll need to grab your current hover thrust value, but I would set these judging by those graphs

INS_HNTCH_ENABLE,1 <- set this then refresh params to see the rest
INS_HNTCH_MODE,1
INS_HNTCH_REF, hover_thrust
INS_HNTCH_FREQ,60
INS_HNTCH_BW,30
INS_HNTCH_ATT,40
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,2

If MOT_THST_HOVER is something like 0.4241648 then just set INS_HNTCH_REF to 0.42 , as an example.

…and do some more hover & dynamic flight testing then check FFT results again.
The graphs should show those peaks squashed, or even gone, but check the Amplitude scale too - it should be down in single digits or less, instead of 10’s and 100’s

If you’re happy with it you can set
INS_LOG_BAT_MASK,0
INS_LOG_BAT_OPT,0
and move on to the next steps, maybe another Autotune and see how that works out.

Compass
I’d suggest going outside for a good solid 3D fix and then run the full compass calibration, even if it will be difficult with a large aircraft. Probably disable the internal compass.
Looking at previous logs, all your compasses are slightly affected by interference by throttle. It might be best to consider running the compass/motor calibration although it can be quite scary and even dangerous if instructions are not followed
https://ardupilot.org/copter/docs/common-compass-setup-advanced.html#common-compass-setup-advanced-compassmot-compensation-for-interference-from-the-power-wires-escs-and-motors

Yesterday I did some test flights with new parameters:

  1. One minute hover Althold:

  2. Loiter:

  3. Aggressive Althold:

Telemetry issues during aggressive Althold:

Logs:
https://drive.google.com/drive/folders/1FnN4aQeRWNzKoUdnOj0Jir8nOKp55RmL?usp=sharing

Thank you for your interest!