Design and Implementation of A Self-Tuning Pid Controller

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Cop)'light @ IFAC Adaptive Systems in Control and

Signal Processing, Glasgow, Scotland, UK, 1998

DESIGN AND IMPLEMENTATION OF A SELF-TUNING


PID CONTROLLER

Toru Yamamoto*, Kenzo Fujii** and Masahiro Kaneda*

** Department of Communication Engineering,


Okayama Prefectural University
111 Kuboki, Soja, Okayama 719-1197, Japan
* Tokuyama Plant, Idemitsu Kosan Co. Ltd.,
1-1 Miyamae-Cho , Tokuyama. Yamaguchi 745-8613, Japan

Abstract: PID control schemes based on the classical control theory, have been
widely applied to real control systems, and there have been a lot of works on the
tuning of PID parameters, as they affect control performance. Several self-tuning
and auto-tuning PID techniques have been reported for systems with unknown or
slowly time-varing parameters. None, however, is applicable to discrete-time system
with unknown dead time. In this paper. a self-tuning PID control algorithm is
proposed based on the relationship between the PID control law and the generalized
minimum variance control law which is one of self-tuning control strategies. The
proposed control scheme is practically evaluated on a temperature control system
of a polybutene reactor. COpyright © 1998 IFAC

Keywords: Self-tuning control, PID control, Chemical industry, Process control,


Adaptive systems

1. INTRODUCTION control(Cameron and Seborg, 1983: Proudfoot and


Gawthrop, 1983: Gawthrop, 1986) have been pro-
Self-tuning control(STC) schemes( Astrom. 1983: posed. To the best of our knowledge, however, no
Astrom and Wittenmark, 1989; Wellstead and Za- self-tuning PID control scheme has been consid-
rrop, 1991) have been developed for systems with ered for unknown time-delay systems.
unknown or slowly time-varying parameters. Fur- The main motivation in this paper is to present a
thermore . the rapid progress in digital computer
design scheme of self-tuning PID controllers, and
technology has enabled simulation of complex and consider the implementation of the proposed con-
large-scale systems. Many control techniques have
trol scheme for a temperature control system of
been proposed to improve the performance of dis-
a polybutene reactor. In the polybutene reactor,
crete-time control systems. However, since these
to maintain product quality and the stability, it
techniques are complex, it is difficult to apply them is important to control temperature. This pro-
to plants and obtain control parameters. On the cess is difficult however, because the dynamics of
other hand, PID(Zieglar and Nichols, 1942; Nims, the system varies with catalyst activity, product
1950; Chien, et al., 1952: Takahashi, et al.. 1971)
grade and reactor rate. To date, various PID con-
control algorithms still continue to be widely used trol schemes have been adopted, the parameters
for most industrial control systems. particularly of which have been determined by trial and er-
in the chemical process industry. The reason is
ror . Moreover. the parameters were not neces-
mainly because PID controllers have simple con-
sarily suitable. and fairly conservative values were
trol structures, and are simple to maintain and
used to ensure the safety of the reactor. Therefore.
tune. Therefore. it is still attractive to design
a self-tuning PID control scheme is needed .
control systems with PID control structures. Fur-
thermore. one may not be able to get good con- This paper is organized as follows. The struc-
trol performance in the case of time-varying pro- ture of a transfer function model to be consid-
cesses. Several techniques for auto-tuning(Astrom ered in the estimation and design of control sys-
and Hagglund. 1984: 1988: Nishikawa. et af.. 1984: tem is first considered . Furthermore. based on the
Radlke and lsermann. 1987) and self-tuning PID relationship between PID control and the gener-

59
alized minimum variance control( G~IVC)( Clarke formance of the control system strongly depends
and Gawthrop. 1979) laws. a design scheme of self- on them . For systems with unknown parameters
tuning PID controllers is proposed . Finally, an im- and unknown time-delays. however. it is difficult
plementation of the proposed control scheme for to find the " optimal" PID gains easily. There-
a temperature control system of a polybutene re- fore , a self-tuning PID control algorithm based on
actor is considered , and the effectiveness is prac- the relationship between PID control and gener-
tically evaluated by applying it to the polybutene alized minimum variance control(G~IVC) laws, is
process. derived below .

