Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Control basics For deeper understanding of their usefulness,

we deconstruct P, I, and D control functions.

Introduction to

PID control
Paul Avery
Senior Product Training Engineer
Yaskawa Electric America, Inc.
Waukegan, Ill.

E
veryone uses control loops. since 1958.
Anytime you adjust how you Similarly, modern indus-
do something based on pre- trial controls are often re-
vious results, you are forming your quired to regulate process-
own control loop. es as part of a control loop.
For example, when you want The controller receives a setpoint
to drive your car at 65 mph, you request from the programmer and
depress the accelerator until the compares it to a measured feedback.
speedometer reports the target The setpoint can be thought of as
speed — simple. But what happens where I want to be and feedback can
when you start driving up a hill? be thought of as where I really am.
The car slows because the torque to The difference between the set- and Derivative. Proportional means
move a car at 65 mph on flat road is point and feedback is called the er- a constant multiple. A number is
no longer enough — so you respond ror ε. The job of the controller is to said to be a proportion to another if
by pressing the accelerator further eliminate the error — so where I am there exists a constant n such that y
down. Your foot, the speedometer, is where I want to be. = nx. This n can be positive or neg-
and your brain have formed a con- ative, greater or less than one. To
trol loop. American cars have of- How do PID loops work? make the formula more accurate by
fered automated speed control loops PID is an acronym for the math- PID controller standards, propor-
— also known as cruise control — ematical terms Proportional, Integral, tion is given by K P and the x term is

PID benefits almost anything measurable and regulable


The main benefit of any PID loop is that a designer would be forced to invent it or factory automation
can “set it and forget it” while still maintaining a well- would be very limited.
regulated system. PID control is so universal that PI PID loops provide technicians and engineers with
and PID loops can be small and fast like a current- a customizable way to control a variety of condi-
regulating loop inside a servo drive or vector con- tions, from temperature to speed and everything in
troller, or a slower loop regulating the liquid level in between. The loop’s control is used to modify appli-
a giant tank holding thousands of gallons. PID loops cation behavior to keep output at stable and improve
are one of the simplest yet most effective means to response rates. What’s particularly exciting is that
achieve that control on almost anything measurable special software and computers can perform calcu-
and regulable. Frankly, if PID didn’t already exist, we lations to make PID design easier.

16 MARCH 2009 MOTION SYSTEM DESIGN • www.motionsystemdesign.com


PIDs play a pivotal role in
making it easier to regulate
and control things. Each part of a PID loop
functions as a tool of adjustment, with each
having specific purpose. Sometimes only one is
necessary for proper regulation and sometimes
only all three properly provide functionality
necessary for a successful application. Above,
loaded with PID loop functions, some control-
lers steer up to 256 rotary and linear axes.

the control loop error ε: y = K P (ε).


The term Integral means the summation of a func-
tion over a given interval. In the case of controller PID
that is the sum of error over time: y = ∫f (ε)dt.
Finally, Derivative is the rate of change during a giv-
en interval. Interpreted by a PID controller:

d(ε)
y=
dt
All three of these PID controller components cre-
ate output based on measured error of the process be-
ing regulated. If a control loop functions properly, any
changes in error caused by setpoint changes or process
Circle XXX
MARCH 2009 MOTION SYSTEM DESIGN • www.motionsystemdesign.com 17
Control basics

Loop basics when error is so small that the


proportional factor is no longer ef-
Setpoint +! Kp fective, the integral is still hard
-!
at work, collecting error until it is
! Controller
large enough to matter — as part of
output the integral’s function is to elimi-
Feedback nate steady-state offset.
In fact, most control loop action
at steady state is due to the integral
If the control loop functions properly, changes in error caused by setpoint
factor. Controllers that feature inte-
changes or process disturbances are quickly eliminated by the combina- gral reset prove it: Resetting the in-
tion of P, I, and D factors. tegral when a loop is in steady state
causes controller output to momen-
tarily drop to zero as the integral
Proportional: Spot fixer “basket” is emptied.
The downside to the integral fac-
tor is that it strongly contributes to
K=5 Too much gain causes overshoot. controller output overshoot past the
K=2 target setpoint. The shorter the in-
tegral time, the more aggressively
the integral works.

