Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Sliding Mode Control of an Inverted Pendulum

Paul G. Grossimon Enrique Barbieri Sergey Drakunov

Electrical Engineering Department


Tulane University
New Orleans, LA 70118

Abstract

This paper considers a sliding mode controller for


a rotational inverted pendulum. The purpose of this
paper is t o familiarize the reader with the strengths of
sliding mode control on a very popular system. An-
other purpose is to reveal our unique surface design
which permits the pendulum angle ( O d e s ) t o be a func- e
tion of the base angle (b): 8 d e s (p). A brief background
on sliding mode and the pendulum’s dynamic equations
are provided. Simulations for two test cases are pre-
sented with figures.

1 Introduction
Inverted pendulums are one of the most commonly
studied systems in the control area. They are quite
popular because the many variations of the pendulum Figure 1: Pendulum Configuration
often represent different kinds of robotic arms. The
pendulum to be discussed is a rotational one, as can coming more popular with the advances in high-speed
be seen in Figure 1. This rotational pendulum will be circuitry as well as the advances in computers [4]. An-
controlled in positions that might have some physical other advantage to the sliding mode controller is its
meaning to the robotics field. The object is to posi- simplicity. Thus, a more robust controller was desired
tion the tip of the second link (pendulum arm) at a for this highly nonlinear plant, yielding the work and
desired angle by rotating the first link (base or posi- results that will be presented in this paper.
tioning arm). This pendulum was previouly controlled
by a proportional-integral-derivative (PID) controller
which was designed for a linearized model of the pen-
dulum dynamics [l].Of course, this problem has been 2 Background
considered by many other researchers as well. Various
types of controllers have been tried on the pendulum 2.1 Sliding Mode Control
such as: feedback linearization, fuzzy logic, and neu-
ral networks [2], [3]. We base our work on the physi- Sliding Mode Control, often referred to as Variable
cal parameter’s of the model of the rotational inverted Structure Control, is a high-speed switching feedback
pendulum developed in [l]. control that switches between two values based upon
It was desired to improve the stability of the system some rule [4], [5]. The control theory uses a high-speed
in the sense of making the pendulum less sensitive to switching control law to drive the nonlinear plant’s
external diturbances by the implementation of a slid- state trajectory onto a specified surface in the state-
ing mode controller. Sliding mode controllers are be- space. This surface is called the sliding or switching

248
0-8186-7352-4/96 $05.00 0 1996 IEEE
surface. According to the theory, a sliding mode will f,. is the reaction force acting through the pendulum,
exist for a system if in the vicinity of the switching and a, and ag are accelerations in the r and 8 direc-
surface, the state velocity vector is directed towards tions respectively. Summing the moments around the
the surface. Given the typical equation of a system as pivot of the rotating base yields
a function of its states and control,
S = f (t,S) + B(t,S)U Mb = Tm - Rf, sin8 - BUS= (J)) (3)
with x E IIi" and U E 8" then, the control is defined
where T, is the torque applied by the motor, R is the
as, length of the moment arm of the rotating base, and J
U;, Si(t,x) > 0
ui =
{
UY,Si(t,X) < 0
is the moment of inertia of the base. Next, a,. and ag
are expressed as sums of the acceleration due to the
for i = 1,.. . ,m. If the value of the surface equation, base plus that due to the pendulum itself.
S , is greater than zero, a positive control is applied. If
the value of the surface equation is below zero, then a uT = R j s i n 8 - Z(4)' (4)
negative control is applied. The idea is quite simple:
force the state trajectories to the surface. ag = -(R$cos8 + 18) (5)
The problem is to design an appropriate switch- Here, 1 represents the distance from the pivot point
ing surface. First, the plant, when restricted to the to the center of mass of the pendulum. Equation 4 is
switching surface, must respond in a desired manner. then substituted into equation 1. Solving for f,. yields,
Second, the switching control law must satisfy a set
of "sufficient conditions" for the existence of sliding f,. = m[gcos8 + Rfisin8- 1 ( 1 $ ~ ] (6)
mode. The next important aspect of sliding mode con-
trol is guaranteeing the existence of a sliding mode. Substituting equation 6 into 3 gives the torque equa-
If a sliding mode exists on S(S) = 0, then S(S) is tion,
termed a sliding surface. A sliding mode exists when
the state trajectory z(t) of the controlled plant sat- T, = mlR8cos 8 - mlR(d)'sin8 + B,B + ( J + mR'))
>
isfies S ( z ( t ) )= 0 at every t t o for some to. This (7)
requires infinitely fast switching. In actual systems, Substituting equation 5 into equation 2 gives us the
this is not the case. Delay, hysteresis, and other ef- relation between /3 and 8,
fects force switchings to occur with finite frequency.
Therefore, the sufficient condition, S(x(t)) = 0, will mg sin 8 = mRfi cos 8 + mle. (8)
not be satisfied; S(x) will oscillate within a neighbor-
The state-space form of equations 7 and 8 is written
hood of zero. This oscillation is called chattering. If
as follows [l],[7]:
the frequency of the switching is very high compared
with the dynamic response of the system, the imper-
fections and the finite switching frequencies are often
but not always negligible. [4]These difficulties, how- (9)
ever, can be obliterated with a slightly more complex
form of control [6].

