You are on page 1of 35

PID Tuning

W I NTER EDI TI O N
Contents

3 — Understanding PID control and loop tuning fundamentals

11 — Learning PID loop tuning from an expert

19 — Feed forwards augment PID control

26 — Beyond PID: 6 advanced strategies to add value to modern


process control

31 — The velocity of PID

2
Understanding PID control and
loop tuning fundamentals  Back to TOC

PID loop tuning may not be a hard science, but it’s not magic either. Here are
some tuning tips that work.

A “control loop” is a feedback mechanism that attempts to correct discrepancies


between a measured process variable and the desired setpoint. A special-pur-
pose computer known as the “controller” applies the necessary corrective efforts via
an actuator that can drive the process variable up or down. A home furnace uses a
basic feedback controller to turn the heat up or down if the temperature measured by
the thermostat is too low or too high.

For industrial applications, a proportional-integral-derivative (PID) controller tracks the


error between the process variable and the setpoint, the integral of recent errors, and
the derivative of the error signal. It computes its next corrective effort from a weighted
sum of those three terms, then applies the results to the process, and awaits the next
measurement. It repeats this measure-decide-actuate loop until the error is eliminated.

PID basics
A PID controller using the ideal or International Society of Automation (ISA) standard
form of the PID algorithm computes its output CO(t) according to the formula shown
in Figure 1. PV(t) is the process variable measured at time t, and the error e(t) is the
difference between the process variable and the setpoint. The PID formula weights the
proportional term by a factor of P, the integral term by a factor of P/TI, and the deriv-
ative term by a factor of P.TD where P is the controller gain, TI is the integral time, and
TD is the derivative time.
3
Understanding PID control and loop tuning fundamentals

 Back to TOC

That terminology bears some explaining. Figure 1: An ideal a proportional-integral-


derivative (PID) controller computes its output
“Gain” refers to the percentage by which
CO(t) by multiplying the sum of the proportional,
the error signal will gain or lose strength as it integral, and derivative terms by the controller gain
passes through the controller en route to be- P. The proportional term is the difference between
the desired setpoint SP and the measured process
coming part of the controller’s output. A PID
variable PV(t) at time t. The integral term is the sum
controller with a high gain will tend to gener- of all past errors multiplied by the inverse integral
ate particularly aggressive corrective efforts. time 1/TI. The derivative term is the rate at which
the error is currently changing multiplied by the
derivative time TD. Courtesy: Control Engineering
The “integral time” refers to a hypothetical
sequence of events where the error starts at zero, then abruptly jumps to a fixed value.
Such an error would cause an instantaneous response from the controller’s proportion-
al term and a response from the integral term that starts at zero and increases steadily.
The time required for the integral term to catch up to the unchanging proportional
term is the integral time TI. A PID controller with a long integral time is more heavily
weighted toward proportional action than integral action.
4
Understanding PID control and loop tuning fundamentals

Similarly, the “derivative time” TD is a measure of the relative influence of the deriva-  Back to TOC
tive term in the PID formula. If the error were to start at zero and begin increasing at a
fixed rate, the proportional term would start at zero, while the derivative term assumes
a fixed value. The proportional term would then increase steadily until it catches up
with the derivative term at the end of the derivative time. A PID controller with a long
derivative time is more heavily weighted toward derivative action than proportional
action.

Historical note
The first feedback controllers included just the proportional term. For mathematical
reasons that only became apparent later on, a P-only controller tends to drive the error
downward to a small, but non-zero, value and then quit. Operators observing this phe-
nomenon would manually increase the controller’s output until the last vestiges of the
error were eliminated. They called this operation “resetting” the controller.

When the integral term was introduced, operators observed that it would tend to per-
form the reset operation automatically. That is, the controller would augment its pro-
portional action just enough to eliminate the error entirely. Hence, integral action was
originally called “automatic reset” and remains labeled that way on some PID control-
lers to this day. The derivative term was invented shortly thereafter and was described,
accurately enough, as “rate control.”

Tricky business
Loop tuning is the art of selecting values for the tuning parameters P, TI, and TD so that
the controller will be able to eliminate an error quickly without causing the process
variable to fluctuate excessively. That’s easier said than done.
5
Understanding PID control and loop tuning fundamentals

Consider a car’s cruise controller, for example. It can accelerate the car to a desired cruis-  Back to TOC
ing speed, but not instantaneously. The car’s inertia causes a delay between the time
that the controller engages the accelerator and the time that the car’s speed reaches the
setpoint. How well a PID controller performs depends in large part on such lags.

Suppose an overloaded car with an undersized engine suddenly starts up a steep hill.
The ensuing error between the car’s actual and desired speeds would cause the con-
troller’s derivative and proportional actions to kick in immediately. The controller would
begin to accelerate the car, but only as fast as the lag allows.

After a while, the integral action would also begin to contribute to the controller’s
output and eventually come to dominate it because the error decreases so slowly when
the lag time is long, and a sustained error is what drives the integral action. But exactly
when that would happen and how dominant the integral action would become there-
after would depend on the severity of the lag and the relative sizes of the controller’s
integral and derivative times.

