To effectively use and tune a PID control loop, it helps to have a basic understanding of how each term affects the control. A few analogies may help illustrate this: the proportional term is like a rubber band. As a rubber band is stretched, it exerts a force proportional to how much it is distorted from its original shape. The integral term is more difficult to analogize, because its output depends upon a time history, not an instantaneous value. Since the proportional term alone cannot always force the output completely to the set-point, the integral term is added to "pull" the output in the rest of the way. The integral term can do this because it "sums up" errors (even small ones) over time. The integral term can also make the controller quicker to respond. The derivative term is analogous to a shock absorber. It is used to minimize controller overshoot.
Mathematical Description
The formula used by an analog PID controller is:
![]()
where: Kc = proportional gain
KI = reset multiplier
KD = derivative time
e(t) = error (as a function of time)
m(t) = controller output deviationTo convert this formula for use in a discrete or digital environment, rewrite the integral as a summation and replace the derivative with a first-order difference approximation:
where: T = sampling interval
ei = error at ith sampling interval
ei-1 = error at previous sampling intervalIn many implementations, the above equation is rewritten as:
![]()
Notice that the term constants have been renamed because of the different equation form. This is very important, especially when using conventional tuning methods. o