EKF Based Generalized Predictive Control of Nonlinear Systems

In this paper, Autoregressive with exogenous input (ARX) and dynamic neural network (DNN) based generalized predictive control (GPC) methods are designed to control of nonlinear systems. ARX and DNN models adaptively approximate the plant dynamics and predict the future behavior of the nonlinear system. While control process goes on, the poles of the ARX and DNN models are constrained in a stable region using a projection operator for structural stability. Simulation results are given to compare the tracking performances of the methods. ARX-GPC and DNN-GPC both yield good tracking performances while keeping the changes in control signal as low as possible. The simulation results show that even though ARX is a linear model, it provides acceptable tracking results as well as DNN model.


Introduction
Identification of systems with unknown mathematical model, control and fault detection studies keep their importance up-todate [1].It is a hard task to obtain a mathematical model in complex systems.In addition, need for system modelling emerges due to uncertainty, disturbances and noises.In such cases, robust or adaptive control techniques should be adopted to design a controller [8].In adaptive control, an appropriate model is selected to approximate the actual system model.Artificial neural network (ANN) and fuzzy networks are widely used as function estimators [25,2].GPC is a class of model-based predictive control.When dynamics of the system are not known, the model which approximates the system has a crucial role in both predicting the future behaviour of the system and generating the future control signals.In each sampling instant first one of the produced control signals is applied to the system [4,3].The models which are able to adapt to the changing dynamics of systems improve GPC performance.Artificial neural network (ANN) [21,17] and support vector machine (SVM) [9,14] can be adopted in GPC studies.DNNs [20] have a recursive structure.Internal states and external inputs constitute the actual inputs of these networks which are widely used in function approximation.DNNs can approximate complex nonlinear dynamics due to the merits of recursive structure and nonlinear activation function [22].Usually they are used in prediction [6], fault detection [12], adaptive control [16] and GPC [24].In this study, particular type DNN and AutoRegressive with eXagenous input (ARX) model based GPC are performed.ARX is a linear model while both linear and nonlinear dynamics exists in the DNN model.Models are trained by extended Kalman filter (EKF).In addition to adaptation of the parameters, poles are adapted such that they are bounded to maintain stability of the model.Thus, quick and stable online identification is obtained.In numerical simulations, bioreactor and continuously-stirred tank reactor (CSTR) benchmark systems are controlled using two methods and results are compared.Rest of the paper is organized as follows.In Section 2, DNN and ARX models are presented; model stability and EKF-based training are introduced.GPC and ARX and DNN based GPC are detailed in Section 3. Simulations are given in Section 4. Finally, paper is concluded in Section 5.

Identification Models
In this section, ARX model and the DNN model which is used in continuous time adaptive control in [13] will be studied for discrete time GPC.Section 2.1 and 2.2 present the ARX and DNN models while Section 2.3 introduces the model stability.Finally, EKF-based training of the models is given in Section 2.4.

ARX Model
ARX model is simple and linear.Consider u n and y n are the past input and output samples to construct the ARX data.Let (1) give the output equation of a system at time instant k whose explicit output expression is unknown.
Output can be approximated linearly by a parameter vector

Dynamic Neural Network
Figure 1 presents internal dynamics of one neuron in the dynamic     This model can be considered as sparsed Hopfield type network in means of inter-neuron connections.Connection of each neuron with itself brings to the network dynamic property.Dashed lines in Figure 1 show nonexisting connections.From this aspect, model is diagonal.Figure 2 presents diagonal dynamic model.

Model Stability
The results in [7,10] were reviewed to analyse the stability of the models and stability conditions given in [15] were followed in this study.First, ARX model stability is analysed.In the simulations ARX model is used as a second order IIR (Infinite Impulse Response) filter since 2 = y n is taken (see Section 4).
Second, DNN model stability is analysed.State equation belonging to the th i neuron in the discrete-time DNN model is given by as the initial state is obtained as follows.
Stability of the DNN model is directly related to the stability of the states since output vector of the DNN model is linearly related to the states as given in Equation ( 4).Neuron in Equation ( 10) can be considered as a first order ARX model.Stability of the DNN model expressed in Equation ( 3) is guaranteed by satisfying the following conditions.
is needed to be satisfied not for the internal stability but for the input to have effect on the output.

Inequality Constrained EKF Based Training
Inequality constrained EKF (ICEKF) is used to train model parameters.Parameter adaptation equations of ICEKF will be given in Section 2.4.1 and training of models will be detailed in Section 2.4.2.

ICEKF
State-space representation of a nonlinear discrete-time system is given in (13).
is system output, (.)   f is nonlinear process function vector, (.)  h is nonlinear measurement function vector, n R w is process noise and m R v  is measurement noise, which both is Gaussian white noise.Extended Kalman filter can be summarized in two steps given Q and R are covariance matrices corresponding to process and measurement noises respectively.
Let us consider there exist inequality constraints on states as given below in state estimation by ICEKF.
Parameters must be within the constraint space to satisfy the constraints.By this reason, projection is taken onto the constraint space [19].(20) presents the projection onto the constraint space as it yields the final optimum state estimation.k x and k P stand for projected state estimation and corresponding error covariance matrix respectively.

Training of Models by ICEKF
Parameters of the ARX model exist directly in the parameter vector θ while parameters of the DNN model are in the matrices is generated as in (21) similar to [11] and [18].
In ( 22), ) is estimation error covariance matrix of the parameters in the vector θ and h J is updated as follows.
Projection onto the constraint space is taken as in (20) to satisfy the constraints in (9) for ARX model while in (12) for DNN model.For the DNN case, states are updated as in (3) using the parameters which are updated satisfying the constraints.Thus, states are not the ones which are estimated optimally but parameters in the vector θ are.