2 . SELF-TUNING PID CONTROLLER 2.3 PID tuning


2.1 Mathematical model Consider the following cost function to derive a
Let z -1 be the backward shift operator, and con- GMVC law:
sider the following discrete-time SISO model: J = {P(z-l)y(t+km+l)+A~U(t)-R(z-l)w(t)}z
A(z-l)y(t) = z-k", B(z-1 )'/L(t - 1) (1) (8)
where where A included in (8) is the weighting factor
with respect to the control input, P(z-l) is the
A(z-l) = 1 + alz-1 + azz- z }
user-specified polynomial of the form:
(2)
B(z-l) = bo + b1z- 1 + .. . + bmz-rr> p(z-l) = 1 + PIZ-1 + pzz-2 . (9)
and u( t) and y( t) are the input and the output and R(z-l) is determined based on the relation-
signals, respectively. Furthermore, km is the min- ship between PID control and GMVC laws. ~ de-
imum value of the estimated time-delay. If the notes the differential operator, i.e. , ~ := 1 - z-l .
true time-delay, k, is known exactly in advance, it
is better to set as krr> = k . On the other hand . The control input minimizing the cost function
where the information about the time-delay is not (8) is given by the following equation( Clarke and
available, then km is set to 1. For the system (1), Gawthrop, 1979):
suppose the following assumptions: F(z-l)y(t) + {E(z-I)B(z-l) + A}~U(t)
[Assumption) - R(z-l)w(t) = 0 (10)
[A.l) The degree of B(z-I), m is known . where E(z-l) and F(z-l) are obtained by solving
[A.2] Parameters, ai and bi are unknown. the following Diophantine equation:
[A.3) The time-delay k may be unknown, but
p(z-l) = ~A(z-l)E(z-l) + z-(k",+l) F(z-l)
the following relation is satisfied :
(11)
km S k S km +m (3) 1
E(z-l) = 1 + elz- + .. . + €k",Z-k",} (12)
[AA] Reference input w(t) consists of piecewise
constant signal. F(z-l) = fo + hz- l + fzz-z .

2.2 PID Controller design Next, based on the relationship between PID con-
Next , the following digital PID control law to be trol and GMVC laws, a tuning method of PID
considered in this paper is described as: parameters is derived. Usually the dynamics of
Ts the system to be controlled, for example, the time-
t:.:u(t) = k c [{ e(t) - e.(t - I)} + T e ft)
, delays or the time constants, are rarely known pre-
cisely in advance . In particular, knowledge of the
+ -Td { e( t) - 2e( t - 1) + e.(t - 2)}] (4) delay is important . Here, the strategy is adopted ,
Ts
that km is under estimated i.e., initially use the
where e( t) denotes the control error signal given upperbound estimate of the delay, or assume that
by the order of B(z-l ) is large enough, in order to
e(t) := wit) - y(t) (5) cope with the above problem. Therefore, the es-
and kc, Ti and Td are the proportional gain , the re- timates km and B(z-l), i.e., the second term in
'set time and the derivative time, respectively. Fur- (10) , E(z-l )B(z-I) , includes some uncertainties.
thermore , Ts denotes the sampling interval. For In order to obtain a control law with a PID struc-
convenience, let C(z-l) be ture, consider the following control law replaced
Ts Td E(z-l)B(z-l) by the static gain £(I)B(I) :
C (z- I ) : = k c ( 1 + - + -) F(z-l)y(t) + {E(I)B(1) + A}lw(t)
T; Ts
2Td ) -1 kc T d_2 - R(z-l)w(t) = O. (13)
- k'c ( 1 + - z +- -z
Ts Ts Here, /1 is defined as
= Co + CIZ-1 + czz - z (6) v := E(I)B(I) +A (14)
then , (-!) can be rewritten by then, (13) can be rewritten by
C(z-l)y(t) + ~'U(t) - C (z-l )w(t) = O. (7) Flz- 1 ) R(z-l )
---y(t) + ~u(t) - . leU) = O. (15)
The tuning of the control parameters in PID con- v v
trol laws (4) or (7), is important, since the per- Furthermore, if the following relations are satis-

