Design and Implementation of Sugeno Controller

6
Design and implementation of Sugeno controller for Inverted Pendulum on a Cart system Ali Poorhossein Control and automation laboratory Engineering school Ferdowsi University of Mashhad Mashhad, Iran [email protected] Ali Vahidian-Kamyad Engineering and mathematical school Ferdowsi University of Mashhad Mashhad, Iran [email protected] Abstract—Nowadays simple and executable controllers that can control many complex processes are more popular, remarkable and justifiable. Studying and designing such controllers for inverted pendulum system is a prominent way to prove the controllers performance. Inverted pendulum system is a classic system in most control laboratories. The system structure, totally, consists of a cart and a pendulum hinged to the moving cart via a pivot. The basic problem in an inverted pendulum system is stabilizing pendulum angle. The system equations are non-linear and non-minimum phase and thereby, the relation between the force to the cart and the angle of pendulum is not easily calculable. Also, the stabilization of cart position should be checked. In many cases the system with controller is not executable. In this paper, a simple implementable controller will be proposed for inverted pendulum on a cart system to stabilize both pendulum angle and cart position. Firstly, the force to the cart is obtained by using feedback linearization method and system dynamic. Then, it will be converted to a fuzzy controller based on Taylor series. In comparison with other controllers, it is more fluent and executable. Simulation and experimental results evaluate the controller performance. Keywords—Feedback linearization method, Fuzzy Sugeno controller, Inverted Pendulum on a Cart system I. INTRODUCTION Nowadays simple and executable controllers that can control many complex processes are more popular, remarkable and justifiable. Studying and designing such controllers for inverted pendulum system is a prominent way to prove the controllers performance. The reason behind such extensive studies of the pendulum relies behind the fact that many important engineering systems can be approximately modeled as pendulum. For example, in thrust vectored rocket control, the pitch dynamics of a rocket can be approximated by a simple pendulum. In robot systems, the relation is pertinent with inverted pendulum systems. In biomechanics, the pendulum is used to model bipedal dynamic walking. The pendulums are also used in the study of wheeled motion and balancing mechanisms [1]. Many challenging control algorithms have been tested with the inverted pendulum system. These controllers are from classical control theories [2-8] to intelligent control algorithms [1][9-15] and hybrid control methods [8][15][16]. The pendulum is a reasonably simple system, but the physical models all have their peculiarities with regard to friction, dead band and other nonlinearities. These characteristics are common cause for obstacles to the control system, which are not always simple to overcome. So, just some of these controllers can be implemented [1][3][8][11-13]. Figure 1. Collage showing the physical inverted pendulum on cart system The inverted pendulum to be discussed in this paper is an inverted pendulum on cart. It consists of a cart and a pendulum hinged to the moving cart via a pivot and only the cart is actuated (Fig. 1.). This system is nonlinear, unstable, non minimum phase and under actuated. Many parasitic effects exist such as friction, elastic modes of rod and shaft, backlash effects of gears and belts, together with input saturation. In this paper, a simple implementable controller is proposed for inverted pendulum on a cart system. The task is to control both pendulum angle and cart position by using Fuzzy Sugeno controller (FSC). The FSC converts non-linear system to a set of nonlinear subsystems that they have much simpler structures. So the mathematical analysis is more feasible and the stability analysis has been presented in the literature. To - 641 - SISY 2010 • 2010 IEEE 8th International Symposium on Intelligent Systems and Informatics • September 10-11, 2010, Subotica, Serbia 978-1-4244-7395-3/10/$26.00 ©2010 IEEE

Transcript of Design and Implementation of Sugeno Controller

Page 1: Design and Implementation of Sugeno Controller

Design and implementation of Sugeno controller for Inverted Pendulum on a Cart system

Ali Poorhossein Control and automation laboratory

Engineering school Ferdowsi University of Mashhad

Mashhad, Iran [email protected]

Ali Vahidian-Kamyad Engineering and mathematical school

Ferdowsi University of Mashhad Mashhad, Iran

[email protected]