ARX and DNN Based Generalized Predictive Control
Section 3.1 briefly introduces GPC while Section 3.2 and 3.3 detail the ARX-based and DNN-based GPC respectively.

GPC
Let us have a NARX (Nonlinear Auto-Regressive with exogenous input) data model for a nonlinear system [9].
) , As n y ~ is the reference signal and n y ˆ is the model output, GPC aims to have the model output track the reference signal with minimum tracking error possible while keeping the changes in the control signal as low as possible.Constraints exist on the control signal.
 , penalizes the abrupt changes in control signal.u K and y K are horizon values up to how many future control inputs and model outputs will be calculated.Always, . At each time instant, to make the system output track the reference signal for is generated and first element in the vector is applied to the system.To predict the future behaviour of the system whose output function is unknown, an appropriate model to approximate that system is used.Also that model is utilised for the gradient information which is necessary to update the control signal at each time instant.This update is expressed as follows.
is obtained and  denotes the step size.It can be calculated optimally using one of the one-dimensional optimization methods in the literature.Gradient vector is the following.
If derivative of ( 29) is taken to obtain Hessian matrix, a term is generated.But it can be ignored since it has small value.Thus, Hessian is approximated as Considering (24), model output depends on the control signals that have a time index value which is smaller than or equal to that of the model output.Thus, the term Computational load of the derivatives depends on the model.

ARX Based GPC
Since the system is approximated by ARX model, It can be written explicitly Thus, partial derivative expression will be  is the unit step function.Obtained partial derivative is substituted in ( 29) and (30) to obtain the gradient vector and Hessian matrix.

DNN Based GPC
Since the system is approximated by DNN model, ) And the future output prediction by the model is given by Thus, partial derivative expression will be  oscillates around its nominal value.Figure 3 shows reference tracking and produced control signal by ARX-based GPC controller while Figure 4 shows time evolution of parameters.Similarly, Figure 5 shows reference tracking and produced control signal by DNN-based GPC controller while Figure 6 shows time evolution of parameters.Tracking performances of the controllers are compared in terms of Root-Mean-Squared-Error (RMSE) and power of the produced control signal ( ARX-based GPC controller tracks the reference signal with little oscillations while DNN-based GPC controller performs smoother tracking as expected.However, it has more overshoot compared to ARX-based GPC.Control signal is less aggressive in DNNbased GPC.ARX-based GPC has still acceptable tracking performance.

CSTR Control
Continuously stirred tank reactor is a third order highly nonlinear system on which tracking performance of the controllers were tested. .Figure 7 shows reference tracking and produced control signal by ARX-based GPC controller while Figure 8 shows time evolution of parameters.

Conclusions
This study presents a comparison of ARX and DNN models in GPC scheme.Tracking performance of models were compared on bioreactor and CSTR systems which are both nonlinear benchmark systems.Even though ARX is a linear model, it has proven to be an acceptable model for generalized predictive control of nonlinear systems.Moreover, structural stability is maintained in both models by constraining the poles in a stable region.As a general result, ARX and DNN models are adopted successfully in GPC scheme for both systems.
NN. States of the neurons are updated in discrete-time as given in (3) and (4).
of linear ARX (AutoRegressive with eXogeneous input) model and nonlinear function tanh(.).Thus, identification of linear and nonlinear dynamic systems is aimed in a quick and efficient way.

Figure 2 :
Figure 2: Diagonal dynamic model.Parameters in the parameter vector

k
is the time index, definition of the variables and model matrices are given in the previous section.Discrete-time state solution of the model given 0 vector is obtained, parameters in both models are updated as follows.
that model.Considering (2), future output prediction by the model is given by y that model.Using (3) and (4), model output can be written alternatively as following.

)
and amount of nutrients per volume.Control signal ) (t u is the flow rate. is time- varying parameter of the process and has a nominal value of 0.48.Controllers were employed to make the reactor output track desired reference value with minimum tracking error possible.

Figure 3 :
Figure 3: Bioreactor reference tracking and control signal produced by ARX-based GPC controller.

Figure 4 :
Figure 4: Time evolution of parameters in control of bioreactor by ARXbased GPC controller.

Figure 5 :
Figure 5: Bioreactor reference tracking and control signal produced by DNN-based GPC controller.

Figure 6 :
Figure 6: Time evolution of parameters in control of bioreactor by DNNbased GPC controller.

u
is the control signal and 2 d is time-varying parameter of the process which has a nominal value of 1. Controllers were employed to make the reactor output track desired reference value with minimum tracking error possible.GPC parameters are the DNN-based GPC case, number of states is set 5 = n

Figure 7 :
Figure 7: CSTR reference tracking and control signal produced by ARXbased GPC controller.

Figure 8 :
Figure 8: Time evolution of parameters in control of CSTR by ARXbased GPC controller.Similarly, Figure9shows reference tracking and produced control signal by DNN-based GPC controller while Figure10shows time evolution of parameters.Tracking performances of the controllers are compared in terms of RMSE and power of the produced control signal ( u P ) in Table2.It is noticed that in the

Figure 9 :
Figure 9: CSTR reference tracking and control signal produced by DNNbased GPC controller.

Figure 10 :
Figure 10: Time evolution of parameters in control of CSTR by DNNbased GPC controller.

Table 1 :
Comparison of tracking RMSE and u P by ARX-based and DNN-based GPC controllers in bioreactor system.

Table 2 :
Comparison of tracking RMSE and u P by ARX-based and DNN-based GPC controllers in CSTR system.