You are on page 1of 62

PID CONTROL

Presentation provided by Dr Andy Clegg

Advanced Control Technology Club


(ACT Club)

Presentation Overview
Introduction
PID parameterisation and structure
Effects of PID terms
z Proportional, Integral and Derivative terms

Tuning PID Controllers


Equivalence of PID and Lead-Lag
controllers
Implementation aspects of PID

Introduction to PID Control


Proportional-Integral-Derivative control
Predominant controller used in industry
Reason: it is adequate for most applications
Initially: analogue implementation
Now: mostly digital

Motivation and Limitations


Motivation
z Simple to get working
z Can be tuned to meet time-domain specifications
z Readily available in PLC/DCS systems
z Digital and analogue implementation easy

Limitations
z For single-input single-output systems only
z Difficult to tune to meet precise specifications
z Subtle differences in implementation causes problems

Idealised PID-Controller
Configuration
Set-Point

e(s)

K(s)

Output

u(s)

y(s)

r(s)
Controller

Plant

Generic PID Control Equations


Time domain:

de
u c (t ) = k1e(t ) + k 2 e(t )dt + k 3


dt


0
P


Laplace domain:

k
U c ( s ) = k1 E ( s ) + 2 E ( s ) + k 3 sE ( s )

s


P
D
I

However there are many different structures ...

Ideal PID Parameterisation

u c (t ) = K c e(t ) +
Ti

de

edt + Td
dt
0

z Kc :

proportional coefficient

z Ti:

integral time constant

z Td:

derivative time constant

Common in PLC and DCS implementations

Parallel PID Parameterisation


t

de
u c (t ) = K p e(t ) + K i edt + K d
dt
0

z Kp :

proportional gain

= Kc

z Ki:

integral gain

= Kc/Ti

z Kd :

derivative gain

= KcTd

Used in SW tools (e.g. Matlab) and some


industrial systems

Series PID Parameterisation

1
u c (t ) = K c 1 +
Ti

de
(.) dt e(t ) + Td

dt

0
t

z Kc :

proportional coefficient

z Ti:

integral time constant

z Td:

derivative time constant

Is found in some industrial systems


Historically popular since can be implemented
with just one op-amp

PID Parameterisation
There are also differences in units for gain terms
Proportional gain:
z as a pure gain or proportional band (= 100%/gain)

Integral gain:
z as reset (i.e. Ki, units of repeats per second or minute)
z or integral time (i.e Ti, units of seconds or minutes)

Derivative gain:
z as derivative time (i.e Td, units of seconds or minutes)

PID Control Action


Traditionally the PID terms act on the error signal, as in
previous equations.
In process applications it is common to have derivative
acting on the output rather than error
z Called PI-D or Derivative on PV

In some cases the proportional control can act on the loop


output as well

Note: if the set-point is constant


z Called I-PD or SP on I-only then all three forms are
equivalent, they only differ when
the set-point changes ..

PID Control Action


Response of a PID acting on the error signal
Controller Output

Set-Point

The big spike in controller output


is due to the set-point step being
fed directly through derivative
Loop Output

PI-D Control Action


Response of a PI-D (i.e. Derivative on PV)
Controller Output

Set-Point

The spike in controller output


is smaller - derivative kick
has been eliminated
Loop Output

I-PD Control Action


Response of an I-PD (i.e. Proportional & Derivative on PV)
Controller Output

No spike in controller output


- both proportional and
derivative kick eliminated

Set-Point

Loop Output
I-PID Control should not be used on
integrating processes (e.g. level control)

PID Parameterisation
These many different forms of PID do cause problems:
z each has different behaviour
z each require different tuning rules
z you must know which form is used before doing any tuning, design and/or
simulation

However, it can provide an additional degree of freedom


when designing a control system

Effects of P, I & D Terms


Proportional Action
z First-order plant
z Second-order plant

Integral Action
z First-order plant

Derivative Action
z First-order plant
z Second-order plant
z Rate feedback

Proportional - 1st Order Plant


First-order plant:

1
G (s) =
s+a

z Pole at s = -a, steady-state gain 1/a

Closed-loop TF:
z New pole s = -(a+Kc)

Kc
y(s) G(s)K(s)
=
=
r(s) 1+ G(s)K(s) s + a + Kc

Steady-state error with step input:


