You are on page 1of 49

AN

EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T

Digital Controller in a Process Control Loop

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Digital Controller in a Process Control Loop

All the desirable features of a process controller (e.g. anti-integral


wind-up, auto/manual modes of operation with bump-less transfer
etc.) may be easily incorporated while maintaining the high
accuracy and precision of digital systems.

No drift problem is encountered in a digital system.

In a processor based digital controller, rapid switching from one


algorithm to another (e.g. a P controller to a PID controller) and
automatic tuning of controller parameters are possible.

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Digital Controller in a Process Control Loop

+
r
+
Set point _

e
Error

Final
mn
m
Digital
DAC
Control
Controller
Element
controller
Error
output
Controller
sequence
sequence
output

ADC

en

Process

DAC equivalent

ADC equivalent

mn

en

Sampler

C (hold
capacitor)

Sample & hold

mn

Controller
output
sequence

Error

0
en

time

DAC
output
m

Error
sequence

0 1 2 3

Sampling interval

0 1 2 3

0 2

time

(ADC conversion time + computation time)

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Digital Controller in a Process Control Loop

The error computation may be performed digitally if the set-point is available in


digital form (say, from digital keyboard) and the measured variable is digitized with
the ADC.
Digital System

rn
Set point
sequence
(digital)

+
_

en

Error
sequence

Digital
Controller

mn

DAC

Final
Control
Element

Process

Cn
ADC
output
sequence

Proper selection of the sampling interval is necessary for satisfactory operation of


the process control loop.
A large may lead to unstable operation of the loop (because of the extra lag
introduced in the loop), whereas a very small requires a high speed digital hardware
(hence high cost) to implement the controller.

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T

Realization of Digital Controllers


(through discrete approximation of analog controllers)
Proportional (P) Controller

The analog controller output is

m = Kp e + b

The controller output at the nth instant is given by

mn = K pen + bn = mn + bn
where, Kp = proportional gain,
bn = fixed bias.

Realization of the P controller:

bn

en

Kp

m'n

mn

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T

Realization of Digital Controllers


(through discrete approximation of analog controllers)
Proportional-Integral (PI) Controller

The analog controller output is

1 t
m = K p e + o e.dt + b
Ti

1 t

m = K p e + o e.dt
Ti

= m + b, where Ti is the integral time and

Let the integration term be

I = o e.dt
t

The integration term at the nth instant is

I n = o e.dt
n

Now,

Then,

n
o

( n 1)

e.dt = o

e.dt = I n 1

= o

where is the sampling interval


n

e.dt + n e.dt

for n = 1,2,3,..

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Pl Controller

The second term of the above relation represents the area


under the curve e for (n 1) t n.

This area may be approximated by the shaded rectangle (called the method of
rectangular integration) as

e t =n

e t =( n1)

( n 1)

e t=n

e t=( n1)

( n 1)

Thus,

Using the notation en for

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Pl Controller

n
( n1)

e.dt e t =n

e t = n ,

In = In1 + en

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Pl Controller

Now, output m at the nth instant may be expressed as

where

In = In1 + en

Similarly the output at the (n 1)th instant may be expressed as

The difference between these two outputs is

1
mn mn1 = Kp en en1 + ( In In1 )
Ti

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Pl Controller

1
mn mn1 = K p en en1 + ( In In1 )
Ti

Substituting the value of (In In-1 ) for rectangular integration, [(In In-1 ) = en ]

en
mn mn 1 = K p en en 1 +

Ti

or,


mn = en Kp 1+ Kpen1 + mn1
Ti
= aoen + a1en1 + mn1, say

where,


ao = K p 1+
Ti

and

a1 = K p

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Realization of the PI Controller

Controller output at the nth instant:


mn = mn + bn

mn= a0en + a1en-1 + mn-1


en-1

delay

a1

bn (bias)

en
error
sequence

ao

m'n

delay

m'n-1

mn
Controller
output
sequence

Problem: Develop a digital PI Controller using Trapezoidal rule for integration.

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T

Velocity or incremental form of PI controller

The controller output is proportional to the derivative of a standard PI


controller and it may be expressed as (without bias):

mn = mn mn1 = mn mn 1 = ao en + a1en1
Velocity form of controller is useful when the actuator is some kind of
adder (integral action), like a stepping motor.

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Software Realization of the PI Controller
a1

