**4.3 Inverted pendulum control**

The inverted pendulum system is one of the classical examples used in many experiments dealing with classical as well as modern control, and it is often used to test the effectiveness of different controlling schemes [13-16]. So in this chapter, to examine the effectiveness of the proposed TDRNN model, we investigate the application of the TDRNN to the control of inverted pendulums.

The inverted pendulum system used here is shown in Fig.6, which is formed from a cart, a pendulum and a rail for defining position of cart. The Pendulum is hinged on the center of the top surface of the cart and can rotate around the pivot in the same vertical plane with the rail. The cart can move right or left on the rail freely.

Recurrent Neural Network-Based Adaptive Controller Design for Nonlinear Dynamical Systems 127

*F*

Z-1

*x*

Fig. 7. Control block diagram of inverted pendulum system

Table 1. Parameter Setting of Inverted Pendulum

[-3, 3] randomly, the parameters


Fig. 8. Control curve of the angle



0

2

4

6

value of *x* within 3.0*m*.

numerical integral. The parameter setting is listed in the Table 1.

parameter *g M m l μ<sup>c</sup> μ<sup>p</sup> φ*

 , and

respectively. The control goals are to control the absolute value of

<sup>Z</sup>-1 <sup>1</sup> 

<sup>2</sup> *W*

<sup>3</sup> *W*

In the numerical experiments, the motion of the inverted pendulum system is simulated by

value 9.81 1.0 0.1 0.6 0.002 0.00002 5° 0 0 0

Besides, the number of hidden nodes is taken as 6, the weights are initialized in the interval

approximate to zero as closely as possible, with the constraint condition of the absolute

012345

Time(s)

<sup>1</sup> *W*

Inverted pendulum *x*

on the TDRNN are set as 0.3, 0.6, 0.4

*x x*

within 10º and make it

Fig. 6. Schematic diagram of inverted pendulum system

The dynamic equation of the inverted pendulum system can be expressed as the following two nonlinear differential equations.

$$\ddot{\boldsymbol{\phi}} = \frac{\operatorname{g}\sin\phi + \cos\phi [-F - ml\dot{\phi}^2 \sin\phi + \mu\_c \operatorname{sgn}(\dot{\mathbf{x}}) \cdot (m + M)^{-1}] - \frac{\mu\_p \dot{\phi}}{m\mathcal{I}}}{\frac{4}{3}l - \frac{m\cos^2\phi}{m + M} \cdot l},\tag{42}$$

$$\ddot{\mathbf{x}} = \frac{F + ml(\dot{\phi}^2 \sin\phi - \ddot{\boldsymbol{\phi}}\cos\phi) - \mu\_c \operatorname{sgn}(\dot{\mathbf{x}})}{m + M}.\tag{43}$$

Where the parameters, *M* and *m* are respectively the mass of the cart and the mass of the pendulum in unit (*kg*), <sup>2</sup> *g ms* 9.81 is the gravity acceleration, *l* is the half length of the pendulum in unit (*m*), *F* is the control force in the unit (*N*) applied horizontally to the cart, *uc* is the friction coefficient between the cart and the rail, *up* is the friction coefficient between the pendulum pole and the cart. The variables , , represent the angle between the pendulum and upright position, the angular velocity and the angular acceleration of the pendulum, respectively. Moreover, given that clockwise direction is positive. The variables *x* , *x* , *x* denote the displacement of the cart from the rail origin, its velocity, its acceleration, and right direction is positive.

We use the variables and *x* to control inverted pendulum system. The control goal is to make approach to zero by adjusting *F*, with the constraint condition that *x* is in a given interval. The control block diagram of the inverted pendulum system is shown in Figure 7. The TDRNN controller adopts variables and *x* as two input items.

Fig. 7. Control block diagram of inverted pendulum system

In the numerical experiments, the motion of the inverted pendulum system is simulated by numerical integral. The parameter setting is listed in the Table 1.


Table 1. Parameter Setting of Inverted Pendulum

126 Recurrent Neural Networks and Soft Computing