Derivative factor
K=1 The derivative factor is the least
understood and used of the three
factors. In fact, a majority of PID
loops in the real world are really just
Larger proportional gain or error increases output from the proportional
factor. Caution: Setting proportional gain too high can cause a controller
PI loops. That does not negate the
to repeatedly overshoot its setpoint. fact that there are certain applica-
tions in which the derivative plays
a very important role. The propor-
disturbances are quickly eliminated larger the proportional gain, the tional corrects instances of error,
by the combination of the three fac- smaller the steady state error — but the integral corrects accumulation
tors P, I, and D. Let us now analyze the larger the proportional gain, the of error, and the derivative corrects
how each contributes to perfor- more likely the loop is to become present error versus error the last
mance. unstable. This dilemma leads to time it was checked.
inevitable steady-state error called In other words, the derivative is
Proportional factor offset. looking at the rate of change of the
The proportional factor is easi- error ∆ε. The more error changes or
est to understand: The output of Integral factor the longer the derivative time, the
the proportional factor is the prod- Think of the integral factor as a larger the derivative factor becomes.
uct of gain and measured error ε. basket in which the loop stores all The effect of the derivative is to
Hence, larger proportional gain or measured error (∫ε). Remember that counteract the overshoot caused by
error makes for greater output from error can be positive or negative, P and I. When the error is large, the
the proportional factor. Setting the so sometimes error fills the basket P and the I will push the control-
proportional gain too high causes a (when positive error is added to pos- ler output. This controller response
controller to repeatedly overshoot itive error or negative error is added makes error change quickly, which
the setpoint, leading to oscillation. to negative) and sometimes it emp- in turn causes the derivative to
The downside to a proportion- ties the basket — as when positive more aggressively counteract the P
al-only loop is that when error be- error is added to negative, or vice and the I. A properly used derivative
comes too small, loop output be- versa. allows for more aggressive propor-
comes negligible. Therefore, even When the integral factor func- tional and integral factors. Larger
when the proportional loop reaches tions properly in the control loop, derivative time makes the derivative
steady state, there is still error. The the basket is nearly empty. Even more aggressively dampen P and I.

18 MARCH 2009 MOTION SYSTEM DESIGN • www.motionsystemdesign.com


Controllers: How they work Techniques for fine tuning
How a PID controller works is a Tuning a control loop is the ad-
pretty easy concept to understand. justment of its control parameters
The PID controller looks at the (gain/proportional band, integral
current value of an error ε, the in- gain/reset, derivative gain/rate)
tegral of the error over a time inter- to optimum values for a target re-
val ∫ε and the rate of change of the sponse. Tuning is part of loop de-
error ∆ε to determine how much of sign, usually required if the system
a correction to apply. The control- oscillates too much, responds too
ler continues to apply the correction slowly, has steady-state error, or is
until change is seen on the feedback. unstable.
Depending on the error calculation One must be careful when deter-
update rate (which in turn may de- mining whether a PID needs tuning
pend on how often the loop feed- or not: Always check hardware first,
back is read) the corrective action as it could be the problem and not
can be adjusted at a fast rate — for the controller that needs tuning. A
instance, the analog feedback on PID most likely needs tuning if:
some variable frequency drives is • The operator thinks that the con-
updated every 10 msec. troller can perform better • process
The job of a PID controller is to dynamics weren’t well understood
force feedback to match a setpoint. when gains were first set • dynamics
Sometimes error between feedback were changed • some control-sys-
and setpoint is caused by a setpoint tem characteristics are direction de-
change, but in most applications the pendent, or • careful consideration
setpoint is not adjusted much. More wasn’t given to the units of gains
often, error in a loop is caused by dis- and other parameters. On the other
turbances in measured feedback. hand, problems may have nothing
In our beginning example, the dis- to do with the PID loop tuning if
turbance of cruise-control regulation a control valve sticks, measure-
was a hill encountered on a road over ment taps are plugged, sensors are
which a car travels. Other examples of disconnected, or if a control valve
disturbances are double doors open- is stripped out from high-pressure
ing in a building where pressure is flow.
regulated, or people showering while Some systems have interactions
a control loop works to regulate the of widely varied strengths — and
connected water-tank level. there is no single definition of “best

PID loop applications


A PID controller can be used to control any measurable variable, in-
cluding those affected by manipulating other process variables. In other
words, anything that can be measured and manipulated is eligible for PID
loop control. Think of the air pressure in a length of ductwork. A simple
pressure sensor can be used to measure duct pressure and anything
that can increase that pressure, such a variable-speed fan or solenoid-
controlled dampers. Voila — these are all the ingredients needed for PID
control. Other typical PID loop targets are temperature, flow rate, chemical
composition, speed, and level.
Note that most PID loops are single-loop setups, though some control
systems arrange PID controllers in cascades or networks. Here, a master
control produces signals used by slave controllers. Coupled and cascad-
ed controls are common in chemical process control, heating, ventilation,
and air conditioning systems, and other systems where many parts coop-
erate.
Circle XXX
MARCH 2009 MOTION SYSTEM DESIGN • www.motionsystemdesign.com 19
Control basics