Abstract—Nowadays simple and executable controllers that can control many complex processes are more popular, remarkable and justifiable. Studying and designing such controllers for inverted pendulum system is a prominent way to prove the controllers performance. Inverted pendulum system is a classic system in most control laboratories. The system structure, totally, consists of a cart and a pendulum hinged to the moving cart via a pivot. The basic problem in an inverted pendulum system is stabilizing pendulum angle. The system equations are non-linear and non-minimum phase and thereby, the relation between the force to the cart and the angle of pendulum is not easily calculable. Also, the stabilization of cart position should be checked. In many cases the system with controller is not executable. In this paper, a simple implementable controller will be proposed for inverted pendulum on a cart system to stabilize both pendulum angle and cart position. Firstly, the force to the cart is obtained by using feedback linearization method and system dynamic. Then, it will be converted to a fuzzy controller based on Taylor series. In comparison with other controllers, it is more fluent and executable. Simulation and experimental results evaluate the controller performance.

Keywords—Feedback linearization method, Fuzzy Sugeno controller, Inverted Pendulum on a Cart system

I. INTRODUCTION Nowadays simple and executable controllers that can control many complex processes are more popular, remarkable and justifiable. Studying and designing such controllers for inverted pendulum system is a prominent way to prove the controllers performance. The reason behind such extensive studies of the pendulum relies behind the fact that many important engineering systems can be approximately modeled as pendulum. For example, in thrust vectored rocket control, the pitch dynamics of a rocket can be approximated by a simple pendulum. In robot systems, the relation is pertinent with inverted pendulum systems. In biomechanics, the pendulum is used to model bipedal dynamic walking. The pendulums are also used in the study of wheeled motion and balancing mechanisms [1]. Many challenging control algorithms have been tested with the inverted pendulum system. These controllers are from

classical control theories [2-8] to intelligent control algorithms [1][9-15] and hybrid control methods [8][15][16]. The pendulum is a reasonably simple system, but the physical models all have their peculiarities with regard to friction, dead band and other nonlinearities. These characteristics are common cause for obstacles to the control system, which are not always simple to overcome. So, just some of these controllers can be implemented [1][3][8][11-13].

Figure 1. Collage showing the physical inverted pendulum on cart system

The inverted pendulum to be discussed in this paper is an inverted pendulum on cart. It consists of a cart and a pendulum hinged to the moving cart via a pivot and only the cart is actuated (Fig. 1.). This system is nonlinear, unstable, non minimum phase and under actuated. Many parasitic effects exist such as friction, elastic modes of rod and shaft, backlash effects of gears and belts, together with input saturation. In this paper, a simple implementable controller is proposed for inverted pendulum on a cart system. The task is to control both pendulum angle and cart position by using Fuzzy Sugeno controller (FSC). The FSC converts non-linear system to a set of nonlinear subsystems that they have much simpler structures. So the mathematical analysis is more feasible and the stability analysis has been presented in the literature. To

- 641 -

SISY 2010 • 2010 IEEE 8th International Symposium on Intelligent Systems and Informatics • September 10-11, 2010, Subotica, Serbia

978-1-4244-7395-3/10/$26.00 ©2010 IEEE

Page 2: Design and Implementation of Sugeno Controller

achieve real-time control an AVR-board (Automatic Voltage Regulator-board) and a PC (personal computer) are used to stabilize Inverted Pendulum system. Experimental studies evaluate the FSC performance. The rest of this paper is organized as follows. Section II presents a solution to stabilize inverted pendulum system with the associated nonlinear force to the cart and Sugeno controller. Section III presents the results in two part of simulation and implementation of controller for inverted pendulum system and analysis. Section IV concludes and highlights the future works.

II. SOLUTION

A. Mathematical model of the inverted pendulum on cart The inverted pendulum on cart system shown in Fig. 2 is composed of a cart and a pendulum. The pendulum is hinged to the cart via a pivot and only the cart is actuated.

Figure 2. The inverted pendulum on cart system

Table 1 shows the system parameters and experimental values.

parameter Definition Experimental values

θ pendulum angle (rad) ,

6 6π π⎛ ⎞−⎜ ⎟

⎝ ⎠

x cart position (m) 1m±M mass of the cart