e1

a0

mp

# include < studio.h>


void main (void)
{
float e = 0, e1, m, mp = 0;
float a0, a1, b;
float adc (void) ;
// digitized error
void dac (float m ) ; // analog output
a0 = - - - - - - - - ; // Kp [1 + /Ti ]
a1 = - - - - -- - - ; // -Kp
b = - - - - - - - - - ; // bias

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Software Realization of the PI Controller
a1

e1

a0

mp

for (;;) // continuous loop


{ // loop time is the sampling interval
e1 = e;
e = adc ();
mp = mp + a0*e + a1*e1;
m = mp + b;
// provision for saturation
if (m < 0) m = 0;
if (m > 100) m = 100;
dac (m);
}
}

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Software Realization of the PI Controller
a1

e1

a0

mp

float adc (void)


// Analog-to-digital conversion
{
float v;
scanf (%f, &v); // for (keyboard) simulation
return v;
// (to be replaced for actual
}
// realization)
void dac (float m) // Digital-to-analog conversion
{
printf (%f\n, m); // for (VDU) simulation
} // (to be replaced for actual realization)

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T

Realization of Digital Controllers


(through discrete approximation of analog controllers)
Proportional-Derivative (PD) Controller

The analog controller output is

de

m = K p e + Td + b
dt

where Td is the derivative time.

Let the derivative of error e at the nth instant be

de
Dn =
dt t = n

Dn may be approximated using the backward difference algorithm as


e

Dn

en en1

slope = Dn

en

en-1

approximate slope

(n-1) n

time

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
PD Controller

Thus the controller output at the nth instant is

e n e n 1
m n = K p e n + Td

+ bn

K p Td
Td

or m n = K p 1 +
en
e n 1 + b n


= a o e n + a1 e n 1 + b n

where

Td
ao = K p 1 +

and

a1 =

K pTd

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Realization of the PD Controller

en-1

delay

en
(error)

a1

bn (bias)

ao

mn
Controller
output

Problem: Develop a c program for software realization of the PD Controller.

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
PD Controller

Provision for anti-derivative kick

To avoid derivative action from a sudden change in set-point, the derivative action
is generally derived from the measured output.
Now, e = r c
then,

de dr dc
=

,
dt
dt dt
dc
=
, assuming set-point r is constant.
dt

Thus, the controller output may be expressed as,

dc

m = K p e Td
+b
dt

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
PD Controller

Provision for anti-derivative kick

dc

m = K p e Td
+b
dt

using backward difference algorithm, the controller output at the nth instant is

c n c n 1
m n = K p e n Td
+ bn

K p Td
K p Td
or m n = K p en
cn +
c n 1 + bn

= a o en + p o c n + p1c n 1 + bn

where

ao = K p
po =
p1 =

K pTd

K pTd

= po

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T

Realization of PD Controller with anti-derivative kick

en
error

ao

cn
(process
output)
cn-1

po

bn (bias)

mn
(Controller output)

delay

p1

Problem: Develop a c program for software realization of the PD Controller


with anti-derivative kick

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T

Realization of Digital Controllers


(through discrete approximation of analog controllers)
Proportional-Integral-Derivative (PID) Controller

The analog controller output is

1 t
de
m = K p e + o edt + Td
+b
dt
Ti
= m '+ b (say)
where

1 t
de
m ' = K p e + o edt + Td
dt
Ti

The controller output (without bias) at the nth instant, using backward difference
algorithm, is

In
en en 1
mn = K p en + + Td

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
PID Controller

The controller output (without bias) at the nth instant is

In
en en 1
mn = K p en + + Td

The controller output at the (n-1)th instant is

I n1
en1 en2
+ Td
mn 1 = K p en1 +

Subtracting,

In In1 Td

+ ( en + en2 2en1 )
mn mn1 = Kp en en1 +
Ti

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
PID Controller

In In1 Td

+ ( en + en2 2en1 )
mn mn1 = Kp en en1 +
Ti

Using rectangular integration algorithm,

then,

or,

or,

I n I n 1 = en

Td

mn mn 1 = K p en en1 + en + ( en 2en1 + en2 )


Ti

Td
K pTd
2Td
+1 K p + en2
mn = en 1+ + K p en1
+ mn1


