Sei sulla pagina 1di 48

CHE3162 Lecture 9

PID Controllers
- Calculating &
Eliminating Offset
Chapter 7&8: Marlin
Chapter 6: Smith & Corripio

Learning objectives
Understand P control and calculate offset for
setpoint and disturbance changes
Understand how PI control eliminates offset
Understand how tuning control loop parameters
K, TI and d affect response of control loops
Be able to prove the magnitude or absence of
offset using TF and final value theorem

PID response matches


common sense
1
de
u(t) = K [e(t) + e(t)dt + d ] + u(0)
c
T
dt
i
If a big error occurs:
You need a big response

Proportional P

But there is still a remaining error:


Adjust until you eliminate error

Integral I

Rapid change
rapid response required

Derivative D

1
U
= K c 1 +
+ d s
E
TI s

General Block Diagram


D
YSP
+

Gc

Gv

Gp

Ym

Gd

Gm

Y depends
on both
YSP and D

Forward
1+ Around the loop

G G G
G
c v p
d
Y=
Y +
D
s
1+ G G G G
1+ G G G G
c v p m
c v p m
Exercise: Derive this Closed Loop Transfer Equation relating Y to Ys and D

P control

P control: What does offset mean?


If you make a setpoint change while in
proportional ONLY control, the output will
change and move towards the setpoint but
will not quite reach the setpoint.
(If gain is high, will 5
0.5
4.5
come close to SP)
e.g SP= +5C,
Final value= +4.5C
Offset=5 - 4.5 = 0.5 C

P control: What does offset mean?


If there is a disturbance while in
proportional only control, the output will
drift initially away from SP, and may drift
back to SP but will never actually return to
the original baseline
5

E.g Disturbance= +
5C,
Final value= + 1.5 C
Offset=1.5 C

1.5
1.5

Proportional Control can cause offset


First order closed loop response to a unit step in SP

Always some
Offset for P
control
Size of offset
depends on size
of controller gain
Kc

Smith & Corropio

P control for a disturbance


P=Offset
H(t) reached steady state
But did not return to
h=6.0 after the disturbance

OFFSET

Smith

P control and offset


In both cases, offset is the difference between
the desired SS value and the actual SS value
SS Offset = |desired output- actual output|
For a setpoint change, want output to reach
the setpoint : Desired = SP
OffsetSP=|SP-FVT|
For a disturbance, want output to stay
unaffected: Desired=0
OffsetD=|0-FVT| =FVT

P control offset calculation example


Even for the most simple 1st order system
No valve or measurement dynamics so Gv=Gm=1
First order response for process Gp and disturbance Gd
inputs

3
Gd =
4s + 1
5
Gp =
3s + 1

Proportional Control: SP Change


Even for the most simple 1st order system:

K cG p
Y
=
SP 1 + K c G p
SP

1
Kc

Gd= 3
4s+1

K v =1

Fs

Km = 1

Gp= 5
3s +1

Example: Proportional Control offset


for SP Change
Closed Loop response to a step in setpoint:
5
Kc
K cG p
5K c
Y
+
3
1
s
=
=
=
SP 1 + K c G p 1 + K 5
3s + 1 + 5 K c
c
3s + 1

Rearrange to standard form K/(s+1):


5K c
1 + 5K c
Y
=
SP 3

s + 1
1 + 5K c

K overall =

5K c
1 + 5K c

=
1 + 5K c

Overall
Gain 1

Time Constant
affected by Gain

Evaluating P-control offset for SP


5K c
1 + 5K c
1
Y=
s 3

s + 1
1 + 5K c

For unit step in SP


(i.e. SP=1/s)

Final Value Theorem:

lim f ( t ) = lim[sf (s)]


t

s0

Evaluate sY(s) as s 0
Y= 5Kc/(1+5Kc) 1

Desired = 1 (since unit change in SP)


May be close enough if 5Kc >>1

Proportional Offset
Desired=SP for a
SP change

SS Offset = |desired - actual|


For control: 1.2
5K c
actual =
1 + 5K c
1
i.e offset =
1 + 5K c

5
K=2

0.8
0.6

K=1

0.4
0.2
0
0

Proportional Offset: Disturbance


Even for the most simple 1st order system:

Gd
Y
=
D 1 + K cG p
SP

Kc

3
4s+1

K v =1

Fs

Km = 1

5
3s +1

Proportional Control: Step in


Disturbance variable
Closed Loop Disturbance TF Y/D:
3
Gd
Y
3
s
+
4
1
=
=
=
3s + 1 + 5 K c
D 1 + K cG p 1 + 5K c
(4s + 1)(
)
3s + 1
3s + 1
3

(3s + 1)
1 + 5K c
Y
3(3s + 1)

=
=
D (4 s + 1)(3s + 1 + 5 K c )

3
(4 s + 1)
s + 1
(1 + 5 K c )

Lead-lag response

Proportional Control: Step in


Disturbance variable
3

(3s + 1)
1 1 + 5K c
Y=
s