(kg) 0.5 kg.

m mass of the pendulum (kg)

0.3 kg

l distance from the turning center to center of mass of the pendulum (m)

0.6 m

b cart's friction coefficient (kg/s)

0.1 / / secN m

F force applied to the cart (N)

2N±

I Inertia of pendulum 20.006kg m×

The equations of motion are

( ) ( ) ( )( ) ( ) ( )

2

2

sin cos 0

cos sin

I ml mgl mlx

M m x bx ml ml F

θ θ θ

θ θ θ θ

+ + + =

+ + + − = The nonlinear state equation can be derived by Lagrange's equations is

.

1 2x x=

( )( )( )

( )( )( )

( ) ( )

12

2 11

24 2 1

1

coscos

sin

tan

M m I mlx ml x

ml x

bx mlx x

g M m x F

−⎛ ⎞+ +⎜ ⎟= −⎜ ⎟⎝ ⎠⎧ ⎫− +⎪ ⎪×⎨ ⎬+ + +⎪ ⎪⎩ ⎭

.

3 4x x=

( ) ( )( )( )( )

( ) ( )( )

121

4 2

24 2 1

2 21 1

2

cos

sin

cos sin

ml xx M m

I ml

bx mlx x

m l g x xF

I ml

−⎛ ⎞⎛ ⎞⎜ ⎟⎜ ⎟= + −⎜ ⎟⎜ ⎟+⎝ ⎠⎝ ⎠⎧ ⎫− +⎪ ⎪

×⎨ ⎬+ +⎪ ⎪+⎩ ⎭

Where 1 2 3 4, , x, xx x x xθ θ= = = = are selected as state Stabilizing Controller variables and the input is the applied force F.

B. Applied force to cart To stabilize 1 2and x x in equation 1, feedback linearization method has been used. The force u is obtained as follows:

21 2 1

1 1

1 2

-(( ) tan( ) sin( )) - ( cos( )) - (( ) / cos( ))

(5 )

u M m g x mlx xml x M m l xx x

= + ++

+

Base on equations 2 and 3, two first parts of equations 2 convert to

.

1 2.

2 1 25

x x

x x x

=

= − −

The equation 4 is linear and stable. So, 1x and 2x will converge to zero. Then, to stabilize all states in equation 1, based on the resister roles of friction and distance of cart from zero, coefficients of

3x and 4x are added to equation 3. Total force to the cart is obtained as follows [14]:

( ) ( ) ( )

( )( ) ( )

( ) ( )

24 1 2 1

2

1 1 2 31

2 tan sin

cos 5 0.5cos

u bx M m g x mlx x

M m I mlml x x x x

ml x

= − − + −

⎡ ⎤+ +⎢ ⎥− − + −⎢ ⎥⎣ ⎦

(2)

(1)

(3)

(4)

(5)

Table 1. System parameters and experimental

A. Poorhossein and A. Vahidian-Kamyad • Design and Implementation of Sugeno Controller for Inverted Pendulum on a Cart System

- 642 -

Page 3: Design and Implementation of Sugeno Controller

C. Sugeno controller Equation 5 is nonlinear. Implementation of such forces is complex and expensive. Also, the system with minimum uncertainty will be unstable. The purpose is to convert equation 5 to a feasible and more executive force. In this part, equation 3 will be converted to a Fuzzy Sugeno controller (FSC) to implement obtained force to the inverted pendulum system. Based on Sugeno structure, membership functions are defined as Zero, Positive Small, Positive Big, Negative Small and Negative Big for all four states (figures 3 to 6).

Figure 3. Membership function of θ

Figure 4. Membership function of θ

Figure 5. Membership function of x

Figure 6. Membership function of x

Based on membership functions 3 to 6, 5 5 5 5 625× × × = rule bases can be considered. For example “If theta is Zero, θ is Zero, x is Zero, x is PS Then …”. Because majority of rule bases are unacquired, not happened or conflict with each other, 169 rule bases will be enough. Second terms of fuzzy rule bases are obtained by linearizing equation no. 1 around central point of each membership functions based on Taylor series by

( ) ( ) ( )

