Basic PID Controller
PID stands for Proportional-Integral-Derivative. This is a type of feedback controller whose output, a control variable (C), is generally based on the error between some user-defined set point (S) and some measured process variable (P). Each element of the PID controller refers to a particular action taken on the error:
The error is multiplied by a gain, Kp. This is an adjustable amplifier. In many systems Kp is responsible for process stability: too low and the P can drift away; too high and the P can oscillate.
The integral of the error multiplied by a gain, Ki. In many systems Ki is responsible for driving error to zero, but to set Ki too high is to invite oscillation or instability or integrator windup or actuator saturation.
The rate of change of the error is multiplied by a gain, Kd. In many systems Kd is responsible for system response: too low and the P will oscillate; too high and the P will respond sluggishly. The designer should also note that derivative action amplifies any noise in the error signal.
Tuning of a PID involves the adjustment of Kp, Ki, and Kd to achieve some user-defined “optimal” character of system response.
Although many architectures exist for control systems, the PID controller is mature and well-understood by practitioners. For these reasons, it is often the first choice for new controller design. It satisfies Occam’s Razor in being the simplest solution for most cases.
A simple digital implementation of a PID controller, in which rectangular integration is assumed, is as follows:
where ek = Sk - Pk, and T is the sampling interval.
This is referred to as two-degree-of-freedom (two-DOF) design. Notice for this implementation it’s assumed that all three controller actions involve ek.
Many practitioners try to avoid this: applying Kp and/or Kd to the set point can magnify transient errors introduced by rapid changes to the S. Consider the alternative implementation, in which Kp and Kd are applied only to the P:
… which is one-DOF.