# PID Parameters Extensive Guide

Is there such a thing?

http://copter.ardupilot.com/wiki/tuning/
But I’m looking to understand deeper.
Just to make it clear - It’s not the PID mechanism I’m looking to understand - It’s which PIDs control which mechanisms (What are the “plants” / “process”, and where is the feedback read from)

Here’s what I know, with questions :

• Stabilize Controller - Roll/Pitch/Yaw (Only P) - In charge of converting the desired angle into a desired rotation rate which is then fed to the Rate controller.
– Questions:
---- Why are they only P gains?
---- What is the feedback? Gyro input?
EDIT: It just hit me - I now understand that the rotation rate in question the rotation of the quad, not the propeller rotation rate. So the feedback must be the gyro derivative, right?

• Rate Controller - Roll/Pitch/Yaw - Converts the desired rotation rate into a motor output. IMAX limits the I parameter to a certain maximum.
– Questions:
---- What is the feedback?
---- Why do we use an Imax instead of lowering I?

Altitude:

• Throttle Rate (PD)- Converts the position of the throttle in the RC radio (i.e: rate of climb or descent) to the acceleration. This is fed to:
• Throttle Accel (PID) - Converts the wanted acceleration into motor output
• Altitude Hold (Only P) - Converts the change in altitude (or the altitude error) to a Throttle Rate (to be fed to the Throttle Rate controller
–Questions:
---- The Throttle Rate controller plant’s is acceleration, meaning it gets the accelerometer values as feedback, right? If so, what’s the Throttle Accel feedback?
---- The Throttle Rate controls the Throttle Accel. How do I use it? Say I want my quad to recover quickly from fast falls, which of these controllers should I change? Both?
---- Why don’t we use all PID gains on all controllers?

The rest are more simple to understand.

Sorry for asking so many questions. I’ll try to make a guide out of this when I’ll figure out everything.

Thanks a lot
Nitay

[quote]- Stabilize Controller - Roll/Pitch/Yaw (Only P) - In charge of converting the desired angle into a desired rotation rate which is then fed to the Rate controller.
– Questions:
---- Why are they only P gains?
---- What is the feedback? Gyro input?
EDIT: It just hit me - I now understand that the rotation rate in question the rotation of the quad, not the propeller rotation rate. So the feedback must be the gyro derivative, right?[/quote]

Only P-gains, because… well it’s complicated. We used to have I and D on the Stab, but found that the best flight performance is with really sharp rate tuning, and then simple stab P-term cascading down onto the lower PID. It does make intuitive sense that Stab I-term does not make sense, you would be requesting a persistent rate demand. D-term might make sense, but that would poke the Rate D-term very hard. Since the derivative of Attitude is Rate, the Rate PID is already seeing the error before an Attitude error has had a chance to build up. Thus, as I say, it’s best to have sharp Rate PID tuning and do less in the Attitude controller.

The feedback for the Stab P is the copter attitude or angle, which is actually the integral of the gyros.

[quote]- Rate Controller - Roll/Pitch/Yaw - Converts the desired rotation rate into a motor output. IMAX limits the I parameter to a certain maximum.
– Questions:
---- What is the feedback?
---- Why do we use an Imax instead of lowering I?
[/quote]

Feedback here is the Gyros. Not directly, because the gyro sensor passes through a lot of other complicated processes before getting to this stage. Basically, the basic gyro system is first integrated and combined with information from the accelerometers and GPS to determine the actual attitude angle. Then we again take the derivative of the attitude angle to determine the real angular rate. This is done because the pure gyro feedback is never accurate, and always has error. We need to remove that error before using it.

Imax prevents saturating the motor output. It is better to do this, rather than decreasing the I-term, because we need a large I-term to be able to respond very quickly to errors. For example, in an Octo, if a motor fails, you will have a large rate error. We want the I-term to build up very fast, right to the point of saturation, to give the best chance of stabilizing the copter.

No, the throttle rate controller uses climb rate as feedback. It demands acceleration from the Throttle Accel function, and the Throttle Accel function obviously uses vertical acceleration as feedback. In this case, as above, it’s not as simple as using pure accelerometer data. It’s a blend of accelerometer and barometer data, to determine accurate altitude, and rate, and then acceleration.

Typically we only tune the Throttle Accel, but you might want to play with Throttle Rate too.

Same as above. What we have here is a triple-cascading PID loop, and best performance is with a really tight tune on the lower controller, with P-term only on the upper ones.

What are the typical PID values for a medium-large quad?
Im trying to set up some initial values that wont immediately crash my quad in the first 3 seconds.

My quad has 15x5.2 props, running 390kv motors at 6S. Weight now is 2250g and will be around 4000g with gimbal and a second battery later.
Motor to motor distance is 75 cm diagonal.

I have seen many videos but they just somehow dont make me feel it, I guess I need to try it for myself. so for now, any starting values you might recommend? should I start with the QUAD X4 params? or maybe the X8? I think the Iris is too small.

thanks!