1gain cannot
1
1
a
However, proportional
just
be
increased
arbitrarily
to
= lim
ess = lim s
=
s0withKactuator
s0error.
s 1+Problems
G(s)K(s) arise
a + Ksaturation
c
remove steady-state
1+ c
s +a
and instability with real, higher-order plant

Proportional - 1st Order Plant


Response to unit step set-point change:
Step Response
1
0.9
0.8
0.7

Amplitude

0.6
0.5
0.4
Kc=1
0.3
Kc=2
0.2
Kc=10
0.1
0
0

0.5

1.5
Time (sec.)

2.5

Proportional - 2nd Order Plant


Second-order plant:
Closed-loop TF:

G(s) =

n2
s 2 + 2n s + n2

Kc
y(s)
= 2
r ( s ) s + 2 n s + n2 + K c

As Kc increases:
z CL natural frequency increases
z CL damping ratio decreases
z steady state error decreases

overshoot increases

Proportional - 2nd Order Plant


Response to unit step set-point ( = 0.4, n = 3)
Step Response
1.6
Kc=1
1.4
Kc=2
1.2

Kc=10

Amplitude

1
0.8
0.6
0.4
0.2
0
0

2
Time (sec.)

Integral Action
Objective is to remove steady-state error
PI controller in time
Laplace domain:

domain: u c (t ) = K c e + T
i

edt

K ( s ) = K c 1 +

T
s
i

With a constant error:

1
u c (t ) = K c e +

Ti

e
et

1dt = K c e +
edt = K c e +

Ti
Ti

0
0

That is, if a constant error exists the controller output


will keep increasing, until the error is zero ...

Integral Action - Constant Error

Integral Action - 1st Order Plant


Plant:

G (s) =

1
s+a

Closed-loop TF:

Controller:

K (s) =

1
Ti s

2
ncl
y(s)
1
= 2
= 2
2
r(s) Ti s + aTi s +1 s + 2 clncls + ncl

CL natural frequency and damping ratio


now functions of Ti
Steady state error now removed:
ess = lim
s0

s
0
1
= lim
=
=0
1 1
1
1 1
s 0
s+
0+
1+
s + a Ti s
s + a Ti
aTi

Integral Action - 1st Order Plant


Response to unit step set-point change:
Step Response
1.8
Ti=0.1
1.6
Ti=1
1.4
Ti=4

Amplitude

1.2
1
0.8
0.6
0.4
0.2
0
0

10
Time (sec.)

15

Derivative Action
Objective: stabilise system; slow down transients
PD controller:

de

u c (t ) = K c e(t ) + Td

dt

In Laplace domain:

K ( s ) = K c (1 + Td s )

With constant error, derivative action = 0


z no contribution to steady-state behaviour

With transients on error, derivative action = large


z risk actuator saturation from measurement noise, step changes
in set-point

Derivative - on Loop Output


Derivative often used in feedback path only
z i.e PI-D control
u c ( s ) = K c (e( s ) Td sy ( s ) )
P-D Controller
r(s)

+
-

e(s)

KC

uC(s)

Plant

y(s)

u c (-s ) = K c (e( sG(s)


) Td sy ( s ) )

KC Td s

Eliminating e(s), using e(s) = r(s) - y(s), gives ..

Derivative - on Loop Output


Derivative often used in feedback path only
z i.e PI-D control
u c ( s ) = K c r ( s ) K c ( y ( s ) + Td sy ( s ) )
Kff(s)

P-D Controller

r(s)

KC

uC(s)

Plant

u c (-s ) = K c (e( sG(s)


) Td sy ( s ) )

KC (1+Td s)

K(s)
GK c
CLTF =
1 + GK c (1 + Td s )

y(s)

Derivative - 1st Order Plant


Plant:

1
G (s) =
s+a

Closed-loop TF:

Controller:

K ff ( s ) = K c

K ( s ) = K c (1 + Td s )

Kc
y(s)
=
r ( s ) (1 + K cTd )s + a + K c

Closed-loop pole: s = (a + K c )

(1 + K c Td )

z as Td is increased, CL response gets slower

Steady state error not effected by Td:


1

1
ess = lim
=
K
1
s0
K c (1 + Td s ) 1 + c
1+
s+a
a

Derivative - 1st Order Plant


Response to unit step set-point change:
Step Response
0.7

0.6

Amplitude

0.5

0.4
0.3
Td=1

0.2

Td=2
0.1

Td=5

4
Time (sec.)

10

Derivative - 2nd Order Plant


Generalised Plant:
Closed-loop TF:

G (s) =

2
np
2
s 2 + 2 p np s + np

2
Kcnp
y(s)
= 2
2
2
r(s) s + 2 pnp + Kcnp
Td s + (1+ Kc )np

CL natural frequency: ncl = np 1+ Kc


CL damping ratio:

cl =

p
1+ Kc

K c np
2 1+ Kc

Td

Steady-state error is not effected by Td

Derivative - 2nd Order Plant


Response to unit step set-point change:
Step Response
0.7

0.6

Amplitude

0.5

0.4
0.3
Td=0.1

0.2

Td=0.3
0.1

Td=0.6

0.5

1.5

Time (sec.)

2.5

3.5

Derivative - as Rate Feedback


Plant, G(s)

Controller
r(s)

e(s)

KC

G*

Kr

angular
velocity

1
s

y(s)

angle

Implementation using direct measure of derivative


Similar to P-D control
z with Kr = KcTd

GK c
CLTF =
1 + G (K c + K r s )

Tuning PID Controllers


Fundamental Trade-offs
Applicability of PID
Process Reaction Tuning
Sustained Oscillation Tuning
IMC PID Tuning
Advanced Tuning Methods

Fundamental Trade-offs
Set-point tracking:
z Good tracking performance

K(s)G(s) large

Stability:
z Keep K(s)G(s) away from -1

limit on K(s)

Disturbance rejection:
z Reduce effect of disturbances

K(s) large

Noise immunity:
z Noise should not excite u(s)

limit on K(s)

Applicability of PID
PI controllers adequate for most applications
Derivative action is rarely utilised
z often misunderstood due to the many different forms and the
different ways in which they work

For dominant second (and higher) order plants


PID control may be more appropriate
z additional D term can provide damping to reduce overshoot
z D can be beneficial for slow thermal processes

Applicability of PID
The following generalisation is from Shinsky
("Process Control Systems", McGraw Hill, 1979)
Process

Proportional Band (%)

Integral

Derivative

Flow

100-500

essential

no

Pressure, liquid

50-200

essential

no

Pressure, gas

0-5

no

no

Level

5-80

seldom

no

Vapour (T and p)

10-100

yes

essential

Chemical Composition

100-1000

essential

if possible

There will always be exceptions, so need tuning rules ...

Process Reaction Tuning


Plant in open loop with and input unom
Apply a step to input (ustep) and record the
response

y y step y nom
R=
=
T
T

Determine L and R from the response

Process Reaction Tuning


Normalise R:

RN =

u step

R
u nom

Use L and RN in this table to give PID settings


C ontroller

Kp

Ti

Td

1.0/(R N L)

P+I

0.9/(R N L)

3L

P+I+D

1.2/(R N L)

2L

1/(2L)

Sustained Oscillation Tuning


Carried out with plant in closed-loop
z useful for open-loop unstable plant

Using a proportional-only controller, increase the


gain until sustained oscillations are attained
z need to be careful that oscillations do not upset normal running

Record the gain (Kc) and the period of the


observed oscillations (Tc)

Sustained Oscillation Tuning


Use Kc and Tc in this table to give PID settings
Controller

Kp

Ti

Td

0.5Kc

P+I

0.45Kc

0.8Tc

P+I+D

0.6Kc

0.5Tc

0.125Tc

These are just initial values to get the controller


to work
z will need fine tuning

IMC PID Tuning


IMC = Internal Model Control
Requires plant model
z model structure and order (e.g. first order with dead-time)
z parameters such as gains, dead-time and time constants
z usually obtained from plant tests

and desired closed loop time constant ()


IMC formulae give required PID gains for
specified plant model and

IMC PID Tuning


If the plant model is:
z first order

- controller = PI

z second order

- controller = PID

z first order + dead-time - controller = PID

For higher order plant models, resulting PID is