Ti
mn = ao en + a1en 1 + a2 en 2 + mn 1

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
PID Controller

mn = ao en + a1en 1 + a2 en 2 + mn 1
where,

Td
ao = K p 1 + +

2T

a1 = K p d + 1

and

a2 =

K pTd

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Realization of the PID Controller

mn = ao en + a1en 1 + a2 en 2 + mn 1

and

mn = mn + bn

en-2

en

a2

en-1

a1

ao

bn (bias)

m'n

m'n-1

mn

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
PID Controller

Problems:

1. Develop a digital PID controller using trapezoidal rule for integration


2. Develop a program in C for software realization of the PID controller
3. Modify the above controller to provide anti-derivative kick feature

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Techniques used for anti-integral windup

By saturating or limiting the integral value


By resetting the integral value to zero
By omitting the integral term

By adaptive adjustment of controller parameters

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Some anti-integral windup schemes

Stop integration when PI/PID controller internal output (prior to the


saturation block) exceeds the saturation limits

Saturation

+
+

Kp

0 100

Multiplier

Kp

100

sTi

1/0

Stop integration if
saturated

Process

Scheme for PI Controller

hard
switching Scheme

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T

Performance of anti-integral windup scheme


Saturation

Kp

0 100

Multiplier

Kp

100

sTi

Process

hard
switching Scheme

1/0

Stop integration if
saturated

Scheme for PI Controller

PI control without anti-integral windup

PI control with anti-integral windup

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Some anti-integral windup schemes

Reduce integration gradually as PI/PID controller internal output


exceeds the saturation limits

Saturation

+
+

Kp

100

0 100

Kp
Ti

1
s

G : a constant

Process

soft
switching Scheme

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Some anti-integral windup schemes

Clegg integrator the integrator is set to zero (reset) when the error
crosses zero

reset control

reset
SW

error

integrator output

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Automatic/Manual modes of Operations

Automatic mode means automatic closed loop operation


Manual mode means open loop manual control

Manual input or commnd

Man

error

Controller

Auto

Final
Control element

Process

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Automatic/Manual modes of Operations

Manual input or commnd

Man

error

Controller

Auto

Final
Control element

Process

If there is any difference between the controller output and the manual command, a
bump occurs in the process output when the switch position is altered.
To provide bump-less transfer from auto-to-manual change over, special
arrangements may be made for set-point initialization.
The manual command is driven to equal the controller output when the loop is in
AUTO mode.

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Automatic/Manual modes of Operations

Manual input or commnd

Man

error

Controller

Auto

Final
Control element

Process

When the loop is in MANual mode, if there is a steady error existing due to any
difference between the set-point of the controller and the process output (under
manual control), integral term, in case of PI and PID controllers, may wind-up to a
large value, and consequently anti-integral wind-up is necessary for such
situations.
To provide bump-less transfer for all the operating modes, incremental or velocity
from of controller is used with an additional integrator.

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Automatic/Manual modes of Operations
Scheme for bump-less transfer

Incremental manual command

bn (bias)

Man

en

Digital
incremental
controller

m'n

Auto

Integrator

m'n

mn

The incremental controller output (without bias) at the nth instant may be
expressed as

mn = mn mn 1

K pTd
Td
2Td

= en K p 1 + + en 1 K p
+ 1 + en 2

Ti
= ao en + a1en 1 + a2en 2

for a PID controller

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Automatic/Manual modes of Operations
Scheme for bump-less transfer

Incremental manual command

bn (bias)

Man

en

Digital
incremental
controller

m'n

Integrator

Auto

m'n

mn

The integrator may be represented as

m'n

Integrator

m'n

The integrator output may be represented as

m n = m n m n 1 + m n 1
= m n + m n 1

m'n

m'n

m'n-1

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Automatic/Manual modes of Operations
Scheme for bump-less transfer

Incremental manual command

bn (bias)

Man

en

Digital
incremental
controller

m'n

Auto

Integrator

m'n

mn

The presence of integrator at the output ensures a smooth output variation even
when the actual manual command is different from the actual controller output
under closed-loop control.

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T

Realization of the incremental type PID Controller

en-2

a2

en-1

Incremental manual
Command

a1

en

bn

MAN

ao

Incremental or
Velocity
Controller

m'n

AUTO

m'n

m'n-1

Integrator

mn

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T