60
£led: dra. 1982 : Goodwin and Sin. 1984) :
= F(Z-l)
~
fl(z-l ) rll - 1) 1/J (t - 1)
fj(t.) = &(1.-1)+ 11ft )
f'(Z - I) (16) 1 +Ii-,T(I - 1)[(t - 1)1/J(t - 1)
C(Z-l ) = . .
I1 J (22)
then (15) becomes identical to (7). Therefore. f(O = ~ [r(t - 1)
based on (6) and (16) , PID parameters can be vJ
calculated as follows: _ fU - l)I/JU - 1)4)T(l- l )fU - 1) ]23
1 vJ + 1j;T(t, - l)f(1 - 1)1/J(t - 1) ( )
kc = --rh
v
+ 2fz)
T - _ h +2fz T c(t) = Yf(t) - (]TU - 1)1/I(t - 1) (24)
( 17)
t - fo + it + fz s
( >d
c(t) -tll(t) = c(t) - d
T--
d -
fz
it + 2fz
T
s· II(t) = ~ Ic(t)1 S d -tl/(t) = 0 (25)
l c(t) < -d -t If(t) = c(t) + d
Note that the parameter A is related to only k c .
where w is a forgetting factor given by 0 < w < 00 ,
In other words, T[ and T D are independent of A.
and c( t) is a prediction error. Also, 2d( > 0) in
Thus, the proposed scheme has a feature such that
after selecting p(z-l) in (8) or (9), A can be deter- (25) is the width of the dead zone. iJ(t) and 1/I(t-
mined or chosen independently by considering the 1) are the unknown parameter and data vectors,
respectively, i. e.,
stability of the control system based on a priori
- '" T
information. For example, the Bode diagram can (}(t) = [til(t) , a2(t) , bo(t) , b1(t), · · ., bm(t)] (26)
be utilized to determine A. Such a design method
for selecting A is discussed in detail in section 4.2.
I/J(t - 1) = [-Yf (t - 1), -Yf(t - 2) , 'u f(t - km - 1),
" ', 'uf(t - km - m - 1)]T .
(27)
The design method of P(z-l) is discussed below.
P(z-l) is designed based on the following two fea- In (25) and (27), the subscript " denotes the fil-
tures which allow one to select the response shape, tered values of the inputs and outputs, and they
overshoot, settling time, etc. are given by

1) the rise time


2) the damping property.
Yf(t) : = D(z-l)y(t)
uf(t) : = D(z-l)u(t). } (28)

