University of Virginia University of Virginia
PID Controllers
Jack Stankovic
University of VirginiaSpring 2015
University of Virginia University of Virginia 2/44
Outline• I Control: Integral Control
• PI Control: Proportional-Integral Control
• D Control: Derivative Control
• PD Control: Proportional-Derivative Control
• PID Control: Proportional-Integral-Derivative Control
• Summary
University of Virginia University of Virginia 3/44
P Control• What is wrong with P control?
– Non-zero steady-state error
• Why?– When (current, instantaneous) error becomes zero
then there is no longer a control signal
University of Virginia University of Virginia 4/44
I Control• What is I control?
– The controller output is proportional to the integral of all past errors
k
jI
I
jeKu
keKkuku
1
)()0(
)()1()(1)(
)(
z
zK
zE
zU I
Integral Controller
E(z) U(z)
University of Virginia University of Virginia 5/44
Integral Control
KI G(z)
R(z) E(z) T(z)+
-
+ +U(z)
D(z)
+ +
N(z)
Y(z)z/
z-1
Adds Pole
University of Virginia University of Virginia 6/44
PI Control
)()( -- response transient theIncrease -- Control P keKku PP
)()1()( --error state-steady Zero-- Control I keKkuku III
1
)(
)(
)(
)1()()()1()(
Control PI
z
KzKK
zE
zU
keKkeKKkuku
PIP
PIP
University of Virginia University of Virginia 7/44
D Control• D Control: the control output is proportional to the
rate of change of the error
– D control is able to make an adjustment prior to the appearance of even larger errors.
– D control is never used alone, because of its zero output when the error remains constant.
)]1()([)( kekeKku DD z
zK
zE
zU DD )1(
)(
)(
University of Virginia University of Virginia 8/44
PD Control
))1()(()()( kekeKkeKku DP
z
KzKK
z
zKK
zE
zU DDPDP
)()1(
)(
)(
control. Ian in does 1at pole thelike response,transient
system' down the slownot does which 0,zat pole a has controller The
z
University of Virginia University of Virginia 9/44
PID Control
1
0
)]1()([)()()(k
iDIP kekeKieKkeKku
)1(
)2()(
)(
)( 2
zz
KzKKzKKK
zE
zU DDPDIP
University of Virginia University of Virginia 10/44
I Control• Mostly used with P control
• Here, by itself to demonstrate its main effects
– Zero steady state error
– Slow response
University of Virginia University of Virginia 11/44
Introducing I Control• What is I control?
– The controller output is proportional to the integral of all past errors
k
jI
I
jeKu
keKkuku
1
)()0(
)()1()(1)(
)(
z
zK
zE
zU I
Integral Controller
E(z) U(z)
University of Virginia University of Virginia 12/44
I Control
KI G(z)
R(z) E(z) T(z)+
-
+ +U(z)
D(z)
+ +
N(z)
Y(z)z/
z-1
University of Virginia University of Virginia 13/44
Steady-State Error with I Control• Start with Example 9.1: the
IBM Lotus Domino Server
43.0
47.0)(
z
zG
Recall
)()()(1
)()(
)(
)()(
zHzGzK
zKzG
zR
zYZFR
Here H(z) = 1
University of Virginia University of Virginia 14/44
Example (continued)
.0 : iserror state-steady The
1
47.0
47.0
)]43.0/(47.0)][1/([1
)]43.0/(47.0)][1/([
)(
)()(
ss
I
I
I
I
R
e
K
K
zzzK
zzzK
zR
zYzF
Multiply top and bottom by (z-1) then set z = 1
University of Virginia University of Virginia 15/44
Why is the steady state error zero
ssssR
ssssss
Rssss
ryF
yre
Fre
/)1(
)]1(1[
:iserror state-steady The
University of Virginia University of Virginia 16/44
General Case for G(z)• The steady-state error of a system with I control is
0, as long as the close-loop system is stable.
0)]1(1[
1)1(
)()1(
)(
)()]1/([1
)()]1/([
)(
)()(
Rssss
R
I
I
I
IR
Fre
F
zzGKz
zzGK
zGzzK
zGzzK
zR
zYzF
University of Virginia University of Virginia 17/44
The steady-state error due to disturbance
)1( iserror state-steady The Dssss Fde
0)1(
)()1(
)()1(
)()]1/([1
)(
)(
)()(
D
IID
F
zzGKz
zGz
zGzzK
zG
zD
zYzF
0)1( Dssss Fde
stable. is system loop-closed theas long as ,)( model systemany for and
of any valuefor zero is edisturbancconstant a error to state-steady theSo
zG
K I
University of Virginia University of Virginia 18/44
• Disturbance Rejection in the IBM Lotus Domino Server
43.0
47.0)(
z
zG
0 5 10 15 20 250
5
10
r(k)
0 5 10 15 20 250
5
10
15
20
d(k
)0 5 10 15 20 25
-20
-10
0
10
20
u(k)
0 5 10 15 20 250
5
10
15
20
y(k)
0 5 10 15 20 25
-10
-5
0
5
10
e(k
)
Example 9.3
University of Virginia University of Virginia 19/44
Transient Response with I Control• I Control eliminates the steady-state error, but it slows the
system down– The reason is the integrator adds an open-loop pole at 1,
which generates a closed-loop pole that is usually close to 1.
• Example 9.2: Closed-loop poles of the IBM Lotus Domino Server
43.0
47.0)(
z
zG
University of Virginia University of Virginia 20/44
Example 9.2 (continued)
• Observe the root locus– The largest closed-loop pole is always closer to the unit
circle than the open-loop pole 0.43.
-1 -0.5 0 0.5 1-1
-0.5
0
0.5
1Root Locus
Real Axis
Imagin
ary
Axis
timesettlinglonger means This
)log(/4
rks
overshootlarger means also This
/
rM p
-1 -0.5 0 0.5 1-1
-0.5
0
0.5
1Root Locus
Real Axis
Imag
inar
y A
xis
Herethere isonlyP control
Here there isI control
University of Virginia University of Virginia 21/44
PI Control• Common controller
• Fast response by P control
• Accurate response by I control
• Good combination
• Another example of Pole Placement Design– Previously we did pole placement for P controller
University of Virginia University of Virginia 22/44
PI Control Design by Pole Placement• Slightly different than for P control (see p 305 in
text/handout)• Design Goals:
• Assumption: G(z) is a first-order system– A higher-order system is approximated by a
first-order system (chapter 3)
*
*
exceednot doesovershoot Maximum (4)
exceednot does timeSettling (3)
minimized iserror state-Steady (2)
stable is system loop-closed The (1)
P
s
M
k
University of Virginia University of Virginia 23/44
PI Control Design by Pole Placement
• Example 9.5: Consider the IBM Lotus Domino server
• Determine transfer function of system and SASO requirements
%10 and 10k and 43.0
47.0)( **
s
PMzzG
Stable – poles within unit circleAccuracy – zero steady state error
Note: 2 poles (one from G(z) and one from I control)
University of Virginia University of Virginia 24/44
PI Control Design by Pole Placement• Compute the desired closed loop poles
• Construct and expand the desired characteristic polynomial
jrez (
6.0,6.0let ve,conservati be To
70.0)1.0ln/(lnlog
log
67.0
*
1044 *
r
rM
r
eer
P
ks
36.0cos2 222 zzrzrz
) )( jrez
/rM p
)log(/4 rks
jre
sincos je j
University of Virginia University of Virginia 25/44
Construct the modeled characteristic polynomial
)](])[[()1(
)(])[()(
zGKzKKz
zGKzKKzF
PIP
PIPR
University of Virginia University of Virginia 26/44
Example 9.5 (continued)• Expand the modeled characteristic polynomial
PIP
PIP
PIP
PIPR KzKKz
KzKK
zGzKzKK
zGzKzKKzF
47.043.0]43.1)(47.0[
47.0)(47.0
)()}1/(]){[(1
)()}1/(]){[()(
2
PIP KzKKzzz 47.043.0]43.1)(47.0[36.0 22
Set the desired equal to the modeled
University of Virginia University of Virginia 27/44
Example 9.5 (continued)• Solve for
36.047.043.0
143.1)(47.0
P
IP
K
KK
76.0
15.0
I
P
K
K
36.0
07.043.0...)(
equation above into substitute verify To
2
zz
zzFR
University of Virginia University of Virginia 28/44
Example 9.5 (continued)• Then check
• Poles are
( .5 + .33) and (.5 - .33) so the system is stable
• = 1 so there is no steady state error)(zFR
University of Virginia University of Virginia 29/44
Example 9.5 (continued)
0 5 10 15 20 250
5
10
r(k)
0 5 10 15 20 250
10
20
d(k)
0 5 10 15 20 25
-10
0
10
up(k
)
0 5 10 15 20 25-20
0
20
ui(k
)
0 5 10 15 20 25-20
0
20
u(k)
0 5 10 15 20 250
10
20
y(k)
10 timesettling
10%overshoot
P control leads to quicker response
I control leads to 0 steady-state error
University of Virginia University of Virginia 30/44
PI Control Design Using Root Locus• The new issue:
– The root locus allows only one parameter to be varied– A PI controller has two parameters:
• The P control gain, and the I control gain
• Solution to this issue:– Determine possible locations of the PI controller’s
zero, relative to other poles and zeros– For each relative location of the zero, draw the root
locus– For the most promising relative locations, try a few
possible exact locations– Simulate to verify the result
University of Virginia University of Virginia 31/44
Summary • I control adjust the control input based on the sum
of the control errors– Eliminate steady-state error– Increase the settling time
• D control adjust the control input based on the change in control error– Decrease settling time– Sensitive to noise
• P, I and D can be used in combination– PI control, PD control, PID control
University of Virginia University of Virginia 32/44
Summary (continued)• Pole placement design
– Find the values of control parameters based on a specification of desired closed-loop properties.
• Root locus design– Observe how closed-loop poles change as controller
parameters are adjusted
University of Virginia University of Virginia 33/44
Relationship to WSN and RTS
• Consider PRR problem in WSN
• Consider Miss Ratio Problem in RTS
University of Virginia University of Virginia 34/44
Extra Slides
University of Virginia University of Virginia 35/44
Example 9.4• Moving-average filter plus I control
– A moving average slows down the system responses– An I control also slows down the system response– So the combination leads to undesirable slow behavior
• Example: IBM Lotus Domino server + I control + Moving-average filer
cz
c
z
zK
zzG I
1 and
1 and
43.0
47.0)(
-1 -0.5 0 0.5 1 1.5-1.5
-1
-0.5
0
0.5
1
1.5Root Locus
Real Axis
Imag
inar
y A
xis
circleunit the toclose polet (2)Dominan
gain ofregion d(1)Shrinke
:nsObservatio
University of Virginia University of Virginia 36/44
Moving-average filter vs. I controller
• An I controller works like a moving-average filter:– More response to sustained change in the output
than a short transient disturbance
• An I controller drives the steady-state error to 0, but the moving-average filter does not.
University of Virginia University of Virginia 37/44
PI Control
University of Virginia University of Virginia 38/44
PI Control Design by Pole Placement
• Approaches:– Step 1: compute the desired closed-loop poles
– Step 2,3,4: find the P control gain and I control gain
– Step 5: Verify the result• Check that the closed-loop poles lie within the unit circle• Simulate transient response to assess if the design goals are
met
rker sks log4
*4 rMM
rP
P
*log
log
)](])[[()1(
)(])[()( ofr denominato theis )cos2( 22
zGKzKKz
zGKzKKzFrzrz
PIP
PIPR
University of Virginia University of Virginia 39/44
PI Control
)()( -- response transient theIncrease -- Control P keKku PP
)()1()( --error state-steady Zero-- Control I keKkuku III
1
)(
)(
)(
)1()()()1()(
Control PI
z
KzKK
zE
zU
keKkeKKkuku
PIP
PIP
University of Virginia University of Virginia 40/44
Steady-state Error with PI Control• PI has a zero steady-state error, in response to a
step change in the reference input– It also holds for the disturbance input
)]1(1[ Rssss Fre
)](])[[()1(
)(])[(
)()}1/(]){[(1
)()}1/(]){[(
)(
)()(
zGKzKKz
zGKzKK
zGzKzKK
zGzKzKK
zU
zYzF
PIP
PIP
PIP
PIPR
0)]1(1[
1)1(
Rssss
R
Fre
F
University of Virginia University of Virginia 41/44
PI Control Design Using Root Locus• Example 9.6: PI control using root locus
43.0
47.0)(
z
zG
good.not circle,unit the toclose always is poledominant the(b),In
University of Virginia University of Virginia 42/44
overshoot actualhigh of because good,Not
4gain overall and 0.2 zero Choose
Example 9.6 (continue)
University of Virginia University of Virginia 43/44
9.0,6.0 IP KK
Example 9.6 (continue)
P control leads to quicker response
I control leads to zero steady-
state error
University of Virginia University of Virginia 44/44
CHR Controller Design Method
)()()( :Assumption
input. control
in the change step a test,bump a with
system, target theof response step obtain the:Point Starting
kbukaynky
University of Virginia University of Virginia 45/44
CHR Controller Design Method
axis time with theline tangent theofon intersecti -the-
react tostartsit after valuefinal its of 0.63reach tosystem by the needed time-the-
line tangent theof slop -the-
L
T
R
University of Virginia University of Virginia 46/44
CHR Controller Design Method• Example 9.7:
design. controller PI for theAsk
response stepunit Given the
University of Virginia University of Virginia 47/44
Example 9.7 (continue)
59at happens10)15(63.0
4
7.19/15
:have wefigure, theFrom
TTLk
L
R
No simulation is needed to verify it. Why?- Only one option in the table
University of Virginia University of Virginia 48/44
D Control
University of Virginia University of Virginia 49/44
D Control• A Real CS Example:
– An IBM Lotus Domino server is used for healthy consulting. (MaxUsr, RIS)
– Bird flu happens in this area. More and more people request for the service.
– More and more hardware is added to the server. – So the reference point keeps increasing.– To deal with the increasing reference point, do
we have better choices than P/I control? – How about setting the control output
proportional to the rate of error change?
University of Virginia University of Virginia 50/44
D Control• D Control: the control output is proportional to the
rate of change of the error
– D control is able to make an adjustment prior to the appearance of even larger errors.
– D control is never used alone, because of its zero output when the error remains constant.
– The steady-state gain of a D control is 0.
)]1()([)( kekeKku DD z
zK
zE
zU DD )1(
)(
)(
University of Virginia University of Virginia 51/44
PD Control
University of Virginia University of Virginia 52/44
PD Control
))1()(()()( kekeKkeKku DP
z
KzKK
z
zKK
zE
zU DDPDP
)()1(
)(
)(
control. Ian in does 1at pole thelike respense,transient
system' down the slownot does which 0,zat pole a has controller The
z
University of Virginia University of Virginia 53/44
PD Control• PD controllers are not appropriate for first-order
systems because pole placement is quite limited
• PD controllers can be used to reduce the overshoot for a system that exhibits a significant amount of oscillation with P control
• Example: consider a second-order system
49.03.1
1)(
2
zzzG
University of Virginia University of Virginia 54/44
Example (continue)
control Ponly gConsiderin
control PD gConsiderin
University of Virginia University of Virginia 55/44
Example (continue)
It is real good
It sounds good
09.0
09.0
18.0
5.0
D
P
DP
DP
D
K
K
KKKK
K
University of Virginia University of Virginia 56/44
Example (continue)
09.067.03.1
09.018.0
)]49.03.1/(1}[/]){[(1
)]49.03.1/(1}[/]){[()(
23
2
2
zzz
z
zzzKzKK
zzzKzKKzF
DDP
DDPR
control D with Compare
control PI with Compare
error. state-steady theeliminate NOTcan control PD that means This
31.0)1( RF
University of Virginia University of Virginia 57/44
Example (continu
e)
University of Virginia University of Virginia 58/44
PID Control
University of Virginia University of Virginia 59/44
PID Control
1
0
)]1()([)()()(k
iDIP kekeKieKkeKku
)1(
)2()(
)(
)( 2
zz
KzKKzKKK
zE
zU DDPDIP
University of Virginia University of Virginia 60/44
PID Control• PI controllers are preferred over PID controller
– D control is sensitive to the stochastic variations– A low-pass filter can be applied to smooth the system
output. In that case, the D control only responds to large changes
– But the filter slows down the system response
• PID Control Design by Pole placement– Compute the dominant poles based on the design
goals– Compute the desired characteristic polynomial– Compute the modeled characteristic polynomial– Solve for the gains of the P, I and D control by
coefficient matching– Verify the result
University of Virginia University of Virginia 61/44
PID control design by pole placement
• Example 9.8:– Consider the IBM Lotus Domino Server
%10 and 10k and 43.0
47.0)( **
s
PMzzG
6.0,6.0let ve,conservati be To
70.0)1.0ln/(lnlog
log
67.0
*
1044 *
r
rM
r
eer
P
ks
11.0063.070.0 :have We
3.0 Choose23
3
zzz
p
University of Virginia University of Virginia 62/44
Example 9.8 (continue)
DDPDIP
DDPDIP
R
KzKKzKKKz
KzKKzKKK
zR
zYzF
47.0))2(47.043.0()43.1)(47.0(
))2()((47.0
)(
)()(
23
2
DDPDIP KzKKzKKKz
zzz
47.0))2(47.043.0()43.1)(47.0(
11.0063.070.023
23
23.0
01.1
31.0
7.043.1)(47.0
063.0)2(47.043.0
11.047.0
D
I
P
DIP
DP
D
K
K
K
KKK
KK
K
University of Virginia University of Virginia 63/44
23.0
01.1
31.0
D
I
P
K
K
K
Example 9.8 (continue)
Top Related