2.2 System Model


Two forces act on the pendulum, gravity and the
reaction at the pivot. In the 8-r vertical reference
frame, the forces are summed at the center of mass.
where 8 and fi are given by:
XF,.= f r - m g c o s O = m a , .. T,
e= + mlRx; sin21 - Bvz4 - (J+ mR2)(g/R) tanzl
mlRcosxl - ( J + mR2)(Z/R) secxl
Fg = -mg sin 0 = mag
(2) . ,
(11)
The angle of the pendulum is represented by 8; the T, - ml R sin x1 cos XI + ml Rx; sin XI - Bvxq
base position is represented by the angle p, see Fig- j= -mR2 cos28 + (J+ mR2)
ure 1. The mass of the pendulum is represented as m, (12)

249
3 Sliding Surface Design The surface equation becomes:

First, let us state the goals of our control design. It S = -Duo(6J)sign(S) + F (19)
is desired that the tip of the pendulum arm be placed
where we require the following constraints to be satis-
at any point. In our case, the position of this point will
fied:
be a function of p, 8 = e&,(/?). This characteristic
is what makes this controller different from others. qe)Uo(e) >0
Again, by moving the positioning arm with the motor, uo(e)= cqe)
we should be able to position the tip of the pendulum
arm at any reachable point.
c > 0.
To achieve this goal, for our pendulum, the sliding The above constraints are necessary to guarantee that
surface is chosen as follows: the sliding mode existence conditions are fulfilled [5]
d lims+o+ S < o
s = -(e
dt
- odes) + A1 (e - odes) (13)
lims_to- S > 0.
or equivalently,
The values of C and A1 are selected in such a way that,

Now, in order to design the control, we must take the The control is now defined as:
derivative of the surface equation. Doing this yields:
U = -Csign[D(B)]sign(S) (20)
s = e - -p
’ ’’ aedes ’* -- + A l ( e - -))
aedes
(15) with the sliding surface equation:
ap ap2 ap
which can be written in the familiar form:
S = - ~ ( e ) c s i g n [ ~ ( e ) ] s i g n (+s )~ 1 6 . (21)
Therefore, the control, in terms of the pendulum
S=DU+F (16) dynamics is expressed as follows:
where D is expressed in terms of the system’s equa- cos e
tions:

D=
cos e
U = -Csign
[ +
mZRcos2 8 - ( J mR2)(Z/R) 1
mZRcos2 8 - ( J + mR2)(Z/R)
--a e d e s 1
ap -mR2 cos20 ( J + + mr2) e

If edes= constant, 4 Simulation Results


cos e
D(e) = The plant’s dynamics were previously implemented
+
mZRcos2 8 - ( J mR2)(Z/R)
in SIMULINK [7]. After the control was designed,
and equation 3, the controller was added to the system
F = Ale. model.
Simulations were done for two test cases: 0 = 45
Then equation 16 becomes, degrees and 0 = 0 degrees.
For o d e s = 45 degrees, a simulation was run on
S = D(6)u + F. (17) SIMULINK for 10 seconds of real time. The Euler
The control is selected in the usual Sliding Mode form, method was used. The resulting sliding surface plot
is shown in Figure 2. Notice that the sliding surface
U = -uosign(S) (18) converges to zero; then, chattering exists. The result-
ing plots for 0 and p are shown in Figures 3 and 4
where respectively. It appears that 8 is unstable, but a sim-
uo = uo(e). ulation was run for more than ten seconds and 8 does

250
W i n g Surfaoe 1os Response of Beta
3 ........!.........!.........!.........!..........j ..........I.........I . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. .
2.: ......................................................................................

$1.5
-1 ........j . . . . ....; .............................. .........j ....... ..:......... ..... . f......
~ j ~

i
-2 _ ........j ............................. j ..........j ..........j .............................. i ...... 1

-
-3 ........j .........;.........) . . . . . . .j ..........j ..........j .........{ .........:.........j ......
0.5

_
-4 ....................... ;........j... :................. :.................:......

C
0 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 10
nme (second) Time (second)

Figure 2: Surface Plot for o d e s = 45 degrees. Figure 4: Response of p for o d e s = 45 degrees.

Response of Theta Sliding Surface


6OL ........! . . . . I .........I...... .................. . . . . . ....... . I ...... . . A.......
%
. I 9 I 4

4 ....... ....... ; .....


55 - ........:...............................................................................

3 ...... ......... .......

2
s
35.. . ...!....... .: ..................:. . . . . . ..: .........:..........: ...... . :.........:.......

30 ......... .........) .......


