|
This article first appeared in InTech, 10 November
1999
Control
Fundamentals: PID settings sometimes fail to make the leap
by
John Gerry
Joe Engineer finally got that replacement for the single-loop
controllers he'd been waiting for. The replacement was a shiny new
programmable logic controller (PLC). "It should really do the job," he
thought. "Well, now to tune the loops."
"Why not start with the settings from the old controllers?" The PLC had
several proportional-integral-derivative (PID) equations to pick from, and
Joe was careful to select one that matched his old single-loop controller
equation.
Joe was also careful to convert the units between the two controllers.
What a surprise when he put the PID settings in the new PLC! The
controller outputs went crazy! He double-checked his conversions. They
were correct. What now?
What happened to Joe? Why didn't those old settings work? As it turns
out, some of the newer PLCs and distributed control systems (DCSs) give
you a lot more control over the PID algorithm.
For example, in many PLCs you enter the update time of the PID loop in
the PID block, and you trigger the PID block with a timer. The two times
should be equal. If they're not, then the PID output will be unreliable.
Sometimes, because of PLC scanning, it is difficult to tell whether the
block triggers on time.
There are several ways to analyze your controller to see whether it is
working properly. One way is to manually test the controller. Another
method is more sophisticated and uses analysis software (see http://www.expertune.com/). Let's
look at the more fundamental technique.
Recall the PID terms
The "P" part of the controller is the proportional band, or gain
setting. Some controllers use proportional band, and others use gain. Some
manufacturers call the gain setting "proportional gain." They are related
by the following:
Proportional band = 100/gain
With the "P" setting, the output of the controller is proportional to
the change in the process variable.
The "I" part of the controller is the integral, or reset. Integral can
be in any one of these units:
- minutes/repeat
- repeats/minute
- seconds/repeat
- repeats/second
With the "I" setting, the controller output continues to change based
on the amount of time there is an error between set point and the process
variable (PV).
For example, if the gain and integral settings of the controller equal
1 and the integral units are minutes/repeat, then the controller output
will repeat the error every minute.
If there were a 10% error between set point and PV, then with our
example the controller output would change 10% every minute.
The "D" part of the controller stands for derivative, or rate action.
"D" action is in units of minutes or seconds. With derivative action, the
output of the controller changes based on the rate of change in the
process variable.
Experiment with numbers
Now to see if the controller is doing what Joe Engineer thinks it's
doing.
The controller will need to be out of service. To test the "P" and "I"
modes, enter a simulated or "fake" process variable value into the
controller. Record the controller output (CO).
For each test, change the "fake" PV by 10%. To find out what a 10%
change is in engineering units, multiply the process variable span by 0.1.
For example, if your controller PV span in engineering units is from
200° to 800°, then a 10% change would be (800-200)° x .01 = 60°.
Test the easiest first
The first and simplest mode to check is the proportional ("P").
- First, eliminate "I" and "D" from the PID control algorithm.
- If "I" is in minutes/repeat or seconds/repeat, then set it to a
very large number, usually over 1,000 if it's in minutes/repeat or
100,000 if it's in seconds/repeat.
- If "I" is in repeats/minute or repeats/second, then set it to 0.
- Set "D" or derivative action to 0.
- If the controller uses gain, set it to 1. If the controller uses
proportional band, set it to 100.
- Set the controller in auto with the output, set point, and PV at
50%:
- Put the controller in manual, and set the output to 50%.
- Set or force the PV to 50%.
- Set the set point of the controller to 50% also.
- Put the controller in auto and verify that the controller output
is at 50%.
- Change the PV to 60%.
- Verify that the output of the controller changes by 10%.
If the controller output does not change by 10%, then the "P" part of
the controller is not working properly. This may indicate a problem in
scaling the controller inputs or outputs.
Integral action test
Now test the controller's "I" action.
- Eliminate "D" from the PID algorithm by setting the derivative
action to 0.
- If your controller uses gain, set it to 1. If the controller uses
proportional band, set it to 100.
- If "I" is in:
- minutes/repeat, then set it to 1.
- seconds/repeat, then set it to 60.
- repeats/minute, then set it to 1.
- repeats/second, then set it to 1/60 or .0167.
- Put the controller in manual, and set the output to 50%.
- Set the PV to 50%.
- Set the set point of the controller to 50% also.
- Put the controller in auto and verify that the controller output
is at 50%.
- Now, change the PV to 60%.
- The controller output should initially change 10% because of the
"P" action in the controller. Then the output should change by an
additional 10% every minute.
If the controller output did not change by an additional 10% every
minute, then the "I" part of the controller is not working properly.
If this is the case, check that the timing is correct in the PID
controller. Is the update time set correctly? Is the triggering for
the controller set correctly?
|
In the top graph, see that the PV was changed from 50% to 60%. The PI controller output shown in the bottom graph initially falls 10% because the gain in the controller is 1. This is a result of the proportional "P" compnent of the PI controller. Because the intergral time is set to 60 seconds, every 60 seconds the output changes by another 10%. |
Ride the "D" train next
Testing derivative action is more complex because of the interplay
with derivative gain limit or derivative filtering. This test requires
having a recorder connected to the controller output. Because there
are many different ways to compute the derivative component, this test
is an approximation.
- Eliminate "I" from the control algorithm. If the integral mode's
units are in:
- minutes/repeat or seconds/repeat, then set "I" to a very large
number, usually over 1,000 if "I" is in minutes/repeat or over
100,000 if "I" is in seconds/repeat.
- repeats/minute or repeats/second, then set it to 0.
- If the controller uses gain, set it to 1. If the controller uses
proportional band, set it to 100.
- If "D" is in:
- minutes, then set it to 1.
- seconds, then set it to 60.
- Put the controller in manual and set the output to 50%.
- Set or force the PV to 50%.
- Adjust the set point of the controller to 50% also.
- Put the controller in auto and wait for the response to settle.
Verify that the controller output is at 50%.
- If the controller is direct acting, change the PV to 49%. If the
controller is reverse acting, change it to 51%.
- The controller output should exponentially decay as shown in the
figure below.
- Measure the peak of the controller output. This value minus 51%
is the derivative gain limit, which has no units.
- Measure the time it takes for the output to reach 54.7%. This
time multiplied by the derivative gain limit yields the derivative
time.
|
The "D" gain limit is 10. This is figured from the y axis from the CO graph
(61-51=10). The CO was at 54.7% after 12 seconds. Thus, the derivative time is
120 seconds (12 x 10). |
If the controller's derivative time is significantly different
from the entered value, the problem is probably in the timing. See
that the update time is set correctly. Make sure someone correctly
triggers the controller. (Author's note: The example test shown in
the figure yeilds a D time of 120 seconds. Either this controller is
not working properly or the user dialed in an actual D time of 120
seconds and not 60.)
However, the derivative setting can be tricky to get right, and
there may be other problems that only the manufacturer can repair.
Pinpoint the algorithm type
The above tests are applicable for all three classes of
industrial controller algorithms: ideal (ISA or noninteracting),
series (interacting), and parallel. However, because the test works
for any of these types, it does not confirm or check the algorithm
type you are using.
Each class of algorithm behaves differently and requires very
different PID tuning. Software analysis tools exist that check not
only the proper behavior of the controller actions but also the
algorithm types.
Credits
Simulations, figures, and tuning
provided by ExperTune Inc.
Simulations were done using ExperTune's
PID Loop Simulator
Author
Information
John Gerry has a
master's degree in chemical engineering and is a P.E. He is
president of ExperTune, Inc. Gerry's most recent contributions to
InTech were in the August 1998 and May 1999 issues.
|