This simple example demonstrates a fundamental principle of PID tuning. The best
choice for each of the tuning parameters P, TI, and TD depends on the values of the
other two as well as the behavior of the controlled process. Furthermore, modifying
the tuning of any one term affects the performance of the others because the modified
controller affects the process, and the process in turn affects the controller.

Ziegler-Nichols tuning
How can a control engineer designing a PID loop determine the values for P, TI, and TD
that will work best for a particular application? John G. Ziegler and Nathaniel B. Nich-
6
Understanding PID control and loop tuning fundamentals

ols of Taylor Instru-  Back to TOC


ments (now part
of ABB) addressed
that question in
1942 when they
published two loop
tuning techniques
that remain popular
to this day.

Their open loop


technique is based
on the results of a bump or step test for Figure 2: An open loop bump test reveals the
behavior of a controlled process by manually
which the controller is taken offline and man-
forcing the controller to apply a bump of B units
ually forced to increase its output abruptly. to the process. The resulting values of the process
A strip chart of the process variable’s sub- variable plotted over time (yellow line) reveal the
process’ dead time d (the time between points 1
sequent trajectory is known as the “reaction
and 2), time constant T (the time between points 2
curve” (see Figure 2). and 4), and gain K (the distance between points 3
and 4 divided by B). Courtesy: Control Engineering

A sloped line drawn tangent to the reaction


curve at its steepest point shows how fast the process reacted to the step change in
the controller’s output. The inverse of this line’s slope is the process time constant T,
which measures the severity of the lag.

The reaction curve also shows how long it took for the process to demonstrate its
initial reaction to the step (the dead time d) and how much the process variable in-
7
Understanding PID control and loop tuning fundamentals

creased relative to the size of the step (the process gain K). By trial-and-error, Ziegler  Back to TOC
and Nichols determined that the best settings for the tuning parameters P, TI, and TD
could be computed from T, d, and K as shown by the equation:

After these parameter


settings have been loaded
into the PID formula and
the controller returned
to automatic mode, the
controller should be able
to eliminate future errors
without causing the pro-
cess variable to fluctuate
excessively. Figure 3: Increasing the gain for a proportional-only controller will
induce oscillations in the process variable as the controller starts causing
overshoot, then undershoot, and then overshoot again. After the gain
Ziegler and Nichols also reaches a critical value known as the ultimate gain Pu, each succeeding
described a closed loop overshoot will be as large as the previous undershoot (and vice versa),
forcing the process variable into sustained oscillations with a period known
tuning technique that is
as the ultimate period Tu. These two values define a process’ behavior
conducted with the control- sufficiently to allow the controller to be tuned to eliminate errors with only
a few oscillations. Courtesy: Control Engineering 8
Understanding PID control and loop tuning fundamentals

ler in automatic mode, but with the integral and derivative actions shut off. The con-  Back to TOC
troller gain is increased until even the slightest error causes a sustained oscillation in
the process variable (see Figure 3).

The smallest controller gain that can cause such an oscillation is called the “ultimate
gain” Pu. The period of those oscillations is called the “ultimate period” Tu. The ap-
propriate tuning parameters can be computed from these two values according to the
following rules:

Caveats
Unfortunately, PID loop tuning isn’t really that simple. Different PID controllers use
different versions of the PID formula, and each must be tuned according to the appro-
priate set of rules. The rules also change when:

• The derivative and/or the integral actions are disabled.

• The process itself is inherently oscillatory.

• The process behaves as if it contains its own integral term (as is the case with level
control).
9
Understanding PID control and loop tuning fundamentals

• The dead time d is very small or significantly larger than the time constant T.  Back to TOC

Furthermore, Ziegler and Nichols had a particular closed loop performance objective
in mind when they settled on their particular tuning rules. They chose to allow some
fluctuations in the process variable as long as each successive peak was no more than
0.25 the size of its predecessor, which is called “quarter-wave decay.” For applications
that require even less fluctuation, additional tweaking of the tuning parameters is re-
quired.

That’s where loop tuning becomes an art. It takes more than a little experience and
sometimes a lot of luck to come up with just the right combination of P, TI, and TD.

Vance VanDoren
Vance VanDoren, PhD, PE, is a Control Engineering contributing content specialist.

10
Learning PID loop tuning from
an expert  Back to TOC

Hands-on experience helps accelerate the PID learning curve.

S oon after graduating from college, I got a job at a chemical plant as an electrical
and instrumentation technician. Being a young guy with little experience, my su-
pervisor paired me up with a grizzled veteran named Tim. Of the many things I learned
from Tim, one of the most valuable was a simple process for tuning a proportional,
integral, and derivative (PID) control loop. I learned about basic control systems and
how they worked as part of my education. Unfortunately, all of my experience with PID
loops had been in textbooks. I never had the firsthand experience of tuning a PID con-
trol loop in the field.

