2. PID Controller
The acronym PID stands for:
• P - Proportional
• I - Integral
• D - Derivative
PID Controllers:
• greater than 90% of all control implementations
• dates back to the 1930s
• very well studied and understood
• optimal structure for first and second order processes
(given some assumptions)
• always first choice when designing a control system
3. PID Control Algorithm
0
0
1 ( )
( ) ( ) ( )
t
c D
I
de t
c t c K e t e d
dt
e(t)- the error from setpoint [e(t) = ysp - ys].
Kc- the controller gain is a tuning parameter and largely
determines the controller aggressiveness.
tI- the reset time is a tuning parameter and determines the
amount of integral action.
tD- the derivative time is a tuning parameter and determines
the amount of derivative action.
4. Transfer Function for a PID Controller
Ideal PID :
Real PID :
Derivative Kick:
To avoid sudden jump of output due to setpoint
change, sensor output is used in place of error term,
i.e,
0
0
( )
1
( ) ( ) ( )
t
s
c D
I
dy t
c t c K e t e d
dt
5. Digital Equivalent of PID Controller
• The trapezoidal
approximation of the
integral.
• Backward difference
approximation of the
first derivative
0
1
)
(
)
(
n
i
t
t
i
e
dt
t
e
t
t
t
e
t
e
dt
t
e
d
)
(
)
(
)
(
t
t
n
t
t
t
e
t
e
t
i
e
t
t
e
K
c
t
c
n
i
D
I
c
1
0
)
(
)
(
)
(
)
(
)
(
6. Derivation of the Velocity Form of the PID
Control Algorithm
n
i
D
I
c
t
t
t
e
t
e
t
i
e
t
t
e
K
c
t
c
1
0
)
(
)
(
)
(
)
(
)
(
1
1
0
)
2
(
)
(
)
(
)
(
)
(
n
i
D
I
c
t
t
t
e
t
t
e
t
i
e
t
t
t
e
K
c
t
t
c
t
t
t
e
t
t
e
t
e
t
e
t
t
t
e
t
e
K
t
c D
I
c
)
2
(
)
(
2
)
(
)
(
)
(
)
(
)
(
______
__________
__________
__________
__________
__________
7. Velocity Form of PID Controller
• Note the difference in proportional, integral, and
derivative terms from the position form.
• Velocity form is the form implemented on DCSs.
( ) ( ) 2 ( ) ( 2 )
( ) ( ) ( )
( ) ( ) ( )
c D
I
t e t e t e t t e t t
c t K e t e t t
t
c t c t t c t
8. Correction for Derivative Kick
• Derivative kick occurs when a setpoint change is
applied that causes a spike in the derivative of the
error from setpoint.
• Derivative kick can be eliminated by replacing the
approximation of the derivative based on the error
from setpoint with the negative of the
approximation of the derivative based on the
measured value of the controlled variable, i.e.,
t
t
t
y
t
t
y
t
y s
s
s
D
)
2
(
)
(
2
)
(
9. Correction for Aggressive Setpoint Tracking
• For certain process, tuning the controller for good
disturbance rejection performance results in
excessively aggressive action for setpoint changes.
• This problem can be corrected by removing the
setpoint from the proportional term. Then
setpoint tracking is accomplished by integral action
only.
)
(
)
(
by
for
d
substitute
)
(
)
( t
y
t
t
y
K
t
t
e
t
e
K s
s
c
c
10. Guidelines for Selecting Direct and Reverse
Acting PID’s
• Consider a direct acting final control element to be
positive and reverse to be negative.
• If the sign of the product of the final control
element and the process gain is positive, use the
reverse acting PID algorithm.
• If the sign of the product is negative, use the direct
acting PID algorithm
• If control signal goes to a control valve with a valve
positioner, the actuator is considered direct acting.
11. Level Control Example
• Process gain is positive
because when flow in is
increased, the level
increases.
• If the final control
element is direct acting,
use reverse acting PID.
• For reverse acting final
control element, use
direct acting PID.
Fout
Fin
L
LC
LT
12. Level Control Example
Fout
Fin
L
LC
LT
• Process gain is negative
because when flow out is
increased, the level
decreases.
• If the final control
element is direct acting,
use direct acting PID.
• For reverse acting final
control element, use
reverse acting PID.
13. General Feedback Control Loop
GP(s)
Ga(s)
GC(s)
KS
GS(s)
Gd(s)
d(s)
ysp(s)
+
-
+
+
u(s) y(s)
c(s)
e(s)
yS(s)
1
)
(
)
(
)
(
)
(
1
)
(
)
(
)
(
)
(
)
(
)
(
)
(
)
(
)
(
s
G
s
G
s
G
s
G
s
G
s
G
s
G
s
G
s
G
s
G
s
G
K
s
y
s
y
c
c
s
c
a
p
c
a
p
S
sp
14. Controller actions on feedback dynamics
Process G(s) : Controller : Proportional, ;
Matlab:
s=tf(‘s’); g=1/(s+1)^3;
step(g); hold on
for kc=[0.5:0.5:2],
gcl=feedback(kc*g,1);
step(gcl);
end
15. Proportional Control
Important points:
• proportional feedback does not change the order of the system
• started with a first order process
• closed-loop process also first order
• order of characteristic polynomial is invariant under proportional
feedback
• speed of response of closed-loop process is directly affected
by controller gain
• increasing controller gain reduces the closed-loop time constant
• in general, proportional feedback
• reduces (does not eliminate) offset
• speeds up response
• for oscillatory processes, makes closed-loop process more oscillatory
16. Controller actions on feedback dynamics
Process G(s) : Controller : PI (I varying) ;
Matlab:
figure; hold on; kc=2;
for Ti=[2:1:5],
gc=tf(kc*[1,1/Ti],[1,0]);
gcl=feedback(gc*g,1);
step(gcl);
end
17. Proporional - Integral Control
Important points:
• integral action increases order of the system in closed-loop
• integral action eliminates offset
• integral action
• should be small compared to proportional action
• tuned to slowly eliminate offset
• can increase or cause oscillation
• can be de-stabilizing
• PI controller has two tuning parameters that can
independently affect
• speed of response
• Nature of response (oscillation)
• PI is the most widely used controller in industry
• optimal structure for first order processes
18. Controller actions on feedback dynamics
Process G(s) : Controller : PD, ;
Matlab:
figure; hold on; kc=2;
for Td=[0:0.2:0.8],
gc=tf(kc*[Td,1],[1]);
gcl=feedback(gc*g,1);
step(gcl); end
19. Proportional Derivative
Important Points:
• derivative action does not increase the order of the system
• Used to compensate for trends in output
• measure of speed of error signal change
• provides predictive or anticipatory action
• adding derivative action affects the period of oscillation
of the process
• good for disturbance rejection
• poor for tracking
• derivative action
• should be small compared to integral action
• has a stabilizing influence
• difficult to use for noisy signals
• usually modified in practical implementation
24. Closed-loop Stability
Every control problem involves a consideration of closed-
loop stability
General concepts:
BIBO Stability:
“ An (unconstrained) linear system is said to be stable if the
output response is bounded for all bounded inputs.
Otherwise it is unstable.”
Comments:
• Stability is much easier to prove than instability
• This is just one type of stability
25. Closed-loop Stability
General Stability criterion:
“ A closed-loop feedback control system is stable if and only
if all roots of the characteristic polynomial (1+ GOL=0) are
negative or have negative real parts. Otherwise, the system
is unstable.”
• Unstable region is the right half plane of the complex plane.
• Valid for any linear systems.
• Underlying system is almost always nonlinear so stability
holds only locally. Moving away from the point of
linearization may cause instability
26. Stability Analysis Methods
Problem reduces to finding roots of a polynomial
Traditional:
1. Routh array:
• Test for positivity of roots of a polynomial
2. Direct substitution
• Complex axis separates stable and unstable regions
• Find controller gain that yields purely complex roots
3. Root locus diagram
• Vary location of poles as controller gain is varied
• Of limited use
• Bode stability criteria
• Niquist Stability criteria
27. Closed-loop stability
Routh array for a polynomial equation
is
where
Elements of left column must be positive to have roots with negative real parts
a s a s a s a
n
n
n
n
1
1
1 0 0
a a a
a a a
b b b
c c
z
n n n
n n n
2 4
1 3 5
1 2 3
1 2
1
1
2
3
4
1
n
b
a a a a
a
b
a a a a
a
c
b a b a
b
c
b a b a
b
n n n n
n
n n n n
n
n n n n
1
1 2 3
1
2
1 4 5
1
1
1 3 2 1
1
2
1 5 3 1
1
, ,
, ,
28. Example: Routh Array
Characteristic polynomial
Polynomial Coefficients
Routh Array
• Closed-loop system is unstable
2 36 1 49 0 58 1 21 0 42 0 78 0
5 4 3 2
. . . . . .
s s s s s
a a a
a a a
b b b
c c
d d
e
5 3 1
4 2 0
1 2 3
1 2
1 2
1
2 36 0 58 0 42
1 49 1 21 0 78
2 50 0 82 0
0 72 0 78
1 89 0
0 78
( . ) ( . ) ( . )
( . ) ( . ) ( . )
( . ) ( . ) ( )
( . ) ( . )
( . ) ( )
( . )
a a a a a a
5 4 3 2 1 0
2 36 1 49 0 58 1 21 0 42 0 78
. , . , . , . , . , .
1
2
3
4
5
6
29. Direct Substitution
• Technique to find gain value that de-stabilizes the system.
• Observation:
Process becomes unstable when poles appear on right half plane
Find value of Kc that yields purely complex poles
• Strategy:
• Start with characteristic polynomial
• Write characteristic equation:
• Substitute for complex pole (s=jw)
• Solve for Kc and w
q j K r j
c
( ) ( )
0
( )
1 ( ) ( ) ( ) 1
c a p s c
r s
K G s G s G s K
q s
q s K r s
c
( ) ( )
0
30. Example: Direct Substitution
Characteristic equation
Substitution for s=jw
Real Part : Complex Part:
• System is unstable if
1
1
0 5 0 5 0 75
0
0 5 0 5 0 75 0
0 5 0 5 0 75 0
3 2
3 2
3 2
K
s
s s s
s s s K s K
s s K s K
c
c c
c c
. . .
. . .
. ( . ) ( . )
( ) . ( ) ( . ) ( . )
. ( . ) ( . )
j j K j K
j K j K
c c
c c
3 2
3 2
0 5 0 5 0 75 0
0 5 0 5 0 75 0
0 5 0 75 0
2
. .
Kc ( . )
Kc
0 5 0
3
K
K
c
c
0 5 0 75 0 5 0 75 0 5 0
0 5 0 25 0
2 2 1
2 2 3
2
. . ( . . . )
. .
/ ,
Kc 1
31. Root Locus Diagram
• Old method that consists in plotting roots of characteristic
polynomial (closed loop poles) as controller gain is changed.
Matlab
s=tf(‘s’);
G1=1/(s+1);
G2=1/(s+2);
G3=1/(s+3);
G=G1*G2*G3;
rlocus(G);
rlocfind(G);