Sei sulla pagina 1di 4

Identification of Servo-driven Inverted Pendulum System using Neural Network

A. Sutradhar #1, A. Sengupta #2, V. R. Challa #3


#

Department of Electrical Engineering, Bengal Engineering & Science University, Shibpur, Howrah711103, West Bengal, INDIA
asee1@rediffmail.com aninsen2002@yahoo.com 3 ramichalla51@gmail.com
2 1

Abstract In the present work, artificial neural network (ANN) has been used to identify a servo-driven inverted pendulum system. The inverted pendulum is a benchmark problem of nonlinear multivariable system with inherent instability. The multi variable system has been considered with servomotor supply voltage as the input and four states of the system being the outputs. An LSVF controller has been used to stabilize the system for identification in closed loop. Here the non linear model of the inverted pendulum has been simulated. The Levenberg-Marquardt back-propagation method has been used for the non linear system identification via Feed-forward Neural Network (FNN). The neural network is trained using the error between the models outputs and the plants actual outputs. The results show good match between predicted and actual outputs. Keywords Neural network, nonlinear system, identification, inverted pendulum, servo-system.

data until the NN model outputs are very close to the goal value. The performance of the network has been compared for different number of neurons in the hidden layer. II. MATHEMATICAL MODEL OF THE SYSTEM The inverted pendulum control system consists of a cart driven by a D.C. motor and a pendulum attached to the cart [4, 8] as shown in Fig. 1. To keep the pendulum at upright position the cart is moved along the track with one degree of freedom. The closed loop control system should be adaptive in any disturbance along with parameter variations. The mathematical models of the non-linear inverted pendulum system and the linear system of servomotor are dealt separately.

I. INTRODUCTION Inverted pendulum is highly nonlinear device, which is inherently unstable. Artificial neural networks being capable of describing nonlinear phenomena can be used to simulate such systems for its identification. Use of Feedforward Neural Network (FNN) and Digital Recurrent Network (DRN) for identification of nonlinear models has already been explored [1,2]. Mohandas et. al. [3] demonstrates both identification and control of nonlinear dynamical systems using static and dynamic back-propagation methods. Riedmiller [4] used supervised learning techniques to learn control of unstable systems. A resilient back-propagation neural network for simulation of double inverted pendulum system was reported in [5]. Researchers have also developed different control algorithms for inverted pendulum and servo driven systems [6, 7]. The present work is to model the servo-driven inverted pendulum system within the chosen framework through observed data. The observed data, usually classified as input and output measured at discrete instants of time t and collected as an array of data for finite duration. A feedforward neural network has been constructed for the servo-driven nonlinear inverted pendulum system to fit the data instead of mathematical equations. These models are used to generate training data for the network. The back propagation algorithm has been used to adjust all the weights in the NN model through these sets of

Fig. 1. Schematic diagram of servo driven inverted pendulum system