Integral: Eliminates steady-state offset

Ti = 1 for more correction — possibly


to the point of excessive.

Ti = 2

Ti = 5 for less correction.

The integral factor is like a basket that stores all measured error. When
the integral is functioning correctly, the basket is always nearly empty.

tuned” that applies to all loops, so no when starting from no-load.


single method optimizes all loops. Several methods are available for
The optimum behavior in a pro- tuning a PID loop; the choice of
cess or setpoint change depends method largely depends on whether
on the application. Some processes or not the loop can be taken offline
must not allow overshoot of a pro- for tuning, and the system response
cess variable, while others must min- speed. If the system can be taken of-
imize energy expended in reaching fline, the best tuning method often
a new setpoint. Generally, response involves subjecting the system to
must be stable and systems must a step change in input, measuring
not oscillate for any combination output as a function of time, and us-
of conditions and setpoints. Tun- ing this response to determine con-
ing of loops is further complicated trol parameters.
by process response time, as it may If the system must remain online,
take minutes or hours for a setpoint one tuning method is to first set I
change to produce a stable effect. and D values to zero and increase P
Some processes also exhibit nonlin- until loop output oscillates — then
earity, so parameters that work well increase I until oscillation stops, and
at full-load conditions don’t work increase D until the loop is accept-

Derivative: Pattern correction


Td = 0.1

Td = 0.7

The derivative factor is the least understood and used of the three fac-
tors. It accounts for and corrects present error versus error at last check.
Circle XXX
20 MARCH 2009 MOTION SYSTEM DESIGN • www.motionsystemdesign.com
Ziegler–Nichols method
Control type Kp Ki Kd
P only 0.5·Kc - -

PI 0.45·Kc 1.2Kp / Pc -

PID 0.6·Kc 2Kp / Pc KpPc / 8

Mathematical gyrations occur during Ziegler-Nichols tuning. With this


technique, I and D gains are set to zero and then P gain is increased
until the loop output starts to oscillate.

ably quick in reaching its reference. times of several minutes, mathemat-


A fast PID loop tuning usually over- ical loop tuning is recommended
shoots slightly to reach the setpoint because trial and error can literally
more quickly. take days just to find a stable set of
Another is known as the Ziegler- loop values. Optimal values are
Nichols method, introduced by John harder to find, but can save a com-
G. Ziegler and Nathaniel B. Nichols pany huge amounts of money. Com-
of Taylor Instruments in 1942. This mercial software is available from
technique also involves setting I and several sources, and can easily pay
D gains to zero and then increasing for itself if a PID loop runs large or
P gain until the loop output starts expensive processes. Some digital
to oscillate. Document critical gain controllers even feature self tun-
K c and the oscillation period of the ing, in which small setpoint changes
output Pc before adjusting P to 0.5. are sent to the process, allowing the
Kc, I to 0.45 K c, and D to 0.6. K c. controller itself to calculate optimal
This proven online method is ad- values.
equate for loops where quarter-wave One can also tune by feel, which
decay is acceptable. is an online method that doesn’t re-
In fact, most industrial facilities quire math. The main problem with
no longer tune loops with manual this method is that it is erratic, not
calculation, but use tuning and loop repeatable, and can be inefficient.
optimization software. These soft- The final method of tuning is a
ware packages gather data, develop quality process model called the
process models, suggest optimal Cohen-Coon, which is a modified
tuning, and even develop tuning version of the Ziegler-Nichols ap-
by gathering data from reference proach. This offline method in-
changes. This can be done both on volves some math, but is only good
and offline. It may also include valve for the first-order process. Under
and sensor analysis, and simula- manual mode, wait until the process
tion before downloading. The only is at a steady state before introduc-
drawbacks: Software is somewhat ing a step change in the input. From
costly and involves some training. the measurements based on the
The analytical approach involves step test, evaluate the process pa-
mathematics. PID loop tuning in- rameters. Based on these, formulas
duces an impulse in the system, and should prescribe controller settings.
then uses the controlled system’s
frequency response to design PID For more information, call
loop values. In loops with response (800) 927-5292 or visit yaskawa.com.
Circle XXX
MARCH 2009 MOTION SYSTEM DESIGN • www.motionsystemdesign.com 21

You might also like