PID and Servo Tutorial

PID,  or Proportional-Integral-Derivative, is a control method used in industrial automation. This tutorial will clear up some misconceptions about this term.

PID controllers have been used in some form since the early 1900s.  They were originally based upon a 19th century governor speed limiter.  Early PID-like controllers were used to automatically steer ships for the US Navy.  These controllers were developed by Nicolas Minorsky, who focused on designing a system that would provide stability against both small and large disturbances.

Today, nearly 95% of closed loop industrial systems use PID control.

PID is essentially a feedback loop control made out of code. It can sometimes be made from hardware.  PID, which stands for Proportional Integral Derivative, is made up of three separate parts that have been joined.  However, in some situations all three parts of the control are not needs, which means you can have P control, PD control, or PI control.

Explanation of the PID Parts

  • P=Proportional. The proportional component of PID allows for correction of a value in proportion to an expected error.  For example, if in building a system, you know your battery will slowly discharge and likely provide less power to your system, you can write a (P) value to correct for this known value error to control your output accordingly.
  • I=Integral.  The integral component of PID essentially takes up the slack left by (P.)  It is the running sum of previous errors.   What this means,  is whatever small amount of error left over after (P) is accounted for is taken care off by (I.)
  • D=Derivative.  The last bit of the PID code is supposed to predict the future.  The derivative component finds the difference between any current error and any previous error, and adjusts the output accordingly.   Control loops that include a (D) component can significantly more time to ‘dial in’ due to the complex nature of the derivative.

PID frequencies are relative to the bandwidth of the servo or process, where the Integral term is most effective at low frequencies, Proportional at moderate frequencies, and Differential at higher frequencies.  PID is more common in process control where pressures, temperatures,  position etc need to be optimally controlled.

In order to properly discuss the effects of PID, we must first look at a basic closed loop servo and the equation for a closed loop response.  In the Sept. 1990 issue of Motion Control, this block diagram of a basic servo and its response formula were published.

In the top diagram, we have the element (A).  The action of summing junction is to subtract the feedback signal (F) from the input (C) with the result known as the error signal (E)=C-F.

The Bode diagram (below)  shows how open loop gain A in an amplifer/motor combination typically experiences a decrease of amplitude by a factor of 10 for every factor of 10 increase in frequency.

The net effect is that A is also A-90°, since it has a gain factor of A and a phase lag of 90°. This closed loop response [F/C = A/(1+A)]

As A’ approaches 1 on the Bode diagram (at 10 rad/sec in the example) the denominator become  1+1 -180°=1-1=0 and F/C becomes infinite.  The result of this is severe oscillations.   But in order to maintain a stable system, the denominator must not be allowed to approach zero.  A commonly accepted design goal is for A’ to have -135° of phase shift or less (45° of  phase margin) This will result in a 25% overshoot of the closed loop system in response to small step inputs.

As the phase margin gets larger, the amount and number of overshoots diminish.  As the phase margin gets smaller, the overshoots get larger and will “ring” for longer periods until finally a sustained  oscillation will occur.

PID provides phase compensation to improve the performance of the servo, using coding to create a closed loop servo with a wider bandwidth and a greater gain (thus greater accuracy) within that bandwidth.  If no velocity loop exists, PID is a good alternative.