My first chance at tuning a PID loop came during a trip with Tim to the ethylene pro-
duction area on the west side of the chemical plant. An operator in the ethylene con-
trol room had placed a trouble call for a 500 gal chemical tank that was not maintaining
an accurate level. Tim reminded me that PID control loops can be found in a variety of
applications that require constant control of liquid level, pressure, flow, temperature,
or tension, to name a few. In this case, the operator was trying to keep a constant level
in a 500 gal chemical additive tank that was a part of a chemical line process, but it was
not working properly.

First things first


The first thing Tim taught me about PID control systems was the basic components.
“The first thing you need is a setpoint signal,” he said. In our situation, the setpoint
signal was a 0-10 Vdc signal from a potentiometer in the control room that the oper-
11
Learning PID loop tuning from an expert

ator used to set the level he wanted to maintain in the tank. “The second thing you  Back to TOC
need in your system is a feedback signal,” said Tim. The feedback device in this case
was a liquid level transducer that provided a 4-20 mA signal based on the level of the
liquid in the tank. Tim explained that the last item required in the system is the actual
PID controller.

Although it has been quite a few years since I graduated from college, at that time, the
controller was a self-standing module that received the setpoint and feedback signals
and performed the PID number crunching. It provided a 4-20 mA output signal that
controlled a valve that fed the tank. It also had a built-in small strip chart recorder that
showed the liquid level over long periods of time. You can still purchase stand-alone
PID control modules today, but the software can also be found in VFDs, and most com-
monly in PLCs and building control systems (see Figure 3). PID control loop software
can be found inside of the PLC that runs an entire control room and provides a sophis-
ticated graphical look of the entire control system on a variety of monitors and control
desks. Even though today’s PID graphics look much better than that old strip chart
recorder, the PID control method used today is basically the same.

The proof is in the testing


When we got to the job site, the first thing we did was test the liquid level sensor,
which provided feedback to the controller. After a few minutes, we determined the
sensor was in good working order because it provided 4 mA at low level and 20 mA at
high level. The next thing we checked was the setpoint signal. Tim stood in the control
room and adjusted the potentiometer from minimum to maximum while I measured
the signal where it connected to the PID module. The potentiometer was functioning
properly and measured 0 Vdc at minimum and 10 Vdc at maximum. The last thing we
12
Learning PID loop tuning from an expert

checked was the valve itself. We connected a small variable milliamp supply that pro-  Back to TOC
vided 4-20 mA to the valve and watched it open and close without a problem. So the
culprit in our nonfunctioning PID control system appeared to be the PID module itself.
A quick trip to the parts depot provided us with an identical replacement module and
we headed back to the ethylene control room. I figured we would swap the module;
adjust the proportional, integral, and derivative selector switches to the same settings
as the old one; do a quick test of the system; and be back at the shop in time for lunch.

The PID module we used had three selector switches on the side: one for the propor-
tional gain setting, one for the integral time setting, and one for the derivative time
setting. In most cases, we would have set the selector switches on the new module to
the identical settings of the old module and called it a day. But Tim thought we could
improve on the performance of the control loop and saw a chance to teach me some
of the finer points of PID loop tuning.

PID optimization experiments


In our experiment to obtain the optimum settings for the PID control loop, we set the
integral and derivative times to zero. The factory setting of the proportional gain se-
lector switch was 1.0, with a maximum of 2.0, a minimum of 0.0, and adjustment points
broken into 0.25 increments. We adjusted the proportional gain selector switch to its
lowest nonzero setting of 0.25. The proportional gain is a simple multiplier with higher
settings increasing the response and lower settings reducing it. By adjusting the inte-
gral time and the derivative time to zero, we took the integral and derivative effects
out of the control loop and would see only the effect of the proportional gain setting.
Tim’s first lesson for me was to work on only one adjustment at a time. “If you start
making changes to all three controls at once, you can easily get disoriented,” he said.
13
Learning PID loop tuning from an expert

We started the system with the tank empty and a setpoint of 50% full. We watched the  Back to TOC
liquid level indication move slowly toward the 50% setpoint on the strip chart as the
tank filled. It took a little more than 10 min for the liquid level to reach the 48% mark
and maintain that level. We felt that the result of our first experiment was not accept-
able. While the liquid level never overshot the setpoint, which was a good thing, the
gain was set so low that it took a very long time to fill the tank to its setpoint. Also, the
liquid level came close to the setpoint, but it never really reached it. Tim explained
that it is typical to have some error—2% in this case—when running a control loop with
only proportional control. This error is called offset.

Next, we adjusted the proportional gain setting to 0.50 and ran the experiment again.
This time, the liquid level reached the 50% setpoint in a little more than 2 min, but the
level shot right past the setpoint and reached 55% before it corrected itself and head-
ed back down toward 50%. As I watched the strip chart, the liquid level signal oscillat-
ed back and forth between 52% and 48% for the next 2 min, reducing the overshoot
with each cycle, and then settled just below the setpoint at about 48%. We were happy
that it took only 2 min for the level to reach the setpoint, but were disappointed with
the overshoot and the oscillations.

