Lowest flyable PID and problems with tuning

Hi,

We’re trying to build a big VTOL plane (15kg) but are having trouble with the PID tuning. In short, my question is: what is the lowest PID value (in my case for pitch) that still has some control authority? Usually, according to the documentation, you start by seeing if the UAV oscillates and then go down by 50% on P, I, and D. We’ve already crashed so many times because the drone isn’t stable enough. Now, I’d like to start from the bottom and work my way up. As I understand it, a value of 0 would mean that inputs just get ignored, which isn’t great if the aircraft drifts.
At the moment, the values are set by the “Initial Tune Parameter” tab in relation to prop size, I believe. But we have different sized motors for the front and rear in Q-Mode. I believe that is the problem. In roll and yaw, the drone is perfectly stable, but in pitch, there are extreme oscillations (30° and more). Here’s a short video:

At about 15 seconds, we activate autotune. In autotune, the drone is perfectly stable in all axes, but obviously twitches, which in this case leads to a crash. We have had longer autotune sessions, but at the moment, our batteries don’t last long enough, and the twitching is too extreme, even on low intensity of autotune.
So, in essence, is there a safe lower boundary to PID, or do you know what values Autotune starts its process on?

Thanks in advance and kind regards,
Jann Sander

Currently the values are:
Roll
P - 0.08
I - 0.15
D - 0.0

Pitch
P - 0.04
I - 0.15
D - 0.0
So already quite low.

No, there are no magic :magic_wand: one-size-fits-all lower boundaries. And if it’s too low it will crash.

I’m not after the perfect tune (for now). I’m looking for the rang wich is described as making the drone slow to respond and hard to maneuver so I can work my way up to a prompt but reasonable response.
There can’t be no way to estimate the approximate range where the PID’ should be, right?
For context


this is our motor layout.
Otherwise: the values that autotune starts it’s tuning on would suite my purpose well - so the values im looking for are out there, but I can’t find a hint to what they are.
I’m thankful for any further suggestions…

Maybe providing some build specs, i.e. make/model motors, KV, prop size, battery, etc.

Providing logs will allow the experts here do some analysis.

Good luck.

Yeah, okay, if that helps. The front motors are T-Motor V605 210KV, which put out a peak power of 3200W, and the rear motors are T-Motor F100 KV1100 with a peak power of 1100W. The front Motors are supplied with 12s battery’s and the rear ones with 6s. The only log with this exact configuration is only about 12 seconds long (V605-Erstflug), while there are two longer flights with autotune and V505 KV260 motors in the front.
Here’s the link to the Google Drive folder: LOGs - Google Drive
Maybe I’ll just try to decrease the pitch PID by 50% two times or so and try, but some certainty would be great.
Thank you very much!

You need to remember what P I D means.
You cannot set a value of zero for p or I.
That’s because they’re used in a multiplicative equation. Such as x* p = z.
If you put zero for p you will get zero for z.

So to solve a PID equation for proportional, the system will take the error which is the difference between desired setting and actual position.
Say for example for yaw. If you direct your copter to yaw to one position, there will be an error between the desired position and the actual yaw. The PID calculation takes that error and will multiply by p to give you a desired output. If you enter zero for p, you will get zero yaw, or roll or pitch. That means you’ll have zero control and you’ll crash.
You can have zero for the derivative and still have control.

Hi, thank you for your response.

Of course, P or I can’t be zero, that’s the whole reason why I started this topic. As I understand it, PID defines the aggressiveness with which the aircraft throttles the motors up/down when detecting a difference between the heading or angle of the aircraft and the position it should have. I’m searching for ideas on how to determine a ballpark for the values. Currently, they are set by prop size, but we have 22" props in the front and 7" props in the rear. As a result, the pitch PID is totally off. It makes sense that the way the drone reacts to throttling the rear motors is very different from what is expected from the plus configuration the FC thinks it has.

I know that I have to lower I and probably also P, but I hesitate to do so because they are already very low, and I want to avoid a drone that is heading towards the next tree and can’t be stopped by inputs. A slow response is okay, but no response is not. Do you have any ideas?

