Neural Networks for Self-tuning ControlSystems

In Fig. 2, the weighting coefficients w ji and v j for the hidden layer and output layer input connections respectively, are shown. In what follows, we will detail the adaptation algo-© In this paper, we presented a self-tuning control algorithm based on a three layers perceptron type neural network. The proposed algorithm is advantageous in the sense that practically a previous training of the net is not required and some changes in the set-point are generally enough to adjust the learning coefficient. Optionally, it is possible to introduce a self-tuning mechanism of the learning coefficient although by the moment it is not possible to give final conclusions about this possibility. The proposed algorithm has the special feature that the regulation error instead of the net output error is retropropagated for the weighting coefficients modifications.


Introduction
The use of Artificial Neural Nets for systems identification and control, has been the subject of a vast amount of publications in recent years. It is possible to mention for instance, the paper of Narendra and Parthasaraty [5] in which several possible structures of the neural controller that suppose an a priori knowledge of the plant dynamic structure are proposed. In Bhat and McAvoy [3] and in many other papers, a scheme based in an inverse dynamic neural model is used. A similar approach is adopted by Aguado and del Pozo [2] but here the inverse neural regulator is complemented by a self-tuning PID algorithm which guarantees that the stationary error goes to zero. In the above mentioned paper and in many others, it is required an exhaustive previous training of the neural net, which is a serious obstacle for the practical implementation of the proposed solution in the industry. At the same time, the controller structure in some cases, as in the mentioned paper of Narendra and Parthasaraty [5], is very complex, including several nets each one with two hidden layers of many neurons which must be trained using large data samples.
An important contribution to enhance the possibilities of neural nets in the solution of practical problems is the paper by Cui and Shin [4]. In that work a direct neural control scheme is proposed for a wide class of non-linear processes and it is shown that in many cases, the net can be trained directly retropropagating the regulation error instead of the net output error. However, in that paper it is not discussed the influence of some training parameters, particularly the learning coefficient, over the closed loop dynamics. It is also not remarked that practically with a direct neural control scheme the training stage can be substituted by a permanent and real time adaptation of the weighting coefficients of the neural net.
In the present paper, it is proposed a self-tuning neural regulator, inspired in the ideas of Cui and Shin [4], but with the particular feature that the previous training is substituted by a permanent adjustment of the weighting coefficients based on the control error. At the same time, it is shown the influence of the learning coefficient over the closed loop dynamics and some criteria are given about how to choose that parameter. Finally, some examples are given where the possibilities of the proposed method for difficult non-linear systems control is shown, specially when there exists a considerable pure time delay.

Self tuning neural controler structure
In Fig. 1, it is shown the proposed scheme of the self--tuning neural regulator. The neural net which assume the regulator function, is a 3 neuron layers perceptron (one hidden layer) which weighting coefficients are adjusted by a modified retropropagation algorithm. In this case, instead of the net output error: it is used the process output error: to adjust the weighting coefficients.
In Fig. 2, it is represented the neural net controller structure. The output layer has only one neuron because by the moment, we are limiting the analysis to one input-one output processes. In the input layer, the present and some previous values of the regulation error are introduced, it means that: x t e t e t e t n y y y For the cases that has been simulated until now, the value n = 2 was sufficient to obtain an adequate closed loop performance. It means that the number of input neurons can be 3. A similar number of hidden layer neurons was equally satisfactory.

Weighting coefficients adaptation algorithm
In Fig. 2, the weighting coefficients w ji and v j for the hidden layer and output layer input connections respectively, are shown. In what follows, we will detail the adaptation algo-