Shigemasa et al. (1983) have presented a practical D(Z-l) is designed as the low-pass filter or the
method to design the reference model based on the band-pass filter. The filters are usually used for
above features in the continuous-time systems. By the purpose of improving reliability of the param-
transforming these features into the discrete-time, eter estimation in real systems.
the following coefficients can be obtained: Next , by solving the Diophantine equation (11)
_.£.. .j4J.L - 1 based on estimates included in iJ( t), and calcu-
PI = -2e ~"cos( p) (18)
2J.L lating (14) and ( 17) , PID parameters can be ob-
tained .
P2 = e-; (19)
The proposed self-tuning PID control algorithm is
where p and J.L are defined by
then realized via the following steps.
fl := Ts l o (20)
:Self. Tuning PID control algorithm]
J.L := 0.25(1 - b) + 0 .510 ( 21) 1. Choose p(z-l ) and A.
and 0 and J.L denote the rise-time and the damp- 2 . Design the estimator filter D(z-l) .
ing index , respectively. Here, the binomial model 3. Estimate iJ(t) by using the RLS algorithm in
response can be obtained for I> = 0, and the But- (22)-(28).
terworth model response for 6 = 1.0. Although 4 . Solve the Diophantine equation (11).
the response shape can be chosen to one's liking 5. Calculate PID parameters based on (14) and
by changing the parameter {; , (; should be set to be- ( 17).
tween 0.0 and 2.0 practically. On the other hand , 6 . Calculate the control inputu( t) based on
0i corresponding to the rise time, can be set to be-
( 4) .
tween 1/ 3 and 1/ 2 of the time constant depending 7. Update t and return to 3 .
on the practical needs.

2.4 Self-tuning PID controller 3. IMPLEMENTATION


Based on the control scheme discussed above. a In this section, the proposed self-tuning controller
self-tuning PID controller is designed in this sec- is practically evaluated on the temperature control
tion. system of a polybutene reactor .

First. unknown parameters included in (1 ) are es- 3.1 Outline of the polybutene process
timated by using the following least squares(RLS) In a polybutene plant . the object system products
algorithm with a dead zone (Peterson and Naren- of C 4 distillation (butene, isobutene and so on)

61
are polymerized by injection of a catalyst . Since 1~ : the temperature conducted at the heat
the thermal polymerization reaction is exother- exchanger [K]
mic , the temperature in the reactor must be strictly Fe: the flow of the coolant [kmol / s]
controlled. However. since a change in the oper- kex : the temperature gain outside of the heat
ating conditions or catalyst activity disturbs the exchanger to the change of the coolant
temperature control. the constant human inter- flow
vention and monitoring are required currently. T( : the time lag by holding up the tempera-

A schematic diagram of the polybutene reactor is ture inside of the heat exchanger [s]
shown in Fig.l. ='Iext, from the pressure balance in the reactor and
the heat balance owing to the heat exchanger, it
is found that the temperature Tr in the reactor is
expressed as the first order element to the temper-
ature Tc of the heat exchanger.

Vapor(Va) Gas phase


G 2(S) = Tr(s) =~ (30)
p Tc(s) 1+728
Liquid phase Tr : the temperature in the reactor [K]
kr : the overall heat transfer gain
Butene 72 : the time lag by conducting heat at the heat
Polymer
+ Butene exchanger [s]
Therefore, the total dynamics Gp(s) of the poly-
butene reactor with respect to the temperature
Catalyst can be expressed as follows (Fujii, et al., 1997) .
Fig.l. Schematic diagram of the polybutene reactor .
Gp(s) = G p1 (S)G p2 (s)
The action of the reactor can be summarized as
kexkr -TIB
follows:
i) The products of C 4 distillation (butene , iso-
(1 + T1s)(1 + 72S) e (31)
butene and so on) are supplied into the reac- Note that the flow of the coolant, Fe, and the tem-
tor. perature in the reactor Tr , correspond to the input
ii) A catalyst is injected and the products are u(t) and the output y(t) in (1), respectively.
polymerized at a specified temperature. 3.3 Control strategy
iii) The products are vaporized or condensed with The self-tuning PID control scheme has been ap-
a coolant. plied to the temperature control system of the
iv) Temperature changes in the reactor due to a polybutene reactor. The control scheme is shown
change in the operating conditions, a change in Fig.2 .
in catalyst activity, the heat of the exother-
mic reaction and so on, are controlled by the
coolant flow rate.
v) The mixed fluids, some of which are polymer-
ized , are sent for further processing.
The reactor with respect to the temperature con-
trol is modeled by considering iv).
3.2 _\Iodeling
Suppose the following conditions:
[1] The equilibrium between the gas and the liq- i .
-' I
uid phase is maintained . !I ~ i.
-.-.-.- . -.- . -.-.- . ~
[2 ] Changes in exothermic heat owing to changes
of temperature in the reactor are neglected ,
since the activation energy for the reaction Fig.2 . Block diagram of the temperature control
rate is small. system of a polybutene reactor with the
self-tuning PID control scheme.
[3] The inside of the reactor is in a state of boiling
owing to the reaction heat , and is stirred. In Fig.2, the solid lines represent the signals which
[4] The flow of coolant involves two phases. are transferred at each sampling time Ts = I[min] ,
[.5] The heat capacity of the steal parts of the and the broken lines the signals transferred at each
reactor and the heat exchanger for cooling is STC period Tsc = 60[min] . Furthermore, the part
neglected . enclosed by the dotted-broken lines is the STC
scheme. The following strategy is employed in
First, the experience equation with respect to the
adopting the STC scheme as shown in Fig.2 .
dynamics of the heat exchanger is as follows:
[1] Though the data-sampling period for the sys-
. Tc(s) kex -T,S
tem identification is the same as for the sam-
C. p d 8 ) = Fc(~) = t'. (29)
u ( 1 + T18) pling time T s , the STC period Tsc during
The notation is summarized as follows: which the PID parameters are changed is set

62
to sixtv times 1"5 for saletv . .-i.lld the svstem ;6.2r
l ------------------
identificatioll and P ID parameter calculation ;I? ~ 1