For our next experiment, we adjusted the proportional gain to 0.75. This time the liq-
uid level reached the 50% setpoint in a little less than 1 min, but the overshoot reached
70% and then oscillated between 60% and 40% for 4 min, reducing the overshoot with
each cycle, and then settled just below the setpoint at about 48%. It appeared that this
adjustment was taking us in the wrong direction, so we changed the proportional gain
setting back to 0.50. Tim’s second lesson for me was: the proportional gain controls
how quickly the process races toward the setpoint. “If you set a very high gain, expect
14
Learning PID loop tuning from an expert

to reach your setpoint quickly but be prepared for the possibility of drastic overshoot  Back to TOC
and oscillations,” he said. “If you set a very low gain, you can prevent the overshoot,
but it may take a long time to reach your setpoint. Start with the integral time, deriva-
tive time, and proportional gain all at zero. Then increase the proportional gain value
in small increments until oscillations occur, then reduce the setting.”

The next thing we did was to add some integral time into the control loop. Tim ex-
plained to me that integral time was like an “error eater” and would go to work on
eliminating some of the oscillation we had experienced. He also said that adding some
integral time would get our system to actually track the setpoint and eliminate the off-
set we had experienced earlier. The factory setting of the integral time selector switch
was 50 sec, with a maximum of 100 sec and a minimum of 0 sec, and adjustment points
divided into 10 sec increments. Hoping to improve on the performance, we adjusted
the integral time selector switch to 10 sec and ran the experiment again. This time the
liquid level reached the setpoint in about 2 min, but continued to increase to about
70% before correcting itself; then it continuously oscillated between 60% and 40% and
never stopped. The overshoot had stayed the same, but we had picked up a ringing
oscillation, which meant the short integral time was making the system unstable.

We adjusted the integral time selector switch to provide 30 sec of integral time for our
next experiment. We ran the system again and the liquid level reached the setpoint in
about 2 min, but continued to increase to 55% before correcting itself. The liquid level
signal oscillated between 54% and 46%, reducing the overshoot with each cycle, and
then settled at the setpoint of 50% within 1 min. While the loop performance was much
better than our last experiment, the biggest difference was the time it took for the sys-
tem to stabilize. Earlier, when we used proportional only control, the system had stabi-
15
Learning PID loop tuning from an expert

lized in 2 min with an offset error. In this experiment, the oscillation was gone in about  Back to TOC
a minute without an offset error.

We ran the experiment again with the integral time set at 50 sec and watched as the
liquid level reached the setpoint in about 2 min and overshot to only 52% before cor-
recting itself. The liquid level signal oscillated between 52% and 48%, reducing the
overshoot with each cycle for about 10 sec, and then settled at the setpoint of 50%.
This adjustment had produced some very good results, we were happy with the prog-
ress that we had made, and I realized we would be back at the shop before lunch after
all. Tim’s third lesson for me was that the integral time acts like an error eater. It can
help reduce the oscillation time and remove the offset, but mis-adjustment can cause
an increase in overshoot as well as lead to the system having oscillations. Increase the
integral time value in small increments until the oscillations and the offset have been
eliminated.

The last adjustment was for the derivative time. Tim explained that the derivative time
acts somewhat like a braking system to help prevent overshoot. However, if derivative
is misadjusted, it could severely reduce the responsiveness of the system. We thought
for a second about the experiments we had run that morning and how we had system-
atically improved the control loop’s performance. In many PID loops, such as HVAC sys-
tems, the derivative control is not used because a little overshoot typically would not
produce detrimental effects. But in situations where overshoot could be dangerous,
derivative control can be useful.

With our last experiment showing only a 2% overshoot and oscillating for only about 10
sec, we thought we had done a pretty good job of tuning the PID loop. But we thought
16
Learning PID loop tuning from an expert

we should try one last experiment to see if we could do even better. The factory setting  Back to TOC
of the derivative time selector switch was at the minimum, 0 sec (disabled) with a max-
imum of 5 sec and adjustment points divided into 0.5 sec increments. I adjusted the
derivative time to the 0.5 sec setting on the selector switch and we ran the experiment
again. We watched as the liquid level reached the setpoint in about 2 min, smoothly
rolled into the 50% setpoint with only a hair of overshoot, showed one small dip below
the 50% mark, and then tracked the setpoint perfectly. This was by far the best perfor-
mance we had seen from the liquid level PID control loop that morning. I adjusted the
liquid level setpoint to 60% and watched the system correct and track accurately. Then
I reduced the setpoint to 40% and saw the same results. Tim’s fourth lesson for me was
that the derivative time provides a braking action to the control loop and is not required
in most applications where a little overshoot is allowable. If it is needed, derivative con-
trol can reduce overshoots but could also lead to a lack of responsiveness. Increase the
derivative time value until the response to process changes is optimized.

Happy with the performance of the PID control loop, Tim and I packed our gear and
headed to lunch. It has been a number of years since I worked with Tim, but this expe-
rience is one I have always remembered. Using the basic techniques he taught me has
helped me tune PID control loops in a number of applications.