*x*

M

2 1

, (42)

. (43)

and *x* to control inverted pendulum system. The control goal is to

and *x* as two input items.

*p*

 

 , ,

represent the

*ml*

2

 

*<sup>m</sup> l l m M*

<sup>2</sup> ( sin cos ) sgn( ) *F ml <sup>c</sup> x*

*m M*

Where the parameters, *M* and *m* are respectively the mass of the cart and the mass of the pendulum in unit (*kg*), <sup>2</sup> *g ms* 9.81 is the gravity acceleration, *l* is the half length of the pendulum in unit (*m*), *F* is the control force in the unit (*N*) applied horizontally to the cart, *uc* is the friction coefficient between the cart and the rail, *up* is the friction

angle between the pendulum and upright position, the angular velocity and the angular acceleration of the pendulum, respectively. Moreover, given that clockwise direction is positive. The variables *x* , *x* , *x* denote the displacement of the cart from the rail origin,

interval. The control block diagram of the inverted pendulum system is shown in Figure 7.

approach to zero by adjusting *F*, with the constraint condition that *x* is in a given

m



The dynamic equation of the inverted pendulum system can be expressed as the following

sin cos [ sin sgn( ) ( ) ] 4 cos

 

*<sup>c</sup> g F ml x m M*

 

3

coefficient between the pendulum pole and the cart. The variables

its velocity, its acceleration, and right direction is positive.

The TDRNN controller adopts variables

  2*l*

*F*

Fig. 6. Schematic diagram of inverted pendulum system

 

*x*

two nonlinear differential equations.

We use the variables

make  Besides, the number of hidden nodes is taken as 6, the weights are initialized in the interval [-3, 3] randomly, the parameters , and on the TDRNN are set as 0.3, 0.6, 0.4 respectively. The control goals are to control the absolute value of within 10º and make it approximate to zero as closely as possible, with the constraint condition of the absolute value of *x* within 3.0*m*.

Fig. 8. Control curve of the angle

Recurrent Neural Network-Based Adaptive Controller Design for Nonlinear Dynamical Systems 129

Piezoelectric vibrator Direction of the rotation

Vibratory piece

Some parameters on the USM model are taken as: driving frequency 27.8 *kHZ* , amplitude of driving voltage 300 *V* , allowed output moment 2.5 *kg cm* , rotation speed 3.8 / *m s* . Besides, the number of hidden nodes of the TDRNN is taken as 5, the weights are initialized

0.6, 0.4 respectively. The input of the TDRNN is the system control error in the last time, and the output of the TDRNN, namely the control parameter of the USM is taken as the

Figure 11 shows the speed control curves of the USM using the three different control strategies when the control speed is taken as 3.6 / *m s* . In the figure the dotted line *a* represents the speed control curve based on the method presented by Senjyu et al.[18], the solid line *b* represents the speed control curve using the method presented by Shi et al.[19] and the solid line *c* represents the speed curve using the method proposed in this paper. Simulation results show the stable speed control curves and the fluctuation amplitudes

max min ( ) / 100% *VV Vave*

where max min *V V*, and *Vave* represent the maximum, minimum and average values of the speeds. From Figure 11 it can be seen that the fluctuation degrees when using the methods proposed by Senjyu and Shi are 5.7% and 1.9% respectively, whereas, it is just 1.1% when using the method in this paper. Figure 12 shows the speed control curves of the reference speeds vary as step types. From the figures it can be seen that this method possesses good

(44)

obtained by using the three methods. The fluctuation degree is defined as

 , and 

**~**

Fig. 10. Schematic diagram of the motor

frequency of the driving voltage.

control precision.

in the interval [-3, 3] randomly, the parameters

Rotor

on the TDRNN are taken as 0.4,

Fig. 9. Control curve of the displacement *x*

