Your SlideShare is downloading. ×
Hh3312761282
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Hh3312761282

47

Published on

International Journal of Engineering Research and Applications (IJERA) is an open access online peer reviewed international journal that publishes research and review articles in the fields of …

International Journal of Engineering Research and Applications (IJERA) is an open access online peer reviewed international journal that publishes research and review articles in the fields of Computer Science, Neural Networks, Electrical Engineering, Software Engineering, Information Technology, Mechanical Engineering, Chemical Engineering, Plastic Engineering, Food Technology, Textile Engineering, Nano Technology & science, Power Electronics, Electronics & Communication Engineering, Computational mathematics, Image processing, Civil Engineering, Structural Engineering, Environmental Engineering, VLSI Testing & Low Power VLSI Design etc.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
47
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Nguyen Thanh Phuong, Ho Dac Loc, Tran Quang Thuan / International Journal of EngineeringResearch and Applications (IJERA) ISSN: 2248-9622 www.ijera.comVol. 3, Issue 3, May-Jun 2013, pp.1276-12821276 | P a g eControl of Two Wheeled Inverted Pendulum Using Silding ModeTechniqueNguyen Thanh Phuong, Ho Dac Loc, Tran Quang ThuanHo Chi Minh City University of Technology (HUTECH) VietnamAbstractIn this paper, a controller via slidingmode control is applied to a two-wheeled invertedpendulum, which is an inverted pendulum on amobile cart carrying two coaxial wheels. Thecontroller is developed based upon a class ofnonlinear systems whose nonlinear part of themodeling can be linearly parameterized. Thetracking errors are defined, then the slidingsurface is chosen in an explicit form usingAckermann’s formula to guarantee that thetracking error converge to zero asymptotically.The control law is extracted from the reachabilitycondition of the sliding surface. In addition, theoverall control system is developed. Thesimulation and experimental results on a two-wheel mobile inverted pendulum are provided toshow the effectiveness of the proposed controller.Key-Words: - Sliding mode controller, twowheeled inverted pendulum.1 IntroductionThe two-wheeled inverted pendulum is anovel type of inverted pendulum. In 2000, FelixGrasser et al. [1] built successfully a mobile invertedpendulum JOE. SEGWAY HT was invented byDean Kamen in 2001 and made commerciallyavailable in 2003. The basic concept was actuallyintroduced by Prof. Kazuo Yamafuzi in 1986.In practice, various inverted pendulum systemshave been developed. Inverted pendulum systemsalways exhibit many problems in industrialapplications, for example, nonlinear behaviors underdifferent operation conditions, external disturbancesand physical constraints on some variables.Therefore, the task of real time control of an unstableinverted pendulum is a challenge for the moderncontrol field.Chen et al. [2] proposed robust adaptivecontrol architecture for operation of an invertedpendulum. Though the stability of the controlstrategies can be guaranteed, some prior knowledgeand constraints were required to ensure the stabilityof the overall system. Huang et al. [3] proposed agrey prediction model combined with a PD controllerto balance an inverted pendulum. The controlobjective is to swing up the pendulum from a stableposition to an unstable position and to bring its sliderback to the origin of the moving base. However, thestability of this control scheme cannot be assured.On the other hand, there are manyliteratures on sliding mode control theory, which isone of the effective nonlinear robust controlapproaches. Juergen et al. [4] designed a slidingmode controller based on Ackermann’s Formula.Their simulation results prove that the mobileinverted pendulum can be balanced by this controller.There is no tracking controller. So tracking controllerof mobile inverted pendulum is deeply needed.In this paper, a practical controller viasliding mode control is applied to control two-wheeled mobile inverted pendulum. The slidingsurface is chosen in an explicit form usingAckermann’s formula, and the control law isextracted from the reachability condition of thesliding surface [5]. Finally, the simulation andexperimental results on computer are presented toshow the effectiveness of the proposed controller.The two-wheeled mobile inverted pendulumprototype is shown in Fig. 1. It is composed of a cartcarrying a DC motor coupled to a planetary gearboxfor each wheel, the microcontroller used toimplement the controller, the incremental encoderand tilt sensor to measure the states, as well as avertical pendulum carrying a weight.Fig. 1 Two-wheeled mobile inverted pendulum2 System ModellingIn this paper, it is assumed that the wheelsalways stay in contact with the ground and that therewill be no slip at the wheel’s contact patches.The motor dynamics have been considered[5]. Fig. 2 shows the conversion of the electricalenergy from the DC power supply into themechanical energy supplied to the load.
  • 2. Nguyen Thanh Phuong, Ho Dac Loc, Tran Quang Thuan / International Journal of EngineeringResearch and Applications (IJERA) ISSN: 2248-9622 www.ijera.comVol. 3, Issue 3, May-Jun 2013, pp.1276-12821277 | P a g eFig. 2 The diagram of DC motorThe motor model is given as follows [6],m m emK K KT VR R  (1)Parameters are given in Appendix A.Straight Motion ModelingIn straight motion modeling of mobile invertedpendulum, the left and right wheels are driven underidentical velocity, i.e., rRl xxx   .The modeling can be linearized byassuming  , where  represents a small anglefrom the vertical direction,21 0dcos ,sin ,dt       (2)The dynamics equation in the straight motion isas follows [6],x Ax bu  (3)22 23 242 43 40 1 0 0 00 00 0 0 1 00 0rrxa a bxA ,x ,b ,a a b                          where 22 23 42 43 2 4a ,a ,a ,a ,b ,b and d are defined as afunction of the system’s parameters, which are givenin Appendix B.Tracking error is defined as1234r dr ddde x x ,e x x ,e ,e      (4)where dx is desired value, d is desired invertedpendulum angle.Fig. 3 Free body of motion modelingFrom Eq. (4), the followings are obtained.12 1234 34r dr d dr ddd ddx x ex x e x ex x eee ee              (5)From Eq. (5), the following can be obtained2 14 3e ee e(6)Substituting Eq. (5) into Eq. (3), the following can beobtained.1 12 23 34 4d dd dd dd dx e x ex e x eA bue ee e                         (7)Rearranging Eq. (7), the following can be obtained1 12 23 34 4d dd dd dd dx xe ex xe eA bu Ae ee e                                          (8)whererx
  • 3. Nguyen Thanh Phuong, Ho Dac Loc, Tran Quang Thuan / International Journal of EngineeringResearch and Applications (IJERA) ISSN: 2248-9622 www.ijera.comVol. 3, Issue 3, May-Jun 2013, pp.1276-12821278 | P a g e22 2342 4322 23 242 43 40 00 0d d d dd d d d dd d d dd d d d dd d dd d dx x x xx x a x a xAa x aa x a x da x a d                                                                        From Eq. (8), the following error dynamic equationof mobile inverted pendulum is obtained:e Ae bu d   (9)where12 2 234 4 40 00 0ee b de ,b ,dee b d                                .Rearranging Eq. (9), the following can be obtained  1e Ae b u d Ae bu     (10)where 1u u d  .Proof of Eq. (10)bd d (11)Because b is not square matrix, the following isobtained by pseudo inverse of b 1T Td b b b d for 0bbT (12)where   2 2 22 4 2 4400 00T bb b b b b bb        .If 2 0b  and  4 0 0b b  , Eq. (10) is given ase Ae (13)If2 22 4 0b b  , 12 2 4 42 22 4T T b d b dd b b b db b  (14)In this paper,2 22 4 0b b  , dx and d are consider asconstant, so2 23 4 432 2 4 4db a b adb b b b  (15)where d is constant, so d is also constant.3 Controller DesignThe control law u is defined as1 2au u d u u    (16)where static controller au contributes the design ofsliding surface, and dynamic controller 2u directlymakes sliding surface attractive to the system state.The static system is nominal system as follows:ae Ae bu  (17)The static controller is given by Ackermann’sformula as follows:Tau k e  (18) 12 30 0 0 1T T Tk h P( A),h , , , b,Ab,A b,A b     ,1 2 3 4P( ) ( )( )( )( )            where 1 2 3 4, , ,    are the desired eigenvalues andP( ) is characteristic polynomial of Eq. (17).Substituting Eq. (18) into Eq. (17), the equation ofclosed loop system is obtained as Te A bk e  (19)The sliding surface is chosen asT T T1S C e,C h P ( A)  (20)where 1 1 2 3P( ) ( )( )( )          ,2 31 2 3p p p      .Proof of Eq. (20)The left eigenvector TC of TA bk associated with4 satisfies4T T TC ( A bk ) C   (21)Rearranging Eq. (21) can be obtained as4T T TC ( A I ) C bk  (22)1 2 3T TC b h ( A I )( A I )( A I )b      (23)  12 32 31 2 30 0 0 111T, , , b,Ab,A b,A bb Ab A b A b p p p     Substituting Eqs. (18), (20) and (23) into Eq. (22)yields4 1 4T T Tk C ( A I ) h P( A)( A I )    T Tk h P( A)Substituting Eqs. (16) and (18) into Eq. (10), thedynamic controller as perturbed system is obtainedas follows:2Te ( A bk )e bu   (24)A new variable z is defined as10Te Iz e TeS C                (25)where  11 2 3Te e ,e ,e is the first three errorvariables of e andTS C e becomes the last statevariable of z .
  • 4. Nguyen Thanh Phuong, Ho Dac Loc, Tran Quang Thuan / International Journal of EngineeringResearch and Applications (IJERA) ISSN: 2248-9622 www.ijera.comVol. 3, Issue 3, May-Jun 2013, pp.1276-12821279 | P a g eThe new coordinate system can be obtained as12 2Tz T( A bk )T z Tbu Az Bu     (26)The transformed system is1 1 11 1 2e A e a S b u   (27)4 2S S u  (28)where  11 2 3Tb b ,b ,b ,11 1140 1T A a bA T( A bk )T ,B Tb             .A is shown in details in Appendix CProof of (28)Differentiating Eq. (20) and substituting Eqs. (10),(21) and (23), the following can be reduced into  2T T TS C e C A bk e bu       2T T TC A bk e C bu  4 2 4 2TC e u S u     (29)The dynamic controller is chosen as2u M(e,t )sign( S )  (30)where 4TM(e,t ) C e .Proof of (30)According to reachability condition00Slim S S  ,the followings must be satisfied,i) S 0 and S 04 2 0TS C e u  2 4Tu C e 4TM(e,t )sign( S ) C e  4TM( e,t ) C eii) S 0 and S 04 2 0TS C e u  2 4Tu C e 4TM(e,t )sign( S ) C e  4TM(e,t ) C e From Eqs. (16) and (18), the control law is givenas2Tu k e u d    (31)4 Hardware DesignThe control system is specially designed fortwo-wheeled mobile inverted pendulum. The controlsystem is based on the integration of threePIC16F877s: two for servo controllers and one formain controller. The main controller which isfunctionalized as master links to the two servocontrollers, as slave, via I2C communication. Thetotal configuration of the control system is shown inFig. 4.Fig. 4 The configuration of control system5 Simulation and Experimental ResultsThe parameters for two-wheeled mobile invertedpendulum used for simulation are given in Table 1.Table 1 System numerical valuesParameters Values Unitsr 0.05 mpM 1.13 KgpI 0.004 2Kg meK 0.007 /Vs radmK 0.006 /Nm AR 3 wM 0.03 KgwI 0.001 2Kg mL 0.07 mg 9.8 2m / sSubstituting system’s parameters into Eqs. (24), thestate space equation can be rewritten as follows:0 1 0 00 4228 0 8809 2 1459 0 88220 0 0 14 3309 9 1060 34 5772 9 1191. . . .e e. . . .         200 198902 0565.u.      (32)where 1 2 3 41 2 3 4, , ,           .It is readily shown that the rank of the controllabilitymatrices is full.Simulation has been done for the proposed controllerto be used in the practical field. In addition, thecontroller was applied to the two-wheeled invertedpendulum for the experiment. It is shown that theproposed controller can be used in the practical field.In the case of straight motion modeling, theparameters of the sliding surface are
  • 5. Nguyen Thanh Phuong, Ho Dac Loc, Tran Quang Thuan / International Journal of EngineeringResearch and Applications (IJERA) ISSN: 2248-9622 www.ijera.comVol. 3, Issue 3, May-Jun 2013, pp.1276-12821280 | P a g e1 1   , 2 32 3,     ; the parameters of thecontrol law is 0 40M  ; the initial values rx , arezero, and initial errors are 1 1 0e . m  and3 0 1e . rad  .Fig. 5 shows that the cart position error has theconvergent time of 5 seconds. Fig. 6 shows that theinverted pendulum angle error is bounded aroundzero after 4 seconds. Fig. 7 shows the sliding surfaceto converge zero very fast in simulation.0 5 10 15-1-0.8-0.6-0.4-0.200.20.4Time(s)CartPositionErrorCart Position Error(m)Fig. 5 Cart position error 1 1 0e . m 0 5 10 15 20 25 30-0.15-0.1-0.0500.05Time(s)InvertedPendulumAngleErrorInverted Pendulum Angle Error(rad)Fig. 6 Inverted pendulum angle error3 0 1e . rad 0 2 4 6 8 10-0.25-0.2-0.15-0.1-0.0500.050.1Time(s)SlidingSurfaceFig.7 Sliding surfaceFig. 8 shows controller 1u versus time. Fig. 9 showscontroller 2u versus time. Fig. 10 presents controllaw u of mobile inverted pendulum to trackreference.0 2 4 6 8 10-40-30-20-1001020304050Time(s)Input Fig. 8 Dynamic controller 1u0 2 4 6 8 10-40-30-20-10010203040Time(s)InputFig. 9 Dynamic controller 2uThe experimental results in stable condition aregiven after errors converge through Figs.(11) ~ (13).The encoder voltage is shown in Fig. 11. Fig. 12presents the output voltage of tilt sensor. Fig. 13presents motor PWM output under the proposedcontroller u in experiment.0 1 2 3 4 5 6 7 8 9 10-40-30-20-100102030405060Time(s)ControlInputuFig. 10 Controller input u
  • 6. Nguyen Thanh Phuong, Ho Dac Loc, Tran Quang Thuan / International Journal of EngineeringResearch and Applications (IJERA) ISSN: 2248-9622 www.ijera.comVol. 3, Issue 3, May-Jun 2013, pp.1276-12821281 | P a g eFig. 11 Output voltage of motor encoderFig. 12 Output voltage of tilt sensorFig. 13 PWM output of DC motor under controllaw6 ConclusionThis paper presents a sliding mode trackingcontroller for the mobile inverted pendulum. Thecontroller is developed based upon a class ofnonlinear systems whose nonlinear part of themodeling can be linearly parameterized. The trackingerrors are defined, and then the sliding surface ischosen in an explicit form using Ackermann’sformula to guarantee that the tracking error convergeto zero asymptotically.The simulation and experimental results showthat the proposed controller is applicable andimplemented in the practical field.REFERENCES:[1] F. Grasser, A. D’Arrigo, S. Colombi and A.C. Rufer, JOE: a Mobile, InvertedPendulum, IEEE Trans. IndustrialElectronics, Vol. 49, No. 1(2002), pp.107~114.[2] C.S. Chen and W.L. Chen: Robust AdaptiveSliding-mode Control Using FuzzyModeling for an Inverted-pendulumSystem, IEEE Trans. Industrial Electronics,Vol. 45, No. 2(1998), pp. 297~306.[3] S.J. Huang and C.L. Huang: Control of anInverted Pendulum Using Grey PredictionModel, IEEE Trans. Industrial Applications,Vol. 36, No. 2(2000), pp. 452~458.[4] J. Ackermann and V. Utkin: Sliding ModeControl Design Based on Ackermann’sFormula, IEEE Trans. Automatic Control,Vol. 43, No. 2(1998), pp. 234~237.[5] D. Necsulescu: Mechatronics, Prentice-Hall,Inc. (2002), pp. 57~60.[6] M.T. Kang: M.S. Thesis, Control forMobile Inverted Pendulum Using SlidingMode Technique, Pukyong NationalUniversity, (2007).Appendix ANomenclatureVariable Description UnitsV Motor voltage Vi Current armature A Rotor angular velocity rad/seV Back electromotive forcevoltageVeK Back electromotivevoltage coefficientVs/radRI Inertia moment of therotor2Kg mmT Magnetic torque of therotorNmmK Magnetic torquecoefficientNm/AT Load torque of the motor NmfK Viscous frictionalcoefficient of rotor shaftNms/ radR Nominal rotor resistance H Nominal rotor inductance Hcx Cart positionperpendicular to thewheel axism Inverted pendulum angle radd Desired invertedpendulum angleradL Distance between thewheel axis and thependulum’s centermD Lateral distance betweentwo coaxial wheelsm
  • 7. Nguyen Thanh Phuong, Ho Dac Loc, Tran Quang Thuan / International Journal of EngineeringResearch and Applications (IJERA) ISSN: 2248-9622 www.ijera.comVol. 3, Issue 3, May-Jun 2013, pp.1276-12821282 | P a g eL RT ,T Torques acting on the leftand the right wheelNmL LH ,P Reaction force betweenleft wheel and theinverted pendulumNR RH ,P Reaction force betweenright wheel and theinverted pendulumNLw Rw,  Rotation angles of the leftand right wheelradL Rx ,x left and right wheelpositionmfL fRH ,H Friction forces betweenthe left and right wheeland the groundNr Wheel radius mpM Pendulum mass KgpI Inertia moment of theinverted pendulum aroundthe wheel axis2Kg mwM Wheel mass with DCmotorKgwI Inertia moment of wheelwith rotor around thewheel axis2Kg mg Gravitation acceleration 2m / sAppendix B222 22 m e p p pK K ( M Lr I M L )aRr    ,2 223pM gLa ,42 22 m e pK K ( r M L )aRr ,43pM gLa  ,222 m p p pK ( I M L M Lr )bRr  ,42 m pK ( M L r )bRr  ,where 222 ww pI( M M )r    ,222 wp p wII M L ( M )r      .Appendix C11 12 13 14 1 1 1 2 1 3 1 421 22 23 24 2 1 2 2 2 3 2 431 32 33 34 3 1 3 2 3 3 3 441 42 43 44 4 1 4 2 4 3 4 4Ta a a a b k b k b k b ka a a a b k b k b k b kA bka a a a b k b k b k b ka a a a b k b k b k b k                    (C1)11 1 1 12 1 2 13 1 3 14 1 4 11 12 13 1421 2 1 22 2 2 23 2 3 24 2 4 21 22 23 2431 3 1 32 3 2 33 3 3 34 3 4 31 32 33 3441 4 1 42 4 2 43 4 3 44 4 4 41 42 43 44a b k a b k a b k a b k A A A Aa b k a b k a b k a b k A A A Aa b k a b k a b k a b k A A A Aa b k a b k a b k a b k A A A A                              11 12 13 1421 22 23 24131 32 33 3431 21 2 3 4 41 42 43 444 4 4 41 0 0 01 0 0 00 1 0 00 1 0 00 0 1 00 0 1 01TA A A AA A A AA T A bk TA A A Acc cc c c c A A A Ac c c c                                    31 2 1411 14 12 14 13 144 4 4 431 2 2421 24 22 24 23 244 4 4 43 341 231 34 32 34 33 344 4 4 431 2 41 4 2 4 3 44 4 4 4cc c AA A A A A Ac c c ccc c AA A A A A Ac c c cc Ac cA A A A A Ac c c ccc c QQ Q Q Q Q Qc c c c                     (C2)where1 1 11 2 21 3 31 4 41Q c A c A c A c A    (C3)2 1 12 2 22 3 32 4 42Q c A c A c A c A   3 1 13 2 23 3 33 4 43Q c A c A c A c A   4 1 14 2 24 3 34 4 44Q c A c A c A c A    .From (21), (C1) and (C3), the followings can beobtained   1 2 3 4T TQ Q Q Q Q C A bk   4 1 4 2 4 3 4 4 4TC c c c c      (C4)1 11 4 1 4 4 44 40c cQ Q c cc c    2 22 4 2 4 4 44 40c cQ Q c cc c    3 33 4 3 4 4 44 40c cQ Q c cc c    4 4 444 4Q cc c  (C5)Substituting (C5) into (C2) can be rewritten asfollows:31 2 1411 14 12 14 13 144 4 4 431 2 2421 24 22 24 23 24 1 14 4 4 443 341 231 34 32 34 33 344 4 4 4400 0 0cc c AA A A A A Ac c c ccc c AA A A A A A A ac c c cAc Ac cA A A A A Ac c c c                       

×