A. Noriega Ponce, A. Aguado Behar, A. Ordaz Hernández, V. Rauch Sitar
In this paper, we presented a self-tuning control algorithm based on a three layers perceptron type neural network. The proposed algorithm is advantageous in the sense that practically a previous training of the net is not required and some changes in the set-point are generally enough to adjust the learning coefficient. Optionally, it is possible to introduce a self-tuning mechanism of the learning coefficient although by the moment it is not possible to give final conclusions about this possibility. The proposed algorithm has the special feature that the regulation error instead of the net output error is retropropagated for the weighting coefficients modifications. where: At the same time, the output layer neuron output value will be: where: As a criteria to be minimised, we defined the function: where it is supposed that the time has been discretized by using an equally-spaced small time interval.
The minimisation procedure consists, as it is known, in a movement in the negative gradient direction of the function E(t) with respect to the weighting coefficients v j and w ji . The E(t) gradient is a multi-dimensional vector whose components are the partial derivatives , it means that: Let us first obtain the partial derivatives with respect to the coefficients of the output neuron. Applying the chain rule, we get: Let us define: Then: In the equation (14), it appears the partial derivative ¶ ¶ e e y u , which can be interpreted as some kind of "equivalent gain" of the process. Further we will make some considerations about that term. The partial derivative of function E(t) with respect to the weighting coefficients w ji , can be obtained applying again the chain rule: and then: Using equations (14) and (18), the adjustments of weighting coefficients v j , w ji can be made by means of the expressions:  can be easily estimated by means of a very simple auxiliary experiment, by instance, to apply a step function at the process input.
The assumption that the sign of the gain remains constant in a neighbourhood of the operation point of the process is not very strong and it is accomplished in most practical cases. Finally, in the worst of cases, real time estimation of the gain sign could be incorporated, without great difficulties, in the control algorithm.
Having in mind the above considerations, the equations (19) and (20) could be written as follows: The right value of learning coefficient h can be experimentally determined from the observation of closed loop system performance when some changes are made in the controlled variable set-point.
The equations (21) and (22) for the proposed neural controller structure, may be interpreted as the regulator adaptation equations instead of training equations as it is normally done. Indeed, the simulation study done until now using the scheme shown in Fig. 1 and permanently adjusting the weighting coefficients v j and w ji by means of (21) and (22) allowed us to arrive to the next conclusions: l It is not in general required a previous training of the net and once the control loop is closed, the weighting coefficients self-adjust in a few control periods, carrying the regulation error e y (t) to zero.
( ) In this way a small basic value of h can be used, for instance h = 01 . , and the effective value ¢ h is incremented depending of the regulation error magnitude. The right value of a can be tuned experimentally without troubles. The use of equation (23) gives the system the possibility to present a fast response when the errors are big and then to go slowly to the reference value. That behaviour is, indeed, very convenient in practice.

Some simulation results
Although the above described algorithm has been tested in many examples, here we will only show the results obtained in two simulated cases corresponding to non-linear processes which can be described by means of the equation: The simulation was carried out on a real time environment provided by the CPG System (Aguado, 1992) so that the obtained results are very close to those that could be expected in a real process.
In Fig. 3 it is represented the closed loop behavior corresponding to the next process and regulator parameters: h a = = 06 0 4 . , . .
As can be seen, a practically perfect response is obtained when positive and negative step changes in the reference output value are applied. Given that the time constants are relatively small, the values of h and a can be chosen relatively big without producing positive or negative over-shoots. This type of performance is observed in general, it means that for fast dynamics processes, it is possible and convenient a fast learning of the net. We have observed that for time constants in the order of milliseconds, values of h of 5 and more can be used.
In Fig. 4, it is represented the close loop performance for the next constants values: 10 20 h a = = 005 020 . , . .
(28) As can be observed, we have a large time-delay non linear system which can be hardly controlled by a conventional adaptive algorithm, for instance a self-tuning PID. However, with the adaptive neural regulator, it is obtained a response that can be considered as very good, given the process characteristics. Notice that in this case, the values of h and a are considerably smaller, as expected, given that the process dynamics is much slower.

Conclusions
The self-tuning control algorithm based on a neural net presented in this paper, promise to be a very interesting option for the control of processes with a difficult dynamics that could not be adequately controlled with PID regulators, even in their self-tuning versions, as it was shown in the above presented simulation cases. The class of processes in which the algorithm could be applied is very wide and it includes most of the cases that can appear in practice. In the near future, we plan to apply the algorithm to some real laboratory processes and to extend the obtained results to the case of multivariable and multiconnected systems.