The control results are shown in Figures 8 and 9, and the sampling interval is taken as *T ms* 1 . Figures 8 and 9 respectively show the control curve of the angle and the control curve of the displacement *x* . From Figure 8, it can be seen that the fluctuation degree of is large at the initial stage, as time goes on, the fluctuation degree becomes smaller and smaller, and it almost reduces to zero after 3 seconds. Figure 9 shows that the change trend of *x* is similar to that of except that it has a small slope. These results demonstrate the proposed control scheme based on the TDRNN can effectively perform the control for inverted pendulum system.

#### **4.4 Ultrasonic motor control**

In this section, a dynamic system of the ultrasonic motor (USM) is considered as an example of a highly nonlinear system. The simulation and control of the USM are important problems in the applications of the USM. According to the conventional control theory, an accurate mathematical model should be set up. But the USM has strongly nonlinear speed characteristics that vary with the driving conditions and its operational characteristics depend on many factors. Therefore, it is difficult to perform effective control to the USM using traditional methods based on mathematical models of systems. Our numerical experiments are performed using the model of TDRNN for the speed control of a longitudinal oscillation USM [17] shown in Figure 10.

Fig. 10. Schematic diagram of the motor

012345

Time(s)

The control results are shown in Figures 8 and 9, and the sampling interval is taken as

is large at the initial stage, as time goes on, the fluctuation degree becomes smaller and smaller, and it almost reduces to zero after 3 seconds. Figure 9 shows that the change trend

proposed control scheme based on the TDRNN can effectively perform the control for

In this section, a dynamic system of the ultrasonic motor (USM) is considered as an example of a highly nonlinear system. The simulation and control of the USM are important problems in the applications of the USM. According to the conventional control theory, an accurate mathematical model should be set up. But the USM has strongly nonlinear speed characteristics that vary with the driving conditions and its operational characteristics depend on many factors. Therefore, it is difficult to perform effective control to the USM using traditional methods based on mathematical models of systems. Our numerical experiments are performed using the model of TDRNN for the speed control of a

except that it has a small slope. These results demonstrate the

curve of the displacement *x* . From Figure 8, it can be seen that the fluctuation degree of

and the control

*T ms* 1 . Figures 8 and 9 respectively show the control curve of the angle

0.00

Fig. 9. Control curve of the displacement *x*

longitudinal oscillation USM [17] shown in Figure 10.

of *x* is similar to that of

inverted pendulum system.

**4.4 Ultrasonic motor control** 

0.02

0.04

0.06

*x*(*m*)

0.08

0.10

0.12

Some parameters on the USM model are taken as: driving frequency 27.8 *kHZ* , amplitude of driving voltage 300 *V* , allowed output moment 2.5 *kg cm* , rotation speed 3.8 / *m s* . Besides, the number of hidden nodes of the TDRNN is taken as 5, the weights are initialized in the interval [-3, 3] randomly, the parameters , and on the TDRNN are taken as 0.4, 0.6, 0.4 respectively. The input of the TDRNN is the system control error in the last time, and the output of the TDRNN, namely the control parameter of the USM is taken as the frequency of the driving voltage.

Figure 11 shows the speed control curves of the USM using the three different control strategies when the control speed is taken as 3.6 / *m s* . In the figure the dotted line *a* represents the speed control curve based on the method presented by Senjyu et al.[18], the solid line *b* represents the speed control curve using the method presented by Shi et al.[19] and the solid line *c* represents the speed curve using the method proposed in this paper. Simulation results show the stable speed control curves and the fluctuation amplitudes obtained by using the three methods. The fluctuation degree is defined as

$$
\zeta = (V\_{\text{max}} - V\_{\text{min}}) / V\_{\text{ave}} \times 100\,\%\tag{44}
$$

where max min *V V*, and *Vave* represent the maximum, minimum and average values of the speeds. From Figure 11 it can be seen that the fluctuation degrees when using the methods proposed by Senjyu and Shi are 5.7% and 1.9% respectively, whereas, it is just 1.1% when using the method in this paper. Figure 12 shows the speed control curves of the reference speeds vary as step types. From the figures it can be seen that this method possesses good control precision.

Recurrent Neural Network-Based Adaptive Controller Design for Nonlinear Dynamical Systems 131

