A method of sliding mode control of cart and pole system

This paper presents a method of using Sliding Mode Control (SMC) for Cart and Pole system. The stability of controller is proved through using Lyapunov function and simulations. A genetic algorithm (GA) program is used to optimize controlling parameters. The GA-based parameters prove good-quality of control through Matlab/Simulink Simulation.


INTRODUCTION
Cart and Pole system is a popular classical non-linear model used in most laboratories in universities for testing controlling algorithm.Morever, it is a SIMO system in which just one input control must stabilize two outputs: position of cart and angle of pendulum.Many control algorithms were proved to work well on this model [1].
Beside other kinds of control, the nonlinear control, especially Sliding Mode Control (SMC), depends on nonlinear structure of system.So, the stability of system is ensured.Cesar Aguilar [2] set new variable including both Cart's position and Pendulum's angle, neglecting some components in calculating and trying to transform dynamic equation to appropriate form.But it just operated well when the neglected component was not remarkable.Reference [3] introduced other way to set sliding mode for a similar model, the Rotary Inverted Pendulum but did not prove the stability by mathematical methods.Reference [4] and [5] respectively introduced integral SMC and hierarchial SMC applied for Cart and Pole system.But [4] did not prove stability by mathematics or examples in Matlab/Simulink.This paper presents a new and simple SMC for Cart and Pole system.First, different sliding surfaces are presented.Then, a positive Lyapunov function is set to include both sliding surfaces.A nonlinear way is set to make this function to zero when operating system.After proving stability of controller, GA program is used to optimize controlling parameters.

CART AND POLE SYSTEM
Trang 168 The studied system in Fig. 1 is a cart of which a rigid pole is hinged.The cart is free to move within the bounds of a one-dimensional track.The pole can move in the vertical plane parallel to the track.The controller can apply a force to the cart parallel to the track.Lagragian equations are: with vector of state variables Potential energy of system: 0 1 1 1 1 cos P P P m gl q = + = (3) Lagrangian operator: L T P m q J q m q q l q m gl q Lagrangian for motion of cart: (5) Lagrangian for rotating motion of pendulum: Solve ( 5) and (6), system dynamic equations are: cos sin cos 2 sin cos cos sin cos sin sin sin m m q ml q q q q F b q J q ml q q q q q ml q q q q q m q l q q mq q l q m gl q bq We can transfrom (7) to the form: Parameters of system is used from the real system in [6], but taking away the second link of the doublelinked Inverted Pendulum to have a Single-linked Inverted Pendulum on Cart (Cart and Pole system).Values of parameters are listed in Table 1.

SLIDING MODE CONTROL
Sliding surfaces are chosen as: Choosing Lyapunov function: With Choosing u that makes: 15) and ( 18), we have: In ( 13 After generating V  in ( 12), we choose control signal u that makes 0 V   in (18).Finally, (19) shows the appropriate control signal u.From ( 14), ( 18

GENETIC ALGORITHM
Stability characteristic of the system is proved in Section 3.With a random parameters of controller like chosen in three examples in Section 5, we have the simulation results are shown in Fig. 4, Fig. 5, Fig. 6.
As in these figures, the cart's position is stable eventhough quality of control is not so good and the Pendulum's angle is not completely stable but it is not unstable.The force on Cart chatters because of using function sign() in controller.So, genetic algorithm (GA) is used here to optimize control parameters.e q  , 2 1 e q  and n is number of samples in one time of simulation.If the controller can stabilize system well, function J will be very small.
In this case, we operate Simulink program of simulating system in 10s, with sample-time is 0.01s.So, we have n = 1001 sample.
After 94 generation, the result is

Using random controlling parameters
In order to test the stability of system, we can choose some values of 1 samples are randomly chosen as: Choosing initial values of variables are chosen as: In Fig. 4, the cart's position is stable eventhough quality of control is not so good.In Fig. 5, the pendulum's angle is not completely stable but it is not unstable.In Fig. 6, the force on cart chatters because of using function sign() in controller.The SMC algorithm ensures the stability of system but quality is not so good.(m); q    (rad/s), and the results of simulation are shown from Fig. 7 to Fig. 13.The cart's position and pendulum's angle move to balancing point after 10s and 2.2s, respectively.In Fig. 9, control signal still chatters but with smaller amplitude than in Fig. 6.Through Fig. 7 to Fig. 8, the variables are proved to stabilized quickly.Fig. 10 and Fig. 11 show the robust characteristics of SMC.Fig. 9 proves the chattering of signal control descreases but not be exterminated.Morever, two sliding surfaces s1 and s2 are proved to be stabilized quickly in just 3s in Fig. 12 and Fig. 13.

CONCLUSION
This paper presented a new way of SMC to control Cart and Pole system.The stability of controller was proved through Lyapunov setting and random examples.Anyway, the stability of system was ensured but quality of controller was not ensured.To overcome the difference in choosing controlling parameters, one GA program was used to search the optimized controlling parameters.The controller with these parameters worked well in Simulation.

Figure 1 :
Figure 1: Cart and Pole system In this case, GA used is off-line.Parameters for GA program are listed as below:

Figure 2 :
Figure 2: Block diagram of GA program With 1

Figure 4 :Figure 5 :Figure 6 :
Figure 4: Position of Cart (m) when control parameters are random

Table 1 :
Real System parameters