Professional Documents
Culture Documents
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
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.
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
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
ADC
Final mn m Digital DAC Control Controller Element controller Error output Controller sequence sequence output en
Process
ADC equivalent
DAC equivalent
en
mn
Sampler
C (hold capacitor)
mn
Error
0 en
time
0 1 2 3
Error sequence
DAC output m
0 1 2 3
0 2
time
Sampling interval
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
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
+ _
en
Error sequence
Digital Controller
mn
DAC
Process
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.
m = Kp e + b
mn = K pen + bn = mn + bn
where, Kp = proportional gain, bn = fixed 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
Proportional (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
Proportional-Integral (PI) Controller
1 t m = K p e + o e.dt + b Ti
I = o e.dt
t
1 t m = K p e + o e.dt Ti
where is the sampling interval
n
I n = o e.dt = o
n
Now,
n o
e.dt = o
( n 1)
e.dt = I n 1
e.dt + n e.dt
for n = 1,2,3,..
Then,
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
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
e
e t =n
e t =( n1)
( n 1)
Thus,
n ( n1)
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
e.dt e t =n
( n 1)
e t = n ,
e t=n
Pl Controller
e t=( n1)
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
where
In = In1 + en
Substituting the value of (In In-1 ) for rectangular integration, [(In In-1 ) = en ]
where,
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
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
a1
delay
bn (bias)
en error sequence
ao
m'n
delay
m'n-1
The controller output is proportional to the derivative of a standard PI controller and it may be expressed as (without 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
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
e1
a1
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
e1
a1
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
e1
a1
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)
Dn
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
Proportional-Derivative (PD) Controller
de m = K p e + Td + b dt
de Dn = dt t = n
en en1
en
en-1
approximate slope
(n-1) n time
K p Td Td or m n = K p 1 + e n e n 1 + b n = a o e n + a1 e n 1 + b n
Td ao = K p 1 +
where
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
e n e n 1 m n = K p e n + Td
+ bn
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
a1
delay
bn (bias)
en (error)
ao
mn Controller output
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,
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
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
ao = K p po = p1 = K pTd
= a o en + p o c n + p1c n 1 + bn
where
= po
K pTd
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
en error
ao
bn (bias)
po
mn (Controller output)
delay
p1
The controller output (without bias) at the nth instant, using backward difference algorithm, is
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
Proportional-Integral-Derivative (PID) Controller
1 t de m ' = K p e + o edt + Td dt Ti
In en en 1 mn = K p en + + Td Ti
In en en 1 mn = K p en + + Td Ti
The controller output at the (n-1)th instant is
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
then,
or,
or,
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
I n I n 1 = en
mn = ao en + a1en 1 + a2 en 2 + mn 1
where,
and
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
Td ao = K p 1 + + Ti 2T a1 = K p d + 1
K pTd
a2 =
and
en
en-2
en-1
a1
a2
mn = mn + bn
ao
m'n
mn = ao en + a1en 1 + a2 en 2 + mn 1
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
+
bn (bias) mn
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
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
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
Saturation 100 r
Stop integration when PI/PID controller internal output (prior to the saturation block) exceeds the saturation limits
+ +
_
Kp
0 100
Process
Multiplier
Kp sTi
1/0
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
Saturation 100 r +
Kp
0 100
Process
Multiplier
Kp sTi
1/0
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
Saturation 100
Reduce integration gradually as PI/PID controller internal output exceeds the saturation limits
+ +
_
Kp
0 100
Process
Kp Ti
1 s
G : a constant
Clegg integrator the integrator is set to zero (reset) when the error crosses 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
Some anti-integral windup schemes
reset control reset SW C R 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
Manual mode means open loop manual control
Manual input or commnd Man e Controller m error Auto Final Control element v
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 e Controller m error 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 e Controller m error 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 Man Digital incremental controller m'n Auto Integrator m'n
bn (bias) mn
en
The incremental controller output (without bias) at the nth instant may be expressed as
mn = mn 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
Automatic/Manual modes of Operations
Scheme for bump-less transfer
Incremental manual command Man Digital incremental controller m'n Auto Integrator m'n
bn (bias) mn
en
m'n
Integrator
m'n
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 Man Digital incremental controller m'n Auto Integrator m'n
bn (bias) mn
en
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
en-2
a2
en-1
a1
bn
en
ao
m'n
AUTO
m'n
mn
m'n-1
Integrator
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
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
Controller Kp Ti Td P Controller 0.5 K c PI Controller 0.45 K c 0.6 K c Tc/1.2 Tc/2 PID Controller Tc/8
gain margin: 2
The relay control provides ON / OFF control of the process. The input r is set to zero.
The output c oscillates around a mean value of zero (limit-cycle oscillations). The 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
+ e D
0 -D
Process
Relay
Assuming the process to be a low-pass system, the process output c contains mainly the fundamental component.
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
+ e D
0 -D
Process
Relay
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
+
0 -D
Process
e = A sin t
Relay
-D
time
-D
time
-A
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
+
0 -D
Process
Relay
time
-D
The Fourier series of the relay output (v) may be expressed as:
The process practically attenuates all higher harmonics other than the fundamental. Then the process gain at frequency becomes
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
+
0 -D
Process
G ( ) =
Relay
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
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 =
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
+
0 -D
Process
Relay
4D . A
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 M r + + _ e PID Controller A v Process D T Mode switch 0 D Relay
M A T
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.
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
D = 0.1vmax e 0 0 t Manual setting
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.
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 M r + _
PID Controller
Process
T Mode switch
0 D
Relay
M A T