287

DC Servo Motor Controllers Based on a Neural Network
C K Lee, T H M Chow, D K W Cheng Hong Kong Polytechnic, Hong Kong.

Abstracl

This paper presents a methodology of developing a neural network based discrete time position servo motor controller. The motor driving circuit is non-linear in nature and it is characterised by "dead-zone"and "saturation" features. Firstly, we analyse how motor operations are affected when the system is operated in closed-loop with such kind of undesirable phenomena. Secondly, we illustrate this system being controlled by a neural network based servo motor controller. Simulation results show that the steady-state error of the closed-loop system is related to the "dead zone" of the motor driving circuit. For the neural controller system, the steady-state error is not affected by the "dead zone" of the motor driving circuit.
1 Introduction .

5. , Therefore, output transistors Q2 and Q4 do not V conduct while V1 is within this region. Nonlinear inputloutput element of which the characteristic is shown in Fig. lb, will unavoidablybe introduced into the system. The introduction of such nonlinear elements violates the linear control theories which have been developed for this system.
Vmotor

Fast position servo systems require rapid acceleration and deceleration capabilities from the motors, which in turn need a driver that can provide bidirectional driving voltages.
+VCC

Different control algorithms are used to implement the motor controller. Control algorithms like the PID, variable structure, self-tuning and model reference have been employed for various applications. However, in order to get a satisfactory result, the system designer needs to know clearly and excatly the plant dynamics. But, due to the fact that usually, the dynamics of many plants are not completelyknown, very often, their control methods can only be vaguely formulated. In fact, there is nostandard method to solve the motor control problems when uncertainties occur. In recent years, research works in artificial neural networks increase rapidly, mainly because their learning and recalling capabilities attract much attentions from researchers in various fields. Neural networks are trained with examples. Trained neural networks know to respond in a way that it was taught in the past lessons. This raises the interests of the control people as controllers based on neural networks can learn to control a plant by past experiences. Besides, as neural networks are built with neurons that usually modelled by a nonlinear sigmod function, they can sometimes perform very complicated operations and hence, they can be adopted to control some nonlinear systems [2,3].

Fig. l a Linear bidirectional motor driver The configuration of one of such linear bidirectional motor drivers [l]s shown in Fig. la. As voltage V1 U i varied, neither 01nor Q3conducts so long as -, 5 Vi V