~ ~
. . . . .j ...... .j ........................ :. . . . . . .: .....

25 _ ................ ............................................................ : .....

_ :..........:....................
20 ....... ;. ......;.........;.........: ........:.......... i. .....
0 1 2 4 5 6 7 6 9 1 0
Time (sewnd) Time (second)

Figure 3: Response of 6 for @des = 45 degrees. Figure 5: Surface Plot for odes = 0 degrees.

251
Response of Theta Response of Beta

I ‘0 1 2 3 4 5 6 7 8 9 10
0 1 2 3 4 5 6 7 8 9 10 Time (second)
Time (second)

Figure 6: Response of 6 for odes = 0 degrees Figure 7: Response of 6 for o d e s = 0 degrees.

in fact converge to 45 degrees. However, the motor is Control of an Inverted Pendulum,” Bachelor’s
required to spin continuously. Thesis, Tulane University, April 1992
Another simulation was run for odes = 0 degrees. [2] T. D.Ledgerwood and E. A. Misawa, “Controlla-
The resulting sliding surface plot is shown in Figure 5 bility and Nonlinear Control of a Rotational In-
The resulting plots for 6 and p are shown in Figures verted Pendulum,” Advances in Robust and Non-
6 and 7 respectively. Again, 6 converges to its de- linear Control Sysytems, DSC-Vol. 43, ASME,
sired value. This time /3 has to spin just over three pp. 81-88, 1992.
revolutions.
[3] E. A. Misawa, M. S. Arrington, and T. D. Ledger-
wood, “Rotational Inverted Pendulum: A New
5 Conclusions Control Experiment ,” Proceedings of the 1995
American Control Conference, (Seattle, WA),
As expected, for the designed controller we ob- pp. 29-33, June 1995.
served sliding. The control of the pendulum was quite
robust in simulation in comparison to the previous [4] R. A. DeCarlo, S. H. Zak, and G. P. Matthews,
PID controller that was implemeneted in [l]. In the “Variable Structure Control of Nonlinear Multi-
future, further restrictions will have to be placed on variate Systems: A Tutorial,” Proceedings of the
the rotation of the base arm. Our simulations demon- IEEE, Vol. 76, No. 3, pp. 212-232, March 1988.
strated that the motor can spin several times or many [5] V. I. Utkin, Sliding Modes and Their Applica-
times, depending on Odes. This would be impractical tion in Variable Structure Systems. Moscow: MIR,
for the physical system as wires would be getting tan- 1978.
gled around the motor. Possible solutions to correct
this problem include a more complex switching sur- [6] V. I. Utkin and S. Drakunov, “On Discrete-time
face or a family of switching surfaces. What is unique Sliding Mode Control,” Proceedings of IFAC Sym-
about the controller implemented on this pendulum posium on Nonlinear Control Systems (NOLCOS),
is that Odes can be a function of p. we are looking (Capri, Italy), pp. 484-489, 1989.
into finding physical situations where this additional
flexibility may be of use. [7] P. G. Grossimon, “Inverted Pendulum Control: A
Nonlinear Simulation Using SIMULINK,” Bache-
lor’s Thesis, Tulane University, April 1995
References
[l]B. L. Chin, “Analysis, Design, Construction, and

252

You might also like