( ) ( ) ( )

0 0

0 0 0 0 0 0

1 2 3 4 1 1 2 21 2

3 3 4 4 1 2 3 43 4

, , ,

, , ,

linearizedu uu x x x x x x x xx x

u ux x x x u x x x xx x

∂ ∂= − + −∂ ∂

∂ ∂+ − + − +∂ ∂

Because the linearized spaces are small, set of subsystems are equal to basic nonlinear system (Eq. 1). Based on the equation no.1, 3 4and x x are linear. Therefore, the fuzzy rule bases decrease from 625 to 25 rule bases. Some rule bases never happen or they conflict with each other. So, 13 rule bases are considered as follows:

1– If theta is Zero, θ is Zero Then

1 1 22.61 0.85u x x= − + 2– If theta is Zero, θ is Zero Then

2 1 2 42.61 0.85 0.2 0.05u x x x= − + − + …

13– If theta is PB, θ is Zero Then

13 1 2 3 42.1876 0.9558 4.32 0.4785 3.3422

u x x x x= − + − ++

Because of confliction between rule bases, defuzzification method is used to obtain output u. Firstly value factors for each sentence of each predicate are defined as follows.

,

, ...i i

i i

If theta is PB Dtheta is PB

x is PB and Dx is PB THENα β

γ λ

Value of each predicate is obtained by i i i iα β γ λ× × × . Numeric values of , , ,i i i iα β γ λ are equal to values of each inputs in fuzzy sets. For example in Fig. 7 value of 1α is 0.3 and value of 2α is 0.8 and the others are zero.

Figure 7. Numeric value of , , ,i i i iα β γ λ

Finally, the applied force to the cart is obtained as follows:

13

113

1

i i i i ii

i i i ii

uU

α β γ λ

α β γ λ

=

=

=∑

(7)

(6)

- 643 -

SISY 2010 • 2010 IEEE 8th International Symposium on Intelligent Systems and Informatics • September 10-11, 2010, Subotica, Serbia

Page 4: Design and Implementation of Sugeno Controller

D. Stabilization of FSC With the suggested FSC in II.c and the value of table 1, maximum of 25 subsystems were suggested. To prove the stabilization of FSC, firstly, each subsystem is linearized about its central point. Then matrixes A for each 25 linear subsystems have been calculated. The eigenvalues of matrixes A, with the values in table 1, are all negative for each 25 linear subsystems. Therefore, the FSC can stabilize the inverted pendulum system in the area of balancing position. The eigenvalues of matrixes A will remain negative with uncertainty about 2 degrees in θ and 5 cm in x [14].

III. RESULT

A. Simulation results Fig. 8 and 9 describe simulation results for system with

Sugeno controller for initial value of ( ).

1 0.5 ,x rad=

( ). . .

2 3 40.1 , 0.1 , 0.1sec secrad mx x m x⎛ ⎞ ⎛ ⎞= = = −⎜ ⎟ ⎜ ⎟

⎝ ⎠ ⎝ ⎠

for 30 seconds.

Figure 8. and θ θ of system with controller

Figure 9. and x x of system with controller

Figure 10. Applied force to the cart

As indicated in Fig. 8 and 9 the system with controller is stable. Also, the applied force to the cart is bounded (Fig. 10.).

B. Experimental results The experimental setup is shown in Fig. 1. The system consists of an inverted pendulum on a cart and an AVR micro-controller. It can be used a personal computer (PC) with AVR micro-controller to increase sampling time. Also graphical user interface (GUI) toolbox of MATLAB has been used to implement controller. AVR (or GUI) controller inputs are pendulum angle and cart position. AVR (GUI) controller Output is pulse width modulation (PWM) signals for motor derivers. The inverted pendulum can fall in two directions, since the contact between the pendulum and the cart is almost frictionless. The cart is actuated by direct current (dc) motor through timing belts (Fig. 1.). Loose tension of timing belts yields nonlinearities such as backlash. The experimental values are shown in Table 1. The dc motors, driven by a driver commanded from the AVR micro controller and parallel port of PC, actuate the axes of the table. The pendulum angle is measured by variable resistor that is attached to pendulum. Movement of the cart in each axis is also sensed by a variable resistor. Sampling period of process is about 0.01s. First, balancing the inverted pendulum at a commanded position is tested. The cart is required to stay at the origin 0 m and the pendulum stay at 0 degree. While the pendulum system is in (0,0) the PWM is zero and the DC motor is off. The results of balancing the pendulum at a desired position and degree are shown in Figs. 11-14. The results for initial states as ( ) ( )

