Arduino PID Library

Neurasonic asked for a story on PID control. Here's my take.
PID stands for proportional, Integral, differential. What do THEY stand for? Start with comparing what you have with what you want with what you have. The difference is called the error signal. If you use only this error signal to drive the output, you have a proportional controller (if the error signal is linear or proportional). This can be OK, but there HAS to be an error to keep driving the output, so it's never exactly right.
OK, how about toting up the small difference, time after time, when you are as close as you can get with the proportional circuit, and driving the output with THAT too? That can work and hit the desired output on the nose.
Now what about if we next want a step change in output?
If we grow restless with a fast start, and a slower slower approach to the desired output, we can get bold. By monitoring the rate that the error signal changes we reduce the time to reach the target value, and (hopefully) minimize the over shoot and hunting chances.
Having said all that PID controllers can be a pig to tune. Some people find fuzzy logic controllers are much easier to understand and to set up.

Brian Whatcott
Altus OK