Professional Documents
Culture Documents
Department of Cybernetics
The University of Reading
Reading, RG6 6AY
United Kingdom
Abstract: This paper describes the application of artificial neural networks for automatic
tuning of PID controllers using the Model Reference Adaptive Control approach. The
effectiveness of the proposed method is shown through a simulated application. Copyright
2002 IFAC.
Keywords: Autotuners, PID Control, Model Reference Adaptive Control, Neural Networks,
Backpropagation.
model output and process output is reduced. The neu- 3. PID AUTOTUNING USING NEURAL
ral network tuner takes past plant output values, con- NETWORKS AND MODEL REFERENCE
trol signal and set point signal as inputs, and produces ADAPTIVE CONTROL
the required changes in the PID controller parameters.
This paper is organized as follows. In section 2, an This paper combines and extends of previous works
overview of Model Reference Adaptive Control is pre- on the subject of self tuning neural network PID con-
sented. The proposed autotuning method is presented troller by Fujinaka et al. (2000) and the work by
in section 3. Sections 4 and 5 present a case study the authors on autotuning of PID controllers using
based on a simulated two tank process model. The MRAC (Pirabakaran and Becerra, 2001). The algo-
paper concludes with a discussion on the results and rithm presented by Fujinaka et.al (2000) achieves the
on the autotuning methods presented. tuning objective by minimizing the squared control er-
ror (e2c = (uc y)2 , where uc is the setpoint and y is the
plant output), however, no performance specifications
like natural frequency or damping ratio can be consid-
ered by using their approach.
The structure of the autotuning scheme described in
this paper is shown in Figure 2, where the outputs of
the neural network shown in Figure 3 are the controller
2. MODEL REFERENCE ADAPTIVE CONTROL parameter changes, (proportional K p , integral Ki ,
(MRAC) and derivative Kd gains) and the inputs are selected
in a suitable way according to the specific problem.
Model reference adaptive control was originally pro- This method calculates the controller parameters on
posed to solve a problem in which the specifications line. As a result, the training targets for the PID con-
are given in terms of a reference model that tells how troller parameters are not available, so that supervised
the process output ideally should respond to the com- training, such as standard backpropagation, cannot
mand signal. This is one of the main approaches to be applied. Instead, the neural network weights are
adaptive control. The basic idea is illustrated in Figure calculated to minimise a criterion using a gradient
1, which is the original MRAC, proposed by Whitaker method. The criterion used is the minimisation of the
in 1958. The regulator can be thought of as consisting squared model error:
of two loops: an inner loop which is the ordinary feed-
back loop composed of the process and controller. The 1 1
J = e2 = (y ym )2 (1)
parameters of the controller are adjusted by the outer 2 2
loop in such a way that the error e between the process
output y and the model output ym becomes small. The where y is the process output and ym is the reference
outer loop is thus the adaptation loop (Astrom and model output. The reference model transfer function
Wittenmark, 1995). is given by:
Reference
ym
Model
-
+
y e
uc u
PID
Controller
Process y
kp , ki , kd
Neural
Network
Tuner
Ym (s) n2
Gm (s) = = 2 (2)
Uc (s) s + 2 n s + n2
E (n) 0
j (n) = f j net j (n) (7)
o j (n)
Hence
3
j = f 0 (net j ) ek (n) f 0 (netk )wk j (8)
k=1
where k=1,2 or 3, o1 = K p ; o2 = Ki ; o3 = Kd .
The calculation of the plant jacobian y (n + 1) u (n)
5. IMPLEMENTATION AND RESULTS
is described in section 5.
This section illustrates the application of the devel-
oped neural network based autotuning techniques (see
section 3) to the two tank level control system de-
4. THE TWO TANK PROCESS MODEL
scribed in section 4.
The system Jacobian y (n + 1) u (n) is not avail-
In order to test the autotuning techniques introduced
in this paper, a nonlinear dynamic model of a two tank able as the true plant parameters are assumed to be
process has been used. This system is illustrated in unknown. Thus, an emulator is introduced that mim-
Figure 4. The liquid level control system considered ics the input/output map of the plant. By using this
here consists of two tanks, which are connected by a emulator to provide an approximation to the system
short pipe. The amount of liquid flowing into the tanks Jacobian, the modified back-propagation method de-
is regulated by a control valve. The control problem scribed in section 3 can be applied to adjust the neural
is to maintain the desired liquid level (h2 ) in second network tuner weights. The PID gains are adjusted by
tank by adjusting the valve opening percentage (V ). A the neural network. The Jacobian of the level control
6. CONCLUSIONS
j
wji
A new autotuning technique was proposed in which
i wkj
a neural network is used to tune online the gains of
u(n) a PID controller, based on Model Reference Adaptive
Control concepts. A neural network tuner is trained
k y^(n+1) online in order to make the system behave like the
y(n)
reference model. The online training was carried out
using a modified backpropagation method. This re-
y(n-1) quires the use of an emulator, which is trained off
line, to obtain an approximation to the plant Jaco-
bian. The use of neural networks allows nonlinear-
ities in the controlled system to be considered for
tuning purposes. Furthermore, the use of the Model
Reference Adaptive Control approach allows desired
performance measures, such as natural frequency and
Fig. 5. Neural network emulator
damping ratio, to be specified. The effectiveness of
system is derived by using the emulator shown in Fig- the developed techniques has been demonstrated by
ure 5. The emulator used is a nonlinear ARX model. means of a simulated two tank process.
The input layer of the emulator consists of three units,
which are connected to six units in the hidden layer. Further work includes the following aspects. In the
The output layer consists of one unit, representing the method described in section 3, the stability of the
estimated value. Its mapping can be written as follows: closed loop system is not guaranteed during the auto
tuning period. Lyapunov theory can be used to de-
y (n + 1) = f (u (n) , y (n) , y (n 1)) (16) rive an adaptation algorithm with guaranteed stability.
From Figure 7 it is possible to note that although the
The neural network emulator was trained offline us- controller parameters (K p , Ki , Kd ) have not converged
ing the Levenberg Marquadts algorithm. Two thou- when the adaptation stops, the scheme clearly makes
sand training data samples were used to train the em- the closed loop system follow the reference model
ulator. Using this emulator, the system Jacobian is very closely. It is then important to investigate the
calculated as follows: conditions for the convergence of the controller pa-
rameters.
y(n
+ 1) 6
u(n)
= w1 j o j (1 o j )w j1 (17)
j=1
7. REFERENCES
Here the suffix 1 in denotes the neuron unit corre- Astrom, K. and T. Hagglund (1995). PID Controllers:
sponding to u(n) at the input layer. The range of sum- Theory, Design, and Tuning. Instrument Society
mation over j is in accordance with the structure of the of America. Research Triangle Park, USA.
connection between the hidden layer and output layer. Astrom, K. J. and B. Wittenmark (1995). Adap-
tive Control, 2nd ed. AddisonWesley. Reading,
To illustrate, a simulation has been carried out using
Mass.
the following values for the reference model param- Fujinaka, T., Y. Kishida, M. Yoshioka and S. Omatu
eters, sampling time, learning rates and momentum (2000). Stabilization of double inverted pen-
parameters, respectively: n =0.02 rad/s, =0.7; T =3 dulum with self-tuning Neuro-PID. In: IEEE
s, =104 , = 2.0 107 , =107 . The reference International Conference on Neural Networks.
signal uc during the autotuning period was generated Vol. IV. Como, Italy. pp. 345348.
as follows: Kiong, T. K., W. Q. Guo and H. C. Chieh (1999).
uc (t) = usq (t) + 0.6 sin(0.02t) + 5 (18) Advances in PID control. Springer. London.
Konar, A. F., S. A. Harp and T. Samad (1995). Neuro-
PID controller. US Patent and Trademark Off ice.
where usq (t) is a square wave with amplitude 0.6 and
USP: 5,396,415.
period 500 s.
Pirabakaran, K. and V. M. Becerra (2001). Automatic
Figure 6 shows the reference model output and pro- tuning of PID controllers using model refer-
cesses output before, during and after the tuning pe- ence adaptive control techniques. In: IECON01
riod, and also the oscillations during the tuning period. 27th Annual Conference of the IEEE Industrial
Notice that the system follows quite closely the refer- Electronics Society. Denver, Colorado, USA.
ence model output after the autotuning is carried out. pp. 736740.
The step response is shown before and after the tuning. Rad, A. B., T. W. Bui, Y. Li and Y. K. Wong (2000).
Figure 7 shows the evolution the controller parame- A new on line PID tuning method using neural
ters. It can be seen that how the controller parameters networks. In: IFAC Digital Control, Past, Present
change with time and eliminate the model error. and Future. Terrassa, Spain. pp. 443448.
9
7
y and ym (cm)
3
Before During
Autotuning autotuning After autotuning
2
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time (s) x 10
4
Fig. 6. Process and reference model outputs before, during and after the autotuning period
5.05
5
Kp
4.95
4.9
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
4
x 10
1.5
1
Ki
0.5
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
4
x 10
10.03
10.02
Kd
10.01
10
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time(s) 4
x 10
Fig. 7. Controller parameter values before, during and after the autotuning period.