Sliding Mode Control of Rotary Inverted Pendulum - advantech greece

0 downloads 0 Views 270KB Size Report
Abstract—This paper presents sliding mode control of. Rotary Inverted Pendulum. Rotary Inverted Pendulum is a nonlinear, unstable and non-minimum-phase ...
7

3URFHHGLQJVRIWKHWK0HGLWHUUDQHDQ&RQIHUHQFHRQ &RQWURO $XWRPDWLRQ-XO\$WKHQV*UHHFH

Sliding Mode Control of Rotary Inverted Pendulm Mojtaba Ahmadieh Khanesar. Member, IEEE, Mohammad Teshnehlab, Mahdi Aliyari Shoorehdeli K. N. Toosi University of Technology Electrical Engineering faculty Control Department Tehran, Iran Email: [email protected] Abstract—This paper presents sliding mode control of Rotary Inverted Pendulum. Rotary Inverted Pendulum is a nonlinear, unstable and non-minimum-phase system. Designing sliding mode controller for such system is difficult in general. Here, first the desired performance is introduced and based on this performance two sliding surfaces are designed, then system is controlled by proper definition of a lyapunov function. The lyapunov function designed puts more emphasis on the control of the inverted pendulum rather than the control of the motor. Rotary Inverted Pendulum, Non-Minimum-Phase, Sliding Mode, Nonlinear Control

I. INTRODUCTION The Rotary Inverted Pendulum is a widely investigated nonlinear system due to its static instability. A version of this system is used as a simplified model for the control of rider-motorcycle systems in circular motion on paths of different radii [1]. This paper deals with a rotary inverted pendulum system (see Fig. 1), which is composed of the following components: a rotating arm, which is driven by a motor with a pendulum mounted on its rim. The pendulum moves as an inverted pendulum in a plane perpendicular to the rotating arm. Essentially the control of this system is difficult because this system has two degrees of freedom and only one control input. Also this system is a non-minimum–phase system. A nonminimum-phase system is a system whose internal or zero dynamics are unstable [2]. Such systems restrict application of nonlinear controller design techniques, such as feedback linearization and sliding mode controller design [3]. In this paper a variable structure controller is developed to control the Rotary Inverted Pendulum. Variable structure control (VSC) with sliding mode control was first proposed and elaborated in the early 1950’s in the Soviet Union by Emelyanov and several co researchers [46]. Since then, VSC has developed into a general design method being examined for a wide spectrum of system types including nonlinear systems, multi-input/multioutput systems, discrete-time models, large-scale and infinite-dimensional systems, and stochastic systems. In addition, the objectives of VSC have been greatly extended from stabilization to other control functions such as tracking, model following etc. The most distinguished feature of VSC is its ability to result in very robust control systems; in many cases invariant control systems result [7]. This method is now tested on variety of different

industrial applications and proves its effective performance. In this paper the sliding mode control design technique is applied to the control of the rotary inverted pendulum. This paper is organized as the following: section II introduces some basics of VSC control using sliding mode and also its difficulties and restrictions are discussed. In section III we will derive nonlinear equations of the plant and consider its state space equations and also the unstable nature of the system is considered. In addition, it will be shown that the system is a non-minimum-phase system. In section IV the sliding mode control of rotary inverted pendulum is considered and also simulation results are provided there. II.

SLIDING MODE FUNDAMENTALS

Essentially, VSC utilizes a high-speed switching control law to drive the nonlinear plant’s state trajectory onto a specified and user-chosen surface in the state space (called the sliding or switching surface), and to maintain the plant’s state trajectory on this surface for all subsequent time. This surface is called the switching surface because if the state trajectory of the plant is “above” the surface a control path has one gain and a different gain if the trajectory drops ”below” the surface. The plant dynamics restricted to this surface represent the controlled system’s behavior [8]. The sliding mode controller design has two fundamental steps [8]. The first step is to select the sliding surface such that the system exhibits the desired behavior in the sliding mode and the second step is to determine control laws to guarantee the reaching and sliding mode conditions [9] To guarantee the convergence to the sliding mode surface a lyapunov function V (S ) is defined as a positive function of sliding surface (S ) and then the control signals are calculated in such a way that: V < 0 this would guarantee that V → 0 and also by proper definition of lyapunov function as a function of S ,. S → 0 . Then the performance of the system is determined by equation S = 0 . Design of sliding surface is very important since after reaching the sliding surface, this surface determines the performance of the system under control. Using output feedback linearization approach, systems can be described in a canonical form consider following dynamical system: x ( n ) = F (x ) + G (x )u y =x

