APPLICATION OF STATE ESTIMATION AND NEURAL NETWORKS IN NONLINEAR CONTROL A. Jadlovská * Department of Cybernetics and Artificial Intelligence Faculty of Electrical Engineering and Informatics Technical University of Košice Letná 9, 041 20 Košice Slovak Republic fax : +421-95-62 535 74 and e-mail : Anna.Jadlovska@tuke.sk Abstract: This paper considers the use of neural networks for non-linear state estimation, identification and control of non-linear processes. The non-linear identification is using feed-forward neural networks as useful mathematical tool to build model between the input and output of a non-linear process. In this paper is considered the possibility an on-line state estimation of the actual parameters from off-line trained neural state space model of the non-linear process using the gain matrix. This linearization technique is used in the algorithm on-line tuning of the controller parameters based on pole placement control design for non-linear process. Keywords: Dynamic neural models, Non-linear State Estimation, Gain Matrix, Nonlinear Control 1 INTRODUCTION The purpose of this paper is to show how feedforward neural network (Multi Layer Perceptron – MLP) can be used for modeling and control of the non-linear processes. When the mathematical model of the process cannot be derived with an analytical method, then the only way is using the relationship between the input and output of the process. Fitting the model from the data is known as an identification of the process. For linear processes this technique is generally well known, (Ljung 1987). For processes, which are complex or difficult to model the non-linear identification can use feedforward neural network – MLP as useful mathematical tool to build the non-parametric model between the input and the output of the real nonlinear process, (Chen et al. 1990), (Narendra et al. 1990), (Jadlovská 2000), (Jadlovská (a) 2002). We will consider in this paper the possibility an on-line state estimation of the actual parameters from off-line trained neural state space model of the non-linear process using the gain matrix, introduced later, (Najvárek 1996). This linearization technique is used to perform an online tuning of the controller parameters based on pole placement control design in observer-based control loop, (Jadlovská (b) 2002). The advantage using sample-by-sample linearization is that the controller parameters can be changed in response to process changes. In fact neural network method also becomes adaptive, if training of the neural network state space model as observer is continued on-line. 2 MODELING OF NONLINEAR PROCESS In this part we will discuss some basic aspects of nonlinear system identification using among numerous neural networks structures only Multi-Layer Perceptron–MLP (a feed-forward neural network) with respect to model based neural control, where the control law is based upon the neural model. (tanh) neuron functions. The „1“ shown in Fig.1. together with the last column in W1 giving the offset in the network. The net input is represented by the vector Zin and the net output is represented by the vector Ẑout . The mismatch between the desired We know, that a discrete-time non-linear system can be written on the following general form: The output from MLP can be written as: output Z out and Ẑout is the prediction error E. xk f xk 1, uk 1, d k 1 yk Hx k Zˆ out (1) in which k is the discrete sample number, x is a state vector, u is the input vector and y is the output, d is a vector of disturbances. We will furthermore include a vector θ containing some set of parameters sufficient to describe the model at time k in the description. f and h are given functions which may be nonlinear, time-varying and multivariable. Z W2 W1 in 1 (3) From a trained MLP (by Back- Propagation Algorithm –first-order gradient method, GaussNewton algorithm – second-order gradient method) which has m0 inputs and m2 outputs can be found a m2 m0 gain matrix N by differentiating with respect to the input vector of the network. We wish to identify a nonlinear (neural network) mapping F The gain matrix N can be calculated from (3) ˆ k F X ˆ k 1,U k 1, Dk 1, E k 1 X N ˆ k Yˆ k Hx (2) E k Y k Yˆ k based on samples of the system inputs and outputs uk , yk kN0 (the training set) such that the prediction error E defined by equations (2) becomes small. F is chosen to be a Multi-Layer Perceptron (MLP). We assume, that the output mapping to be fixed, H I 0 , where I and 0 are identity and zero matrices of appropriate dimensions. We will use in this paper feed-forward neural network MLP with a single hidden layer. This structure is shown in matrix notation in Fig.1, (Najvárek 1996). Zout Zin Y0 W1 1 X1 Y1 1 W2 X2 Ẑ out +E - Fig.1. Matrix block diagram of an MLP The matrix W1 represents the input weights; the matrix W2 represents the output weights, represents vector function containing the non-linear d Zˆ out d Zˆ out d Y1 d X 1 W 2 X 1 W1 (4) d Z inT d Y1T d X 1T d Z inT where W1 W1 (excl. last column). Above mentioned the gain matrix N allows an online estimation of the actual model parameters from off-line trained neural model - MLP of the non-linear process. We know from linear identification, that for a linear process with m inputs, n states and p outputs the following model is often used xˆ k Φ xˆ k 1 Γ uk 1 Ke k 1 y k H xˆ k e k (5) where x̂ is the state vector (order n), u is the input vector (order m), y is the output vector (order p) and e is the prediction error (order p). For the linear case Φ , Γ , K and H are constant matrices of dimension n n ,n m ,n p and pn respectively. It is assumed that x̂ is not measurable (incoplete stste information) and the model is named the Innovation State Space model. The matrix H is choosen to H I p , p O p ,n p , where I p , p is p p unity matrix and O p ,n p is a p n p zero matrix. This means, that the first p elements of the state vector x̂ is filled with ŷ . With the inspiration from this linear state space model (5) in our paper we will applicate idea using dynamic neural network model, where no all inputs and outputs from the neyworks are measurable. This type of the model is well-known Nonlinear Innovation State Space model (NISS), (Norgaard 1997), (Jadlovská 2002). Y(k) q-1 X̂ k-1 U(k – 1) Neural network q -1 X̂ ( k ) H Ŷ ( k ) E(k – 1) + E(k) - The non-linear Innovation State Space model (Kalman Predictor) can be defined by equations (5) ˆ k F X ˆ k 1,U k 1, E k 1,θ X ˆ k Yˆ k HX Fig.2. Non-linear State Space Model (NISS) (6) Y k Yˆ k E k where F is non-linear vector function, θ represents vector of the parameters and E is the prediction error (order p), U is input vector (order m), X is state vector (order n) and Y is the output vector (order p). The neural NISS model with the input vector Zin k and output vector Z out k Xˆ k 1 Z in k U k 1 E k 1 ˆ k Z out k X (7) is shown in Fig.2, which is a recurrent network After training neural network MLP can be on-line estimated the actual gain matrix N k , which is calculated by (4) and for NISS model by (8): N k The model of non-linear process and the training method has been considered generally for the multivariable case in part 2. Next we will think about control design for non-linear MISO process using neural state space model NISS (6). A trained neural NISS model representing a model of the non-linear process we use for an on-line state estimation actual process parameters by gain matrix N k , (Najvárek 1996), (Norgaard 1997). This linearization technique allows an on-line tuning of the controller parameters using pole-placement control strategy, which is well known from the linear control theory, (Åström et al. 1990). In this paper the pole placement method as control concept is formulated in a way, which allows the neural model found in section 2 to be used as state observer. An example of the control structure using estimation process parameters from NISS model is illustrated on Fig.3. y(k + 1) Proces ˆ k ˆ k dX dX out T T T ˆ k 1U k 1 E T k 1 d Z in k d X ˆ k ˆ k ˆ k X X X T T ˆT X k 1 U k 1 E k 1 3 NONLINEAR CONTROL USING STATE ESTIMATION ˆ k , Γˆ k , K ˆ k Φ Observer -L (8) For a non-linear process the actual linearized ˆ k , Γˆ k , K ˆ k are not constant parameters Φ matrices, but depend on the actual values of the input, state and output vectors. Because neural state space NISS model on Fig.2 contains feedback loops around MLP we will apply for training this recurrent network a second order Recursive Prediction Error Method (RPEM) using Gauss-Newton search direction, (Ljung 1987), (Chen et al. 1990), (Jadlovská (b) 2002). x̂ k ˆ k Γˆ k Φ Place poles Fig.3. The principle of pole placement control using a state observer The aim is to design the feedback gain L in a way so that the closed loop has a set of prescribed eigenvalues. Because the linearization model will change from sample to sample, it is necessary to recalculate L accordingly. If we have trained a simulation model – observer network NISS we can design the control law. Since full state information is not available, the control law is chosen as a linear feedback from the state observer by equation (9). ˆ k uk Lk x (9) where L is state feedback matrix which places the eigenvalues of the closed loop system. 4 SIMULATION RESULTS The idea and results of the estimation process parameters from an off-line trained neural NISS model as an observer and its using for tuning parameters of controller designed by pole-placement strategy (non-linear system control) are presented for non-linear test process – two tanks system, (Jadlovská 2001). We consider NISS model with 6 inputs and 8 neurons in the hidden layer. The activation function in the hidden layer is „tanh“ function and in the output layer is selected a linear function. The actual gain matrix N k can be calculated by (4) and actual values of estimated parameters can be obtained from N k by (8). Presentation of results of non-linear control designed by pole placement method using on-line parameter estimation from an off-line trained neural state model is illustrated in Fig. 4 at the change of one parameter of the non-linear process (10). y(t) 0.6 0.4 The mathematical model of this system can be described as 1 h1 ( t ) q1,1 ( t ) q2 ,1 ( t ) A 1 h2 ( t ) q1,2 ( t ) q2 ,2 ( t ) A 0.2 0 0 500 1000 1500 2000 2500 3000 3500 (10) 0.6 0.5 u1(t) 0.4 where 0.3 h1( t ) , h2 ( t ) [m] denotes water levels in two tanks, which are in interaction, 0.2 0.1 u2(t) 0 0 500 1000 1500 2000 2500 3000 3500 q1 ,1 ( t ) , q1,2 ( t ) [m3 s 1 ] denotes input flows of the tanks, q2 ,1 ( t ) , q2 ,2 ( t ) [m3 s 1 ] denotes outflows of Fig.4 State controller based on actual parameter estimation from neural NISS model the tanks. q2 ,1 ( t ) q1,2 ( t ) .z1 ( t ). 2.g .h1 ( t ) , q2 ,2 ( t ) .z2 ( t ). 2.g .h2 ( t ) , where z1( t ) and z2 ( t ) [m] are the rises of output outlets of two tanks. The other parameters of two tanks are: the cross section area of the tanks A 1m 2 , the parameter of the output outlet of the tank 0.5m , the constant of gravity g 9 ,81 ms2 . The inputs of the system are: the input flow of the first tank u1 t q1,1 t , the rise of output outlet of the second tank u2 t z2 t , the rise of output outlet of the first tank z1 t , d t z1 t . The output of the system is water level in the second tank yt h2 t . Simulation study shows that the non-linear observerbased control loop with the desired closed-loop poles giving a critically damped response of the output tracking. This example shows real power of the neural modeling using the structure NISS and the possibility to apply the method pole-placement known from the linear control theory for control of non-linear MISO process. 5 CONCLUSION In this paper is trained neural NISS model as Kalman predictor for non-linear MISO process. After training this NISS model can be used in closed control loop to an on-line state estimation of the process parameters, which allow tuning of the controller parameters by pole-placement method. A practical simulations by language Matlab/Simulink, Neural Toolbox and NNSID Toolbox ilustrate, that this control strategy using linearization technique by the gain matrix from neural state model produces excelent performance for control of non-linear MISO process. But this controller design can be applied for only non-linear process, which does not contain hard nelinearities. ACKNOWLEDGMENTS The work has been supported by the grant agency VEGA 1/9032/02. This support is very gratefully acknowledged. REFERENCES Åström, K., J. and B. Wittenmark (1990). Computer Controlled Systems, Theory and design, PrenticeHall, second edition Chen, S., S. Billings and P. Grant (1990). System Identification using Neural Networks. In: International Journal of Control, Vol.51, No.6, pp. 1191-1214 Jadlovská A. (2000). An Optimal Tracking NeuroController for Nonlinear Dynamic Systems, In: Control System Design, A Proceedings volume from IFAC Conference Bratislava, Slovak Republic, 18-20 June, Published for IFAC by Pergamon – an Imprint of Elsiever Science, pp.493-499, ISBN 00-08 043 546 7 Jadlovská, A. (a) (2002). Neural networks Based Predictive Control of Non-linear System, Acta Electrotechnica et Informatica, No.4, Vol.2, Košice, pp.35-38, Slovak Republic, ISSN 13358243 Jadlovská, A. (b) (2002). Non-linear Control Using Parameter Estimation from Forward Neural Model, Journal of Electrical Engineering – Elektrotechnický časopis, No.11-12, Vol.53, pp.324-327, Slovak Centre of IEE, FEI STU, Bratislava, ISSN 1335-3632 Leontaritis I., J. (1985). Input-output parametric models for non-linear systems, part 1 and 2., In: International Journal of Control, Vol.41, No.2, pp.303-344 Ljung, L. (1987). System Identification: Theory for the User, (T. Kailath, Ed.). Prentice-Hall, Inc., Englewood Cliffs, New Jersey Najvárek, J. (1996). Matlab and neural networks, FEI VUT, Brno Narendra, K.S. and A.U. Levin (1990). Identification and control of dynamical systems using neural networks, In: IEEE Transaction on Neural Networks, Vol.1, No.1, pp. 4-27 Norgaard, M.(1997). NNSID Toolbox, Version 1.1, Technical Report, Department of Automation, DTU