14th World Congress oflFAC
ADDITIVE FEEDFORWARD CONTROL WITH NEURAL NETWORKS ...
C-2a-11-2
Copyright © 19991FAC 14th Triennial World Congress, Beijing, P.R. China
ADDITIVE FEEDFORWARD CONTROL WITH NEURAL NETWORKS OLE S0RENSEN
Aa/borg University Inst. of Electronic Systems, Dept. of Control Engineering Fredrik Bajers 7Jej 7C, DK-9220 Aalborg !21, Denmark
phone +45 96 35 87 48, telefax +45 98 15 17 39 E-mail
[email protected]
Abstract: This paper demonstrates a method to control a nonlinear, multivariable, noisy process using trained neural networks . The basis for the method is a trained neural network controller acting as the inverse process model. A training method for obtaining such an inverse process model is applied. A suitable 'shaped' (lowpass filtered) reference is used to overcome problems with excessive control action when using a controller acting as the inverse process model. The control concept is Additive Feedforward Control, where the trained neural network controller, acting as the inverse process model, is placed in a supplementary pure feedforward path to an existing feedback controller. This concept benefits from the fact, that an existing, traditional designed, feedback controller can be retained without any modifications, and after training the connection of the neural network feedforward controller to the feedback controlled process may happen gradually and controlled. Copyright © 1999lFAC Keywords: Neural Network, NARMAX, Nonlinear Control, Feedforward Control.
• The third problem is to avoid excessive control action, which is accomplished by a suitable low-pass filtering of the reference signal.
1. INTRODUCTION When the goal is to control a process, P, it is tempting to try to find a controller, C, which represents the inverse model of the process, C = p-l. The serial connection of the controller and the process produces in this way a unity gain transfer function from the input of the controller, which is the reference (the desired output from the process), to the output from the process. This method implies that three problems arise. • The first problem concerns stability of the controller itself, which is accomplished, when limiting oneself to consider processes, which are of minimum phase type. • The second problem concerns causality of the controller, which can be accomplished, when the reference signal is known temporal in advance.
In (Hunt et al., 1992) and (Hunt and Sbarbaro, 1991) different control concepts based on a trained neural network, representing the inverse process model, are mentioned, e.g. Direct Inverse Control and Internal Model Control. In this paper, however, a trained neural network, representing the inverse process model, is applied in a control structure including an additive feedforward control to the existing feedback control, the principle of which is shown in fig.I. The starting point of this concept is an existing, but not satisfactory functioning, feedback COnh·oller. This offers the following advantages • Collection of data for the training session of the neural network feedforward controller is 1378
Copyright 1999 IFAC
ISBN: 0 08 043248 4
ADDITIVE FEEDFORWARD CONTROL WITH NEURAL NETWORKS ...
14th World Congress ofIFAC
GENERAL TRAINING ARCHITECTURE
Fig. 1. The principle of additive feedforward control performed from the existing closed loop, thus facilitating the problem of collecting data which are sufficiently representative for the process. • During training, as well as during control, there is no need for opening the existing control loop. Also, there is no need for retuning the existing feedback controller. Furthermore, all the equipment for supervision and security can be retained. • After training, the connection of the neural network feedforward controller to the controlled process may happen gradually and controlled. Section 2 describes, in principle, how to train a neural network controller acting as the inverse process modeL Section 3 describes the process, which is a nonlinear, multivariable and noisy thermal mixing process. In section 4 a neural network forward process model is trained and evaluated, and in section 5 a neural network inverse process model for control is found. Finally, in section 6 the trained neural network inverse process model is placed in a supplementary pure feedforward path to the existing traditional controller and a test. confirms the improvements of the existing cont.rol performance.
2. GENERAL AND SPECIALIZED TRAINING Fig.2 illustrates two different architectures for training a neural network to represent the inverse of t.he process. The two methods are named general and specialized training, respectively. The weights in the neural network are updated during training, based on the error Eu. in general training, and on the error Ec in specialized training. The two methods are described by many researchers applying neural networks for control, e.g. Psaltis and ot.hers (Psaltis et al., 1988), K ..J.Hunt. and D.Scarbano (Hunt and Sbarbaro, 1992) and K.J.Hunt and ot.hers (Hunt et al., 1992). In general training, a process input. U is selected and applied to the process to obtain a corresponding out.put. Y, and the network is t.rained, based on the error Eu, to reproduce U at its output. from Y. If the training succeeds, the network should then be able to take a desired response Y r as
SPECIALIZED TRAINING ARCHITECTURE
Fig. 2. General and specialized training architecture input and produce the appropriate f), making the actual process output Y approach Y,.. This method is appealing because the error E ... , used for training, is generated directly on the output of the neural network. Unfortunately the method has two drawbacks. The first drawback is that the method is not 'goal directed', which means that choosing different values of U for t.raining does not. ensure that Y is trained in those regions, which are of particular interest for succeeding control application. This is strongly related to the general concept of persistent excitation. The second drawback is that an incorrect inverse can be obtained, if the non-linear process mapping is not one-one. In specialized training, the desired output Y,. is used as input to the neural network and the network is trained to find the process input (], which drives the process output Y to t.he desired output Yr. This is accomplished by using the error Ec between the desired and the actual output of the process to update the weights in the network. This method is appealing, because the architecture allows training of the network in t.hose regions for Y, which are of particular interest for succeeding control application, thus ensuring persistent excitat.ion, but also because a particular inverse model will be found, even if the non-linear process mapping is not one-one. The only drawback is t.hat. the t.raining becomes more complicated, since the error Eo measured on the output side of the process, has to be transformed into an equivalent error on the input side of the process, in order to he applied to training the neural network. Transformation of the error E c, measured on the output side of the process, to an equivalent error on the input side of the process, requires knowledge to the Jacohian ofthe process. However, the actual value of this Jacobian is easily calculated from another t.rained, forward, neural network model, substituting the process in the specialized training architecture.
Psaltis and others (Psaltis et al., 1988) propose a combination of the two training methods, first. performing general training to learn the approx1379
Copyright 1999 IF AC
ISBN: 0 08 043248 4
ADDITIVE FEEDFORWARD CONTROL WITH NEURAL NETWORKS ...
imate behavior of the process, followed by specialized training to fine-tune the network in the operating regions of the process. To avoid excessive control action the desired output Y,. is produced by filtering a reference R with a suitable 'shaping' filter F
where q denotes the time shift operator.
3. THE NONLINEAR MULTIVARIABLE PROCESS
14th World Congress ofTFAC
mix temperature T3mix is measured by a relatively slow transducer with a time constant T, where T = 10 sec. This measured temperature is denoted T 3Tn • The angle, determining the volume of the tank, is denoted v, where v = 7r /10 rad. It is assumed that the valves are controlled by fast local flow feedback loops, and further, a pump arrangement is introduced to ensure good mixing in the tank.
Physical constrains imply, t.hat. the valves saturate downward at 0 m 3 / sec and upward at 0.0005 m 3 / sec, and that the water level saturates downward at 0.05 m and upward at 1.00 Tn. The sampling rate is chosen to Ts
The simulated MIMO process is a thermal mixing process, containing several typical practical difficulties. The process is characterized by • • • • • • • •
it is dynamic. it is multivariable, MIMO. it contains measurement noise. it is nonlinear. it contains a non-measurable state. it contains external disturbances. the actuators saturate. a transducer has a considerable time constant. • the outputs are mutually coupling.
= 5 sec.
The measurement noise is normal distributed, white noise with a standard deviation 0.05 ern for H 3m and 0.05 C for T 3 m.' The vector signals for the process are naturally organized &<; follows
Input Um(k) Disturb. Dm(k) Output Y'I7l(k)
{Qlm(k), Q2mCk)}T
= {Q3m(k), T1m(k), T
2m (k)}T
{H37n(k), T3m(k)}T
3.2 How to collect training data 3.1 Description of the process
In traditional linear system identification it is well
The process is sketched in fig.3. It is a thermal mixing process. The purpose of the process is to supply water to a user at a specified temperature and water level, regardless of the actual amount of water tapped from the V-shaped tank. INL8f : HOT WAn.:R
H\WT: c(JLl) WATER
TEMP.T lm
TEMP. T2at FLOW Q 2m
FLOWQLm
OUTLET: MlXFD WATER TEMP. T Jmb:
FLOWQ:=h1l
Fig. 3. A draft of the thermal mixing process The inlet flows are the cold water supply Q17n with temperature T 1111 , and the hot water supply Q2m with temperature T 2 m.' The disturbing outlet !low is Q3m with the mix temperature T 3mix ' The water level H3m is measured by a fast transducer, not shown in the figure, but unfortunately the
known, that the frequency spectrum of the input Signal must be sufficiently wide in order to identify the process. \Vhen using a neural network to make a nonlinear system identification, this demand is valid too, but a further demand must now be added, namely that the amplitude spectrum of the input signal must be sufficiently wide, i.e. it is necessary, that the network is trained with various amplitudes in order to learn the nonlinearities of the process. Regarding the thermal mixing process, it is very difficult, in advance, to determine how t.o manipulate the two inlet valves, in such a way that the water level, as well as the temperature, contain sufficiently varied amplitudes, without frequent saturation of the valves, or without completely filling or emptying the tank. As a consequence, the data forming the training and t.est sets are collected in a dosed loop, controlled by two traditional PI-contwllers. After training, the neural network model is tested by placing the network in the closed loop instead of the process. FigA shows the arrangement for collecting data. It is arbitrarily chosen to let the flow of the cold water control the water level, and to let the flow
of the hot water control the temperature, thus neglecting the cross couplings in this multi variable 1380
Copyright 1999 IF AC
ISBN: 008 0432484
ADDITIVE FEEDFORWARD CONTROL WITH NEURAL NETWORKS ...
14th World Congress ofIFAC
INPUT. 'TEST SET
Q3m T lm T 2m qlm Rim
H3m
+
,)
THERMAL
.Q
MIXING
R2m
+
PROCESS
T3m
l -- ---~ -- .-.."- ----_.--:1 o(~(----,:-:::--.....",:---"""w::----;;::;;-----,J(::;;x.,:--~ SAMJ"l...Eti
c: q2m
i
D IS11JRB.IillCR,1ESTSET
~:~==.=====
Fig. 4. The arrangement around the thermal mixing process of two individually tuned control loops to collect data for the training and test set
sa
-
-
-
~AMl'lES
-
~
I,)
-
iVVSj - --
process . Using this concept the two discrete time PI-controllers are tuned individually
~
~
~
~AMJ'l£'j
OlTl'PUT1. TES'i SET
For the training set the purpose was to obtain combinations and variations in order to produce a sufficiently rich input, concerning frequency and amplitude. Therefore the references were frequently changed. Another reason for frequently changing the references is to prevent, that the input correlates with the output caused by the closed loop. This is always a problem, when identification is performed based on data collected in a closed loop. Here, this problem is avoided simply by adding a small random signal to the input, qI'Tn and q2m in fig.4. Both qhn and q2m are chosen to Pseudo Random Binary Sequences (PRBS), with heights between ±O.05 l/sec, and with widths between 5 and 10 samples. The purpose of the data collection arrangement in fig.4 is to obtain persistent excitation, where the exciting signals, qlm and q2m, are 'carried' around in the relevant operating area by the controller outputs.
!~~ . - - - ~
~
SAMPt .E'i
Fig. 5. Te.st .set collected from the thei'mal mixing process. 4. FORWARD NEURA.L NETWORK PROCESS MODEL With U denoting the scaled input vector, Y the scaled output vector and D the scaled disturbance vector, a second order NARMAX (Nonlinear ARMAX) model for the multivariable non linear thermal mixing process is introduced Y(k) =:F (Y(k - 1), Y(k - 2), U(k - 1), U(k - 2),
lJ(k - l),lS(k - l),lS{k - 2),8) Y(k) = Y(k)
+ E(k)
(3)
where E is the scaled prediction error vector.
The collected training set is not shown here but the test set is shown in fig.5, and the hidden couplings and nonlinearities of the multivariable process are clearly observed in fig.5.
In (Ljung, 1987) the ARMAX model is described for linear systems, while (Billings et al., 1990) and (Chen et al., 1990) describe NARX and NARMAX models implemented with neural networks .
For a physical process the individual elements of the input and output vectors are measured in physical units, which often are of quite different orders of magnitude. For this reason a scaling is performed. It is here chosen to sca le all individual inputs and desired outputs in such a way that, based upon the training set, the mean value becomes zero and the standard deviation becomes one. In the rest of this paper all measured signals are given a subscript 'm', contrary to the scaled signals.
The neural network configuration for this model is shown in fig.6. All the vectors U, Y and E have two elements, while D has three elements, so the total number of inputs to the network is 15, and the number of outputs from the network is 2. The number of hidden neurons is chosen to 10. After having trained the network with the Back Propagation Error Algorithm (BPEA), with the gradient factor 1] gradually decreasing from 0.02 1381
Copyright 1999 IF AC
ISBN: 0 08 043248 4
ADDITIVE FEEDFORWARD CONTROL WITH NEURAL NETWORKS ...
The neural network configuration for general training is shown in fig. 7, and the training is performed by BPEA.
Y(k-t)
Y(k)
, Y(k)
+
14th World Congress ofTFAC
E(k)
Y(k+2)
NN2 U(k)
Y(k+l)
+
1\
U(k}
Y(k)
Bu(k)
-
Y(k-l) U(k-I)
Fig. 6. Nonlinear ARMAX model (NARMAX) for the thermal mixing process to 0-001, examinations of the whiteness of the prediction error plus some relevant correlation analysis showed that the neural network had the potential to form a forward prediction model of the thermal mixing process.
5. INVERSE NEURAL NETWORK PROCESS MODEL Assume, that the thermal mixing process is described by a forward second order NARX model. Y(k
+
1)
=F
INVERSE
D(k)
~ODEL
Fig. 7_ General training of the inverse process model NN2 Based on (6) a neural network can now be trained to act as the inverse process model for controlling the process. The general training concept is first applied, using the sequences of the input U) disturbance D and output Y from the training set in section 3.2 and afterwards the specialized training is continued to fine-tune the controller in all relevant operating areas.
(Y(k), Y(k - 1), U(k), U(k - 1),
D(k») Y(k
PROCESS
+ 1) = Y(k + 1) + E(k + 1)
6_ ADDITIVE PURE FEEDFORWARD CONTROL
(4)
where :F is a nonlinear vector function, D(k) is the disturbance and E(k) is the output prediction error.
The trained inverse process model (6) is now applied as a 'pure' feed-forward controller
In K.J_ Hunt and D. Sbarbaro (Hunt and Sbarbaro, 1991) it is proofed that, if :F is monotonic with respect to U(k), then (4) is invertible, and the desired inverse process model is
Uf(k)
= Q (Yr(k + 2), Yr(k + 1), Yr(k), YT(k Ur(k - l),D(k)
- 1),
(7)
If the training succeeded, this a minor approxima-
U(k)
= 9 (Y(k + 1). Y(k), Y(k - 1), U(k
- 1),
D(k)) U(k)
= U(k) + Eu(k)
(5)
t.ion, since Y '" Yr' The implementation of the neural network based additive pure feed-forward control is shown in fig.8.
where 9 is a nonlinear vector function, D(k) is the disturbance and Eu(k) is the input prediction error. In fact, this is true only for a process containing no . 8yT (k+l) -J. d h dl further delay, Le. aU(k) r 0_ In or er to an e also processes containing an extra delay, and also in order to obtain a more smoothed control action, it is preferred to assume, that the output is known two samples in advance, giving U(k)
= Q (Y(k + 2), Y(k + 1), Y(k), Y(k - 1), U(k - 1), D(k))
U(k)
= U(k) + E,.(k)
Fig. 8- Implementation 0/ pure additive /eedforward control
(6) 1382
Copyright 1999 IF AC
ISBN: 008 0432484
ADDITIVE FEEDFORWARD CONTROL WITH NEURAL NETWORKS ...
14th World Congress ofTFAC
The 'shaping' reference filter has a DC-gain of one and a double-pole in 0.9. 0.01 1 - 1.80q-l + O.81q-Z
~t~~~
(8)
o
When applying the reference and disturbance sequences for the test set from section 3.2, the result of the control action is shown in fig.9. Sub-figures a and b show the control signals and the disturbances to the process, while sub-figures c and d show the controlled outputs, the water level and the temperature. INPUf 1'0 Plmr....,,:ss
~'r------'::""'--'--------------,
.,
, I" .______________________. - _ _._ _ _._ _ _ . _ _ . . _ _ . . OU1'Pt.rr I FROMPROCR<':S 1{]
J::r:' :--~ c_ ,r-;-: l
"[j
::t:. I
L
I
I
1_
I
.
=
-
-
.~A;r.,'lPLES
-
-
-
from the existing controller are very small and hardly visible in the figure, indicating a successful training.
7. CONCLUSION
This paper has demonstrated a method to control a non linear , multivariable and noisy process using an additive feedforward control signal from a trained neural network controller, while an existing, traditional designed, feedback controller can be retained without any modifications.
I
~_
8. REFERENCES
SAMPLES
4{)
_
Fig. 10. Additive pure feedforward control, the components of the control signal
---;;':::::"'---;]""""'--'---:-:1100'
:1
~
j~~==:J
lUO ; ;---;",o:::",-----:-04il;:-'----;:6(:;;-u
~
=
C()MPOl'IEk"n'S OF INPUT 2 TO PROCESS
l:'I~==':=~'-'------
" 0'------=---=-----0::0-----==-----,-::-:0:-----::'. SAMPLES S" -
_
St\}'IPL-ES
v,..------>v_----'v
3,)f--:----". 2[;0!---;o::;,-----:-04!;(;:-'---::.OO:::---:':::::"'---;I""""',------;:!UOO SAMPLES
Fig. 9. Additive pun; feed-forward control, inputs to and outputs from the process It is obvious, that the training has produced an additive controller, which highly improves the performance of the existing controller, compare the outputs in fig.9 with the outputs in fig.5. Now, the outputs track the 'shaped' references, and the disturbances are well suppressed. The resulting control signal Um is composed of two contributions, U cm from the existing feedback controller and Ufm from the additive neural network feedforward controller. Depending on the success of the training session, the feedforward controller takes over a major part of the resulting control signal This fact is illustrated in fig.IO, which shows that the components of the control signal from the additive feedforward controller are totally dominating, while the components of the control signals
Billings, S. A_ et aL (1990). Properties of neura.! networks with application to modelling non-linear dynamical systems. Int. J. Control 1,193-224. Chen, S. et al. (1990). Non-linear system identification using neural networks. Int. J. Control 6, 1191-1214. Hunt, K. J et al. (1992). Neural networks for control systems - a survey. Automatica 6, 10831120. Hunt, K.J. and D. Sbarbaro (1991). Neural networks for nonlinear internal model control. IEE Proceedings-D, Control theory and applications 138(5), 431-438. Hunt, K.J. and D_ Sbarbaro (1992). Studies in neural network based control. In: Neural networks for control and systems. pp. 94-122. Peter Peregrinus Ltd.,London, United Kingdom. Ljung, Lennart (1987). System identification, theory for the user. first ed .. Prentice-Hall. Psaltis, Demetri et al. (1988). A multilayererd neural network controller. IEEE Control System Magazine 8(3), 17-21.
1383
Copyright 1999 IF AC
ISBN: 008 0432484