Understanding PID Control Systems
Understanding PID Control Systems
Understanding PID Control Systems
REV 1
For ME 4031 by Adam A. Krzmarzick
---------------------------------------------------------------------------------------------------------------------
SUMMARY
---------------------------------------------------------------------------------------------------------------------
Contents
Introduction and Motivation..................................................................................................................................2
Control Systems...................................................................................................................................................2
Open Loop versus Closed Loop Control Systems.....................................................................................2
PID Parameters..........................................................................................................................................................3
Proportional Action Term..................................................................................................................................3
Integral Action Term...........................................................................................................................................3
Integral Windup...............................................................................................................................................5
Derivative Action Term......................................................................................................................................6
Noise Amplification due to Differentiation.............................................................................................6
Continuous Mathematical Representation of the PID Parameters........................................................7
Discretized Mathematical Representation of the PID Parameters........................................................8
Transfer Function and Laplace Representation........................................................................................11
Tuning........................................................................................................................................................................12
Command Tracking and Disturbance Rejection......................................................................................12
Enhancing PID control.........................................................................................................................................13
Conclusion................................................................................................................................................................13
Reference Documents...........................................................................................................................................13
Introduction and Motivation
Control Systems
Controls systems come in a wide variety of configurations, but one aspect they all have in
common is task automation. Some may be entirely automated requiring no user input, while
others may seek continual user input to produce the desired automated output. Examples of
control systems include household temperature control, cruise control, artificial hearts, robots,
washing machines, and all automated manufacturing processes. A backhoe or a skid-steer is also
a control system, where the operator is the controller. These few examples only scratch the
surface, as control systems intertwine the lives of average citizens and permeate the entire
engineering world.
A closed loop control system has a reference value, also known as the set point. The reference is
a parameter that the operator must specify. For instance, if it is desired to maintain a transplant
organ at 40.0°F, the technician would specify 40.0°F as the set point on the refrigeration unit.
The sensor, perhaps a thermocouple, would send a signal that would be converted to a
temperature reading. This reading would then be compared with the user specified set point. The
deviation between the reading and the set point, known as the measured error, is sent to a
controller unit. Based on the magnitude and the sign of this error signal, the controller algorithms
2
decide what magnitude of output signal should be sent to the system to correct for the measured
error. Even in the event of a system disturbance, such as the cooler being transferred to a warmer
room, the closed loop feedback system continuously corrects for any deviation from the set
point.
The concept of a closed loop control system is straightforward and its utility in a wide range of
applications is evident. However, it is possible that some uncertainty exists regarding the logic
that is programmed into the control unit.
PID Parameters
Proportionally
Controlled Ship
GALE!
GALE!
GALE!
Figure 3: Offset (also known as droop) condition due to lack of integral control: Ship analogy
4
Constant Disturbance
Natural Length (Analogous to Set-point)
Offset
The proportional
spring force balances
with the constant
disturbance, resulting
in a constant offset or
droop.
Figure 4: Spring Example to illustrate the demand for integral control to complement proportional control
Integral Windup
A notable problem that can arise from the integral gain is integral windup, also referred to as
integral saturation. Windup occurs when the integral of the error with respect to time becomes
large, during a change in set-point for example. Even once the new set point is reached, the
integral term will demand a corrective action proportional to the accumulated error, causing a
potentially aggressive overshoot of the set point. The integral term will provide a pull to
overshoot until all of the integral-error of a particular sign has been "unwound" or cancelled by
integral-error of the opposite sign. The proportional and derivative terms will fight to limit the
over shoot, but may not be able to do so satisfactorily if the windup is especially aggressive.
Figure 5 shows a visual of the cause and consequence of excessive windup.
5
Set Point and Process Variable Values
Set Point
Process Variable
Integral Error
Time
Several actions can be taken to solve the problem of windup. Some of these actions include:
3) Turning off the integral term when implementing set point changes.
4) Increasing the set point as a ramp function rather than as a step function.
6
!"
= ! ω cos ! ! + ! ! !"#! !
!" ! ! ! !! !
! !! !
components with frequencies much higher than the signal frequency, the noise component can come to dominate the differentiated signal. That is, the ratio can be arbitrarily small if !! is
!! !!
large. For this reason, one must use care to ensure that the differentiated signal is not saturated
with noise. Filters and other more in depth modifications to the derivative term can be
implemented to help solve the problem of noise amplification.
As is shown below in Equation 11, the transfer function ! ! = ! of the differential term tends to infinity for large values of !.
However, some systems require only one or two terms to provide necessary system control. For
example, some systems only need PI, PD, P, or I control. The mathematical expressions that
represent each PID term follow directly from the descriptions given in the preceding paragraphs.
!!"# = !!!(!)
!!"# = !! ! ! !"
!
7
Equation 4: Integral Term, Continuous
!
!
!"# = !! !" !(!)
!(!)
! ! = !!"# + !!"# + !!"# = !!! ! + !! ! ! !" + !!
!"
!
u t : controller output
!": ! !"#$%& !" !ℎ ! !"#$%&& !"#$"%&' !ℎ !" !" !"#$% !"#$ ! !"#$%&' !"#$%&'( !" !"#$
In a programmed loop, the line of code e!!"!_!"#: !""#" + !""#"_!"# would keep a running total of the accumulated error
Recall from above: !!!"!: !""#" !" !"!" ! = !" − !"
8
!" !"#$% !"#$ ! !"#$%&' !"#$%&'( !" !"#$
Equation 8: Integral Term, Discrete
!""#" − !"#_!""#"
! =!
!"# !
Δ!
!": ! !"#$%& !" !ℎ ! !"#$%&& !"#$"%&' !"#$% !" !"#$ !"#$%&' Δ! = !"#$%&" − !"#$%&'=time step interval
!""#" − !"#_!""#"
! = !!"# + !!"# + !!"# = !! ∗ !""#" + !! ∗ !""#!!"# + !!
Δ!
u: controller output
Equation 10: Combining Equations 7 through 9 gives the controller output u(t)
9
Figure 6: LabVIEW Formula Block, Discretized PID Control Algorithm
Note that the controller output u is added to the previous output output_old. The reason for this is
that the output required for maintaining the system at the set point value when the measured error
is zero is not zero. Rather, if the system is at the set point, then the controller output u will equal
zero and no correction to the previous output output_old will be made. However, if a corrective
action is required, then the controller output u will modify the output accordingly.
10
P_out
Set Point
(Reference)
å System System Output
åå å
D_out
++++
Measured Output Sensor
correction for an error of a given magnitude. This will pull the process
variable back to equilibrium faster, but setting the proportional gain
too large will result in system instability due to overcorrection.
Integral gain, !! In theory, a larger value of !! will eliminate steady state errors more
shoot.
Derivative gain, !! In theory, a larger value of !! will serve to decrease overshoot.
11
Tuning
Even though PID controllers are generic and can be applied to a multitude of systems, the PID
parameters, namely !!, !!, !"# !!, must be specially tailored to the system at hand. This tailoring of the PID
parameter to a particular system is called system tuning. Aside from blind trial and error, there are several
PID tuning strategies available. Over the years, software has been developed to expedite and optimize
PID tuning. However, a simple tuning strategy called the Ziegler-Nichols method can still be an effective
and efficient means to obtain suitable PID parameters. A possible disadvantage of the Ziegler-Nichols
tuning method is that it involves bringing the system to a point of instability, which may be unsafe or
damaging, depending on the nature of the system. The Ziegler-Nichols tuning method is simple and is
explained below:
Step 1: Set the integral gain !! and the derivative gain !! to zero.
Step 2: Gradually increase the proportional gain !! (starting from zero) until it reaches the ultimate gain !!. (!! is the approximate value of !! at which the system begins to oscillate.)
At this point, the process variable oscillates with constant amplitude at a given frequency. Based on the ultimate gain !! and the oscillation period !!, the
PID control parameters can be determined from Table 2.
Control Type !! !
!
!
!
P !!
- -
2
PI !
!
!!
2.2
1.2
!!
-
PID !! !!
!!
2
0.6!!
8
!!
12
Enhancing PID control
There are many strategies available to enhance the performance of the PID algorithm. As with signal filters, PID
controllers can be daisy-chained (or cascaded) in order to boost performance. Gain scheduling is another
enhancement that can be implemented. It automatically modulates one or all of the controls parameters in a strategic
manner based on the state of the system. For example, during a change in set point, the integral gain !! may be
automatically reduced until the new set point is reached; this would serve to limit undesirable integral windup
effects. Fuzzy logic can also be integrated with PID control to improve the performance of certain systems.
Conclusion
Having a basic understanding of the general process and concepts of controls is critical in present
day engineering. With a solid understanding of these concepts, a mechanical engineer should feel
competent when coordinating a project with the company's control engineers team. A mechanical
engineer should also be able to select proper stock hardware and controllers in order implement
simple control systems. Competency in control and control systems is a critical skill set for an
engineer in today's highly automated world.
Reference Documents
[1] K. J. Astrom and R. M. Murray. (2010, "PID control," in Feedback Systems: An Introduction
for Scientists and Engineers (2nd ed.)Anonymous .
13