Modelling of Inverted Pendulum system The free body diagram of inverted pendulum with the force u as the driving input is shown in Fig 2. x is the position of the cart, is the angular position of the pendulum rod with the vertical axis. The mass of the cart, M; mass of the pendulum bob, m; the length of pendulum rod, l and g, the gravity constant are the parameters. The dynamic equations for the inverted pendulum system [3, 5] can be derived using Lagrange Equations from the kinetic and potential energies of the system. The total kinetic energy of the system is: 1 1  cos + l 2 2 sin2 ) ..(1)  2 + m( x  2 + l 2 2 cos2 + 2lx  T = Mx 2 2 The potential energy stored in the pendulum rod is

A.

978-1-4244-9074-5/10/$26.00 2010 IEEE

2010 Annual IEEE India Conference (INDICON)

V = mgl cos
The Lagrangian function is

(2) the load torque utilized to generate the linear force u to drive the cart. Converting the rotational variables of the motor shaft ( m ,TL) to translational variables the cart(x, u):

L = (T V ) = 1  cos + 1 ml 2  2 mgl cos  2 + mlx  (M + m) x 2 2


(3)

Tm

 x V in K b V in K b m nr = Ki = Ki R R a a


(10)

TL = ru and m =

x nr

Thus from equations (9) and (10), the equilibrium torque equation for the combined system becomes:

Tm = J m

   x x + Bm + nru nr nr

(11)

Fig. 2. Free Body diagram of Inverted pendulum

 and x, x The state variables of the system are ,  . Thus the non-linear dynamical equations of the inverted pendulum system comes out to be :  ml sin  2 = u  + ml cos (M + m)  x (4)
 mgl sin = 0  + ml 2 ml cos  x (5) B. Model of DC Servomotor The DC servomotor is coupled with the chain-sprocket arrangement [8] to drive the cart with the force u. The motor is controlled by varying the armature voltage Vin(t). The torque developed by the motor is proportional to the air-gap flux and the armature current. So, Tm (t ) = K i .i a (t ) (6) where Ki is the torque constant. Electrical circuit equations for the motor are:  (t ) + R i (t ) Vin (t ) eb (t ) = La i (7) a a a

Using equations (6) through (8), and assuming zero armature inductance,  x V in K b V in K b m nr = Tm = K i K (12) i Ra Ra Now equations (4), (5), (11) and (12) describe the nonlinear model of the servo-driven inverted pendulum system. The parameter values of the entire system as obtained from the prototype system developed in the laboratory [8] are shown in (Table 1).
TABLE 1. PARAMETERS FROM THE LABORATORY PROTOTYPE SYSTEM

M l m r g Bm Ra Ki Kb Jm n

 (t ) = K (t ) eb (t ) = K b m b m

(8)

Mass of the cart Length of the pendulum Mass of the bob Radius of the gear Acceleration due to gravity Damping coefficient of the shaft Armature resistance Torque constant Back emf constant Moment of inertia of the rotor shaft of Dc servo motor Gear ratio

1.094kg 0.33m 0.11kg 0.025m 9.81m/sec2 0.05Nm/rad/sec 2.8 0.23Nm/volt 0.23Nm/volt 0.00325kg-m2 0.2

The torque equation for motor output shaft position m is

III. FEEDFORWARD NEURAL NETWORK REPRESENTATION OF


NONLINEAR SYSTEM

 (t ) + B  Tm (t ) TL (t ) = J m m m m (t )

(9)

The state variables of the servo system can be defined as ia(t), m(t) and m(t), where, Kb= Back emf constant, Jm= Moment of inertia of the rotor with load, Bm= Damping coefficient and m= Motor shaft position. C. Modeling of the combined system The equations describing the behavior of the combined system consisting of inverted pendulum and DC motor has been derived. For the coupled system, r = radius of sprocket and n = ratio of the intermediate coupling gear (Fig.1). TL is

where, ym (k ) is the mth output of the model, (k ) is the regression vector and is the parameter vector. Depending on the choice of the regressors in (k ) , different models can be derived. The present nonlinear system of servo driven

Different methods have been developed in the literature for nonlinear system identification. These methods use a parameterized model. The parameters are updated to minimize an output identification error. The following model can describe a wide class of nonlinear dynamic systems with an input u and an output ym: y m ( k ) = f ( ( k ), ) (13)

2010 Annual IEEE India Conference (INDICON)

inverted pendulum very closely resembles that of an NARX (Nonlinear AutoRegressive with eXogenous inputs) model for SISO system given by:

(k) = (u(k 1), u(k 2),......,u(k nu ), y(k 1), y(k 2), ......,y(k ny ))

of the FNN by Back Propagation in MATLAB program, the gensim command has been used to produce corresponding trained network block. The FNN block is then placed in the SIMULINK diagram to compare the NN outputs with the actual outputs of the system. B. Results and Discussions The performance of the neural net model is tested by comparing the MSE (mean squared error) that indicates the accuracy of the model (Table 2). The regression curves for the output with hidden layer neurons 100 are shown in Fig.4. Fig.5 shows the actual plant outputs plotted against the neural net model outputs with 100 hidden layer neurons.

where ny denotes the maximum lag of the output and nu denotes the maximum lag of the input that decide the present output of the system. Feedforward Neural Network (FNN) structure for the present multivariable system is shown in Fig. 3.

Fig 3. FNN structure for multivariable system identification

The input vector to the FNN is

X T (k) = [x1 x2 x3....xm...xM ] = [u(k 1) u(k 2) ...u(k nu ) y1(k 1) y1(k 2) ... y1(k ny1) y2(k 1) ... y2(k ny2) .....yP (k nyP)]
and the output vector of the FNN model is: T YN ( k ) = [ y N 1 y N 2 y N 3 .... y Np ... y NP ] (15) (14)

Fig 4. Regression Curve for theta ( ) with 100 no. of hidden Layer Neurons TABLE 2. PERFORMANCE COMPARISON OF VARIOUS STRUCTURES

A. Simulation of FNN for closed-loop system For simulation of FNN, we have to consider the network layers, number of neurons in each layer, the initial value, learning methods etc. We have chosen a two layer network with one hidden layer, and its input consists the servomotor input (V in) and the four states of the system: the pendulum  , the cart position angle , angular velocity of the pendulum  . The output layer has one neuron per x and the cart velocity x output state and the number of neurons in hidden layer is varied from 10 to 100 and the performances of the network were compared. The sigmoidal activation functions tansig and the linear activation function purelin have been used in the hidden layer and the output layer respectively. The Tapped Delay Lines (TDL) is used to feed the delayed samples of the input and output of the plant to the neural network. Neural network identification of inverted pendulum is done mainly through the collecting and collating arrays of input and output data stored in the workspaces obtained by running the SIMULINK file . Band limited white noise has been applied as input signal to the system. An LSVF controller is used to stabilize the servo driven inverted pendulum system. The feed forward neural network with back propagation algorithm has been developed by MATLAB program. After proper training

IV. CONCLUSION The dynamic systems containing nonlinear relations are difficult to model with conventional techniques. Inverted pendulum is a minimum phase control object with non-typical uncertainty. For identification of the present problem, the twolayer feedforward network with sigmoidal activation function in the hidden layer and linear activation function in the output layer has been chosen that has the ability to approximate nonlinear function with sufficiently large number of neurons in the hidden layer. In this paper, the feedforward neural network has been developed using the input-output data from the MATLAB workspace of the servo-driven inverted pendulum model. Back propagation algorithm has been used effectively for the complicated multivariable nonlinear and inherently unstable control problem. In designing the neural network model, the

2010 Annual IEEE India Conference (INDICON)

Fig. 5. Validation Curves for four output states with Hidden Layer Neurons =100

problem is to determine an optimal architecture of the network. Large time lags in both the inputs and output data result in better prediction of the network. However, large nu and ny (may be different for all the four outputs) also result in a large number of parameters (weights and biases) that need to be adapted causing an increase of computational overhead. The network was tested with varying numbers of hidden layer neurons. The MSE between the actual model and the neural network model is within acceptable limit. Increasing the number of hidden layer neurons improves the performance of the model in closed loop allows for more complex functions to be modelled.

[3]

[4]

[5]

[6]

REFERENCES
[1] [2] Anderson C. W., Learning to Control an Inverted Pendulum Using Neural Networks, Control Systems Magazine, IEEE Vol. 9, Issue 3, pp. 31 37,1989. Vesna M. Rankovi and Ilija Z. Nikoli., Identification of Nonlinear Models with Feedforward Neural Network and Digital Recurrent Network, FME Transactions Vol. 36, No 2, pp. 87-92, 2008. [7]

[8]

Mohandas K P and Suresh Paritala, Simulation of Inverted Pendulum Using Neural Networks for Identification , Proceedings of the 4thFaculty of Architecture and Engineering Symposim, European University of Lefke, North Cyprus, Nov 30-Dec 2, pp. 621-627, 2006. Riedmiller. M., Controlling an inverted pendulum by neural plant identification Systems, Systems Engineering in the Service of Humans, Conference Proceedings, International Conference on Man and Cybernetics,vol.4, 17-20 Oct., pp.473 478, 1993. Bogdanov. A., Optimal Control of a Double Inverted Pendulum on a Cart, OHSU Technical Report, Department of Computer Science & Electrical Engineering, OGI School of Science & Engineering, CSE-04-006, 2004. Moreno. A. R., Gordilo. F. S. M. and Gibu. L. D. G., Implementation of Servo System for Controlling a Double Purpose Nonlinear Plant: Inverted Pendulum and Crane, IEEE international conference on control application, September 5-7, 2001; pp. 884-889, 2001. Kawada.K, Yamamoto.T and Mada.Y.A., , Design of Evolutionary Recurrent Neural-Net Based Controllers for an Inverted Pendulum, 5th Asian Control Conference. Volume 3, 20-23 , pp.1419 1422, 2004. Sahoo. K., Design and Analysis of Controller for Inverted Pendulum System; M. E. (Electrical Engg.) Dissertation 2006, Bengal Engg. & Science University, Shibpur, Howrah, India, 2006.

2010 Annual IEEE India Conference (INDICON)

Potrebbero piacerti anche