For example I wonder if increasing D to something greater than 0 might already improve the situation. At the moment the drone always overshoots the desired pitch angle and pushes back and overshoots and so on. Dampening might already help. Unfortunately I have no experience with manual PID tuning and would like to reassure myself with someone who has, before putting this overly expensive sin-wave generator back up in the air… :wink:
As I mentioned: I am not looking for a way to calculate an accurate value to have perfect response with. I just want to get that damn thing in the air so I can tune without having to rebuild it every time. (Autotune start parameters?)

Sounds about right.
I tune PID parameters in industrial applications for a living. One thing is for certain the values that you ultimately end up with are only good for one condition and one configuration. When you change the configuration, the values are no longer valid or they may just work somewhat.

Prepare yourself for lots of trial and error and try to tune it for when you kick on the other promps and then adjust in small increments. There’s no fast way to tune. There is Auto-Tune but when you run the other props, it’s a crap shoot.

You may be able to write a script that substitutes PID values for when you run the rear props but I’m not sure about that capability.

Yes, that PID is highly special to the config. and basically nothing that can be calculated is clear to me. Also, there are no changes to the configuration (motors, props, arrangement) planned (anymore). And oh my - lots of trial and error we had… :see_no_evil:. So increasing D and decreasing P and I is the right direction when facing large oscillations (+/- 30° in the worst cases), you think? That would make me feel much better for the next test (Nr. 9…)

I just added another (quite old) video (3min) to the video-link above. The first 30s or so show the problem well, I think. The oscillations are greater now then they where back than, because we increased the power of the front motors, thus increasing the difference in power between front and rear.

If you’re using mission planner, there is an option to choose which PID self-tune you would like to invoke. Don’t have to do all three of them at one time. Basically the option allows those drones that don’t have a lot of battery capacity to continue and finish tuning. Start Auto-Tune with just the yaw. Then do pitch, then roll.

On your video at 1: 15 if that’s in auto-tune, you can clearly see the oscillation getting smaller. Try getting your copter flying in stabilize mode for a minute and try to get a good hover, then invoke auto-tune for one Axis only. Don’t touch the sticks until it’s done unless you may have to move it away from an object. Also make sure your trims are correct and do an auto trim before tuning.

Also read this: Arducopter Tuning Guide - Discussions - diydrones

Autotune is what we have tried until now. In the long video (Autotune was activated at about 20s in), it clearly stopped twitching after 2 minutes, and we safely landed, disarmed, and powered it off. However, it did not save the new values, and we found no way to access them. That was only for the pitch axis and on low intensity. After that, we tried to reproduce the tune several times, but it did not finish in time, also only pitch. That’s why I’d like to try to tune it manually, but I can’t find a starting point. Do you happen to know the parameters on which Autotune starts its tune? Because as soon as I enter Autotune, it stands still (apart from the tuning twitches, of course), as can be clearly seen in the short video from 15s on.

As I said, manual tuning will require you to change the value in planner and fly again. Over and over. It’s very time consuming. The only other option is that if you have rotary knobs on your transmitter, you can use one of them to dial in a P or I or a D value while you turn the knob. I don’t remember what was required to save your chosen values after that. It’s in the documentation though.

https://ardupilot.org/plane/docs/automatic-tuning-with-autotune.html

https://ardupilot.org/copter/docs/common-transmitter-tuning.html

There are min/max setting for when using knobs.

Uhhhhhhh :slightly_smiling_face:, that seems handy. I won’t have a problem with starting over and over, I don’t think, but varying the parameter in flight would be awesome! Then I can set the min to something reasonable and the max to what is currently active, and come back “up” quickly if necessary. That is an awesome tip, thank you! I’ll try that. I don’t understand how I did not stumble across that already…

For other people searching to solve that issue, I’d recommend this page Transmitter Based Tuning — Plane documentation
I’ll try tuning it like that and let you know how it turned out!
Thank you again.

1 Like

Just one more question to the PID-Expert before the test: what value would be the most sensible to tune in first – what will probably reduce the oscillations the fastest? I’d recon P, because it has the biggest influence in live correction, but D is there so the correction doesn’t overshoot, and that’s what it is doing… What should I start with?
Also an update to the current parameters given in the post above, they where from the wrong tab…
Pitch P = 0.25, I = 0.25, D = 0.0036

It sounds like you want the VTOL Quick-Tune script
It doesnt do the full Autotune, it just does some basics to reduce oscillations and get to a flyable state.