3
(4 s + 1)
s + 1
(1 + 5 K c )

For unit step in D:

Offset calculated using Final Value Theorem:


sY(s) as s 0 :

Y= 3/(1+5Kc)

Desired = 0
Offset = 3/(1+5Kc)

Disturbance Offset
SS Offset = |desired - actual|

Desired=0
For disturbances

0.5

3
= offset
actual =
1 + 5K c

0.45

K=1

0.4

Amplitude

0.35
0.3
0.25

K=2

0.2
0.15
0.1

K=5

0.05
0

8
Time (secs)

10

12

14

16

Proportional Control:
Calculating Offset for a Disturbance
2: Regulator Transfer Function
D
YSP
+

Gc

Gv

Gp

Ym

Gd

In process
control YSP
+ Y is usually
+
constant
& D(t) varies
So YSP = 0

Gm

G
Y
d
=
D 1+ G G G G
c v p m

This is the closed loop


DISTURBANCE Transfer Fn.
(also known as regulator TF)

Exercise: Write down the Transfer Function Y/Ys for D(t) = constant

Proportional control of

st
1

order

Closed loop means offset is unavoidable


Offset may not be important in practice
Or, the offset could be critical
This depends on the values of gains in the process
and the process application!

Offset occurs for both setpoint changes and


process disturbances
Controller Gain directly affects overall process
gain AND time constant

Proportional control of
Second Order processes
P control of 2nd order process (Kv=1)
Gp =

Kp

s + 2s + 1
Closed loop TF:
2 2

Gp
SP
+

Kc

K v =1

F
s

2nd order

Km = 1

Kc K p
Y
= 2 2
SP s + 2s + 1 + K c K p
For step in SP:

Kc K p
1
Y=
s 2 s 2 + 2s + 1 + K c K p

Proportional control of
Second Order processes
For step in SP

Kc K p
1
Y=
s ( 2 s 2 + 2s + 1 + K c K p )
Kc K p
1 + Kc K p
1
Y=
s 2
2 2

s +
s + 1
1+ K K
1+ K K
c
p
c
p

System is still second order but Kc affects time


constant AND damping coeff

2nd Order P control


Set point step change
Kc K p
1 + Kc K p
1
Y=
s 2
2 2

s +
s + 1
1+ K K
1+ K K
c
p
c
p

K values affect
Underdamped?
Overdamped?
Stability?

KcK p
(s)
FVT: lim sY

0 =
1 + KcK p
Dynamics

control

=
1 + KcK p

control

=
1 + KcK p

Example: P control 2nd order


system
Gp TF is overdamped

With control
control

2
=
1 + Kc

Amplitude

1
Gp =
9s + 12s + 1

K=8: >1

0.9

underdamped

0.8
0.7

K=3: =1

0.6

Critically damped

0.5
0.4

K=1: >1
overdamped

0.3
0.2
0.1
0

10

15
Time (secs)

Behaviour of the Proportional


Controller
As the gain increases control quality (error,
or deviation from set point) starts to
improve
But oscillation increases

Beyond a certain gain instability occurs


For stable control there is a residual
steady state error
This is called the OFFSET
P control will ALWAYS leave an offset
Increasing the gain reduces the offset

P vs PI control
Discussed P control
1st and 2nd order processes
SP and D changes

Always have offset for P control


Possible to change stability of loop by
choice of Kc
What about PI control??

PI control
1
u(t) = K [e(t) + e(t)dt] + u(0)
c
T
i
U is the controller output
E is the difference between SP
& the measured value

Laplace transform

1
U

= K c 1 +
E
TI s
Kc = controller gain

TI = Integral time

The Proportional Plus Integral


Controller (PI)
1
u(t) = K [e(t) + e(t)dt] + u(0)
c
T
i
This is a two-term controller
The integral action eliminates offset
It also makes the control system less
stable
The PI controller is the most widely
used controller in the process
industries

Ti is the integral time


1/Ti is the reset rate

U
1
= K [1 +
]
c
E
Ts
i

P vs PI control for a disturbance


PI control eliminates offset after the disturbance,
h(t) reaches SS AND returns back to original value of h=6.0 ft.

Smith

PI control of any 1st order process


1st order system

Gp =

Kp

s + 1

G c = K c 1 +
TIs

Closed loop TF

K p K c 1 +
TIs
Y

=
SP

s + 1 + K p K c 1 +
TIs

PI control of any 1st order process


Closed loop TF:

Multiply by (Tis)/(Tis)

K p K c 1 +
K p K c (TI s + 1)
TI s
Y

=
=
SP

1 TI s (s + 1) + K p K c (TI s + 1)

s + 1 + K p K c 1 +
TI s
Step change in SP = 1/s:

K p K c (TI s + 1)
1
Y=
s TI s (s + 1) + K p K c (TI s + 1)

PI control of any 1st order process


K p K c (TI s + 1)
1
Y=
s TI s (s + 1) + K p K c (TI s + 1)

Final Value Theorem:

0 = 1
lim
sY ( s )

OFFSET = 0 - Action of Integral controller!