Box 1 . 4b shows the corresponding error input to the nonlinear drivingcircuit and its output. Vmntnr end ifvl < -Vdead-znne. (1). 2. . Motor control by a neural network based motor controller 3. to control the same system by a neural network based Vmax-input. Fig. Closed-loop operation of the system Here. This paper describes our procedures to carry out the work for these two stages. 4. In Figure 4b. Vmax-input. 3. the amplifier outputs a zero voltage when the input is Less than ZVdead zone.2 Sbiiulation results The system shown in Fig.m function is written while its function is written as shown i the Box 1. 4a depicts the step response of the system. vmolnr = . 3 shows the block diagram of the system in a closedloop form. 2 Motor drive system As shown in Fig.m function to simulate the nonlinear drive 3. VI = if VI > Vdead-zone. lb. we observe that the error input when the time equals 0. we analyse the effects of the motor when the nonlinear motor driver and motor are in closed-loop. X(l) = @(t . to analyse how motor operations are affected by such To model the nonlinear driving circuit.1 Planf modelling Fig. a MATLAB . Fig. The linear gain of the amplifier is ?gain. The characteristic of the motor driver is already shown in Fig. (VI . in shaft position. lb.tO)X(lO) Here. n if VI > Vmax-input. 2 shows a system configuration of the motor together with the bidirectional motor driver. the response of the system shows that the system is underdamped and there is a steady state error of 0. 3 was simulated under the MATLAB environment.21 sec.Vdead-zone)*gain. W(r) is the disturbance. is within the dead zone of the non-linear driving circuit.1703 rad. We model the motor using the state-transition equation [4] and its response is given by Equ. we need to divide the task into two stages. The supply voltages to the amplifier are fmed at ?Vcc. and 2.288 To control a position servo system of the above mentioned bidirectional driver. 4a. we describe our approach to control the system by using a neural network based motor controller. Generally speaking. 3 Closed-loop operation of the system In Fig. VI = a nonlinear motor driver. A backpropagation neural network system. Fig. Fig. We employ a neural network using backpropagation learning method. or onwards.A)-']. They are 1. Experimental system if VI < -Vmax-input. consists of multiple inputs and outputs neurons which are simple and similar processing elements. controller. By changing the weights in the network the behaviour of the where @(r) = L-'[(sl . 5. we have adopted the method from Li and Slotine (21 in the second stage. as shown in Fig. so the output of the driving circuit is zero. ~ i (VI + Vdead-zone)*gain" Fig.

2....... 25 a ... The training data is the information of the motor and driver dynamics..... .. zk. dt.... ot -051 I1 0 : 6* ' 005 .. . and the time durathe tion..&* '==' ' ' ' ' ' ' ' 01 015 02 025 Time (sec. 5 Neural network structure (sec ) 5. Fig. However. .1 Training of neural networks 5. 4.....1 Neural network control method The neural network control method from Li and Slotine [2] is adopted in this paper.. The goal is to change the weights of the network so that a desired inputloutput relationship is achieved..... i .... The training of the neural network is that..... ..289 35 3- r ....... . Step 1... 1... The training of neural networks usually involves two steps...... the designer should decide the types of operations and to what extent the controller is required to carry out the control. 1. insufficient amount of data or informaton about the plant will definitely affect the performance .. Based on the errors of the neuron outputs and the desired outputs. present inputs. . Fig.. + 1 are determined from the present states of the plant. I I Weights ---... The following points need to be considered when preparing the data. .... which depend on its applications... z and Zk+1 describes the dynamics k of the plant at a certain operating conditions... 6b... Training the Neural Motor Controller To train the neural motor controller.. . 4a Undamped system response .. x I8 ! 1) 6 15 Dabred i positions Inputs 0 Controlled pos!tions 05 lnprt k v r H i " layer m u layer p Ol....... Thus.. 2.. the amount of training data should be as small as possible..) 03 035 Ok 045 05 1' of the trained controller.... then it is a discrete time controller which is capable of calculating the present inputs when it is given the present states and the desired next states. ... The next states of the plant ZI. The input training patterns are sent to the input of the network. Its characteristics are briefly described as follows.. ........ Since neural networks are capable of performing actions similar to what it has learned before.. 6a is a state-space representation of the nonlinear plant. .. the designer should find out beforehand what sorts of operations are required for the motor. In order to reduce the training time. given a set of input training patterns.. If the states and inputs of the plant are rearranged as shown in Fig..... ..... he can then generate training data at or near these operating regions.. 4b Error signal whole network will be altered. 1 .. we need togenerate training data. 3 ..Uk.' 0 3 ' ' ' ' ' ' 005 01 015 ' 04 ' 02 025 lime 03 035 045 05 1 Fig........ Fig.. a set of weights is found so that a prefined objective can be achieved within minimal error... State-space representation is used for the nonlinear plant model. t .. ~.. Each set of Uk. the weights are updated according to an adopted learning rule.. In our case.. Step 2.. . ...... T o solve this. the controller was trained to control the motor up to a shaft position of 2n rad. This process is known as training the network.............

(2) to (5). The controller and the plant was simulated under MATLAB environment. Sigmod(x) = (1 + e-')-'. in a 80386 computer system. 6b Discrete time neural controller 5. The generated training data were arranged as s h o w in Box 2.U. 2 (Desired output from the controller) I I 1 I I ~ Fig. Two of them are the present motor position and speed. Testing Fig. Training the controller Discrete time controller zd@+i. k ' ( ' . 5.'d.k+l) Pdt) I - The training was carried out using a neural networks simulation software. It took approximately 24 hours to complete the training. 6a Nonlinear plant state space representation Box 2 Arrangement of the training data 5. different sets of desired motor positions/speedsdatawere prepared. Neuralworks Professional 11. To test the controller.000. but they were limited in the range of kmu-input. 00 E R"' (Output from Output layer). 650 pairs of data were used to train a 10 hidden neurons backpropagation neural network.+ ~ L . WHO E R'O" (Weights. To simulate the controller.290 resent states no. I[E R4" (Inputs to Input layer). output of the of the controller is calculated using Equ. Io E R"' (Inputs to Output layer).1 Next states no.2 Next states no. while the other two are the desired motor position and speed after one time duration. The neural controller has four inputs. OH E R"" (Outputs from Hidden layer). 6.2 (Input to train the controller) I Random input no.000trainings were carried out using these 650 pairs of data. 00 = Sigmod(l0) (5) where IH E R'"' (Inputs to Hidden layer). (Weights. 7 Training data generation The two next states are the motor position and motor speed after one time duration. 1 (Desired output from the controller) Iresent states no. from Hidder layer to Output layer). from Input layer to HidWIH € R'0'4 den layer). 7 is the block diagram showing the process of data generation. Note that since the controller was trained to control motor positions up to . the weights from the trained controller were used. 1 (Input to train the controller) Random input no. In Feedforward (or Recall) operations of the controller. 111 = (WIH * IdT (2) OH = Sigmod(1H) (3) (4) 1 = OH 0 * WHO Fig.2 Generatioil of rlie trainiiig dala Fig. Random inputs of positive and negative values were generated. The two present states are the present position and present speed of the motor.

and I h\mpllW o/p(/iO) U 0 -0. friction.9aand 9b show similar outputs but there is no overshoot in the desired motor shaft positions. 351 . Note that v&d-mm and V. of the driver were set at 20. damping. the steady-state error is related to the "dead-zone" of the motor driving circuit. I Desired wsdimr o Coddled p l s n r error = . Fig. the steady-state error of the system is not affected by the vdead-mne of the motor driving circuit.05 0. A small steady-state is always . Stew-%le 4 . we found that 1. It reveals that when the driver and motor are operated in a closed-loop form. . even though some of the motor dynamics were not taught to the controller before.Figs. 9b Motor controller and driver ouptuts Cmlrollet e/p < -02-01+ I t generate approximately correct outputs to the system.2 0. The control actions are based on the plant dynamics learned beforehand.8b shows the neural motor controller and nonlinear driver output. 9a Motor shaft position : * . the controller cannot cope with the changes in system parameters.291 2n radians only. 2. 0 03847 rod I . the desired motor positions should not exceed 2n radians. Conclusions 035 04 0 005 01 015 02 025 Time (sec) 03 045 05 A discrete time position servo motor controller based on Fig.35 04 045 05 h e (sec ) Fig.. . 3. such as changes in the payload. the controller can still a neural network was developed.8a shows the desired and controlled motor shaft positions. andthegainoftheamplifierwereset at 240. . for the neural motor controller controlled system. 8b motor controller and driver outputs From the results.15 0. 8.25V and 1OV. . . ' ' ' ' ' ' ' ' I i i 05- - t9 t 05 + + + t i i I I j D 1 005 01 015 02 025 h e (sec 05 035 04 045 05 2 t j 02 Fig.1 0. The motor driving circuit is nonlinear in nature and is characterised by "dead zone" and "saturation". 0 0.25 03 0. the steady-stateerror is not affected by the "dead-zone"of the motor driving circuit. when it is required to carry out these actions.I . However. Results and discussions Fi. respectively. 7.6.

R.292 resulted regardless of the magnitude of the motor driving circuit dead-zone. 152-179. Automatic Control Systems. 1978. Pittsburgh. USA. Kuo. April 1990. "LinearDC Servo Amplifiers".11361141. June 21-23. Vol. C. in Incremental Motion Control: volume 1. "Neural Network Control of unknown Nonlinear Systems". pp. Nguyen. pp. Slotine.10. C. References 1. Derrick H. No. IEEE Control Systems Magazine. 6/e. Proceedings of the 1989 American Control Conference. 2. 3. Schmidt. .3. B. pp. Bernard Widrow. 4. PrenticeHall.1989. Kuo. pp.211-217.edited by B. SRL Publishing Company. "Neural Networks for Self-learning control control systems".18-23. 1991. Weiping Li and Jean-Jacques E.