Mechatronics 9 (1999) 675±686
Implementation of indirect neuro-control for nonlinear dynamic systems Jun Oh Jang*, Gi Joon Jeon School of Electronic and Electrical Engineering, Kyungpook National University, Taegu, 702-701, South Korea Received 22 December 1997; received in revised form 14 December 1998; accepted 15 December 1998
Abstract This paper represents identi®cation and control designs using neural networks for a class of nonlinear dynamic systems. The proposed neuro-controller is a combination of a linear controller and a neural network trained by an indirect neuro-control scheme. The proposed neuro-controller is implemented and tested on an IBM PC-based bar system, and is applicable to many dc-motor-driven precision servo mechanisms. The algorithm and experimental results are described. The experimental results are shown to be superior to those of conventional control. # 1999 Elsevier Science Ltd. All rights reserved. Keywords: Neural network identi®cation; Indirect neuro-control; Neuro-controller; Bar system
1. Introduction Control design for nonlinear systems is typically performed on a case-by-case basis since there are no universally applicable tools at the present time. Most of the current nonlinear schemes are based on well established results in linear systems theory or extensions thereof. This is largely due to the fact that little is known about the analysis and control of nonlinear systems in general theoretical terms, especially the issues of stability and convergence. Recently, advances in the area of neural networks have provided the potential for new approaches to the
* Corresponding author. Tel.: +82 53 950 5524; fax: +82 53 950 5505. E-mail address:
[email protected] (J.O. Jang) 0957-4158/99/$ - see front matter # 1999 Elsevier Science Ltd. All rights reserved. PII: S 0 9 5 7 - 4 1 5 8 ( 9 9 ) 0 0 0 1 1 - 2
676
J.Oh Jang, G.J. Jeon / Mechatronics 9 (1999) 675±686
control of nonlinear systems through learning process. Relevant features of the neural networks in the control context include among others their ability to model arbitrary dierential nonlinear functions, and their intrinsic on-line adaptation and learning capabilities [1]. This fundamental link of the neural networks with nonlinear systems, together with the fact that reliable and inexpensive computing hardware is available, has resulted in a tremendous growth of research and development in this area. Kawato et al. [2] used a hierarchical neural network model as an add-on component to the conventional linear controller in order to control the movement of a robot. Lee et al. [3] proposed a combined neural network/switching controller for nonlinear servomechanisms with DSP-based implementation. Lightbody and Irwin [4] proposed a direct model reference adaptive control structure using a linear controller and a neural network in parallel for a chemical process and a missile control system. In this paper, we present the idea of controlling a nonlinear system with a proposed neuro-controller. The neuro-controller is composed of a PI controller and a neural network controller (NNC) in parallel, which is trained through the neural network identi®er (NNI) by an indirect learning scheme. By an example of a bar system, this paper gives an implementation of the idea of controlling a class of nonlinear dynamic systems using a PI controller and two neural networks, which are employed as identi®cator and neural controller, respectively. 2. Bar load system As an example of nonlinear dynamic systems, a bar load system (Fig. 1) driven by a permanent magnet dc motor has been chosen for the experiment and it can be described by the following system equation [5], T
t
Je Jm y 2
t Cy_ 2
t G TC Td Fy2
t,y_ 2
t
Fig. 1. A bar load system.
1
J.Oh Jang, G.J. Jeon / Mechatronics 9 (1999) 675±686
677
where the coecient terms Je, Jm, C and G represent the eective inertia term, the motor inertia term, the centrifugal and Coriolis terms, and the gravity term, respectively. T represents the motor torque, Fy2
t, y_ 2
t includes unmodeled dynamics. TC represents the Coulomb friction in the motor while Td is the disturbance. The unmodeled dynamics include out-of-plane movement of the bar, wobbling, sensor dynamics, etc. Control is applied only to the second joint and the ®rst joint is just a variable load in the experiment. An important characteristic of this system is its periodicity, i.e., at a constant speed, the system with the bar load has periodical dynamics. 3. Indirect neuro-control of a bar load system The structure of the neural network identi®er (NNI) and design techniques of the proposed neuro-controller are presented in this section for experimentally controlling the velocity of the bar 2, y_ 2
t. Fig. 2 shows the NNI and the proposed neuro-controller which has the linear controller and the neural network controller (NNC) in parallel. The NNI which emulates the dynamic behavior of the plant is necessary for the indirect neuro-control scheme and plays an important role in the update of the neuro-controller parameters. This update is achieved by obtaining a better estimate of the gradient in the gradient descent technique using the trained NNI. It is noted that the NNI is trained in a series-parallel mode [6] before being used for control. The parameters of the NNI are updated to follow the dynamics of the plant in the reported research since this is found to increase accuracy. The output of the NNI in Fig. 3(a), with the number of nodes in successive layers 4-5-1, is given by " !# 5 4 X X ^_ i i i i v x w s
2 y m1
m1
l1
lm
l
with s i( ) the hyperbolic tangent function, v ilm the interconnection weights from
Fig. 2. The proposed neuro-control system.
678
J.Oh Jang, G.J. Jeon / Mechatronics 9 (1999) 675±686
Fig. 3. Structure of the neural network (a) NNI and (b) NNC.
®rst to second layer, w im1 the interconnection weights from second to third layer, and the superscript i implies NNI. The inputs to the NNI, x i=[x i1, x i2, x i3, x i4]T=[T(kÿ1), T(kÿ2), y_ 2
k ÿ 1, y_ 2
k ÿ 2T , are composed of the control input and the plant output. For the NNI in Fig. 2, Z1(z )=[z ÿ1, z ÿ2, 0, 0]T, Z2(z )=[0, 0, z ÿ1, z ÿ2]T. The performance index for training the NNI is: ^ Ei
k 12 ei
k2 12 y_ 2
k ÿ y_ 2
k2
3
where ei (k ) is de®ned as the error between the plant output, y_ 2
k and the output ^ of the NNI, y_ 2 . The second to third layer weights of the NNI, w im1 are updated by back-propagating the error by the following equation: ^ @ Ei
k @ y_ 2
k i w ei
k
k Z m1 @wim1
k @wim1
k ! 4 X i i i i vlm
k x l
k ei
k wm1
k Z s
wim1
k 1 wim1
k ÿ Z
4
l1
where Z is the step size. Similarly, the ®rst to second layer weights of the NNI, v ilm are updated by the following equation:
J.Oh Jang, G.J. Jeon / Mechatronics 9 (1999) 675±686
^ @Ei
k @ y_ 2
k i
k Z w ei
k lm @vilm
k @vilm
k ! 4 X vilm
k x il
k wim1
k ei
k vilm
k Z x il
k s_ i
679
vilm
k 1 vilm
k ÿ Z
5
l1
where sÇ i( ) is the time derivative of s i( ). Control input T to the plant is de®ned as: T T1 T 2
6
where T1 is the output of the linear controller and T2 is the output of the NNC. The output of the NNC in Fig. 3(b), with the number of nodes in successive layers 3-5-1, is given by T2
" 5 X i1
wci1
c
s
3 X h1
!# vchi
x ch
7
where v chi are the interconnection weights from ®rst to second layer, w ci1 are the interconnection weights from second to third layer, and x c=[x c1, x c2, x c3]T=[e(k ), fe(k ), sgn
y_ 2
kT are the inputs to the NNC. The inputs to the neural network controller, e(k ) and fe(k ), are selected for compensation of nonlinearities in the plant since the PI controller is used for stabilization of plant dynamics. The signum function, sgn( ), is needed in the Coulomb friction term. Since the NNC cannot directly learn the nonlinearity of the plant, the interconnection weights of the NNC in Fig. 2 are updated by an indirect neuro-control scheme [7] with the performance index: ^ E^ c
k 12 e^c
k2 12 y_ 2 d
k ÿ y_ 2
k2
8
where eÃc (k ) is de®ned as the identi®ed tracking error between the reference signal and the output of the NNI. The indirect neuro-control scheme of the NNC is as follows: the plant dynamics are identi®ed by the NNI through a learning process, during which connection weights are updated in a direction to minimize the sum ^ of squared errors between the plant output, y_ 2 and the output of the NNI, y_ 2 . ^ _ Meanwhile, the partial derivative, @ y 2 =@ T, which is calculated by using the NNI and the error signal, eÃc (k ), is used to update the weights of the NNC by employing the dynamic back propagation scheme [6], which provides a better ^ estimate of gradients, @ y_ 2 =@ T. Therefore, the second to third layer weights of the c NNC, w i1, are updated by back propagation of the identi®ed tracking error, eÃc (k ), through the NNI by the following equation:
680
J.Oh Jang, G.J. Jeon / Mechatronics 9 (1999) 675±686
wci1
k 1 wci1
k ÿ Z wci1
k Z
@ E^ c
k @wci1
k
wci1
k Z sc 4 X l1
^ @ y_ 2
k ec
k @ T
k ! " 3 5 X X vchi
k x ch
k vi1m
k s_ i
@T2
k @ T1
k @wci1
k @ wci1
k
h1
m1
!#
vilm
k x il
k wim1
k
e^c
k
9
utilizing the facts that @ T1
k 0 @wci1
k
and
@T2
k sc @ wci1
k
3 X h1
! vchi
k
x ch
k
from (7). The ®rst to second layer weights of the NNC, v chi, are similarly updated by the following equation: ^ @ E^ c
k @T2
k @ y_ 2
k c v ec
k
k Z hi @vchi
k @ vchi
k @ T
k ! 3 X c c c c c vhi
k x h
k wci1
k vhi
k Z x h
k s_
vchi
k 1 vchi
k ÿ Z
5 X
h1
"
m1
vi1m
k
s_
i
4 X l1
vilm
k
!#
x il
k
wim1
k
e^c
k:
10
The group of Eqs. (4) and (5) and (9) and (10) outline the back propagation neural network training algorithm [8]. Neural network control of nonlinear plants using gradient methods suers from the drawback that it is not possible to obtain reliable estimates of the derivatives through the plant. This derivative estimation process is rendered easy by the NNI which is an important advantage of the indirect neuro-control scheme. It is noted that the control input generation and the weight updates of the NNC and the NNI are executed in one sampling time. The updating of the NNI weights during control phase is useful in improving the tracking performance in the face of changes in system dynamics and noisy measurement.
J.Oh Jang, G.J. Jeon / Mechatronics 9 (1999) 675±686
681
4. Experimental results The eectiveness of the proposed neuro-controller by an experiment on the bar system is presented in this section. The maximum steady-state-error (MSSE) (%) is de®ned as 100 vEmax/y_ 2d j where E y_ 2d ÿ y_ 2 . The experimental setup is shown in Fig. 4. It consists of a dc motor with a bar, an encoder and a counter for output signal, a Digital-to-Analog (D/A) converter and a servoampli®er for control signal, and an IBM PC equipped with an Intel 8255-based interface card. The voltage output from the computer is ampli®ed using a pulse width modulated ampli®er. An optical encoder with a quadrature decoder chip is used for angular position measurement. Angular velocity is calculated from this position measurement by dierentiation. In the experimental setup, the proposed control scheme is implemented on the IBM PC with an Intel 486DX-66 microprocessor at a 100 Hz sampling rate. Although the main thrust of this work is to discuss the neuro-controller in the bar system, it is necessary to add a conventional linear controller to evaluate the ®nal results. A natural approach is to design the linear controller in the neurocontroller. Therefore, we obtain a linearized model of the bar load system with l1=10 cm and y1=308 through the system identi®cation and the curve ®tting method as follows: G
s
1 : 0:0144s 0:9149
11
The PI controller based on the linearized model (11) is tuned after obtaining the gains of the controller by the Ziegler±Nichols method [9]. For fairness of comparison, the gains of the PI controller are chosen to the identical gains of the PI part in the neuro-controller, i.e., KP=5 and KI=2.5.
Fig. 4. Experimental setup.
Fig. 5. Experimental results of the neural network identi®cation with T(t )=3.1+1.5 sin 3pt+2.7 sin 4pt v.
Fig. 6. Experimental results with the unit step reference signal (l1=10 cm) (a) by the PI controller and (b) by the neuro-controller.
J.Oh Jang, G.J. Jeon / Mechatronics 9 (1999) 675±686
683
Identi®cation, which is essential for implementing the neuro-control strategy, is considered ®rst. Subsequently, the neuro-control results are discussed. Randomly generated sinusoidal control inputs with magnitude within 25 V and several frequencies up to 2 Hz are used as the training inputs after several tests using various signals. Fig. 5 shows the neural network identi®cation response obtained from the experimental neural network identi®er for the test signal T(t )=3.1+1.5 sin 3pt+2.7 sin 4pt v. The NNI consistently gives very accurate outputs throughout the control phase of the experiments, too. This observed capability of the NNI to model a complex experimental system accurately in real-time is a signi®cant result. Fig. 6 shows the experimental performance of the PI controller and the proposed neuro-controller for a step reference signal. Since the bar moves in a
Fig. 7. Experimental results with the sinusoidal reference signal (l1=10 cm) (a) by the PI controller and (b) by the neuro-controller.
684
J.Oh Jang, G.J. Jeon / Mechatronics 9 (1999) 675±686
vertical plane, the periodical characteristics of the bar mechanism (oscillation) are shown in Fig. 6. The proposed neuro-controller is found to outperform (4% MSSE) the PI controller (11% MSSE). For the sinusoidal reference signal, the deadzones in the vicinity of the zero velocity are observed in Fig. 7(a). This phenomenon is related to the Coulomb friction, especially at low velocity. As a result, the proposed neuro-controller performs much better than the PI controller. Finally, in order to investigate the eect of varying length of the bar 1 similar experiments for a step and sinusoidal reference signals are carried out with the length of the bar 1 changed from 10±15 cm. It is noted that the MSSE for the step reference signal and the width of deadzones for the sinusoidal reference signal have increased signi®cantly in case of the PI controller (Figs. 8(a) and 9(a)). However, it is noticeable in Fig. 9 that the degradation of the proposed neuro-
Fig. 8. Experimental results with the unit step reference signal (l1=15 cm) (a) by the PI controller and (b) by the neuro-controller.
J.Oh Jang, G.J. Jeon / Mechatronics 9 (1999) 675±686
685
Fig. 9. Experimental results with the sinusoidal reference signal (l1=15 cm) (a) by the PI controller and (b) by the neuro-controller.
controller due to the varying length of the bar 1 is very little compared with the PI controller.
5. Conclusions A design method and implementation architectures of the neuro-controller have been proposed for a DC motor system with a bar load. The proposed neurocontroller outperforms the conventional controller for a step and sinusoidal reference signals. A key feature of the neuro-controller design is the usage of the NNC to compensate the nonlinear terms for a class of dynamic systems. Also, it is noticeable that the update of the NNC weights is carried out eectively by the
686
J.Oh Jang, G.J. Jeon / Mechatronics 9 (1999) 675±686
indirect neuro-control scheme. Demonstration of the capability of neural networks to identify and control the experimental system is in itself signi®cant, and shows the promising potential of such designs. Although the bar load system is considered in the study, the proposed neuro-controller has applicability to a large class of dynamic systems. It should be noted that the theoretical issues of convergence and stability are not well understood for neural algorithms at present. However, since this can be said for most of the current control designs for nonlinear systems in general, neural networks can be viewed as viable alternatives for control of nonlinear systems. Acknowledgements The authors would like to thank the reviewers for their helpful comments. References [1] Hornik K, Stinchcombe M, White SH. Multilayer feedforward networks are universal approximator. Neural Networks 1986;2:359±66. [2] Kawato M, Uno Y, Isobe M, Suzuki R. A hierarchical model for voluntary movement and its application to robotics. IEEE Contr Syst Mag 1988;8:8±15. [3] Lee TH, Low TS, Xu JX, Lim HK. Oset-free combined neural network/switching control for nonlinear servomechanisms with DSP-based implementation. IEEE Trans Ind Electron 1995;42:9±16. [4] Lightbody G, Irwin GW. Direct neural model reference adaptive control. IEE Proc D 1995;142:31± 43. [5] Craig JJ. Introduction to Robotics: Mechanics and Control. MA: Addison-Wesley, 1986. [6] Narendra KS, Parthasarathy K. Identi®cation and control of dynamical systems using neural networks. IEEE Trans Neural Networks 1990;1:4±27. [7] Jeon GJ, Lee IS. Neural network indirect adaptive control with fast learning algorithm. Neurocomputing 1996;13:185±99. [8] Rumelhart DE, Hinton DE, Williams GE. Learning internal representations by error propagation. In: Rumelhart DE, McClelland J, editors. Parallel Distributed Processing. Cambridge: MIT Press, 1986 Vol. 1, ch. 8. [9] Ziegler JG, Nichols NB. Optimum settings for automatic controller. Trans ASME 1942;64:759±68.