A method of sliding mode control of cart and pole system

Bài báo trình bày một phương pháp sử dụng giải thuật điều khiển trượt (SMC) cho hệ con lắc ngược trên xe. Độ ổn định hệ thống của bộ điều khiển được chứng minh thông qua hàm Lyapunov và các kết quả mô phỏng. Một chương trình tính toán áp dụng giải thuật di truyền (GA) được sử dụng để tối ưu hóa các thông số điều khiển.

pdf7 trang | Chia sẻ: linhmy2pp | Ngày: 17/03/2022 | Lượt xem: 273 | Lượt tải: 0download
Bạn đang xem nội dung tài liệu A method of sliding mode control of cart and pole system, để tải tài liệu về máy bạn click vào nút DOWNLOAD ở trên
TAÏP CHÍ PHAÙT TRIEÅN KH&CN, TAÄP 18, SOÁ K6- 2015 A method of sliding mode control of cart and pole system . Nguyen Van Dong Hai1 . Nguyen Minh Tam2 . Mircea Ivanescu1 1 University of Craiova, Romania 2 Ho Chi Minh City University of Technology and Education, Vietnam (Manuscript Received on July 15, 2015, Manuscript Revised August 30, 2015) ABSTRACT This paper presents a method of using program is used to optimize controlling Sliding Mode Control (SMC) for Cart and Pole parameters. The GA-based parameters system. The stability of controller is proved prove good-quality of control through through using Lyapunov function and Matlab/Simulink Simulation. simulations. A genetic algorithm (GA) Keywords: Sliding Mode Control, Cart and Pole, Inverted Pendulum, Genetic Algorithm, Matlab/Simulink. 1. INTRODUCTION Cart and Pole system is a popular classical way to set sliding mode for a similar model, the non-linear model used in most laboratories in Rotary Inverted Pendulum but did not prove the universities for testing controlling algorithm. stability by mathematical methods. Reference [4] Morever, it is a SIMO system in which just one and [5] respectively introduced integral SMC and input control must stabilize two outputs: position hierarchial SMC applied for Cart and Pole system. of cart and angle of pendulum. Many control But [4] did not prove stability by mathematics or algorithms were proved to work well on this examples in Matlab/Simulink. model [1]. This paper presents a new and simple SMC Beside other kinds of control, the nonlinear for Cart and Pole system. First, different sliding control, especially Sliding Mode Control (SMC), surfaces are presented. Then, a positive Lyapunov depends on nonlinear structure of system. So, the function is set to include both sliding surfaces. A stability of system is ensured. Cesar Aguilar [2] nonlinear way is set to make this function to zero set new variable including both Cart’s position when operating system. After proving stability of and Pendulum’s angle, neglecting some controller, GA program is used to optimize components in calculating and trying to transform controlling parameters. dynamic equation to appropriate form. But it just 2. CART AND POLE SYSTEM operated well when the neglected component was not remarkable. Reference [3] introduced other Trang 167 SCIENCE & TECHNOLOGY DEVELOPMENT, Vol.18, No.K6 - 2015 The studied system in Fig. 1 is a cart of which Kinetic energy of system: a rigid pole is hinged. The cart is free to move 1 T =TT + =m q&2 + within the bounds of a one-dimensional track. The 0 12 0 0 (2) pole can move in the vertical plane parallel to the 1 1 +Jq&&&2 + m () q+ q lcos q 2 track. The controller can apply a force to the cart 211 2 1 0 1 1 1 parallel to the track. Potential energy of system: P= P0 + P 1 = mgl 1 1cos q 1 (3) Lagrangian operator: 1 1 L= T - P = m q&&2 + J q 2 + 20 0 2 1 1 1 +m( q&& + q l cos q )2 - m gl cos q 2 1 0 1 1 1 1 1 1 (4) Lagrangian for motion of cart: Figure 1: Cart and Pole system d L   L    F  b0 q 0 dt q  q Lagragian equations are: 0  0 (5) d L   L Lagrangian for rotating motion of pendulum:     Qp (1) dt q   q d L   L (6)     b1 q 1 dt q  q q0  1  1 with vector of state variables q    q1  Solve (5) and (6), system dynamic equations are: mmqmlq010111    cos qq 11   sin q 1  Fbq  00   2 2 2 2 2 Jqmlq11111 cos q 1  2 q  1 sin q 1 cos q 1  mlq 110  cos qqq 101    sin q 1  mql 111  cos q 1 sin q 1  (7)  mqql1 0  1 1sin q 1  mgl 1 1 sin q 1  bq 1  1 We can transfrom (7) to the form:  x1 x 2   x2 f 1()() x  g 1 x u TT  with x x1 x 2 x 3 x 4   q 0 q 0 q 1 q  1  (8)   x3 x 4  x4 f 2()() x  g 2 x u And , , , defined as below: f1() x f2 () x g1() x g2 () x 2 2 3 2 2 2 2 Jbx102  glm 11cossin x 1 xlmx 1114  cos x 3 sin xblmx 30112  cos x 3     Jlmxsin xblmq  cos x  lmx3 2 2 cos x sin x 1114 31111 3 114 3  3   (9) f1 () x  2 2 m0 m 1 l 1cos ( x 3 )  J 1 m 0  J 1 m 1 Trang 168 TAÏP CHÍ PHAÙT TRIEÅN KH&CN, TAÄP 18, SOÁ K6- 2015 2 2 J1 l 1 m 1cos x 3 g1 () x  2 2 (10) m0 m 1 l 1cos ( x 3 )  J 1 m 0  J 1 m 1 2 2 2 2 2 2 glm11sin x 3114104114 bmx  bmx  lmx cos x 3 sin x 3114  lmx cos x 3 sin x 3   2 2  blmx0112cos x 3  glmm 101 sin x 31014  lmmx cos x 3 sin x 3  f2() x  2 2 (11) m0 ml 1 1cos ( x 3 ) J 1 m 0  J 1 m 1 l1 m 1cos x 3 g2() x  2 2 (12) m0 ml 1 1cos ( x 3 ) J 1 m 0  J 1 m 1 Parameters of system is used from the real system in [6], but taking away the second link of the double- linked Inverted Pendulum to have a Single-linked Inverted Pendulum on Cart (Cart and Pole system). Values of parameters are listed in Table 1. Table 1: Real System parameters Parameter Unit Definition Value m 0 Kg Mass of cart 0.033 m1 Kg Mass of first pendulum 1.999 L1 M Length of first pendulum 0.2 l 1 M Distance between center and rotating axis of first pendulum 0.115 2 J1 kgm Inertial moment of first pendulum 0.023 g m Gravitation acceleration 9.81 s2 F N Force controlling cart kg Viscous Coefficient of Cart 0.0001 b0 s b1 Nms Viscous Coefficient of Rotating Axis of first inverted pendulum 0.0001 3. SLIDING MODE CONTROL Sliding surfaces are chosen as:  s1 x 1   1 x 2  with 1 const 0and2 const 0 (13) s2 x 3   2 x 4 Choosing Lyapunov function: V s1  3 s 2  0 (14)  V s1sgn s 1  3s  2 sgn s 2  x2  1 x 2sgn s 1   3 x 4   2 x  4 sgn s 2  x1  1 fxgxu 1()  1 ()sgn  s 1  x 3   2 fxgxu 2 ()  2 ()sgn  s 2  ()()x   x u (15) Trang 169 SCIENCE & TECHNOLOGY DEVELOPMENT, Vol.18, No.K6 - 2015 With (x ) 1 sgn sfx 11 ( )   3 sgn sfxxsxs 22 ( )  2134 sgn( )   sgn( 2 ) (16) And (x ) 1 sgn( s 1 ) g 1 ( x )   3 sgn( s 2 ) g 2 ( x ) (17) Choosing u that makes: In this case, GA used is off-line. Parameters  for GA program are listed as below: V 4 0 (18)  Size of population: N=20 So, we choose 4 const 0  Linear Ranking Selection:  0.2 From (15) and (18), we have:  Decimal coding  Two-point crossover 4  ()x  u    (19)  Crossover parameter: 0.8  ()x   Mutation parameter: 0.2 In (13), two sliding surfaces are presented Choose fitness function: with s1includes elements of Cart and s2 includes n n 2 2 (20) J e1()() i    e 2 i  elements of Pendulum. When model is balanced, i1 i  1 s1and s2 will move to zero. In this case, we try to reduce s1 and s2 by setting positive function V in (14). After generating V in (12), we choose control signal u that makes V  0 in (18). Finally, (19) shows the appropriate control signal Figure 2: Block diagram of GA program u. From (14), (18), we have: V  0 and VV  0 With e1 q 0 , e2 q 1 and n is number of . So, V t  0 . From (14), we have: t t samples in one time of simulation. If the controller s 0 and s 0 . 1 2 can stabilize system well, function J will be very 4. GENETIC ALGORITHM small. Stability characteristic of the system is In this case, we operate Simulink program of proved in Section 3. With a random parameters of simulating system in 10s, with sample-time is controller like chosen in three examples in Section 0.01s. So, we have n = 1001 sample. 5, we have the simulation results are shown in Fig. After 94 generation, the result is   5.84 ; 4, Fig. 5, Fig. 6. 1 ; ; and the fitness 2  0.06 3  7.42 4  9.84 As in these figures, the cart’s position is function is J 0.8677. 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. Trang 170 TAÏP CHÍ PHAÙT TRIEÅN KH&CN, TAÄP 18, SOÁ K6- 2015 cart chatters because of using function sign() in controller. The SMC algorithm ensures the stability of system but quality is not so good. Figure 4: Position of Cart (m) when control parameters are random Figure 5: Angle of Pendulum (rad) when control parameters are random Figure 3: Flow chart of GA Searching process 5. SIMULATION 5.1 Using random controlling parameters In order to test the stability of system, we can Figure 6: Force on Cart (N) when control parameters are random choose some values of 1 ; 2 ; 3 ; 4 . Three 5.2 Using controlling parameters from GA samples are randomly chosen as: program  Example 1: By using GA program in Chapter 4, we have: 1  5.84 2  0.06 3  7.42  4  9.84 1 1; 2 1; 3 1; 4 1 ; ; ; .  Example 2: Choosing initial values of variables are q  0 .1 q   0.1 0 _ in it (m); 0 _ in it (m/s); 1 10; 2 10; 3 10; 4 10 q  0 .1 q  0 .1 1 _ init (rad); 1 _ init (rad/s), and  Example 3: the results of simulation are shown from Fig. 7 to Fig. 13. The cart’s position and pendulum’s angle  1;   2 ;  3;   4 1 2 3 4 move to balancing point after 10s and 2.2s, Choosing initial values of variables are respectively. In Fig. 9, control signal still chatters chosen as: q  0 .1 (m), q   0.1 0 _ in it 0 _ in it but with smaller amplitude than in Fig. 6. Through (m/s), (rad), (rad/s), q1 _ init  0 .1 q1 _ init  0 .1 Fig. 7 to Fig. 8, the variables are proved to the simulation results are shown in Fig. 4, Fig. 5, stabilized quickly. Fig. 10 and Fig. 11 show the Fig. 6. robust characteristics of SMC. Fig. 9 proves the In Fig. 4, the cart’s position is stable chattering of signal control descreases but not be eventhough quality of control is not so good. In exterminated. Morever, two sliding surfaces s1 Fig. 5, the pendulum’s angle is not completely and s are proved to be stabilized quickly in just 3s stable but it is not unstable. In Fig. 6, the force on 2 in Fig. 12 and Fig. 13. Trang 171 SCIENCE & TECHNOLOGY DEVELOPMENT, Vol.18, No.K6 - 2015 Figure 7: Position of Cart (m) with parameters chosen by GA Figure 8: Angle of Pendulum (rad) with parameters chosen by GA Figure 9: Force on Cart (N) with parameters chosen by GA Figure 12: Sliding surface S1 Figure 10: Position and Velocity of Cart in 20s Figure 13: Sliding Surface S2 Figure 11: Angle and Angle Velocity of Pendulum in 20s Trang 172 TAÏP CHÍ PHAÙT TRIEÅN KH&CN, TAÄP 18, SOÁ K6- 2015 6. CONCLUSION system was ensured but quality of controller was This paper presented a new way of SMC to not ensured. To overcome the difference in control Cart and Pole system. The stability of choosing controlling parameters, one GA controller was proved through Lyapunov setting program was used to search the optimized and random examples. Anyway, the stability of controlling parameters. The controller with these parameters worked well in Simulation. Một phương pháp điều khiển trượt cho hệ con lắc ngược trên xe . Nguyễn Văn Đông Hải1 . Nguyễn Minh Tâm2 . Mircea Ivanescu1 1University of Craiova, Romania 2Đại học Sư Phạm Kỹ Thuật Tp. Hồ Chí Minh, Việt Nam TÓM TẮT Bài báo trình bày một phương pháp sử qua hàm Lyapunov và các kết quả mô phỏng. dụng giải thuật điều khiển trượt (SMC) cho hệ Một chương trình tính toán áp dụng giải thuật con lắc ngược trên xe. Độ ổn định hệ thống di truyền (GA) được sử dụng để tối ưu hóa của bộ điều khiển được chứng minh thông các thông số điều khiển. Từ khóa: Điều khiển trượt, Con lắc ngược trên xe, Giải thuật di truyền, Matlab/Simulink. REFERENCES [1]. Olfar Boubaker, The inverted Pedulum: a [4]. Zhiping Liu, Fan Yu, Zhi Wang, Application fundamental Benchmark in Control Theory of Sliding Mode Control to Design of the and Robotics, pp 1-6, International Inverted Pendulum Control System, Conference on Education and e-Learning International Conference on Electronic Innovations (ICEELI), IEEE, (2012). Measurement & Instrument, ICEMI’ 09, Vol. [2]. Cesar Aguilar, Approximate Feedback 3, pp 801-805, IEEE, (2009). Linearization and Sliding Mode Control for [5]. Dianwei Qian, Jianqiang Yi, and Dongbin the Single Inverted Pendulum, Master Thesis, Zhao, Hierarchical Sliding mode control for a Queen ‘s University, England, (2002). class of SIMO under-actuated systems, [3]. Mojtaba Ahmadieh Khanesar, Mohammad Journal of Control and Cybernetics, Vol. 37, Teshnehlab, Mahdi Aliyari Shoorehdeli, No. 1, (2008). Sliding Mode Control of Rotary Inverted [6]. Tran Vi Do, Nguyen Minh Tam, Ngo Van Pendulum, Proceedings of the 15th Thuyen, Nguyen Van Dong Hai, Some Mediterranean Conference on Control & methods in controlling Double-linked Automation (IEEE), pp 1-6, Greece, (2007). Inverted Pendulum, National Conference in Mechatronics (VCM), Vietnam, (2014). Trang 173

Các file đính kèm theo tài liệu này:

  • pdfa_method_of_sliding_mode_control_of_cart_and_pole_system.pdf