Tim’s PID control loop rules of thumb


1. Work on only one adjustment at a time. If you start making changes to all three
controls at the same time, you can easily get disoriented.

2. Proportional gain controls how quickly the process races toward the setpoint. If
you set a very high gain, expect to reach your setpoint quickly but be prepared
17
Learning PID loop tuning from an expert

for the possibility of drastic overshoot and oscillations. If you set a very low gain,  Back to TOC
you can prevent the overshoot, but it may take a long time to reach your setpoint.
Start with the integral time, derivative time, and proportional gain all at zero. In-
crease the proportional gain value in small increments until oscillations occur, and
then reduce the setting.

3. The integral time acts like an error eater. It can help reduce the oscillation time and
remove the offset, but improper adjustment can cause an increase in overshoot as
well as lead to the system having oscillations. Increase the integral time value in
small increments until the oscillations and the offset have been eliminated.

4. The derivative time provides a braking action to the control loop and is not re-
quired in most applications where a little overshoot is allowable. If it is needed,
derivative control can reduce overshoots but could also lead to a lack of respon-
siveness. Increase the derivative time value until the response to process changes
is optimized.

John A. Autero
John A. Autero is the manager of technical training services at Yaskawa America Inc.
He has been involved with industrial automation for more than 28 years, 25 of which
have been with Yaskawa. He developed the Yaskawa Engineering Summer Intern and
Co-Op Program, and advanced Yaskawa’s Technical Training Services into an IACET
Authorized Provider to offer CEUs for its students. He holds a BS in industrial engineer-
ing technology from Southern Illinois University.

18
Feed forwards augment PID control
 Back to TOC
In closed-loop motion control applications, it is common to multiply the
target speed and target acceleration by the velocity and acceleration feed
forwards to generate the feed forward’s contribution to the control output.
Feed forward augmentation is a prediction technique that estimates the
output from a proportional-integral-derivative (PID) control algorithm without
waiting for the PID algorithm to respond. Feed forward reduces the error
faster or keeps the error smaller than relying on the PID algorithm alone.

F eed forward augmentation is a prediction technique that estimates the output


from a proportional-integral-derivative (PID) control algorithm without waiting for
the PID algorithm to respond. If the feed forward prediction can estimate the control
output closely, the PID algorithm, whose job it is to minimize the error between the
current state of the system and the desired state, will need to do less to correct the
error. This reduces the error faster or keeps the error smaller than relying on the PID
algorithm alone. Feed forward control outputs usually are calculated using the setpoint
value and its derivatives (based on target velocity and acceleration values) and multi-
plying each one by a gain. In closed loop motion control applications it is common to
multiply the target speed and target acceleration by the velocity and acceleration feed
forwards to generate the feed forward’s contribution to the control output.

Motor PID example


As a simple example, consider a motor that will move 1 in. per second if 1 V is applied,
2 in. per second when 2 V are applied and so on, such that applying 10 V will result in
a speed of 10 in. per second. In this case the feed forward value would be proportion-
al to the velocity: the velocity feed forward value is 1 volt per inch per second. This
19
Feed forwards augment PID control

means that if the setpoint (that is, the target velocity of the system) is 8 in. per second,  Back to TOC
the output from the velocity feed forward term would be 8 V.

In a motion control application the velocity setpoint is ramped up to the final setpoint
smoothly so the feed forward term ramps up smoothly to avoid sudden changes in the
control output that would shock the system.

Also, a motion control application usually has an acceleration feed forward that is mul-
tiplied by the rate of change in the velocity setpoint to give the motor an extra boost
when accelerating to the final position and a little braking while decelerating as the
final position is reached.

Temperature control applications generally perform well without using feed forwards
because the process is relatively slow and the integrator gain term has time to do most
of the work. However, there are cases where the load changes rapidly.

Feed forward story problem


For example, consider a baking application where material being heated moves
through the oven on a conveyor. Assume that the time the material must be in the
oven is constant, but the oven temperature can be varied, and the difference in the
rate of baking can only be due to the density of the material being heated. As the ma-
terial leaves the oven, it removes heat; material leaving the oven at a higher rate will
make for a greater heat loss. To compensate for these factors, some mechanism would
be required to estimate the density of the material going through the oven, which
could be used to calculate the required variations in oven temperature.

20
Feed forwards augment PID control

Typically, the greater the volume or number of items going through the oven, the  Back to TOC
higher the oven temperature should be. If the oven is long and has many zones, then
a queue needs to be implemented so each zone can respond to different amounts of
material in it. There may even need to be a “look ahead” feature in the queue to ac-
count for dead time between items being baked.

In theory, feed forwards should be able to predict the correct control output so there
would be no error, making the use of a PID control algorithm unnecessary. In reality,
the feed forward gains will not be perfect due to the real-world reactions of the plant
being nonlinear, changing loads, or time constants relating to the process that aren’t
really constant. So a PID is still required to correct the error. However, if the feed for-
wards can estimate the control output within 10% of the actual control value required,
then the PID only needs to do the last 10% of the work. This will result in a faster re-
sponse and less error over time, and presumably lower costs and higher productivity
for the manufacturing process.