Dynamics of PI control of 1st order process:


Like a second order system
Can be underdamped and oscillate

Example: PI control of a
1st order process
Gc Gv G p
Y
=
SP 1 + Gc Gv G p Gm

Gc = 11 +
Ti s
SP

Gc

3
4s+1

Gv =1

Fs

Gm = 1

5
3s +1

Example: PI control of a
1st order process

Gc Gv G p
Y
=
SP 1 + Gc Gv G p Gm

1
5
1 5

51 +
1 +

5+
TI s
TI s
TI s (3s + 1)
Y

=
=
=

SP

1 3s + 6 + 5
1 5

3s + 1 + 51 +

1 + 1 +
TI s
T
s
T
s
(
3
s
1
)
+
I

3
4s+1

SP

+
-

1+1
TiS

K v =1

Fs

Km = 1

5
3s +1

Example:

st
1

5+

CLTF =

5
TI s

Y
=
SP 3s + 6 + 5
TI s

Multiply by Tis/ Tis:


Divide by 5:

order +PI control

Y
5TI s + 5
=
SP 3TI s 2 + 6TI s + 5

Y
TI s + 1
=
SP 0.6TI s 2 + 1.2TI s + 1

control = 0.6TI

control

0.6TI
=
= 0.6TI
0.6TI

Offset of PI control
Y
TI s + 1
Use FVT to evaluate as
=
2
sF(s) 0
SP 0.6TI s + 1.2TI s + 1
Assume unit step in SP
Put into equation and

TI s + 1
1
evaluate using FVT

FVT ( sY ) = s
2
s 0.6TI s + 1.2TI s + 1
If Y=1 after SP=1, then Y
will reach the SP
exactly (no offset)
0 +1
=1
FVT =

Independent of Ti value
0 + 0 +1
Offset elimination is the main
advantage of PI control
Note:Integral time choice does affect stability

Example:

st
1

order +PI control

1.4

Kc=1 in this example

TI=0.2
1.2

TI=1

No offset with PI
Goes to +1 exactly

TI=2

0.8

Y
5TIs + 5
=
2 means
Shorter
SP integral
+ 6TIs + 5
3TIstime

Setpoint increase of +1

0.6

0.4

Less stable need longer times


To average out any oscillations
Shorter integral times will cause oscillations

0.2

2
Time (secs)

Error integrals

Smith & Corropio

P vs PI control for a disturbance


PI control eliminates offset after the disturbance,
h(t) reaches SS AND returns back to original value of h=6.0 ft.

Smith

PID Transfer Function


de
1
u(t) = K [e(t) + e(t)dt + d ] + u(0)
c
dt
T
i
Laplace transform

1
U
= K c 1 +
+ d s
E

TI s

Same procedure as used for P and PI control


Substitute the controller transfer function:
Use final value theorem to final SS value
Practice this in assignment and lab

Typical responses

Seborg

Effects of the Different Control


Actions
MODE
PROPORTIONAL

VALUE
Most stable

INTEGRAL
(RESET)

Removes
offset

DERIVATIVE
(RATE)

Increases
stability
Shorter
oscillation
period

TOO MUCH
Stability
decreases

TOO LITTLE
Larger offset
Slower
response

Stability
Slower return
decreases
to set point
Longer
oscillation
period
Stability
Max benefit
increases
not achieved
Amplify noise

PID Control Choice


Star
t
Can offset be tolerated?

Yes

Use P-Only

No

Is there noise present?

Yes

No

Is dead time excessive?

Use PI
Yes

No

Is capacity extremely small? Yes

Use PID

No

Slide from Brent Youn

Which controller?
P, PI or PID?
1. Basic pressure or
level control
Basic P control OK
Can use PI to remove
offset

2. Flow control

3. Temp or concentration
Usually SLOW response
PI usually slow or unstable
Use PID: Need D to
increase K and speed of
response

Fast response (can add All systems:


I)
Be careful with D
DONT want offset
Noise gives large D
Use PI
response
e.g. splashing in liquids

Choice of Control Action


P only

Simplest.

Will give OFFSET

P+D

Rare.

Still have OFFSET.


D action improves stability, but sensitive to noise.
Usually restricted to batch temperature control.

P+I

Most common

I action Removes OFFSET.


Stability is decreased: care!

Choice of Control Action


PID

Widely used

D action compensates for destabilising


effect of I action, allowing higher P gains.
D action sensitive to noise.
PID (vs PI) IS recommended for temperature control;
vapour pressure control; composition control (not
with long sampling times, and not for pH).
PID (vs PI) NOT recommended for gas pressure,
liquid pressure control; level, flow control.

CHE3162 Structure Basic control


Single control loop

T2: 1st Order


responses

T1: Modelling
& Laplace TF

T3: 2nd Order T4: Deadtime, T5: Frequency


responses Block Diagrams Response

T6: PID Control


loops

T7: Tuning
Control loops

T8: Cascade
Control

T9: Feed
Forward
& Ratio control

Potrebbero piacerti anche