only an approximation of true IMC controller
Tools are available that contain the formulae
z e.g. EZYtune (http://www.unac.com.au/ezytune)

Advanced Tuning Methods


Astrm and Hagglund (Relay) Auto-tuning:
z similar to sustained oscillation method, but uses a relay with
dead-zone to establish oscillations
z tuning rules built into controller so that it can perform this test
and automatically re-tune itself

PID tuning using system identification and


closed loop pole placement
z called self-tuning if carried out on-line and automatically

Loop Tuning Check List


; define desired performance
z rise time, peak overshoot, stability margins, etc.

; identify the dominant plant dynamics


; look at interaction with neighbouring loops
; which PID configuration is being used ?
; consider saturation
; examine set-point tracking and disturbance
rejection of CL system
z has the desired performance been met ?

PID and Lead-Lag Controller


Characteristics
PI similar to lag-compensator
PD similar to lead-compensator

. shown in the following bode plots

PI & Lag Compensator


Bode plot:
Bode Diagrams

Magnitude:

60

PI:

rising for decreasing


frequency
PI
lag
Lag: levels out at low frequencies

Phase (deg); Magnitude (dB)

40
20
0
0

-50

-100
-2
10

-1

10

10

10

Frequency (rad/sec)
Phase:

PI:

90 phase lag for frequencies below breakpoint


Lag: phase lag only between breakpoints

PD & Lead Compensator


Bode plot:

Magnitude:
Bode Diagrams

60

Phase (deg); Magnitude (dB)

40

PD:

rising for increasing frequency


Lead: levelling out

PD
lead

20
0
100

50

0
-1
10

10

Phase:
Frequency (rad/sec)
PD:

10

10

90 phase lead for frequencies above breakpoint


Lead: phase lead only between breakpoints

Implementation Aspects of PID


Bumpless Transfer
Derivative Filtering
Integral Windup
Digital Implementation

Bumpless Transfer
Prevents spiky demand signals to actuators when
switching between different control modes
Occurs when switching from manual to automatic
z Cause: controller output different from current signal
z Solution: set reference to follow current plant output value
called a tracking controller

Derivative action on PV also helps

Derivative Filtering
Most industrial PID controllers have some filtering
on derivative action
Prevents noisy measurements giving noisy
controller outputs
Usually applied as:

Td s
Td s + 1

= derivative time multiplier


z typically in range 0.06

0.13

Integral Windup
Caused by integral action and actuator saturation

Can lead to instability

Graphical Representation

This extra control is a time delay


- which can destabilise the plant.

Anti-Windup Mechanisms
Analogue implementation:

In practice it is difficult to set-up gain K

Anti-Windup Mechanisms
Logic/digital implementation easier:

*
*

1 if u = 0
0 if u<>0

Anti-windup present in most industrial controllers

Digital Implementation
A continuous time PID controller is given by:
t

u c (t ) = K p e(t ) + K i

de
e(t )dt +K d
dt

This can be cast into this discrete time form:


u c ( k ) = K p e( k ) + K i s

Kd

e( j ) +
j =0

[e(k ) e(k 1)]

where k is the sample number and s is the


sampling period

Digital Implementation
This may be re-written as:
u c (k ) = u c (k 1) + K p [e(k ) e(k 1)] + K i s e(k ) +

or:

Kd

[e(k ) 2e(k 1) + e(k 2)]

u c (k ) = u c (k 1) + u c (k )

The change in controller output (uc) is calculated


and the inherent digital integrator forms uc(k)
Called an incremental PID controller

Extra Slides

Generic Equations
Closed-loop TF from reference to error
e( s ) =

1
r ( s)
1 + G(s)K(s)

Type 0 servo, unit-step steady-state error


1

1
1
=
ess = lim s
s 0 1 + G ( s ) K ( s ) s 1 + k p

Type 1 servo, unit-ramp steady-state error


1

1
1
2 =
ess = lim s
s0 1 + G ( s ) K ( s ) s
kv

Proportional - 2nd Order Plant


Steady-State Error
1
1
= lim
ess = lim s
s 0 s 1 + G ( s ) K ( s ) s 0

n2 K c
1+ 2
s + 2 n s + n2

If Kc larger, error smaller

1
=
1+ Kc

Integral Action - 1st-Order Plant


Steady State Error
Integral control:
s
0
1
ess = lim
= lim
=
=0
1
1
1
1
1
s0
s 0
s+
0+
1+
s + a Ti s
s + a Ti
aTi

Proportional-integral control:
ess = lim
s 0

K ( s ) = K c 1 +

T
s
i

s
= lim

1
1 s 0
1
1

1+
K c 1 +
s+
K c s +
s + a Ti s
s+a
Ti

0
1
1
Kc
a
Ti

=0

Derivative - 2nd Order Plant


Steady-state error:

1+
e ss = lim
s0

1+

2
np
2
s 2 + 2 p np s + np
2
np

2
s 2 + 2 p np s + np

K c Td s

K c (1 + Td s )

1
1+ Kc

You might also like