MMAE54 Robotics- Class Project Paper Neural Network Controller for Robotic Manipulator Kai Qian Department of Biomeical Engineering, Illinois Institute of echnology, Chicago, IL 666 USA. Introuction Artificial neural network is parallel computation structure inspire from the unerstaning of biological nervous system(lippmann, 987). It consists of many interconnecte computational element through weights which keep aapting to achieve better system response. wo major capacities of neural network are classification (Ripley, 994), a simple example is just perceptron, an function fitting (can map from m n space R tor ), such as multilayer neural network. It has been shown a two-layer networks with sigmoi function activation function for hien layer an linear activation function for output layer, can approximate any continuous function to any egree of accuracy with sufficient large number of hien layer noes(hornik et al., 989). Base on its universal approximation capacity neural network has been naturally an successfully applie to ientification an control of complex system ynamics(hagan et al., ). or robotic manipulator control, the aaptive controller(slotine an Li, 99) we stuie in class has shown impressive asymptotic trajectory tracking performance in face of parameters uncertainty such as loas changes. Without knowing the mass, link length an loa information, the controller estimates those parameters an makes them converge to its real value, therefore provie perfect estimation of system ynamic to achieve the great system performance. he aaptive control scheme(slotine an Weiping Li, 987) is shown in figure. igure. Aaptive control scheme for robotic manipulator(slotine an Weiping Li, 987).
In eriving aaptive controller, it requires substantial work to compute the Y matrix, such that Yqqq (,,, q ) aˆ = Hqq ˆ ( ) + Cqqq ˆ(, ) + Gq ( ). System performance epens on the accuracy of r r r r regression matrix Y an the knowlege of complete system ynamics. However the estimation of the aaptive controller remine me the function approximation ability of neural network. It can give great estimation only by training on input an output. If a neural network can replace the role of Y matrix, then goo system performance will be achieve as aaptive controller without preliminary ynamics analysis to compute Y. his is also the motivation for this class project paper. rom the literature search, the paper(lewis et al., 996) was about the same objective with formal stability proof of the neural network controller. he control scheme was shown in figure. igure. Neural network control Scheme for robotic manipulator(lewis et al., 996) So, the neural network controller evelope in this paper was base on this paper. he etaile erivation was given in section metho part. An a -link manipulator tracking task simulation was use to emonstrate the performance of the neural network controller. he properties an some consierations on above neural network controller was followe in final iscussion part.. Metho.. Neural Network A three layer neural network as figure 3 with sigmoi activation function for input layer an linear activation function for output layer is efine by y = W σ ( V x) () σ ( z) = sigmoi z + e α where V is NN input layer weights matrix, an W is output layer weights matrix. Output vector y is in m imensions, which is also corresponing to the output layer neuron number N3, N3=m, an input layer vector x is in n imensions, input layer number N = n, A general function f(x) can be written as
f( x) = W σ( V x) + ε () ε is NN function reconstruction error. Since any continuous smooth function can be approximate by a large multilayer net base on various activation function, such as sigmoi an raial basis functions(cybenko, 989, Hornik et al., 989). here exist finite hien neuron number N, W an V to make the function reconstruction error ε very small. f( x) will provie a best fit for target function. y y. Robotic Manipulator Dynamics igure 3. hree Layers Neural Network Structure A general n-link robotic manipulator ynamic equation is given by q M( qq ) + V( qqq, ) + Gq ( ) + q ( ) + τ = τ (3) m et () = q () t qt () (4) r = e +Λe (5) () t is the esire trajectory input, e(t) is the tracking error an r(t) is the filtere tracking error. An rearrange the system equation (3) with (4) (5), the manipulator ynamic equation can be expresse in term of filtere tracking error r as Mr = V r τ + f + τ (6) m f( x) = M( q)( q +Λ e) + V ( q, q )( q +Λ e) + G( q) + ( q ) (7) m We choose control torque input to be x= [ e, e, q, q, q ] (8) τ = fˆ + Kr (9) where ˆf is an estimation of f, then the system ynamic equation in term of filtere tracking error can be written as Mr = ( Kv + Vm) r + f + τ () f = f fˆ () Base the feeback filtere tracking error ynamic equation (), if function estimates error of f(t) is small an system isturbance is small, then a goo tracking performance will be achieve(dawson et al., v
998). So, the essential part of the neural network controller in this paper is using neural network to approximate function f(t) to achieve better tracking performance..3 Neural Network Controller A Given neural network estimation of f as in (7) by ˆ( ) ˆˆ f x = W σ ( V x) () where Wˆ an V ˆ are weights estimates an let W an V be the ieal weights with which the neural network reconstruction error will be minimal. Assume ieal weights are boune, esire trajectory input is boune an the input vector x to neural network is boune. Z Z, Z = trace ( Z Z ) (3) M q q q Q c, c, Q, Z are constants. Define the hien-layer output error by m (4) x cq + c r (5) ˆ ( ) ( ˆ σ = σ σ = σ V x σ V x) (6) an with aylor series expansion expresse by ˆˆ (7) σ( V x) = σ( V x) + σ '( V x) V x+ο( V x) Since the activation function is sigmoi function, the higher orer term in (7) is boune by Ο( ) + + (8) V x c cq V c V r 3 4 5 Let control input be = ˆˆ τ W σ( V x)+ Kr v v (9) Substitute ()(7)(9) into () finally we will get ( ) ˆˆ ˆ Mr = Kv + Vm r + W σ + W σ ' V x + w + v () w ˆ = W σ ' V x+ W Ο ( V x) + ( ε + τ ) () w is the isturbance term containing neural network reconstruction error, higher orer term in aylor expansion of sigmoi function, an system isturbance. Assume w an v is zero, given the weight upate law by
ˆ W = ˆ σ r ˆˆ V = Gx( iag( ˆ σ ') W r) an G are positive efinite Matrice. An choose Lyapunov function to be () L = r Mr + trace( W W ) + trace( V G V ) (3) L r Mr r Mr trace( W = + + W ) + trace( V G V ) (4) Using () an let w an v to be zero, with the weights upating law, finally we will get L = r Kr (5) As t increases, tracking error will approach zero. ormula (9) an () efine the Neural Controller A, however, the error tracking performance is base on three strong assumptions ) no neural network estimation error ) No unmoele isturbance 3) No higher-orer aylor series term. urthermore, no information is provie on weights upating stability. hese limitations make the neural network controller A less appealing. Neural controller B was propose to overcome above limitations with weights upating law by v ˆˆˆ W = ˆˆ σr iag( σ ') V xr κ r W ˆˆˆ V = Gx( iag( ˆ σ ') W r) κg r V where κ is constant. A one robustifying term v(t) (6) vt () = K( Zˆ + Z ) r (7) K z is another esign constant. Let the control law of neural controller B be z M = ˆˆ τ W σ( V x)+ Kr v (8) v Choosing the same Lyapunov function as (3), ifferentiating an substituting system ynamic equation () without assuming w =, yiels L = r Kr hrough several inequality equations, it gives v r M Vm r tracew W ˆˆ σr ˆ σ V xr + ( ) + ( + ' ) V G V + xr Wˆ ˆ σ + r w + v +trace ( ') ( ) (9) L r [ K r + κ Z ( Z Z ) C C Z ] (3) vmin M
Rearranging (3), if [ K r + κ Z ( Z Z ) C C Z ] then L vmin M (3) Or r κ C3 /4+ C > br (3) K vmin Z > C / + C /4 + C / κ b (33) z 3 3 where the K vmin is the minimal element in the iagonal gain matrix, an constants in (3)(33) are from boune input, boune ieal weight, an bone higher orer term in σ function aylor series expansion assumptions as in (4)(5)(8). (3)(33)(3) state that base on neural controller B (efine by (6)(7(8)), L is negative outsie a compact set. If tracking error is outsie of the compact set, L will become less than zero, system energy ecreases an tens to rive r back to the compact set. An the same explanation applies to the weights matrix. herefore, neural controller B will guaranty the tracking error is boune an weights upating is boune. An the compact set range or tracking error range is ajustable by changing gain K v an those boune constants as in (3)(33). Since neural network controller B can provie boune tracking error an weights tuning, it was aopte for the following simulation stuy section. 3. Simulation Results Neural network controller B was implemente an simulate for a -link planar arm that is the same as homework 6, with m = m = 5, l = l =, lc=lc=.5 as shown in figure 4. 3. Neural Network Controller B vs. PD controller igure 4. two-link planar he task is joints angle tracking as the esire trajectory given by q = sin( t), q = sin( t), with initial conition q() = 45, q() = 45. he tracking performance of neural controller B is shown in figure 5. he parameters for the controller are Kv =, Kz =., Zm = 4, Λ=[5 ; 5], Initial Weights W, V sets to zero, =iag(*ones(8,)), G=iag(*ones(,)), neural network input layer neuron number N=, as the input vector given by
x= [, e, e, q, q, q ] (34) Constant in x vector is corresponing to the threshol vector which is the first column of weights matrix V. As shown in figure 5, neural network controller B achieve goo performance for the tracking task; only very small tracking error was observe (less than.8 ra)..5.5 q q q q Joint Angle (ra).5 -.5 - -.5 - -.5 4 6 8 4 6 8 igure 5. Response of Neural Controller B 4 3 q q q q Joint Angle (ra) - - -3-4 4 6 8 4 6 8 igure 6. Response of PD Controller without Neural Network Part or PD controller, the control torque input generate by Neural Network part is remove. All the other parameters left unchange. he system output was shown in figure 6. he system tracking performance egraes a lot. Large tracking error an phase shift were observe. When PD controller gains Kv increase from to 4, the system response was as in figure 7. racking error still coul be observe clearly from the figure 7. Control torque input graphs for neural network controller B an PD controller with large gain were shown in figure 8. Oscillations were observe in torques generate by neural network controller B. Magnitue of the torque generate by PD controller was larger than that of neural network controller B.
.5.5 q q q q Joint Angle (ra).5 -.5 - -.5 - -.5 4 6 8 4 6 8 igure 7. Response of PD Controller with large PD gains (Kv=4) a) orque generate by neural network controller B b) orque generate by PD controller with large gain igure 8. orque generate by neural network controller B an PD controller with large gain 3. Comparison to aaptive controller he aaptive controller use here was the same as in homework 6 with the following parameters, K =, Lamba = iag([5,5]) P=iag([4,,,, 8]. he response of the aaptive controller was shown in figure 9. he a vector estimation was as figure.
Joint Angle (ra) 3 - q q q q - -3 4 6 8 4 6 8 igure 9. Response of Aaptive controller 8 7 6 5 a a a3 a4 4 3-4 6 8 4 6 8 igure. Estimation of parameter vector a in aaptive controller he tracking performance was perfect for aaptive controller as shown figure 9. o moel the unmoele ynamics effect of aaptive controller, the element of y(,4)=cos(q()) in aaptive controller Y matrix was set to zero. he system output was then shown in figure. Significant tracking performance egraation was observe from the figure..5 Joint Angle (ra).5.5 -.5 - q q q q -.5 - -.5 4 6 8 4 6 8 igure. Response of aaptive controller with unmoele system ynamics
3.3 Neural Network Controller B with less number of noes in hien layer he neural network controller B with 8 noes in hien layer gave goo tracking performance as figure 5. o reuce the number of noes in hien layer will increase the estimation error of the neural network, which then increases the boun of the tracking error as (3). A neural network controller with the same parameters as in section 3. but the number of noes in hien layer was reuce to. he response was shown in figure. As expecte, larger tracking error was observe compare with figure 5. Joint Angle (ra).5.5.5 -.5 - q q q q -.5 - -.5 4 6 8 4 6 8 igure. Neural Network Controller B with fewer noes in hien layer 3.4 Neural Network Controller A Neural network controller A base on (9)() with w(t)=,v(t)=, Kv =, Λ=[5 ; 5], Initial Weights W, V sets to zero, =iag(*ones(8,)), G=iag(*ones(,)) was also simulate to compare with NN controller B. he response an torque plot were as figure 3 an figure 4. Since the strong assumptions of neural network controller A are easily violate, the tracking performance an stability cannot be guarantee, just as shown in figure 3 an 4, the tracking performance was very poor an very large torque spikes. 5 4 3 q q q q Joint Angle (ra) - - -3-4 4 6 8 4 6 8 igure 3. Response of neural network controller A
5 Joint Joint Input orque for the Arm 5 5-5 4 6 8 4 6 8 ime (s) igure 4. orque generate by network controller A 4. Discussion he neural network controller B provie goo tracking performance which is comparable to the output by aaptive controller, while no preliminary analysis of system ynamics to erive the controller is require. With boune input an sufficient large net, the system tracking error an weights will be boune by neural controller B. he control torque generate by neural controller was not very smooth compare with PD controller an Aaptive controller. Since weights were only proofe to be boune, not to exponentially converge. It may keep ajusting weights to keep the tracking error to be in the small compact set as in (33). he oscillation of control signal by aaptive neural network controller was also mention an shown in (Cao an Hovakimyan, 7). he neural network learning rules evelope in(lewis et al., 996) as ()(6) were not the stanar training or learning rule for multilayer neural network as in(gurney an Gurney, 997). In (), weights upate i the backpropagation part, not backpropagate the neural network estimation errors ( f fˆ ), but the errors were tracking error r, since the real value of f was unknown. It follows into unsupervise learning. he author (Lewis et al., 996) change the name of () stanar backpropagation rule to unsupervise backpropagation rule in his later book(lewis et al., 999). It also gave a hint in applying neural network to control system. Bring in the matrix expression of the neural network, assuming it gives ieal fit for certain part of control system to be estimate, the weights upate law are then erive base on carefully selecte Lyapunov function. he stability conitions also followe. wo rawbacks of neural network controller also raise in implementing the controller. ) too many parameters to ajust to guaranty the performance of NN controller, such as Kv, Kz, Zm, Λ,, G an
neural network hien noes number N. All these a to the complex of the controller in traing off the benefit from no preliminary system analysis as in aaptive controller which has fewer parameters to ajust. Although hien layer noes were use in simulation examples in (Lewis et al., 996), but the imension of its G an matrix i not match the weights upating law ()(6). ) Computation loa. Since the hien layer noes number is large, this then correspons to a large weight matrix, an each element in it has to be upate each step. It seems impossible to implement it in realtime control situation. References CAO, C. & HOVAKIMYAN, N. 7. Novel L neural network aaptive control architecture with guarantee transient performance. IEEE rans Neural Netw, 8, 6-7. CYBENKO, G. 989. Approximation by superpositions of a sigmoial function. Mathematics of Control, Signals, an Systems (MCSS),, 33-34. DAWSON, D. M., HU, J. & BURG,. C. 998. Nonlinear control of electric machinery, Dekker. GURNEY, K. & GURNEY, K. N. 997. An introuction to neural networks, UCL Press. HAGAN, M.., DEMUH, H. B. & JESÚS, O. D.. An introuction to the use of neural networks in control systems. International Journal of Robust an Nonlinear Control,, 959-985. HORNIK, K., SINCHCOMBE, M. & WHIE, H. 989. Multilayer feeforwar networks are universal approximators. Neural Netw.,, 359-366. LEWIS,. L., JAGANNAHAN, S. & YEŞILDIREK, A. 999. Neural network control of robot manipulators an nonlinear systems, aylor & rancis. LEWIS,. L., YEGILDIREK, A. & LIU, K. 996. Multilayer neural-net robot controller with guarantee tracking performance. IEEE rans Neural Netw, 7, 388-99. LIPPMANN, R. 987. An introuction to computing with neural nets. ASSP Magazine, IEEE, 4, 4-. RIPLEY, B. D. 994. Neural Networks an Relate Methos for Classification. Journal of the Royal Statistical Society. Series B (Methoological), 56, 49-456. SLOINE, J.-J. E. & WEIPING LI 987. On the Aaptive Control of Robot Manipulators. he International Journal of Robotics Research, 6, 49-59. SLOINE, J. J. E. & LI, W. 99. Applie nonlinear control, Prentice Hall.