Automatic tuning of PID Controllers the Relay autotuner


Suitable for processes with non-zero dead-time.

This is based on a special technique for determining the critical gain Kc and critical
time period Tc of the process loop.
Kc is the gain margin of the process loop.

Controller parameters Kp, Ti and Td are calculated according to Ziegler Nichols


(Z-N) rule for a stable time response.
Z-N settings

Controller

Kp

Ti

P Controller

0.5 K c

PI Controller

0.45 K c

Tc/1.2

PID Controller

0.6 K c

Tc/2

Td

Tc/8

gain margin: 2

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T

Automatic tuning of PID Controllers the Relay autotuner


The critical gain Kc and critical time period Tc are determined from an experiment
with relay (switching element) feedback.

set point
r=0

0
-D

Process

Relay

9The relay control provides ON / OFF control of the process.


9The input r is set to zero.

9The output c oscillates around a mean value of zero (limit-cycle oscillations).


9The process is driven by a square wave of amplitude D.

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T

Automatic tuning of PID Controllers the Relay autotuner

set point
r=0

0
-D

Process

Relay

Assuming the process to be a low-pass system, the process output c contains


mainly the fundamental component.

Thus the error signal e becomes sinusoidal,

e = A sin t

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T

Automatic tuning of PID Controllers the Relay autotuner


set point
r=0

Process

0
-D

Relay

The relay output v may be found out as follows:


v

-D

-A

-D

time

time

e = A sin t

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T

Automatic tuning of PID Controllers the Relay autotuner


v

set point
r=0

0
-D

Process

Relay

time

-D

The Fourier series of the relay output (v) may be expressed as:

4D
1
1

+
+
+
v=
sin
t
sin
3
t
sin
5
t
.......

3
5

The process practically attenuates all higher harmonics other than the fundamental.
Then the process gain at frequency becomes

output amplitude
A
A
G ( ) =
=
=
4
D
input amplitude
4D

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T

Automatic tuning of PID Controllers the Relay autotuner


set point
r=0

0
-D

Process

Process gain at frequency :

G ( ) =

Relay

output amplitude
A
A
=
=
4D 4D
input amplitude

Now, to maintain steady oscillations at = c, the loop gain is 1 (considering


negative feedback).
Thus the gain of the relay controller (i.e. the critical gain) at = c is

Kc =

G ( c )

4D
A

as K c . G ( c ) = 1

Also G (c) = , as relay phase shift is zero.

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T

Automatic tuning of PID Controllers the Relay autotuner


set point
r=0

0
-D

Process

Relay

Thus by knowing the relay amplitude D and by measuring the amplitude A of the

process output c, critical gain Kc may be determined K c =

4D
.

Tc may be estimated by measuring the frequency of the output oscillation Tc =

2
.
c

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Block diagram of the Relay autotuner

(The Satt Control Autotuner by Satt Control, Sweden)


Manual
command

+
+
_

PID
Controller

Process

T
Mode
switch

0
D

Relay

M Manual position
A Auto position
T Tune position

At first, the process is brought to equilibrium state ( zero error), by


setting a constant control signal in manual mode.
The tuning is then activated by pushing the mode switch to tune position.

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T

Modified relay characteristic for a non-zero set-point


v

Controller
output for
zero error

D = 0.1vmax

Manual
setting

The relay amplitude D is initially set to 10% of the controller output-range.

This amplitude is adjusted after one and a half period to give oscillation of 2% of the mean output.
This ensures minimum disturbance at the process output due to tuning.

This adjustment is done by measuring the change in output during the first one and a half period.
The modified relay amplitude is stored for the next tuning operation.

AN
EL JAN
EC R
TR AK
IC SH
JA AL IT
D E an
KO AV NG d A
LK PU INE MI
AT R U ER TA
A, NI IN VA
IN VE G C
D R DE HA
IA S P T
IT A T
Y R E
TM RJ
E N EE
T
Satt Control Autotuner
Manual
command

+
_

PID
Controller

Process

T
Mode
switch

0
D

Relay

M Manual position
A Auto position
T Tune position

The system is automatically switched to Auto mode after estimating the


critical gain Kc and critical time period Tc during first 5 period of oscillation.
The parameters of PID controller (viz. Kp, Ti and Td ) are determined from Kc
and Tc according to Z-N rule.