. . . .

1 2 3 40.1 , 0 , 0 , 0sec secrad mx rad x x m x⎛ ⎞ ⎛ ⎞= = = =⎜ ⎟ ⎜ ⎟

⎝ ⎠ ⎝ ⎠ are

( )radθ

Figure 11. θ of system with controller

Figure 12. x of system with controller

Sampling time (20 seconds)

( )x cm

Sampling time 20(seconds)

A. Poorhossein and A. Vahidian-Kamyad • Design and Implementation of Sugeno Controller for Inverted Pendulum on a Cart System

- 644 -

Page 5: Design and Implementation of Sugeno Controller

Figure 13. Applied force to the cart

C. Analysis Simulation shows that our controller can greatly enhance the stability of the inverted pendulum system. In addition, our experimental results justify the simulation results. In theory, θ can vary between ( )90 ,90− , but, experimentally, based on some limitations such as dc motor saturation and sensors uncertainty, it reduced to ( )30 ,30− . It can be increased by using a more powerful dc motor and encoder instead of variable resistor.

The applied force to the cart is linear and easy to implement to the system using AVR micro controller. Thereby the suggested FSC in this paper is simplified and the RAM (read access memory) requirements are reduced. In comparison with some other controllers, the suggested FSC can be implemented to the system conveniently [11-13]. It is known that as the number of rule bases increase, fuzzy control becomes smoother. In the experimental result we use 13 rule bases. The efficiency and smoothness of FSC can be improved by increasing the number of rule bases (Table 2). Stabilization of both x and θ was proved bye stabilization of each linear equivalent systems. Also, the applied force to the cart is bounded and small. So, it is suitable to apply to a DC motor. Some other controllers could not be implemented [3-6, 8-10].

IV. CONCLUSION Three critical issues in inverted pendulum controllers are classic, intelligent and hybrid controllers. Fuzzy controller in

Figure 14. Trajectory tracking pictures

this paper offers an efficient solution to stabilize inverted pendulum dealing with state spaces equations. The discussed sugeno controller in this paper stabilized both pendulum angle and cart position. First, the force to the cart was suggested by feedback linearization method and system dynamic. Then, it converted to a fuzzy controller based on Taylor series. Specifically, simplicity and potency of FSCs enable controllers to be implemented in real environments. Although the system we have studied so far is standard benchmark task, the discussed controller has shown encouraging results. The work reported here only marks the beginning of our study into the complex and nonlinear systems domain. While it can be implemented to the other real systems by using just an AVR micro-controller, it will remain a challenge to maintain the robustness and adaptability of the proposed FSC in this paper in more complex real-world problems. Our future work in control, welding and CNC laboratories of Ferdowsi University of Mashhad will include the development such controllers that can cope with a variety of complex and dynamic situations.

No. of rule bases 10 experimental

13 experimental

17 experimental

25 experimental

13 simulation

Settling time of θ 20 sec 17 sec 15 sec 14 sec 10 sec Settling time of x 20 sec 17 sec 15 sec 14 sec 10 sec Uncertainty of θ 0 1about ± 2about ± 2about ± 2about ± Uncertainty of x 0 2about cm± 2about cm± 2about cm± 5about cm±

Stable confine of θ 20± 30± 45± 55± 90±

( )u N

Sampling time (20 seconds)

Table 2. System result for different number of rule bases

- 645 -

SISY 2010 • 2010 IEEE 8th International Symposium on Intelligent Systems and Informatics • September 10-11, 2010, Subotica, Serbia

Page 6: Design and Implementation of Sugeno Controller

ACKNOWLEDGMENT The authors would like to thank control, welding and CNC laboratories of Ferdowsi university of Mashhad providing opportunity to implement inverted pendulum system with designed controller.