(1)

7

3URFHHGLQJVRIWKHWK0HGLWHUUDQHDQ&RQIHUHQFHRQ &RQWURO $XWRPDWLRQ-XO\$WKHQV*UHHFH

The sliding mode controller design for such system is quite easy and straightforward. The sliding surface considered for this system can be [10]: d  s = +λ  dt 

direction, the velocity of the point mass in the y direction and the rotating pendulum about its center of mass: T = K .E .Hub + K .E .V x + K .E .V y + K .E .Pendulum

n −1

(2)

e

is:

(6)

The moment of inertia of a rod about its center of mass

The lyapunov function considered here is simply: 1 MR 2 JCM = 12

1 V = s2 2

(3)

Using this lyapunov function, the stability condition is as: V < 0

(4)

The control signal for the system can be easily calculated. But in non-minimum-phase system, the system can’t be controlled simply by stabilization of error and its derivatives as proposed in [10]. THE MODEL OF ROTARY INVERTED PENDULUM SYSTEM As mentioned earlier the Rotary Inverted Pendulum is an unstable nonlinear system. Also it should be mentioned that this system is a non-minimum-phase system. The variables used to define the model of the rotary inverted pendulum are as follows:

Here R=2L and (L) is the length of the pendulum. So JCM = 13 ML2

Symbol

L h r

DESCRIPTION OF THE PARAMETERS USED IN THE MODELING OF THE SYSTEM

Description Length to Pendulum's Center of mass Distance of Pendulum Center of mass from ground

T =

θ α JCM Vx

Pendulum Arm Deflection (radians) Pendulum Inertia about its center of mass

Vy

Velocity of Pendulum Center of mass in the y-direction

Kt

Motor Torque Constant

Km

Back EMF Constant

Rm

Armature Resistance

Jm

Motor Inertia

ηg

Gearbox Efficiency

ηm

Motor Efficiency

Velocity of Pendulum Center of mass in the x-direction

L = T −V =

(9)

1 2  J eq θ2 + mL2α 2 − mLr cos ααθ 2 3 1 + mr 2θ2 − mgL cos α 2

(10)

General coordinates are θ, α. Therefore, we have: δL  δL = TOutput − B eq θ   −  δθ  δθ δL  δL =0   −  δα  δα

(11)

And also: TOutput =

ηm η g K t K g (V m − K g K m θ )

(12)

Rm

So we have: ..

..

.

.

a θ − b cos(α ) α + b sin(α )(α )2 + G θ =

Using Euler-Lagrange formulation we obtain potential and kinetic energy of the system as follows [11]: The only potential energy of the system is the gravity:

V = P .E .Pendulum = m g h = m g L cos(α )

1 1 J eq θ2 + m (rθ − L cos α (α ))2 2 2 1 1 + m (L sin αα ) 2 + JCM α 2 2 2

Therefore, we have Lagrangian formula as:

δ δt δ δt

Rotating Arm Length Servo load gear angle (radians)

(8)

Finally, kinetic energy is as follows:

III.

TABLE I.

(7)

(5)

The Kinetic Energies in the system arise from the moving hub, the velocity of the point mass in the x

..

ηm η g K t K g Rm

Vm

(1

..

c α − b cos(α )θ − d sin(α ) = 0 3)

In which some simplifying assumptions are considered as follows:

7

3URFHHGLQJVRIWKHWK0HGLWHUUDQHDQ&RQIHUHQFHRQ &RQWURO $XWRPDWLRQ-XO\$WKHQV*UHHFH

.

x1 = x 2 .

x 2 = F1 (X ) + G1 (X )u

(15)

.

x3 = x 4 .

x 4 = F2 (X ) + G 2 (X )u

Where:

F1 (X ) = Figure 1. Top view of Rotary Inverted Pendulum

G1 (X ) = F2 (X ) = G 2 (X ) =

−b

2

2

sin(2x 1 ) x 22 − G b x 4 cos(x 1 ) + a d sin(x 1 )

ηm η g k t k g b

(

R m a c − b 2 cos 2 x 1

)

cos(x 1 )

cF1 (X ) − d sin(x 1 ) b cos(x 1 )