Calculating feed forward gains


Feed forward gains are actually the inverse of the plant model (a mathematical model
of the operation or process being controlled). If the plant model was some function
Gp(s), the feed forwards would be FF(s) = 1/Gp(s). This fact is useful because when
controlling a system, the process variable [PV(s), the measured state of the process]
should be equal to the setpoint SP(s). In math terms, feed forward control is:

SP(s)*FF(s)*Gp(s)=PV(s)

21
Feed forwards augment PID control

Since the feed forwards are the inverse of the plant, Gp(s)*FF(s) = 1, so the equation  Back to TOC
above simplifies to

SP(s)=PV(s)

The process variable is the same as the setpoint, so there is no error. This is the desired
goal. As mentioned above, the only problem is that typically the plant designers ne-
glect to provide a plant model, so the feed forward gains must be tuned manually. This
isn’t as hard as it seems if the person doing the tuning has access to the integrator’s
gain contribution to the control output.

It is best if the integrator’s gain contribution can be plotted on a trend or captured in


a plot. The reason for this is that if there is an error in the feed forward gains, the inte-
grator gain will try to compensate for the error.

3 tuning plot figures


The yellow plot line in each represents the integrator term. Red and light blue are ac-
tual and target position. Blue and magenta are actual velocity and target velocity, and
green is the control output to the valve. The goal is for the actual and target axis posi-
tions to precisely overlap at every point in time (horizontal axis).

By looking at the plot or trend, the cause of the error can be determined. Then, to re-
duce the error, a feed forward gain can be calculated as a function of whatever caused
the error. For instance, if the motor discussed earlier is told to move at 10 in. per sec-
ond, the motor’s actual speed will lag behind the target speed until the value of the

22
Feed forwards augment PID control

PID’s integrator component winds up enough to increase the control output to 10 in.  Back to TOC
per second.

Changing the target velocity caused the error, so the first step is to calculate a feed
forward term as a function of velocity. Using the numbers from the example above the
integrator value would need to increase enough to contribute 10 V to the control out-
put, causing the system to go 10 in. per second. Now the person tuning the system can
divide the speed by the control output to easily arrive at a velocity feed forward term.

Acceleration, deceleration
Assuming the velocity feed forward is now correct, there should be very little, if any,
error while the system is traveling at constant velocity. However, there will most likely
be some error during acceleration and deceleration. During acceleration the integrator
output will tend to increase a bit to keep the actual velocity from lagging the target
velocity. Since the target acceleration also can be plotted, the amount of integrator
wind-up during acceleration can be divided by the peak acceleration to get a good
estimate of the acceleration feed forward gain. This should reduce the following error
during the acceleration phase and when deceleration goes to zero.

Linear motor model


Finally, as stated above, the feed forward gains provide the coefficients for the plant
model because the feed forward terms are the inverse of the linear plant model. A sim-
ple linear motor model may be:

So the feed forward gains are:

23
Feed forwards augment PID control

…where:  Back to TOC

K is the gain of the motor with load

Τ is the time constant of the motor with load

s is the Laplace operator

1/K is the velocity feed forward term

Τs/K is the acceleration feed forward term

[Reminder: Laplace transform is a mathematical device used to make a round trip from
the time to the frequency-dependent complex variable(s) domain and back. A Laplace
operator is a differential operator given by a function’s gradient.]

Hydraulic cylinder model


A linearized model for a hydraulic cylinder and load is more complicated. The cylinder
and load can be modeled as a mass between two springs, so it is an underdamped
two-pole system. A linear model is:

Invert to find the feed forward gains:

…where the additional term ζ is the damping factor and ω is the natural frequency

1/K is the velocity feed forward term


24
Feed forwards augment PID control

 Back to TOC
(2*ζ*s)/(K*ω) is the acceleration feed forward term

and

1/(Kω2 ) is the jerk feed forward term

Notice that there is an extra power of (s) and a corresponding feed forward term. This
is the jerk feed forward gain that is multiplied by the current target jerk generated by
the target generator.

Feed forwards are relatively easy to tune or determine empirically and can reduce er-
rors and improve response times significantly. Feed forwards always should be consid-
ered when setpoints or load change, yet the error must be minimized.

Peter Nachtwey
Peter Nachtwey is president of Delta Computer Systems Inc.

25
Beyond PID: 6 advanced
strategies to add value to  Back to TOC

modern process control


While PID control is a good choice for most process control applications,
sometimes the application is too challenging or complicated. When that’s the
case, six strategies can simplify the process.

T he proportional-integral-derivative (PID) control scheme is a popular approach


used in programmable logic controllers (PLCs) and distributed control systems
(DCSs) to control complex processes and manage dynamic industrial systems. Many
available online resources center around the fundamentals of setup and control loop
tuning methods used to control errors and minimize process fluctuations – including
how to pick the initial gains, when to use derivative control, how to adjust a PID for
response time, how to reduce overshoot and more.