REFERENCES [1] Mohamed I. El-Hawwary, A. L. Elshafei, H. M. Emara, and H. A. Abdel

Fattah, “Adaptive Fuzzy Control of the Inverted Pendulum Problem”, IEEE Transactions on Control Systems Technology, pp. 1135-1144, November. 2006.

[2] Taworn Benjanarasuth and Songmoung Nundrakwang, “Hybrid Controller for Rotational Inverted Pendulum Systems”, SICE Conference, pp. 1889-1894, August. 2008.

[3] Awhan Patnaik1 and L. Behera, “Evolutionary Multiobjective Optimization Based Control Strategies For An Inverted Pendulum On A Cart”, IEEE Congress on Evolutionary Computation, pp. 3141-3147, 2008.

[4] Samatthachai Panya, Taworn Benjanarasuth, “Hybrid Controller for Inverted Pendulum System”, International Symposium on Communications and Information Technologies, pp. 385-388, 2008.

[5] Ahmad Al-Jarrah and Atef Fahim, “New Robust Controller Design For Multivariable Control Systems”, IEEE conference. 2008.

[6] Emanuel Todorov and Weiwei Li, “A generalized iterative LQG method for locally-optimal feedback control of constrained nonlinear stochastic systems” , American Control Conference, pp. 300-306, June. 2005.

[7] Heide Brandtst and Martin Buss, “Control of Electromechanical Systems using Sliding Mode Techniques”, Proceedings of the 44th IEEE Conference on Decision and Control, and the European Control Conference, pp. 1947-1952, December. 2005.

[8] Ratchatin Chanchareon, Viboon Sangveraphunsiri, and Supavut Chantranuwathana, “Tracking Control of an Inverted Pendulum”, RAM conference, 2006.

[9] Arbin Ebrahim and Gregory V. Murphy, “Adaptive Backstepping Controller Design of an Inverted Pendulum”, IEEE conference, 2005.

[10] Tahar Bouarar, Kevin Guelton, Noureddine Manamanni and Patrice Billaudel, “Stabilization of Uncertain Takagi-Sugeno Descriptors: A Fuzzy Lyapunov Approach” ,16th Mediterranean Conference on Control and Automation, pp. 1616-1621, June. 2008.

[11] Jin Seok Noth, Geun Hyeong Lee , and Seul Jung, "Position control of a mobile inverted pendulum using radial basis function" International Joint Conference on Neural Networks (IJCNN 2008), pp. 370-376, 2008.

[12] Jeng-Hann Li, Tzuu-Hseng S. Li, Meng-Che Tsai, “Design and Implementation of Dynamic Weighted Fuzzy Sliding-Mode Controller for an FPGA-based Inverted Pendulum Car”, Proceedings of the 2003 IEEEI/ASME lnterational Conference on Advanced Intelligent Mechatronics(AIM 2003), pp. 628-633. 2003.

[13] Fu Wei, Giang Liangzhong, Yang Jin Bian Qingqing, “Inverted Pendulum Control System Based on GA Optimization”, Workshop on Intelligent Information Technology Application, pp. 347-350, 2007.

[14] A.Poorhossein and A.Vahidiyan-K, “Design of Sugeno Controller for both Inverted Pendulum’s angel and cart’s position using feedback linearization”. 3th joint conference on Fuzzy systems and Artificial intelligences, pp. 1344-1349, July. 2009. (In Persian)

[15] Sheng Qiang, Qing Zhou, X. Z. Gao and Shuanghe Yu, “ANFIS Controller for Double Inverted Pendulum”, The IEEE international conference on Industrial Informatic, pp. 475-480, July. 2008

[16] Baojiang Zhao and Shiyong Li, “Design of a Fuzzy Logic Controller by Ant Colony Algorithm with Application to an Inverted Pendulum System”, IEEE International Conference on Systems, Man, and Cybernetics, pp. 3790-3794, October. 2006.

A. Poorhossein and A. Vahidian-Kamyad • Design and Implementation of Sugeno Controller for Inverted Pendulum on a Cart System

- 646 -