ηm η g k t k g c

(

R m a c − b 2 cos 2 x 1

(16)

)

In [1] a feedback linearization method for obtaining the canonical form of the Rotary Inverted Pendulum is proposed. Also in [12] another mathematical approach to approximated feedback linearization using splines is proposed, where the Rotary Inverted Pendulum is used as a benchmark to show the procedure used. But the input of the system considered in both papers is the torque of the motor or any actuator applied to the rotary arm and those approaches can’t be applied here. The input of the system considered here is motor voltage. Here the feedback linearization of the system is considered. Consider x 1 as the output of the system, so we have:

Figure 2. Side View of Rotary Inverted Pendulum

y = h (X ) = x 1 a = J eq + mr 2

(17)

Then we have:

b = mLr 4 c = mL2 3 d = mgL

L g h (X ) = 0

(18)

L g Lf h (X ) = G1 (X )

(19)

(14)

E = ac − b 2 G =

a c − b 2 cos 2 x 1

ηm η g K t K m K g2 + B eq R m Rm

So that the state equations of the system would be:

In which L g h (X ) represents Lie derivative of h (X ) with respect to g . So the relative degree of the system is r = 2 and 2 modes of the system are unobservable. Also:

Lf h (X ) = y = x 2

(20)

Then: L2f h (X ) = y = F1 (x )

(21)

7

3URFHHGLQJVRIWKHWK0HGLWHUUDQHDQ&RQIHUHQFHRQ &RQWURO $XWRPDWLRQ-XO\$WKHQV*UHHFH

is:

In addition, the feedback input to linearize the system

u =− −

(

)

1 L2f h (X ) −V (x 1 , x 2 ) = L g L f h (X ) 1 ( F1 (X ) −V (x 1, x 2 ) ) G1 (X )

(22)

Where V (x 1 , x 2 ) is the controller applied to the linearized system, which can be a linear combination of x 1 , x 2 in feedback linearization control approach or can be the gain calculated using sliding mode. In either case:

V (0, 0) = 0

(23)

Observable modes of the system can be stabilized, choosing proper function for the V (x 1 , x 2 ) . To analyze the zero dynamics of the system we consider: X

*

= [0 0 x 3

x4]

IV.

SLIDING MODE CONTROL OF THE ROTARY INVERTED PENDULUM

A. designing a proper sliding surface for the system As mentioned earlier, the Rotary Inverted Pendulum is a non-minimum-phase system. Finding a proper sliding surface for such a system is not a routine task. The mathematical model of the system can be seen as a combination of two systems in a canonical form. Consider desired dynamics for these two canonical forms are as: x1 + λ1x 1 = 0

(30)

x3 + λ3 x 3 = 0

(31)

These two equations guarantee the stability of both the motor position and the inverted pendulum on the sliding surface. Here we can use two sliding surfaces s1 and s 2 as following:

(24)

s1 = x 2 + λ1x 1

(32)

s 2 = x 4 + λ1x 3

(33)

Then: −Gb F1 (X * ) = x4 ac − b 2

F2 (X * ) = −

Gc

(25)

To have a stable system with guarantee of stability here the lyapunov function is considered as follows: (26)

V =| s1 | +λ2 | s 2 |

ηm η g k t k g b G1 (X * ) = R m ac − b 2

(27)

Here λ2 is a positive variable. The effect of λ2 is to put more stress on the control of the inverted pendulum rather than the control and stability of the motor, so λ2 assumes to be a user defined real number between 0 and 1. To guarantee the stability of the feedback system, we drive the control signal u such that:

ηm η g k t k g c G 2 (X * ) = R m ac − b 2

(28)

V V = −α sat ( ) Φ

ac −b 2

(

x4

)

(

)

Using equations (16) the zero dynamics of the system will be obtained as follows: d 2x 3 dt

2

=−

Gc ac − b

2

x4 −

Gc a c −b 2

(29)

The obtained zero dynamic of the system are unstable. So, the analysis above shows that if α is considered as the plant output, feedback linearization approach can’t stabilize the system and the θ and its derivative which are two unobservable state variables show unstable response. As θ represents angle of the motor, the motor will not stop rotating. Finding a sliding surface for the system is not straightforward [2].

(34)

(35)

Where sat (V ) is the saturation function, which is defined as in (36). This function reduces chattering very much. V if Φ