View Single Post
Old Jan 25, 2011, 08:35 PM
Centurian is online now
Find More Posts by Centurian
Centurian's Avatar
Corvallis OR
Joined Apr 2004
260 Posts
Comming to Terms with PID Terms

I've been struggling to truly understand the PID coefficients. My tuning has gotten better and better, but I think I finaly understand the PID terms and thought this might be of help to some...

Let me define CSD as transmitter Control Stick Displacement. In the case of MultiWii, 1500 is center, so the control channel receiver output -1500 is CSD. This value will be positive or negative number depending on direction of stick displacement

And define GYRO as the gyro output. The gyro(s) are calibrated to zero at start up. Sense of angular velocity is a positive or negative number depending on direction of rotation. GYRO is a measurement of angular velocity like degrees/second or RPM.

There are 4 items that make up the output of the PID forumula.

1) CSD

2) P is GYRO * the P coefficient. "P" will always try to stop any and all angular velocity. This result drives GYRO back to zero.

3) I is the cumulative sum of the CSD - GYRO. This is trying to match the GYRO to CSD meaning the CSD is really trying to act like a request for angular velocity(gyro output). If the angular velocity matches the perceived CSD request for angular velocity the result would be zero. Don't forget it's cumulative, each time it's calculated, it's added to the previous result. So the "I" term can and will "wind up" but is limited to a maxium sum which is about +/-20 degrees of rotation. This "I" term is what I think of as heading hold.

4) The D is change(delta) of GYRO from the previous reading (last 4 readings actualy). "D" is trying to do is prevent angular acceleration. This was the part that I did not previously understand. If the angular velocity stays constant (no angular acceleration) the result of the "D" term is zero.

Today I used this newfound understanding to go back and retune my tri & quad and I am very pleased with the results. The Tri is large, about 38" dia, the quad is small and squirrly @ 17" diameter. The feedback frequency (wobble) is very fast on the quad and much slower on the tri due to their size difference. They are both pretty light.

In both cases I decreased the pitch & roll "D" to absolute maximum(Note this is a negative value). I can see no downside to this and in both cases I was able to increase "P" as well because the large "D" coefficient trys to resist angular acceleration which dampens the feedback (wobble) normaly caused by a large "P". Both machines are now flying better and the low throttle descent wobble has been greatly reduced/nearly eliminated.

Both machines fly like submarines now. They are so well dampened that it's like flying in water rather than air

One more thing to be aware of is the tail servo output response on a tri does not include the "I" term at low throttle. This is to prevent "wind up" on lift off preventing a large yaw jump. Because of this, I as I compaired the servo response with my PID changes, I was confused until I finaly figured this out!!! To observe the real yaw servo output, move the throttle stick to hover position (motors on or off).

Hope some of this makes sense, it took a LONG time to get thru my thick head!

NOTE: Poorly balanced props will result in bad data comming from the sensors which will be amplified by your PID coefficients. Comes down to garbage in, garbage out... your sensors are your friends and your props are their enemies!!!!
Centurian is online now Find More Posts by Centurian
Last edited by Centurian; Jan 26, 2011 at 02:00 AM.
Reply With Quote