1
Decoupled Extended Kalman Filter-Based Dynamic Neural Network for Adjustable Speed Motor Drive Systems Khaled NOURI1 , Rached DHAOUADI2 and Naceur Benhadj BRAIEK1 1 Laboratoire d’Etudes et de Commande Automatique des Processus (L.E.C.A.P). Ecole Polytechnique de Tunisie, BP. 743, 2078, La Marsa, Tunisie. 2 Department of Electrical Engineering, School of Engineering. American University of Sharjah, Sharjah, UAE. 1 Email :
[email protected], 2
[email protected], 1
[email protected] Abstract - In this paper, a neurocontrol method for motor drive systems is proposed. A recurrent multilayer perceptron is trained off-line to learn the inverse dynamics of the system from the observation of the input-output data. The direct adaptive control approach is performed after the training process is achieved. A modified form of the Decoupled Extended Kalman Filter is proposed and used to adjust on-line the network weights so that the neural model output follows the desired one. The simulation results obtained verify the effectiveness of the proposed control method. Keywords— Extended Kalman filter algorithm, Recurrent neural network, Motor drive, Adaptive control. I. INTRODUCTION
This study has been motivated by the increasing interest in designing accurate and robust controllers for precision servos in motor drive systems and for tracking and pointing systems. Although high-quality servos are largely described by linear models, their performance is often limited by nonlinear phenomena such as friction and backlash [JAN 00], [DON 94], [OUY 01]. Recently, advances in the area of artificial neural networks (ANNs) have provided the potential for new approaches to the control of nonlinear systems through learning process. ANNs provide a distinctive computational paradigm by exploiting the massively parallel processing performed in their elementary processing elements called neurones. Relevant features of ANNs in the control context include their ability to model arbitrary differential nonlinear functions, and their intrinsic on-line adaptation and learning capabilities [PLE 03], [REN 03], [NOU 01]. ANNs have been used to detect faults in control systems [S.R 90], to solve nonlinear optimization problems [KEN 88], to identify nonlinear input-output maps [NAR 90], and other purposes [DHA 99], [DHA 98], [R.D 01], [K.C 96]. These studies have posed the control problem in the same form as classical control but with an ANN modelling the process and the controller. In this paper, an ANN adaptive control method is proposed for a class of nonlinear motor drive systems. First, the considered ANN is trained to learn the inverse dynamic characteristics of the system using a modified version of the Decoupled Extended Kalman Filter algorithm. After being trained, the neural network inverse model is used as a feed-
forward controller for the direct adaptive control approach. The different sections of this paper are organized as follows: in section II, we define the model of the considered class of motor drive systems. The neural network identification of the motor drive is described in section III. Section IV, provide the direct adaptive control structure applied to our system. Numerical simulation of the identification and control system are illustrated in section V, and a conclusion is drawn in section VI.
II. MODEL STRUCTURE OF THE MOTOR DRIVE SYSTEM
In this paper, we will consider a special class of nonlinear motor drive systems. The considered system is composed of a motor inertia connected to a load inertia with a lowstiffness shaft, that can be represented by a linear second order motor system with linear stiffness function and linear viscous damping [OUY 01], [DHA 99], [K.C 96]. The dynamic equation are given as:
Jm
dωm dt
=
τm − Bm ωm − τsh
(1)
dωl dt
=
τsh − Bl ωl − τl
(2)
Jl
τsh
=
K
Z
(ωm − ωl )dt
(3)
where ωm : motor speed, ωl : load speed, τm : motor torque, τsh : shaft torque, τl : load torque, Jm : motor inertia, Jl : load inertia, Bm , Bl : damping coefficients. The load speed is usually not available for measurement. The transfer function between the motor torque and the motor speed in the absence of load torque is given as:
Bl K s+ 1 ωm (s) Jl Jl = G(s) = τm (s) Jm s3 + a 2 s2 + a 1 s + a 0 s2 +
(4)
where: a2 =
Bl Bm K K + , a1 = B m Bl + + and Jl Jm Jm Jl
a0 = (Bm + Bl )
K Jm Jl
Since the system will be controlled by a digital controller, the discrete-time model of the system is derived to design the neural network. Using the Trapezoidal method, the discrete-time model of the system can be represented as: y(k)
hidden layer are represented by w h and θ h , while between the hidden and output layer they are represented by w o and θo . The weights representing the feedback in the output layer are denoted by w ro , while those in the hidden layer are wrh . The network equations are given by z shi
a1 y(k − 1) + a2 y(k − 2) + a3 y(k − 3)
+
b0 u(k) + b1 u(k − 1) + bu2 (k − 2) + b3 u(k − 3) o (5) e (k) =
III. NEURAL NETWORK IDENTIFICATION OF MOTOR DRIVE SYSTEM
A. Structure of Neural Network A number of results have been published showing that a feedforward network of the multilayer perceptron type can approximate a continuous function arbitrarily well. More specifically it is show that a continuous function can be approximated arbitrarily well by a feedforward network with only a single internal hidden layer [PLE 03], [NAR 90]. Therefore, we choose a recurrent multilayer perceptron with internal and external recurrence consisting of three layers : an input layer with ni neurons, a hidden layer with nh neurons and an output layer with one neuron (no = 1) as shown in figure 1. The output of each recurrent node delayed by a unit time step, is feed back to itself through a trainable feedback connection as well as to all other nodes within the same layer through trainable crosse-talk connections. Let x be the input to the neural network, and sh , z be
x(k)
whji
x(k-1)
wrh ji
θh j
j x(k-q)
wokj wkkro z(k)
k
i
o
θk
(6) (7)
where
=
where k is the discrete-time index, u(k) and y(k) denote the system input(τm ) and output(ωm ) respectively. The parameters ai and bi are a function of the system parameters and the sampling period Ts .
= eo = f (ehi )
ehi (k) =
Pn h
wjo shj + wro z(k − 1) + θ o
Pn i
h xj + wij
j=1
j=1
Pnh
m=1
rh h wim sm (k − 1) + θih
and f (·) is the sigmoidal activation function. The number of neurones in the input layer (ni ) will depend on the model structure of the considered system. The number of hidden neurones (nh ) can be chosen according to practical situations. B. Neural Network Training Algorithm Off-line identification will be performed by presentation of a predefined number of previously obtained patterns. The patterns are made up of a series of input and corresponding desired output signals. The approach is much the same as in standard identification, the only difference being that presentations of the data are repeated [OUY 01]. This procedure is referred to as neural network training. In our work, we consider the extended Kalman filter approach proposed by Puskorius and Feldkamp [PUS 91], named a Decoupled Extended Kalman Filter (DEKF). The derivation of the DEKF algorithm is based upon the assertion that the weights of the network can be grouped (or decoupled) such that the element’s of the error covariance matrix P (n) corresponding to weights from different groups can be ignored. Given a network with M weights and no output nodes, partition the weights into g groups, with mi weights in group i. The update for a training instance at time step n of DEKF is given by [PUS 91]:
z(k-1)
A(k)
z(k-p)
=
[R(k) +
g X
HiT (k)Pi (k)Hi (k)]−1 (8)
i=1
TDL
Fig. 1. Architecture of the considered recurrent neural network
the output from the hidden layer and output layer respectively. The weights and biases between the output and the
Ki (k)
=
Pi (k)Hi (k)A(k)
Wi (k + 1) Pi (k + 1)
= =
Wi (k) + αKi (k)(d(k) − z(k)) (10) Pi (k) − Ki (k)HiT (k)Pi (k) + Qi (k)
(9)
(11)
where the matrix A(n) is a no by no global scaling matrix that contains correlation information between the plant’s observable outputs; R(n) is a diagonal no by no matrix whose diagonal components are equal to or slightly less than 1; Hi (n) is a mi by no gradient matrix containing the partial derivatives of the outputs of the plant’s model with respect to the weights of group i. Note that the components of the matrix Hi (n) are obtained exactly with the same way as does RTRL algorithm [WIL 90]. Pi (n) is a mi by mi matrix representing the uncertainty in the estimates of the weights of the group i defined as the approximate conditional error covariance matrix. Ki (n) is a mi by no matrix containing the Kalman gains for weights of group i. Wi is a vector of length mi containing the weight values of group i. α(n) is a scalar learning rate parameter. d(n) is a desired output and z(n) is the plant’s observable output. Finally Qi (n) is a mi by mi diagonal covariance matrix of an artificial process noise. The presence of this matrix helps to avoid numerical divergence of the algorithm, and also helps the algorithm to avoid reaching poor local minima [PUS 91]. In our work, the weights of the considered recurrent neural network are decoupled in a new form, which we refer to Layered Decoupled Extended Kalman Filter (LDEKF): for each network layer, we regrouped the biases of the nodes in a group, the weights of the feedback connections in a second group, and the weights related to successive layer in another group. The weights of the network are therefore decoupled with respect to their type of connexion. Consequently, the weights will be decoupled into 6 groups organized as follow: ro ] 1) W1 = [w11
2) W2 =
Consider now a recurrent neural network with a 5 dimension input vector xc , a single output u ˆ and an input-output relationship represented by : u ˆ(k) = gnnet (xc (k))
where gnnet (·) denotes the input-output mapping of the neural network. The existence of the internal recurrence in the neural network can reduce the dimension of the input vector xc to 5 elements. If u ˆ(k) approximates u(k) for the corresponding inputs, the neural network can be thought of as an inverse model of the system. Conceptually, the simplest approach is direct inverse modelling as shown schematically in figure 2. The
y(k)
System (Motor drive)
u(k)
+
TDL TDL
e(k)
-
Neural network
^ u(k)
LDEKF algorithm
Fig. 2. Direct inverse modelling by neural networks
network is updated in order to minimise the error function defined as :
e(k) =
o o o [w11 , w12 , ..., w1j ]
(14)
1 [u(k) − u ˆ(k)]2 2
(15)
The training data set is used cyclically by the LDEKF algorithm and the neural network training is carried out until the output error E is kept small below a certain desirable level.
rh rh rh 3) W3 = [w11 , w12 , ..., wij ] h h h 4) W4 = [w11 , w12 , ..., wij ]
5) W5 = [θ1o ] 6) W6 = [θ1h , θ2h ..., θjh ] E=
C. Identification of Dynamic Inverse Model
(12)
where xc (k) = [y(k), y(k − 1), y(k − 2), y(k − 3) , u(k − 1), u(k − 2), u(k − 3)]
e(k)
(16)
k=1
Inverse models of dynamical systems play a crucial role in a range of control structures [HUN 92]. Given the system model equation (5) and assuming that the plant is invertible .i.e there exist a function g(·) such that: u(k) = g(xc (k))
N X
(13)
Our objective therefore is to design a neural network that performs this mapping.
where N is the number of input-output patterns. IV. DIRECT ADAPTIVE CONTROL NEURAL NETWORK OF THE MOTOR DRIVE
The proposed closed-loop speed control system using the neural network is shown in figure 3. The initial values of the weights are those calculated by prior off-line learning of the inverse dynamics model. The LDEKF algorithm is used to adjust the weights so that the neural model output follows the desired one. Consequently the considered neural network learns continuously on-line and performs the adaptive speed control of the system. The
10
TDL TDL
0.4
6
0.3
4
0.2
2
0.1
Error diffirence = Desired output − Neural output
Neural network (Inverse Model)
r(k+1)
0.5
Neural output Desired output
8
u(k)
System (Motor drive)
y(k+1)
LDEKF algorithm
0
0
−2
−0.1
−4
−0.2
−6
−0.3
−8
e(k) + -
−10
−0.4
0
2
4
6
8
10
−0.5
12
0
2
4
6
Time(sec)
8
10
12
Time(sec)
Fig. 5. Neural network output after training
Fig. 3. On-line learning neural network control for motor drive system
2
weights are updated in order to minimize the error function e(k) = 21 (r(k) − y(k)) using the LDEKF algorithm. For each group of weights, first we compute the elements of Hi (k), which are used to determine A(k), and Ki (k). Note that to find the dynamic derivative of error with respect to the weight of the network, we need the knowledge of the system Jacobian [PLE 03], [DHA 99].
1.8 E : Total Squared Error 1.6
1.4
1.2
1
0.8
0.6
0.4
V. SIMULATION
0.2
The dynamic equations of the considered system are implemented in C++ language using the Runge Kutta(4th order) numerical integration method. The off-line training process of the inverse model system is carried out for varying numbers of hidden neurons ranging from 7 to 15. At time step k = 0, the weight vector Wi (0) and the covariance matrix Pi (0) are initialized by random values in the range [−10−3 , 10−3 ] and [102 , 104 ] respectively. During training, the components of the artificial process noise Qi (n) were chosen to be random values in the range [10−4 , 10−6 ]. The optimum parameters used are α = 10−5 , and nh = 10. Figure 4 shows the training pattern used for training the RMLP to learn the inverse dynamic model of our system.
0
0
500
1000
1500
2000
2 u : System Input
y : System output (Motor speed )
2.5
T = 10ms s
0.4
1.5
0.3
1
0.2
0.5
0.1
Diffirence error = Reference − System output
0
−0.1
−0.2
−1
6
4000
0.5
System output Reference
Ts = 10 ms 2
T = 10 ms s
1.5
3500
used as a controller in the Feed-forward adaptive control path as illustrated in figure 3. Figure 7 shows the output of the dynamic system with direct adaptive control using the same reference signal y(t) used in the off-line learning phase. The success of this control method depend largely
−0.5
Ts = 10 ms
8
3000
Fig. 6. Total squared error during the off-line training
0
10
2500
Iterations number
−0.3
−1.5 1
−0.4
4
−2 −0.5
0.5
2
−2.5
0
2
4
6
8
10
0
2
4
6
8
10
12
12 Time(sec)
0
Time(sec)
0
−2
Fig. 7. Closed loop system response using reference data training
−0.5
−4 −1 −6 −1.5
−8
−10
0
2
4
6
8
10
12
−2
0
2
4
6
8
10
12
Time(sec)
Time(sec)
Fig. 4. Training data-pattern
Figure 5 shows the neural network output after good convergence is achieved. The graph in figure 6 shows the total squared error per trial as a function of iteration number. After the training phase, the recurrent neural network is
on the ability of the considered neural network to generalize or learn to respond to inputs that were not specifically used in the learning phase. In figure 8 we have illustrated the system response to a sinusoidal reference, with the neural network controller initialized by the weights acquired by prior off-line learning using the chirp signal, after 1 iteration and after 10 iterations. Figure 9 shows the system response to a step reference after 1 iteration and after 10 iterations.
1 After 1 iteration
1
System output Reference
T = 1ms s
0.8
0.6
0.6
0.4
0.4
0.2
0.2
0
0
−0.2
−0.2
−0.4
−0.4
−0.6
−0.6
−0.8
−1
[DON 94] D ONNE J. D., O ZGUNER U., Neural control of a ¤exible-link manipulator, vol. 4, p. 2327–2332, Proceeding IEEE International Conference on Neural Networks, 1994.
System output Reference
After 10 iterations; Ts = 1ms
0.8
[HUN 92] H UNT K. J., Z BIKOWSKI D., G AWTHROP P. J., Neural networks for control systems-A survey, vol. 28, p. 1083–1112, Automatica, 1992. [JAN 00] JANG J. O., J EON G. J., A parallel neuro-controller for DC motors containing nonlinear friction, vol. 302, p. 233–248, Neurocomputing, 2000.
−0.8
0
0.5
1
1.5
2
2.5
−1
0
0.5
1
Time(sec)
1.5
2
2.5
Time(sec)
Fig. 8. Closed loop system response to a sinusoidal reference (0.1Hz) after 1 iteration and after 10 iterations
2
2
System output Reference
After 1 iteration; Ts = 1ms
s
1.8
1.8
1.6
1.6
1.4
1.4
1.2
1.2
1
1
0.8
0.8
0.6
0.6
0.4
0.4
0.2
0
[NOU 01] N OURI K., D HAOUADI R., B RAIEK N. B., Adapting back-propagation algorithm for training recurrent multi-layers neural network, p. 363–368, Proceeding Smart systems and Devices, 2001. [OUY 01] O UYANG X., M ORGAN C., N WAGBOSO C., Modelfollowing control of nonlinear Servo systems using neural networks, p. 263–272, Simulation, Technical Article, may 2001.
0.2
0
0.2
0.4
0.6
0.8
1
1.2
1.4
0
[KEN 88] K ENNEDY M. P., C HUA L. O., neural networks for nonlinear programming, p. 2430–2433, CAS-35, 1988. [NAR 90] NARENDRA K. S., PARTHASARATHY K., Identi£cation and control dynamical systems using neural networks, vol. 1, p. 4–27, IEEE Trans. on Neural Networks, 1990.
System output Reference
After 10 iterations; T = 1ms
[K.C 96] K. C. S IO K. C., L EE C. K., Identi£cation of a nonlinear motor system with neural networks, p. 287–292, Proceedings of the AMC’96-MIE, 1996.
0
0.2
0.4
Time(sec)
0.6
0.8
1
1.2
1.4
Time(sec)
Fig. 9. Closed loop system response to a step reference after 1 iteration and after 10 iterations
The results show that the system follows very closely the reference. This confirms also the ability of the considered neural network trained on-line by the LDEKF algorithm to adaptively control the system so that the system output follows closely the reference input. Similar results have been also obtained by letting the system run for a long period of time before saving the speed signal. This demonstrates the stability of the control algorithm. VI. CONCLUSION
In this paper, we have proposed a control method for a nonlinear motor drive system using a Recurrent MultiLayer Perceptron. Before, the application of the proposed neurocontrol, the recurrent neural has been trained off-line to implement the inverse dynamics of the considered system using a modified form of the Decoupled Extended Kalman Filter. The simulation results obtained show the effectiveness of the recurrent network structure and its adaptation algorithm to simulate the inverse dynamics of the system, and to control it in closed loop with good tracking performance. REFERENCES [DHA 98] D HAOUADI R., N OURI K., Feed-forward control of an elastic drive system using neural networks, p. 187–192, Les Annales Maghrbines de l’Ingnieur C2MMNI6, 1998. [DHA 99] D HAOUADI R., N OURI K., Neural network-based speed control of a Two-mass model system, vol. 3, p. 427–430, Journal of Advanced Computational Intelligence, 1999.
[PLE 03] P LETT G. L., Adaptive inverse control of linear and nonlinear systems using dynamic neural networks, vol. 14, p. 360–376, IEEE Trans. on Neural Networks, 2003. [PUS 91] P USKORIUS G. V., F ELDKAMP L. A., Decoupled extended Kalman £lter training of feed-forward layered neural networks, vol. 1, p. 771–777, In International Joint Conference on Neural Networks, 1991. [R.D 01] R. D HAOUADI R., G ANDHI P., G HORBEL F., Dynamic modelling of hysteresis in harmonic drives, p. 00225, Proceedings of the 9th European Conference on Power Electronics and Applications, 2001. [REN 03] R EN X. M., R AD A. B., C HAN P. T., L UN W. L., Identi£cation and control of continuous-time nonlinear systems via dynamic neural networks, vol. 50, p. 478–486, IEEE Trans. on Industrial Electronics, 2003. [S.R 90] S. R. NAIDU S. R., Z AFIROU E., M C AVOY T. J., Use of neural networks for sensor failure detection in a control systems, vol. 10, p. 49–55, IEEE Control System Magazine, 1990. [WIL 90] W ILLIAMS R. J., P ENG J., An ef£cient gradientalgorithm for on-line training of recurrent networks trajectories, vol. 2, p. 490–501, Neural Computation, august 1990.