While PID control is a good choice for most industrial control applications, it’s some-
times not enough to handle a system that is challenging or can’t be boiled down to
a simple setpoint (SP), process variable (PV) and control variable (CV). Some systems
have large deadtimes, which means the time it takes for a change in the CV to make a
noticeable change in the PV. PID is most effective on processes that are linear in their
control range, so processes with non-linear responses, such as pH, can be difficult to
control with a PID loop.

1. Tune the instruments for better PID results


Well-tuned instruments improve PID: The PV input to the PID drives everything that
26
Beyond PID: 6 advanced strategies to add value to modern process control

happens in the rest of the control loop. A noisy measurement will make the error calcu-  Back to TOC
lation (the difference between the SP and PV) erratic. If derivative control is presented
with a significant change or fluctuation in the error within a single cycle of input and
output (I/O) scans, then the derivative is gigantic, and the CV will be slammed to a
minimum or maximum value immediately. Adjusting or replacing the instrument pro-
ducing a noisy PV can turn an erratic control loop into a well-behaved system.

2. Signal filtering cleans PID information


Ensure PID uses clean data: Some process properties are noisy, and the instrumen-
tation accurately records this noise. One way to deal with this noise is signal filtering.
This approach involves applying a time-based filter to the PV and replacing the signal’s
instantaneous value with a value averaged over a certain time window.

When choosing a filtering scheme, the goal should be to preserve as much meaningful
signal as possible while eliminating noise. It’s important to recall that the integral term
of the PID is a time-filtered evaluation of the error, so the filtering is essentially applied
twice. Some control loops are tuned too aggressively for the noisy PV they’re trying to
control. In this instance, reducing the gains to de-tune the PID would work better than
signal filtering.

Signal filtering can hide important process information from operators and control
loops, so use it sparingly and intentionally.

3. Cascade control, using one PID to control another


Controlling a challenging PV: Another way to control a challenging PV is to use one
PID to control another PID, which is known as cascaded PID control. The high priority
27
Beyond PID: 6 advanced strategies to add value to modern process control

 Back to TOC

PV is fed to a slow-moving primary PID, which sends a Basic proportional-integral-derivative


(PID) control is often sufficient for
dynamic SP to a fast-moving secondary PID that con-
process control applications, but
trols a different, secondary PV, which then influences there are other tools available there
the primary PV via process interactions. For example, to augment its capabilities. Courtesy:
Maverick Technologies
a steam heat exchanger’s pressure is a fast-mov-
ing property that can be adjusted to control the
slow-moving temperature of the fluid exiting the exchanger. Controlling the secondary
PV – pressure – gets the primary PV – temperature – to its SP faster and keeps it there
with little or none of the oscillation that would be present using a single PID to control
temperature directly.

28
Beyond PID: 6 advanced strategies to add value to modern process control

4. Feedforward control: Change based on an anticipated future  Back to TOC


Change the future before it gets here: Control system designers sometimes know pre-
cisely how a PV will react to a change in CV, and they can encode that knowledge in the
control strategy. This is broadly known as feedforward. A PID system is fundamentally a
feedback scheme, in which the CV is changed, and the resulting PV change is measured
to calculate a new error term. In feedforward, the CV change is used in the control logic
to calculate an expected change in the error term, and this is used in the PID logic. Many
modern PID control logic objects include an input for this feedforward term, which usual-
ly has its own gain tuning constant. Often if a Proportional-Integral (PI) controller is strug-
gling, the best way to improve it is to add some feedforward instead of adding derivative
control, if a suitable leading feedforward variable can be identified.

5. Gain scheduling sometimes can help PID


How gain scheduling can help PID: For processes that are nonlinear over the intend-
ed operating range, PID control can still be an option if each segment of the operat-
ing range has an essentially linear response. The proportional, integral, and derivative
gains can be determined for each segment and then programmed to be changed in the
PID object as the process moves along different linear domains. This is often known as
gain scheduling. Exercise caution with gain scheduling and pay special attention to the
boundaries between gain regimes. If the process is often operated close to a boundary,
consider changing the gain schedule to avoid constant switching between gains.

6. Model-predictive control takes advantage of controller power


Model-predictive control uses modern controllers to help processes: Faster central
processing units (CPUs) are included in modern PLCs and DCSs. Some may recall those
long-gone days of assiduously managing controller memory usage and clock cycles to
29
Beyond PID: 6 advanced strategies to add value to modern process control

avoid controller faults or skipped routines. Today’s controllers feature CPUs with amaz-  Back to TOC
ing calculation capability, which has unlocked the control-scheme innovation called
model-predictive control (MPC). In MPC, control system engineers collaborate with ex-
perts on the physical process to design a mathematical model of it that resides in the
controller. This real-time process model enables the control logic to predict all relevant
PV changes for different CV settings throughout the whole process. These predictions
are used to identify the best CV changes required to achieve the desired overall pro-
cess state.

