Interactive PID Demonstration

Most articles define the PID algorithm by stating its mathematical formula.  I will resist doing that in this demonstration.  My intention is to demonstrate PID.  We will examine the most commonly implemented PID algorithm: the "series" control algorithm.

First, notice a few things about the control loop above.  (If you do not see a control loop above, click here.)  The controller, FRC-200, is a liquid flow rate controller; it is in manual; the set point is at 0, and the output is at 100%.  The controller is direct acting; the valve is air to close.  In other words, the valve is closed when the controller output is 100%.  On the trend, the white trace is the controller output (OP), the yellow trace is the set point (SP) and the green trace is the process variable (PV).  The pump is off. Feel free to "play" with the controller and the pump control, but to get full benefit of this demonstration, resist the urge until after the lesson.

Proportional
The P in PID stands for Proportional.  A controller manufacturer can implement it in one of two ways, as Proportional Band or Gain.  Proportional Band is usually expressed in percent.  It represents the amount the process variable (PV) or set point (SP) must change to cause the output (OP) to change 100%.  To demonstrate, put the above controller in Automatic by clicking the "A/M" button.  Notice that P is set to 100%.  Keeping in mind that raising the SP has the same effect on the controller as a falling PV (as far as P is concerned), what will the OP do when the SP is changed from 0 to 10?  Try it.  Did it respond as expected?  Change the SP to 20, then to 40.  As one can see, the PV or SP will have to change 100% to cause the OP to change 100%.  If the controller used gain instead of proportional band, what gain would have the same effect?  An input change of 10% causes an output change of 10%: a gain of 1.  Set the SP back to 0. Set P to 50. Now a SP or PV change of 50% will cause the output to change 100%.  Change the SP from 0 to 10.  The output should change 20%, from 100 to 80.  An input change of 10% causes an output change of 20%: a gain of 2.  What is the gain if P is 200?  Gain can easily be calculated.  Gain = 100 / Proportional Band.  Conversely, Proportional Band = 100 / Gain.  After a little experimentation, put the controller in manual.  Set the P back to 100, and set the OP to 100%.  Start the pump by clicking the "Start" button on the pump control faceplate.  Now put the controller back in automatic.  Notice that the control algorithm set the SP equal to the PV.  That is a feature of some controllers called bumpless transfer.  Change the SP from 0 to 20.  As expected, the OP changes from 100 to 80.  Since the pump is running, the flow (PV) starts to increase.  Unfortunately, it does not reach the desired flow rate (SP).  The difference between the SP and PV can be referred to as "offset" or "error".  Can the offset be decrease by decreasing the P (increasing the Gain)?  Decrease the P by small amounts and note the change in the PV.  What happens if the P is set too low?  Set the P to 50 and change the SP a small amount.  Notice the pretty green sine wave. That’s not a good sign (pun intended).  Set the P back to 100 or put the controller in manual before we blow out the pump seals. We need someone or something who will notice the offset and "reset" the output to a value that will eliminate the offset. That is where the I in PID comes in. It is sometimes referred to as Reset.

Integral
To prepare for this part of the demonstration, Click Here to set the controller to a known state.
The I in PID stands for Integral, and a controller manufacturer can implement it in one of two ways, as "repeats per minute" or "minutes per repeat".  "Repeats per minute" represents the number of times per minute the I term repeats the action of the P term.  Of course, "minutes per repeat" represents the number of minutes the I term takes to repeat the action of the P term.  This action is easily demonstrated.  Note that the controller above uses "repeats per minute."  Make sure the controller is set to its initial state: SP = 0, OP = 100, P = 100, I = 0, D = 0, and Pump OFF.  Put the controller in Automatic.  Change the SP from 0 to 10.  As noted before, the OP changes from 100 to 90 with no further corrective action taken.  Change the SP back to 0.  Set I to 1.  Change the SP from 0 to 10 again.  This time, after P moves the OP from 100 to 90, I takes over and moves the OP from 90 to 80 over the next 1 minute.  In other words, it repeats the action of P 1 time every minute (repeats per minute).  For reference, the vertical lines on the trend chart are spaced 1 minute apart.  After verifying the OP is changing 10% per minute, put the controller in manual and set the OP to 100.  Set I to 2 and put the controller back in Automatic.  What will happen now when the SP is changed from 0 to 10?  Repeat the process using the following values for P and I.  Try to predict the OP response to each setting.
P = 200, I = 1
P = 200, I = .5
P = 50, I = 1
P = 50, I = 5
Once you are familiar with the way P and I interact, start the pump and try to tune the controller.  Start with P set to 100 and I set to 0.

Derivative
The D in PID stands for Derivative.  The first thing one should know about derivative is it should never be implemented in a flow controller. Therefore,  click here to retrieve a temperature controller.  It should also be noted that derivative does not respond to set point changes.  Notice this controller is reverse acting.  Also, the controller input has been disconnected from the process and connected to a signal generator.  Put the controller in automatic by clicking the "A/M" button on the controller faceplate.  Click the blue "up" arrow on the signal generator to cause the controller input to begin slowly ramping up.  After a few seconds, notice how the controller output (white trace) is mirroring the controller input (green trace).  As we learned earlier, that is a result of P's corrective action.  Click the "Stop" button on the signal generator to stop the ramping action.  Change the controller input back to 200 degrees by typing 200 into the signal generator window and pressing "Enter."  Now change the derivative (D) to 0.5 then click the "up" arrow on the generator again.  Notice the step change in the output this time.  That step change is the derivative action.  The derivative action is proportional to the "rate of change" of the process variable.  It is designed to stop the process variable from changing and then its job is done.  Click "Stop" on the signal generator and notice, since the process variable rate of change goes to zero,  derivative removes its corrective action from the output.  Experiment with different values for P and D.

Conclusion
As with most things in industrial instrumentation, PID and loop tuning are very deep and complicated subjects (for me anyway). For further study on the subject, please read the following articles written by people much more knowledgeable than I.
PID Control Information by John Shaw
What is PID - Tutorial

[Home]