it 1~ (\ r\ ,il r\l\ri!A~ fl J
are carried out by using the last 250 sampled
d ata at each T5 C-

16.0~ · ~ .. ·.. V
·y-i.. ~(1· \ ..~·ff..~·r'rt ·~t1
· 0
:2] The following band-path filter D(::-l ) is em-
:
ployed for the input and output sampled data
of the plant in order to smooth the observa-
tion noise. and to remove the trend owing to
, ri' ~ IVJ ,', tJ! Operator tun ing PlO ' Self tuning PlO
the change of the catalyst activity.
1 5 .80=-----'--:-4-::-00:;;---'---;:8:-::0-;::0--'--'-;1-:::2':::0::::-0---L---:1:-::6-!;:,0c:::'0
1-/l 1 + :: - 1 1+ , j 1-:: - 1
0(::-1 ) = (__ )( __ ) t [step]
21-0::- 1 21-d:: - 1
(32) 90.0.---r--,---.-.--.--.-----r-........-,

Here. u and d are respectively set to 0 .05 and


0.95 from the roughly estimated time con-
stant of the system .

3.-1 P(z-l) and A

From historical data of the polybutene process.


the time constant of the process is calculated as
T = 566[sec] . Based on the time constant. the 60. 00~--'--4-:-:0::-:0:--....I.----=c80:':-:0:--....I.--'-:1-;::2'"=0-;:;-0---'----:1-;::6':::0-='0
rise-time is determined as a = 250[sec], and b = t [step]
0.0 in this case. From (18)-(21) . p(z-l) is de-
signed as: Fig.4 . Control results where the operator tuning
parameters were used in the interval 0 :s:
p(z-l) = 1-1.238z- 1 +0 .383z- 2 . (33) t < 1100 and the self-tuning PID parame-
ters were used in the interval 1100 < t <
~ext. a scheme how to set suitable A is considered. 1600.
As mentioned in section 2.3, A is related only to
the proportional gain k c . To ensure stability, one 8.0.------r--,--.----r--,--~__r-.....,-,
can adjust A by using a simple Bode analysis based
on a priori or approximate knowledge of the pro- 6.0
cess. In the Bode diagram, only the gain curve is 4 · °r-------==:;~1~~
affected by A and the phase curve is invariant to Operator tuning PID, Sellluning PID
A. Assuming the following equation as the true 2.0 1600
0 400 800 1200
system. which has been obtained from historical [step]
data :
y(t) = l.575y(i, - 1) - 0.65-ly(/. - 2)
+ 0 .02311.(/. - 2) - 0 .019u(/ - 3) . (3-1) c
:t
8' 0~
6.0f-------------., ~
the Bode diagram of the control system is shown ~ 4.0
in Fig.3. which is constructed by using (3-1) and
2. 00~-L---4-:-:0~10::---L...---'8::-:0~
1 0::-....1.-....1.-1-=21::-'0""0---"'---:-1"='6,::-00='
1

the PlO controllers whose PlO parameters are cal·


cuiateci UV I lll . ( !-l l and ( i7 > [11 Fig.3 . .'. . S • [:;:ep)
changed trom 0.0 to 0 .5 in increment s U.l.

J:~~: . ": I :d
50

i ·~lliT'
.~.
.50 '
. : :
! - - -·-
i ·- -·- · -· -' : - - '-_ . _ ._ ._ ._ ._. _. · .,---_ _ _ _........Jl
0.0 ~---'---~40:':-:O~~-:;::-80:':-:0~~~1~2~0~0~---:1~6~O~0
t [step]
1 1
10" 10 10
Frequency I(~d/secl Fig.5 . PlO parameters trajectories corresponding
to Fig...!.

From Fig.3 . ,\ is set to 0.1 to obtain a gain margin


of approximately lO[dB 1.

3.5 Control results


The newly proposed self-tuning PlO control scheme
has been applied to the temperature control sys-
Ffequency tfaa/secl
tem of the polvbutene reactor. The control results
Fig.3. Bode diagram of the temperature control are shown in FigA.
system of the polybutene reactor to indi·
cate the effect of A. In the system description (1) . km and /11 were

63
respectivelv set to 0 and 3. furthermore.~· = tomatic Controls. Trans. AlEE. 70 . 606-61l.
O. 99( the forgett ing factor) and 2d = O.H t he dead :\ishikawa. Y .. T . Ohta and H. Tanaka (1984) . A
zone width) in the parameter estimation. The re- ~lethod for Auto- Tuning of PID Control Pa-
sults of the estimator to compute PID parameters rameters . Automatica. 20 . 321-332 .
are shown in Fig.5. Peterson. B .B. and K . S.~arendra (1982). Bound-
These results suggest that the newly proposed self- ed Error Adaptive Control. IEEE Trans. on
tuning PID control scheme is applicable to a real A utomatzc Control. 27-6 . 1161- 1168.
plant of which dynamics varies considerably. if ap- Proudfoot . C.G .. P.J . Gawthrop and O.L.R. Ja-
plied carefully. cobs (1983). Self-Tuning PI Control of a PH
:\eutralisation Process. Proc. lEE. l30D .
267-272 .
4. CONCLUSIONS
Radke. F . and R. lsermann (1987). A Parameter-
In this paper, a self-tuning PID control scheme Adaptive PID-Controller with stepwise Pa-
has been proposed based on the relationship be- rameter Optimization. Automatica, 23. 449-
tween the PID control and the GMVC laws. Also, 457.
a method for designing the parameter A and the Shigemasa. T. , Y . Takagi, Y. Ichikawa and T. Ki-
polynomial P(z-l) included in the cost function tamori (1983). A Practical Reference Model
of the GMVC law has been discussed, which are for Control System Design(in Japanese) .
selected based on some a priori information about Trans. on SICE, 19, 592-594.
the process. Finally, the effectiveness of the newly Takahashi. Y ., C.S . Chan, D.M . Auslander (1971).
proposed control scheme has been shown by prac- Parametereinstellung bei Linearen DDC-
tical evaluation on a temperature control system Algorithmen , Regelungstechnik und Prozej:J-
of a polybutene reactor. Especially, the control re- Datenverarbeitung. Verlag R. Oldenbourg, 19 ,
sults illustrate that the proposed scheme is appli- 237-644 .
cable to a real plant whose dynamics varies with Wellstead, P.E . and M .B.Zarrop (1991) . Self-Tun-
the catalyst activity and the change of product ing Systems, Control and Signal Processing,
grade. Transition control in the change of prod- John Wiley & Sons Ltd.
uct grade is currently under investigation. Ziegler. J .G. and N.B. Nichols (1942) . Optimum
Settings for Automatic Controllers, Trans.
REFERENCES ASME, 64, 759- 768.
Astrom. K.J. (1983). Theory and Applications
of Adaptive Control-A Survey. Automatica,
19, 471-486 .
Astrom , K.J. and T. Hiigglund (1984) . Automatic
Tuning of Simple Regulators with Specifica-
tions on Phase and Amplitude Margins.
Automatica, 20, 645-651.
Astrom. KJ. and T . Hiigglund (1988). Automatic
Tuning of PID Controllers. Instrument Soci-
ety of America. Research Triangle Park.
Astrom. K.J. and BWittenmark (l989\. Aaavtive
Control. Addison- \Veslev.
Cameron. F. and D .E. Seborg (1903 ). A Self-
Tuning Controller with a PID Structure . Int.
1. Control. 38 . 401-417.
Chien. K .L.. J .A . Hronesand J.B. Reswick (1952).
On the Automatic Control of Generalized
Passive Systems. Trans . ASME. 74.175-185.
Clarke. D .W. and P.J . Gawthrop (1979) . Self-
Tuning Control. Proc. lEE. l26D. 633-640.
Fujii. K .. T .Yamamoto and M .Kaneda (1997).
Self- Tuning PID Control of a Polybutene Pr~
cess. Proc. of IFAC International Sympost'Um
on Advance Control of Chemical Processes.
BanfI. 103-108.
Gawthrop. P.J . (1986). Self-Tuning PID Controller
: Algorithms and Implementation. IEEE
Trans .. AC-31. 201-209.
Goodwin. G.C. and K.S . Sin (1984). Adaptwe Fil-
termg Prediction and Control. Prentice-Hall.
~ew Jersey.
~ims . P.T. (1950) . Some Design Criteria for Au-

64

You might also like