Don’t abandon hope for an automated, closed-loop solution


For controlling a complex process or dynamic industrial system, basic PID control is
often sufficient, but it is by no means the only tool available. There are many different
options available to control these processes and systems. Combine these options in
various ways to achieve the outcomes that operations personnel and production de-
mands require. When a process seems doomed to oscillation and requires constant,
active supervision by operations personnel, consider the advanced control strategies
reviewed here. They can turn the most challenging process into a reliable, high-up-
time, almost invisible part of a smooth-running facility.

William Hughes, PE
William Hughes, PE, is a senior engineer at Maverick Technologies, a leading plat-
form-agnostic automation solutions provider offering industrial automation, strategic
manufacturing and enterprise integration services for the process industries. He has
over 20 years of experience in process automation, including full-size aviation testing
wind tunnels, power plants, paper mills, consumer product packaging and large chem-
ical processes.
30
The velocity of PID
 Back to TOC
Proportional-integral-derivative (PID) theory is best introduced as the
familiar second order differential equation via the velocity form instead
of the more traditional positional form.

D espite being ubiquitous in industrial control system (ICS) usage, the proportion-
al-integral-derivative (PID) algorithm is a mystery to many. Ask an engineer to de-
scribe the behavior of the D (derivate) term, for instance, and some may respond with
a blank stare.

Textbooks, seminars, and articles often explain the PID control algorithm in a form re-
sembling the following equation:

The terms are:

E = Error, difference between setpoint and measurement

OP = Output to the final control element, typically in percent of scale

P = Proportional term

I = Integral term

D = Derivative term

Kp = Proportional gain

31
The velocity of PID

Ki = Integral gain  Back to TOC

Kd = Derivative gain.

A different view
Why is it presented this way? Well, it does match the name of the algorithm and shows
the proportional, integral, and derivative terms in a simple manner. However, this arti-
cle suggests a different approach using velocity instead of position.

A core foundation of an engineering curriculum is differential equations. Once engi-


neering students grasp differential equations, they see them used to explain the clas-
sic spring-mass system in physics and LRC circuits in electrical studies. [Of course, L
stands for inductance, R is resistance, and C is capacitance.] Engineering graduates
are very familiar with the spring-mass system and LRC circuits. That’s because they
are the same mathematically. They are second-order differential equations. A lot of
real world applications are second order differential equations, so the ability to com-
prehend the common mathematical foundations makes it easy to understand and
remember.

Textbooks describing the PID algorithm present it as a differential equation, but not in
the same way as the spring-mass or LRC circuit. Even though it is the same second-or-
der differential equation, its presentation and explanation differ. To match the more
familiar presentation, it would be shown as:

The only change made was to take the derivative of the prior equation. The original
form of the equation is the positional form. Taking the derivative of a position over
32
The velocity of PID

time creates velocity. Therefore, the latter presentation is the velocity form. When  Back to TOC
doing so, the proportional (P) term becomes a velocity (V) term; the integral (I) term
becomes a positional (P) term; and the derivative (D) term becomes an acceleration (A)
term. Position, velocity, and acceleration (PVA) are very familiar terms. To make it more
familiar, the order has been rearranged:

Note: the PVA equation looks like the very familiar second order differential equations.
It makes the contribution of each term much easier to understand. Explaining it with
the PVA approach can help engineers with a rudimentary or even no knowledge of PID
to better grasp the concepts.

Velocity form comments


However, there are obvious caveats to explaining the algorithm with the velocity form:

• Historical momentum perpetuates the traditional presentation. Textbooks using


the positional form are abundant, and the few that mention the velocity form do so
in passing.

• The way the algorithm is implemented in control systems is the positional form.
In addition, the implementation is more complex than a simple addition of three
terms. Filtering of the derivate term, interacting versus standard forms, and differ-
ing actions on setpoint versus measurement change are common features of the
control system implementation that add to the complexity.

Despite historical and implementation support of the positional form, the velocity
(PVA) form offers a way to introduce the algorithm in a more familiar way to engineer-
33
The velocity of PID

ing students and a more understandable way to help practicing engineers advance  Back to TOC
their engineering prowess, without any blank stares.

Patrick Dixon
Patrick Dixon has worked in the control engineering field since 1984. He is a graduate
of Miami University majoring in Paper Science and Engineering with a minor in Math.
He has continued his involvement with the university’s engineering department with
his service on the academic committee and board of trustees since 1998, earning a
Pioneer Award for distinguished service. In his professional service he has worked as
a process control engineer and project manager in a variety of work environments at
industrial facilities, large control system vendors, start-up advanced control technology
developers, and small system integrators. Dixon established the process control con-
tracting/consulting practice DPAS-INC in 1998 and is a registered professional engi-
neer. He has also led several nonprofit and volunteer organizations.

34
PID Tuning
Thank you for visiting the PID Tuning eBook!

If you have any questions or feedback about the contents


in this eBook, please contact CFE Media at
customerservice@cfemedia.com

We would love to hear from you!

You might also like