control nonlinear systems. Our numerical experiments show that the TDRNN has good effectiveness in the identification and control for nonlinear systems. It indicates that the methods described in this chapter can provide effective approaches for nonlinear dynamic

The authors are grateful to the support of the National Natural Science Foundation of China (61103146) and (60873256), the Fundamental Research Funds for the Central Universities

[1] M. Han, J.C. Fan and J. Wang, A Dynamic Feed-forward Neural Network Based on

[2] G. Puscasu and B. Codres, Nonlinear System Identification and Control Based on

[3] L.Li, G. Song, and J.Ou, Nonlinear Structural Vibration Suppression Using Dynamic

[4] T. Hayakawa, W.M. Haddad, J.M. Bailey and N. Hovakimyan, Passivity-based Neural

[6] D. Wang and J. Huang, Neural Network-based Adaptive Dynamic Surface Control for a

[7] Y.M. Li, Y.G. Liu and X.P. Liu, Active Vibration Control of a Modular Robot Combining

[8] J.C. Patra and A.C. Kot, Nonlinear Dynamic System Identification Using Chebyshev

[9] R.J. Wai, Hybrid Fuzzy Neural-network Control for Nonlinear Motor-toggle

[10] G. Cybenko, Approximation by superpositions of a sigmoidal function, Math. Control

[11] S. Haykin, Neural Networks: A Comprehensive Foundation (Englewood Cliffs, NJ:

[13] C.H. Chiu, Y.F. Peng, and Y.W. Lin, Intelligent backstepping control for wheeled inverted pendulum, Expert Systems With Applications, 38 (2011) 3364-3371.

[12] J.L. Elman, Finding Structure in Time, Cognitive Science, 14 (1990) 179-211.

IEEE Transactions on Neural Networks, 22 (2011) 1457-1468.

Vibration and Control, 16 (2010), 1503-1526.

Computers & Structures, 78 (2000) 575-581.

on Neural Networks, 16 (2005) 195-202.

Vibration and Control, 11 (2005) 3-17.

Signals and System, 2 (1989) 303–314.

Prentice Hall, 1999).

and Cybernetics, Part B: Cybernetics, 32 (2002) 505-511.

Gaussian Particle Swarm Optimization and its Application for Predictive Control,

Modular Neural Networks, International Journal of Neural Systems, 21(2011), 319-

Neural Network Observer and Adaptive Fuzzy Sliding Mode Control. Journal of

Network Adaptive Output Feedback Control for Nonlinear Nonnegative Dynamical Systems, IEEE Transactions on Neural Networks, 16 (2005) 387-398. [5] M. Sunar, A.M.A. Gurain and M. Mohandes, Substructural Neural Network Controller,

Class of Uncertain Nonlinear Systems in Strict-feedback Form, IEEE Transactions

a Back-propagation Neural Network with a Genetic Algorithm, Journal of

Functional Link Artificial Neural Networks, IEEE Transactions on Systems, Man,

Servomechanism, IEEE Transactions on Control Systems Technology, 10 (2002) 519-

systems identification and control.

**6. Acknowledgment** 

(DUT11SX03).

**7. References** 

334.

532.

Fig. 11. Comparison of speed control curves using different schemes

Fig. 12. Speed control curve for step type

### **5. Conclusions**

This chapter proposes a time-delay recurrent neural network (TDRNN) with better performance in memory than popular neural networks by employing the time-delay and recurrent mechanism. Subsequently, the dynamic recurrent back propagation algorithm for the TDRNN is developed according to the gradient descent method. Furthermore, to train neural networks more efficiently, we propose three criterions of selecting proper learning rates for the dynamic recurrent back propagation algorithm based on the discrete-type Lyapunov stability analysis. Besides, based on the TDRNN model, we have described, analyzed and discussed an identifier and an adaptive controller designed to identify and control nonlinear systems. Our numerical experiments show that the TDRNN has good effectiveness in the identification and control for nonlinear systems. It indicates that the methods described in this chapter can provide effective approaches for nonlinear dynamic systems identification and control.
