Copyright I6l 200 I IF AC IFAC Conference on New Technologies for Computer Control 19-22 November 2001, Hong Kong
A SELF-TUNING PID CONTROLLER BASED ON EXPERT SYSTEM
Xing Jianchun, Wang Ping, Wang Lin
Research Institute of Control and Measurement of Nanjing Engineering Institute 210007, Nanjing, Jiangsu P.R.China,
[email protected]~
Abstract: This paper introduces a PID controller with self-tuning function. It may provide optimal PID control parameters. The self-tuning algorithm based on the expert system and pattern recognition has quick convergence speed through the application of the new characteristic variables and the distinctive pre-tuning formulae. The uniformed self-tuning formula is also presented, which makes it easy to implement and maintain the expert system based on the single chip micro-processor. Copyright© 200] IFAC Keywords: PID control, error criteria, control algorithms, expert system
implementation of self-tuning of the digital PID controller is a emergency project.
1. INTRODUCTION With the development of electrical technology, computer technology and control theory, the conventional controller has been replaced successfully with the digital controller in the recent years. But the Proportional Integral Derivative(PID) algorithm is still widely used in the process industries(Zhuang and Atherton, 1993). This is due to several reasons: many process engineers are much more familiar with PID controller than with sophisticated modem control concepts like state-space control; they have much experience in application and tuning of the conventional analogue PID controllers; the application of complex control algorithms up to now requires special training of the user; with the great majority of processes, PID control shows good performance and is known to be nearly as robust as state-space control regarding process parameter changes. However, the tuning of digital PID controller is still a difficult and time-consuming chore and the presented self-tuning methods can't ensure that the parameters obtained from self-tuning are optimal. For these reasons, the application of the digital PID r.ontroller in the process industries has been greatly limited. The
511
In the last few years, some methods of tuning the parameters of PID controller have been developed and several commercial self-tuning controllers are available. However there are some practical problems in these self-tuning algorithms, for example, the poleplacement algorithm requires the accurate plant model that it is always difficult to be obtained; the algorithm of numerical optimisation or identification method is very complex and the disturbance must be introduced in the tuning procedure. In this paper, we will introduce a self-tuning method base on expert system. In this method, a pre-tuning formula is given to improve the convergence speed of the expert self-tuning algorithm. The rule collection and the uniform self-tuning formula of the expert selftuning are introduced. The self-tuning procedure is close-loop, that is to say, the tuning procedure will cycle until the optimal parameters are obtained. In some present self-tuning algorithm, the self-tuning procedure is open-loop, the control effect of the selftuning parameters is judged by the control engineer
but not by the controller and the refming of the PID parameter is also executed by the control engineer.
between the set value and the process value, it is the function ofa and t, n=0,1,2,3 ....
2. CONTROLLER STRUCTURE
The choice of n=1 in the above integral criteria, which is known as the ISTE criterion, gives
The structure of the self-tuning controller is shown in the Fig. I. The expert self-tuning controller consists of the following parts: pattern recognition, dynamic infonnation database, static infonnation database, inference mechanism, PID control algorithms, etc. The pattern recognition function recognizes the model of the error signal between the set value and the process value, the resUlt is written into the dynamic database. The static infonnation database stores the expert rules. The dynamic infonnation database store the error model, the self-tuning procedure infonnation, tuning target, etc. The inference mechanism calculate the tuning value(.6 Kp, .6 Ti, .6 Td) of the PID control parameters
Tab. I Relation between the error integral criteria and the characters of the transient procedure. Control tar..&.et
Error integral criteria
f t6e2 (8,t)dt
The characters of the Transient procedure Almost no overshoot, The rising speed is very slow.
0
J 3 (8)
=
I
J 2(8)
= Jo~t4e2(8,t)dt slow,
2
J 1 (8)
=f
3
J o(8)
= fo~ e 2(8,t)dt
The
t 2e 2(8,t)dt
rising
speed
The overshoot is About 5% The rising speed is fast, The overshoot is Moderate, about 10% The rising speed is Very fast, the overshoot Is serious, about 20%
satisfactory result. A large amount of simulation experiments has been made, for the fIrst-order plus dead time (FOPDT) plant model which is widely used to represent the practical plant procedure, using the Equ.l, in which the n is chosen as 0,1,2,3.
Set value L - - - - - - L . . . . : - : . ! l _ j - - - - - value
The transfer function of a FOPDT model is Fig. I The structure frame of the self-tuning controller
n
G (s)= k·ep
according to the infonnation in the dynamic and static infonnation database.
The conventional perfonnance index, such as rise time, overshoot, damping, etc., always only reflects the perfonnance of the transient procedure in some aspect, also these perfonnance indexes conflict each other. However, the error integral perfonnance index is a comprehensive index, it may reflect the general perfonnance of the transient procedure. But there are many error integrating styles, minimising the different error integral criteria, you may obtain different PID control parameters and different transient procedures.
4. PRE-TUNING FORMULAE The converging speed of the self-tuning algorithm is an important index to evaluate a self-tuning PID controller. Because the iteration number of the selftuning is bigger, the disturbance introduced by the self-tuning algorithm is serious. The presented selftuning algorithm always provided two ways to
The common description of the error integral perfonnance criteria is:
J n (8)
= Jof{t n e(8,t)}2dt
(2)
l+T·s
The simulation experiment result denotes that: if the error integral criteria is detennined, for various T, le, 'r in the Equ.(2), using the control parameters obtained by minimising the error integral criteria, the transient procedure is approximate. That is to say, the perfonnance of the transient procedure is only related with the error integral criteria when the optimal PID control parameters are used. Therefor, we can obtain the required transient procedure by choosing the proper error integral criteria. The Tab.l shows the relation between the error integral criteria and the perfonnance of the transient procedure.
3. INTEGRAL PERFORMANCE CRITERIA AND CONTROL TARGET
(1)
here, a is the parameters collection which influence the error integral J, e( a ,t) is the error signal
512
is
~5~--------------~
1L~----------------'
III
0
I; I
~5.-----------------,
If: : /1;
,
. 11
0
•• «1 IU
..
9 8 7 I)
1.5
o
4
~
•• 25
2
:I
,·1 "Ir
S 2 II~~~~~~~W-~
Fig.2.a Relation between
kpi{ and
0 I 2 3
..
a2 -.210 -.239 -.272 -.293
al 1.036 1.254 1.439 1.558
aO .030 .028 .019 .022
b2
8 1.2 1.4 U 8.S 1 1.2 1.4 1.& 1.1 ()
Fig.2b
Fig.2c T/ •
()
Relation between /
Tab.2 The coefficients of the pre-tuning formulae Control target
II~WW~~~~~~~
8 1.2 • . 4 U 8.a 1 1.2 1.4 1.& 1.1 ()
11 8 1.21.4 U 8.S 1 1.21.41.& 1.8 ()
bl
bO
c2
.4 1.3
.027 1.329 -.031 .042 .243 1.191 -.032 .042 .193 1.154 -.022 .043 .168 1.126 -.016
cl
Relation between
and ()
T,
r.·1 d IT and ()
Experiment condition: control period: SP=O.5s simulation step: SS=O.1 simulation time: St=200s control target: OS=3
cO
.246 .014 .274 .002 .236 .003 .202 .005
..
The results show that the optimal PID parameters obtained by minimising the criteria are
mltlaiIse the PID parameters: entermg the mItIal parameters by the user or obtaining the initial parameters according to the presented simply selftuning formulae. For this reason, the initial parameters may be far away form the convergence parameters, and the number of self-tuning is so bigger that it can not meet the need of the practical procedure. In our research, we have derived a group of formulae by parameter optimisation to provide the initial parameters. These formulae may provide the better initialising parameters.
~. =2.314
7;. =72.615
Td • =5.479
The initial parameters according to the pre-tuning formulae are ~ =2.172
That
is
to
7; =69.843 say,
the
Td =5.394
initial
parameters
~ , 7; , Td obtained by the pre-tuning formula are
In the simulation experiments, it is found that: there are some explicit relation between the optimal PID
near to the optimal PID parameters~·,7;· ,Td • .The
parameters kp · ' t;·, td· obtained by minimising the
self-tuning algorithm can converge rapidly if these initial parameters are sued.
error integral criteria and the FOPDT plant model parameter K ,T and 't'. These relations are showed in figures 2a,2b,2c.
5. CHARACTERISTIC VARIABLES OF THE TRANSIENT PROCEDURE
,I
group of pre-tuning According to these curves, formulae are derived as Equ.(3). In the formulae e = 't' I T and the coefficients are shown in the Tab.2.
2 Kp = K l(a e + ale + a ) 2 O 2 T; = T · (b e + ble + b ) 2 O 2 Td = T· (c e + cle + co) 2
The present expert system based PID self-tuning algorithms always select the overshoot, damping, oscillation period as the characteristic variables. In our research, we presented a group of characteristic variables to speed up the convergence of the selftuning algorithm. The definition of these four characteristic variables is as Fig3.
(3) SV
I r-I_-_-_-_-_-_-_-
ql
L....L.
e
To verify the pre-tuning formula, a simulation experiment is made. The plant model:
Gp (s) = I I (1 + 48 . s) . e-20s
513
r-I,---_-_-_-_-_-_-_-
L....
e
=_ E2
Overshoot: OV
set SRDA = da - da'
El
da'
E3 -E2 El -E2 E3 Peak Rate : PR=-E2
Damping: DA=
here, da is the practical damp, da' is the desired damp. if SRDA::; 0.1 * r
then
Dda=O if 0.1 * r < SRDA ::; 0.2 * r
Time Rate: TR = t3 -t2 t2 - tl
then
Dda = 1* sign(da - da') if 0.2 * r < SRDA::; 0.3 * r Dda = 2 * sign(da - da') if SRDA ~ 0.3 * r then
6.THE UNIFORMED SELF-TUNING FORMULAE AND PRODUCTIVE RULES
then
Dda = 3 *sign(da -da')
If the characteristic variables of the transient procedure are directly used to verify the PID control parameters, it is difficult to express the difference between the practical response and the desired response when the different control target is utilised. Further, to speed up the convergence of self-tuning, when this error is big, the tuning should be big; and to ensure the stability of the procedure, when this error is small, the tuning should be small. So, the following definitions are introduced.
According to the above defmitions, the uniformed formula is driven as following
Mp =akp ·r·~Dovl+IDdaj).kp(n-I) {
r· ~Dovl + IDdal). ti(n -1) Md = aId · r· ~Dovl + IDdal). td(n -1) M ; =a l;
a kp ' a l ;. aId
here,
ov-ov set SROV = • ov
(4)
•
are
the
coefficients
determined by the expert rules according to the number and the direction of the tuning. While kp(n-I). ti(n-I). td(n-I) are the
here, the OV is the practical overshoot,OV' is the desired overshoot.
kp. ti. td after the previous tuning. Then, after tuning, control parameters should be:
if SROV::; 0.1
*r
kp(n) = kp(n -1)+ Mp
then
Dov=O if 0.1 *r < SROV::; 0.2 *r
then
Dov = I*sign(ov-ov') if 0.2 * r < SROV ::; 0.3 * r
then
{
Dov = 3 *sign(ov -ov')
{
~
tAn)=tAn-I)+Md
The self-tuning controller has adapted the productive rules like "if...then ... " to express the expert's experience and knowledge. Several rules have been given as the example of the productive rules.
here, Y is the coefficient related with control target. For the control target 0, 1, 2, 3, the Y orderly is 2.0, 2.0, 1.2, 1. sign(·) is the symbol function.
sign (x) =
(5)
For different control target and different expert rules, the application of the uniformed formula of selftuning algorithm will make it easy to implementing and maintaining the expert rules.
Dov = 2*sign(ov - ov') if SROV ~ 0.3 * r then
- 1
t;(n) = t;(n -1) + M;
Rules 1: if(DOV=O and PR<0.2) then
x
O
{
a kp =0: a l ; =0: aId =0.07;
}
Rules 2: if(DOV=3 and DDA=3 and tdr >2.8) then
a kp =0: at; =0: aId =-0.0252; Rules 3: if(DOV>=O and PR
Similarly, the damp has the following defmition:
then
a kp =0: a l ; =0.0265: aId =0; Rules
514
4 :
if(OV>=HOV
and
}
DA>HDA
} and
PR>=PrDn) then a kp =-0.018:
effect is satisfactory. a lj
=0:
aId
=O;}
8. CONCLUSION
Mp' tlt
The controller calculates the
j
tltd
,
A self-tuning controller based on the pattern recognition and the expert system has been presented. The self-tuning algorithm structure is reasonable, and it has broken through the conventional pattern recognition method, so that it has quick converging speed and satisfactory performance of the transient procedure. This algorithm has been implemented in a digital controller(Xing, et aI., 1997), and control performance is good enough for a variety of industry plants(Xing, et aI., 1999).
according to the coefficients given by the productive rules, then the tuning of the control parameters k/n) , tj(n) , tAn) may be obtained.
7. TESTING THE SELF-TUNING ALGORITHM To test the self-tuning, an experiment of the temperature control of an electric oven has been made. The FOPDT plant model of the electric oven is e-214 .3s
I
The defect of this method is that the disturbance must be introduced into the control procedure, even though the margin of the disturbance may be set by the control engineer. The method of solving this problems is to wait for the natural disturbance during the tuning procedure, that means the self-tuning time is longer and the performance of the control system may be not satisfactory before the optimal control parameters were obtained.
11 + 717.6S
Gp(S) =
Test condition: control target OS=1 control period SP=4s Because there is a long dead time, the PI control algorithm has been used in the controller. The initialization parameters according to the pretuning are Kp=1.210 Ti=717.5
REFERENCES Hang, C.C. and K.K.Sin(1991). A Comparative Performance Study of PID Auto-tuners. IEEE Trans. Control System, AUGUST pp41-47 EDGAR H. BRlSTOL(l977). Pattern Recognition: an Alternative to Parameter Identification in Adaptive Control. Automatica, VoU3, pp197202. Zhuang, M and D.P. Atherton(l993). Automatic tuning of optimum PID controller. lEE PROCEEDINGS-D, Vo1.140, No.3, pp216-224 KRAUS, T.W. and TJ.MYRON "Self-Tuning PID Controller Uses Pattern Recognition Approach" CONTROL ENGINEER, JUNE 1984, pp. 106III Xing Jianchun, Wang Lin, and Wang Ping(l997). Intelligent Digital Controller. Proceedings of the IEEE First International Conference on Intelligent Processing Systems, pp775-778, Beijing. Xing Jianchun, Fang Zhonghua, Zhong Weiyang, Wang Ping and Wang Lin(l999). Application of intelligent controllers on the power plant boiler control, Proceedings of the IFAC 14th World Conference, Vol.O , pp345-349, Beijing
After five times self-tuning, the controller parameters converged to Kp=1.068 Ti=!>73.4, and the desired response was obtained. The self-tuning procedure is shown in Tab.3. The step response are shown in Fig. 4. The experiment proves that the converging speed of Tab.3 Self-tuning procedure of the electric oven control n
I 2 3 4 5
Kp Ti OV(%) DA 1.210 717.5 10.1 0.114 1.160 777.2 8.70 0.097 1.112 831.2 7.0 0.078 1.081 873.4 5.0 0.066 1.068 873.4 5.0 0.064
TR
PR
1.297 1.114 1.975 0.830 0.057
0.103 0.201 0.208 0,385 0.343
DOV 3 3 2 0 0
DDA 3 3 2 1 0
this self-tuning algorithm is fast, and the control - '---';-'-- 1---'".;.. ' --,-
I
i
:
3000
3SOO
~--~~~-----~--~--·~~~·--~t- ~-----
o
i
500
1000
1500
2000
2SOO
400
Fig. 4 Step response of the experiment control process
515