0% found this document useful (0 votes)
79 views

Swing Up Control of Inverted Pendulum

This document presents a new type of inverted pendulum control system consisting of a pendulum attached to a rotating motor shaft. It summarizes the modeling of the controlled object, including kinetic energy, potential energy, dissipation energy, and input torque equations for both the nonlinear and linearized models. It then describes a feedforward control method using a steepest descent algorithm to determine bang-bang control inputs to minimize a criterion function and swing the pendulum from hanging to upright, with the switching instances determined to optimize the cost function under constraints.

Uploaded by

Victor Passos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views

Swing Up Control of Inverted Pendulum

This document presents a new type of inverted pendulum control system consisting of a pendulum attached to a rotating motor shaft. It summarizes the modeling of the controlled object, including kinetic energy, potential energy, dissipation energy, and input torque equations for both the nonlinear and linearized models. It then describes a feedforward control method using a steepest descent algorithm to determine bang-bang control inputs to minimize a criterion function and swing the pendulum from hanging to upright, with the switching instances determined to optimize the cost function under constraints.

Uploaded by

Victor Passos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Swing Up Control of Inverted Pendulum

Katsuhisa Furuta and Masaki Yamakita Seiichi Kobayashi


Department of Control Engineering Nippon Seiko Ltd.
Tokyo Institute of Technology 78 Toriba-machi, Maebashi-shi
2- 12-1 0h-0 kayama, Meguroku Gunma 371 Japan
Tokyo 152 Japan

Abstract 2 MODELLING OF CONTROLLED


OBJECT
Inverted pendulums have been used for the verification of de-
signed control systems and control laboratory experiments in con- In the swing up control, we use a full nonlinear model and
trol theory education. In particular, the control of a double in- its linearized model around the upright position. The nonlin-
verted pendulum has been known as a good example to show the ear model is obtained by Euler-Lagrange’s method , and the lin-
power of the state space approach. The triple pendulum, how- earized model is calculated based on the nonlinear model. The
ever, has not been successfully stabilized at the upright position parameters of the models are determined by physical parameters,
due to the inaccuracy of the modelling and error introduced by which are estimated by identification procedures.
the computation.
Instead of these stabilizing control, one of the authors has stud- 2.1 Calculation of Energy and Input Torque
ied the swing-up of a pendulum from the stable hanging state to
For the definition of notations, see Fig. 1 and Table 1. S u b
the upright position. However, the control input was designed
a priori, so the transfer of the state of the pendulum was not scripts 0,l stand for variables for the arm and the pendulum,
respectively. Kinetic energy I;, potential energy V i , and dissipa-
assured. One of the reasons is due to unmodelled dynamics.
tion energy Vi (i = 0,1) are obtained as follows. Three kinds of
This paper presents a new type of pendulum on a rotating arm total energy 7 ,V , V are obtained as sums of those of the arms,
fixed to a rotating shaft and a swing up control algorithm based i.e. arm pendulum. Since input torque is applied to only the arm,
on state space setting. The control input for swing up is restricted we have eq.(5).
to a bang-bang type, which is determined from the phase plane
trajectory. Such state feedback type control gives reliable control 1. The arm
for the transfer of the state.
1 .a 1
70 = -Ioeo
2 , vo = o , vo= -coei
2

2 . The pendulum
1 INTRODUCTION 2

(Losin Bo + Il sin el cos e,)


The inverted-pendulum control problem has been widely used
as an example to demonstrate the effectivenessof modern control (LOcos BO - ll sin el cos e,)
theory. Until now, the structure of the inverted pendulum has
been the rail-cart type which consists of a cart running on a rail
1 .2
and a pendulum attached to the cart. The inverted pendulum of v, = mlgllcose1 , V, = -Cl@, 2 (3)
this type has the moveming limitation of its cart as a restriction
of the control system. 3. Total energy T ,V ,V
To remove this restriction, we designed and made an inverted 1 1 1
pendulum with a new structure. It has a direct-drive motor (NSK ? = X I , , v = X v , , 21=cvol(4)
4inch Megatorque) as its actuator source and its pendulum at- ,=O ,=O ,=O
tached to the rotating shaft of the motor. Compared with the
4. Input torque F
conventional inverted pendulum, the new type requires less space
and has less unmodelled dynamics due to a power transmission
mechanism (a belt) used in the conventional one, since its pen- (5)
dulum is directly attached to the motor shaft.
We consider the swing-up control of this new-type inverted pen- 2.2 Euler-Lagrange’s Dynamic Equations
dulum in this paper. We consider both feedforward control which (Nonlinear Model)
is a conventional method for swing-up control and its improved
version which employs, additionally, the state-feedback control According to Euler-Lagrange’s method, we get
using phase-plane information to cope with parameter uncertain-
ties. The control system was constructed and the validity of the d a 7 aT+av
---ae, a+aS,=F,
av (z = 0 , l ) (6)
control method was examined by an experiment. dt ab,

2193 CH2976-9/91/0000-2193 $1.00 01991 IEEE


I ECON ’91
then the following equations are obtained. 3.1 Feedforward control method
In this section, using the nonlinear model (7), we construct a
+
I ~ + ~ ~1l2sin1el)
( L ~ mlllLocos81
~ feedforward control law via the steepest descent method. Partic-
uldy the resulting control law is derived in terms of bang-bang

[ $1
mlllLo COS B1
+ [ co+2mil:sin2elBi -mlllLocosel]
control sequence (see Fig. 2) of which is determined by the set of
switching instances:
-mlG sin Oleo +
JO milt
0 *' = {(TI ,~ 2 * *, * I Tn 1 (9)

They are determined to minimize the criterion function:

(Linear Model) J = e,QCn, (10)


From dynamical equation (7), each coefficient matrix of
8,,Bi,Bi ( i = 0,1) involves 01,B2 in terms of sinB1,cosO1, so this where
equation is a nonlinear ordinary equation.. By linearizing this Bend = [eO(Tn),ei(Tn), eO(Tn), 81(Tn)]' (11)
around the vertical inverted state (01 = 0 , 81 = 0) the following with the following restrictions.
equation is obtained.
G = 2(k)= (12)
[-T1(k), -T&) - Tl(k),- T 3 ( k ) - T'(k),-T,(k)- T3(k)ITI 0
In order to minimize eq.(lO) under the constraint of eq.(12) we
( 8 ) consider a Lagragian given by

L ( z ) := J(z)' + AT G (13)
For the Lagrangian, we employ a modified steepest descent-
method to obtain its minimum value. The algorithm is given
as follows:
x = [A, x 2 A3 A,]= 2 0 (14)
aJ aG
+
L(z €2)= ( J ( z ) t- z)' + a2
AT(-tz G) (15) + a2
+
L(Z+€Z) - L(2) =
aJ aG 63
( 2 5 ( 2 ) - ~ + X'-Z)E
82 a2
+ E'(-z)'
82
(16)

Then
aJ ac
z = (2J(2)-
az
+ a2

Fig. 1 Illustration of variables


.
(T.1.T Pendulum)

physical Step 2. Find J ( t ( k ) ) .


value notation value [unit] Step 3. Compute z and e.
Step 4. If 11~11< lo-' then stop.
total length Lo 0.215 (1.1 +
Step 5. Set z(k 1) = ~ ( k ) cz. +
incrtia of the arm 10 1.75 x 10-Z[kg:i~~2] +
Step 6. Set X(k 1) = A(k) AG (A + < 0).
frictipn Step 7. Increme k by 1 (k = k 1). +
coefficient CO O.ll8(Nm-s] +
Step 8. Ruet if X(k 1) < 0.
mass mi 5.38 x lO-l[kg] +
Step 9. Ruet if t ( k 1) < 0.
Step 10. CO to Step 2.
distance to
gravity center li 0.113 [nil Repeating the above algorithm 30 times using the identified
iiicrtia around parameters, we got the cost function J as shown in Fig. 3 and
gravity center Ji 1-98x 10-'[kg.m2J the minimum J was found to be 6.205. Here the input time is
frictipn ti = 60ms, t2 = 245mr, t 3 = 355ms, 1 4 = 710ms.
coefficicnt C1 8.3 x 10-SINm.sJ
- 19p.t .

System
Fig. 2 Profile of the control input
In this section, three methods are discussed.
-.. to awing up the pendulum

2194 I ECON '91


3.3 Control of the up-right state
Criteria J

128 1) Design of the optimal regulator


188 Consider the quadratic criterion function J

88. 8
J = L"(zTQz + ru2)dt (23)
68.8
and the optimal feedback gain f for the criterion under the
40.8 dynamic constraint (8). If the design parameter Q and r are
specitied, then f can be obtained by a standerd method.
28. 8

8. 88 ' 5 18 15 28 25
I
38
2) Design of the observer
Xina We use a minimal order observer for the state feed-
Fig. 3 Convergence of t h e criteria by back. And we select observer poles as design parameters,
a steepest descent m e t h o d and P, Q,R , SI,Sa are obtained by Gopinath's method in
the following equations[Furuta, 1988).

3.2 Bang-bang state feedback control i = P2+Qy+Ru (24)


method
Consider the non-linear model (7). It can be observed that

(J] + mllt)i1 - cli1 - mlllgsinB1


3) Design of closed loop system

+
= - m l l l ~ o ( c o s ~ l ) i o mll:(sin01)6i: (19) Using the optimal regulator and the minimal order observer
obtained in 1) and 2), we construct closed loop system with
Now suppose that the last term of the right hand side of (19)
can be neglected, i.e, t( = -fT; (26)

* 2 The linear state feedback is used around the upright position.


mll:(sin 81)Bo rz 0. (20)

(This assumption is valid provided that pendulum is sufficiently 26.8


light so that it can be swing up with small Bo. ) Consequently, 19.5
(19) is reduced to

+
( J ~ ml/i)il - clil - mlllgsinO1
13. 8

6.58
......................................
......................................
....................................... . . . .
= -ml~l~o(~os~l)io (21) 8. 88
......................................
......................................
eeeecc....

.......................................
........................................
-6.58
Next we rewrite (21) in the state space form as
-13. 8

-19.5
..........
-~......~--
w*\\\b\.w--..#+++#.- w\\\\\\*w---a##+r..--

""~,,~...-.......~~--l~,,,"l-
""I,,~~---~......~--*"I,I,"
-~..~.-..T--""I,~II--~~~.~.~.~--~"I~~,"--
.
.
-T.-.~~-.-rULI.r.ru-c"5.-.~-r..-+uL~~~--
-
s44
\
.-
\
. .
\\
\\
-L-
/-
-26.8

0, [ r d ]

Fig. 4 a Vecto_r field of ( 8 ] , b 1 )i n a case of


as
Let us consider io an input of the system (22). Projected 8, = 0.0[rad/s2]
vector fields on. to (el, 81) phase plain of (22) with respect to 80 =
0 [rad/sec2] ,BO = +lo0 [rad/sec2] and 0'6 = -100 [rd/sec2] can i, [~NI/SCC]
26. 8
be obtained as shown in Fig. 4% Fig. 4b and Fig. 4c respectively.
19.5
The next step combine these vecter fields results to construct a
bang-bang state feedback. For simplicity, we suppose here that 13. 8
there is no modelling error in the motor model so that the re- 6.58
lation betwe_en the control U and the acceleration of the motor
8. 88
shaft angle 80 can be exactly derived. Consequently, the required
control law can be obtained io determine a switching law of Bo -6.58

which makes the pendulum swing up to the upright position. -13. D


It can be observed that there are many switching patterns of -19.5
80 which satisfy the aforementioned objective. One pattern used
-26.8
here is such that the corresponding 80 is small and thus (20) is -6.28 -1.71 -3.14 -1.51 8.88 1.57 3.14 4.71 6. 2 8
assumed reasonably. A proposed pattern is shown in Fig. 5 ,
where U = -uo in area A , U = 0 in area B and D and U = uo 01 [rad J

in area C. The input U is switched based on where (01,81) are in Fig. 4 b Vector field of (81,8,) i n a case of
the phase plane 80 = 10O.O[rad/s~]

I ECON '91 2195


26.8
4.1 Hardware
19.5 The detail of Each part is as follows:
13.0 1) The controlled object : Pendulum on the rotating arm.
6.58 The apparatus requires little space compared with the
e. eo conventional type. In fact, our apparatus needs only about
-6.58
50cm x 50cm area.
-13.0 2) The sensor : potentiometer and a resolver.
-19.5 Two kinds of variables are observed and each one is mea-
-26.8 sured with the following detectors.
-6.28 -1.71 -3.11 -1.57 8.88 1.57 3.14 1.71 6.28

(1) Rotational angle of arm Bo :


01
Resolver with 102400 pulses/round.
Fig. 4c Vec_tor field of ( O I I & ) in a case of
eo = -100.0[rad/s2] (2) Rotational at angle of 1st pendulum 01 :
Potentiometer with O-10V/34Oe.
3) The actuator : D.D. motor (4inch Megatorque Motor:NSI<)
-10-10V signal is given as torque command.

26. 8 4) The signal converter : 1/0board


There are the interface boards in which the signal inside
19.5
and outside the personal computer is communicated.
13. 8
(1) A/D board : converting 81 to 12-bit data.
6.50 (2) D/A board : converting 12-bit data to voltage.
(3) Counter board : converting pulse signal to 12-bit data.
0. 00
5) The controller part : Personal computer with the math co-
-6.50
processor 80287.
-13. 8
4.2 Software
-19.5
We use original realtime software (MRCOS Ver. 201) which
-26. 8 was developed in our laboratory. The program consists of
-65.8 -47.5 -38.8 -12.5 5.88
xl el 0 off-line part and on-line control calculation part written in C
nren A I 11 = - (111 language.
wen U,D t 1: 3 0 '1 [rdJ
nren C I II = ita
0 on-line input-output part and interrupt part written in macro
assembler.
Fig. 5 Vector field of by
t h e bang-bang control Changes of control law can be done by modifying the control
calculation part written in C.

4 SYSTEM CONSTRUCTION 5 EXPERIMENTAL RESULTS


A configuration of Our experimental set UP and signal flows We experimented on the rotating inverted pendulum a d corn-
Of the 'Ystem are shown '
Fig. & The Proposed Tqntroller's pared the feedforward control with the state-feedback control us-
realized on a personal computer based on 80286 (+80287). ing the phase-plane information.
The comparison was done in two cases; when all the parameters

by attaching 15[g] weight to an end point of the pendulum.


< experimental condition >
0 linear control law the pendulum is around the upright state

0 pendulum: swing-up control from -T + O[rad].


@ Personal computer
i :

..._. lDrlverL-11 0 weight : Q =diag[30 2000 0.1 101. r = 1


V

0 observer: the observer poles are multiple poles at -50.

Fig. G Configuration of t h e system 0 control period : 5[ms]

2196 I ECON '91


5.1 Swing-up control using feedforward When the parameter uncertainty was introduced, it can be seen
that while the feedforward control fails to swing up the pendulum,
The experiment results when the parameters match and when
the weight is attached are shown in Fig. 7 and Fig. 8 respectively. ..
the state-feedback control could so successfully as shown in Fig.
11.

5.2 Swing-up control using s t a t e feedback


The experiment results whei the parameters match and when Input [VI
the weight is attached are shown in Fig. 9 and Fig. 10, respec-
lively.
Input U[V1 ::::
1. 90

4.88

-4.88

-6.88
} I
-4.88
-6.88 1 -6.08
8. 88 8. 58 1. 88 1.58 2. 88

-6.88 '
8. 89 e. 58 1.88 1.58
I
2.88
TI. [sec1

11.. [=I
Fig. 9a Feedback control (without a load)
Fig. 7a Feedforward control (without a load)

9, [rdl

ee

Fig. 9 b Response of p e n d u l u m to
feedback control
(without a load)
8. 88

-4.88

-6.88

-6.88
8. 88 8.58 1. ee 1.58 2.88

Fig. 10a Feedback control (with a load)


I ECON '91 2197
1. EO A control system has been designed for stabilizing t!ie donble

.7
inverted pentluluin and realized nith ease \rhile the details have
0. E 8 n o t reported. The robiistness of t h e controlled syst.eiii I n s been
evaluated by frequency domain analysis. T h e proposed syst.em is

J
-I. ee very useful not only for univ?rsity stridents b u t also for control
engineers i n i n d u s t r y wlio wants to s t u d y coiitrol system design
-2. BE - and analysis.

-3. BE -

-4. E0

Time [..I
Fig. l o b Response of pcriduliini by
tlie feedback cont,rol (with a load)
0, [,N1/9PC]

20. E I--
_ _ _Feedforward
- (with a 10~1)
Feedback ( w i t l i o i l t a load)

15. 0

IO. 0

5.00

E. 0 0

-5.00

A . - -
-10. E - .

EO -3. E O
..
-2. 013
---
-1.EO E. 0 0
~ ~-
OD

(1, [,dl

Fig. 1 1 Trajectory in t h e (Oi,ii)


p1;rrie t o Fig. 1 2 Movement by swiiig u p control
tlie feedforward and feedback control
References
6 Concluding Remarks I<. Fnruta . "Control of uiistahle mechanical
111 S . hiori? 11. Nisliiliara and
system Control of pendulurn" Int. J. C;ontrol, vo1.23, pp.673~G92, 1976
111 this paper a new bang-bang type state feedliack control a1-
[Z] N. Bakri, N. Hecker and I; Ostertag , "Appliration of ,:ontrol distiir-
goli(1iiii wliicli can swiiig rip a p e n d u l u m from a pendant pc~siliori bance observers for the conlrol and compensation of dry frictign" Ail-
to a upright position lins been proposed. I n the control system a tomatisierungstechnik, vol.36, pp.SO-i4, 1088
conventional LQ [Purut.a,1984] control method i q also eniployrrl [ 3 ] I<. Furuta, I[. Kajiivara and I<. K z i l g e , ''1)ig;ikI control of a douti!c
around the upright position to maintain tlie pendiilrim i n the n p inverted penduiiim on an inclined rxil" Int. J . ConLiol, vol.22, pp.Pr17-
riglit position after the peiidulum was swung rip to the position 11s 921, 1980
(.lie proposed bang-liarig control. Expeiiinental results has sliowii [4] I<. Furuta, T. Ochiai, and N. O n o , " A t t , i t i i d t coiitrol of a triple inierted
that the proposed method is robust for parameter iincertaiiities of pendulum" Int. J. Control, vo1.19. pp.1351-1365, 1984
o l the corrtrolled system computing w i t h a feedforward control i n [5] \ V. hlaletinsky, h1.F. Senning and F. \Viwlerk?hr , "Observer Itascd
[hIori,1976]. control of a double penduliini " Pror. IFAC' \\'or14 Congr, pp.3383--3?87,
Since the peiidulrini is attaclied Iiy a hinge to a rntafiirg a r m 1961
fixed to a direct drive motorshaft, it contains less unccrtaiiities 161 I<. Furuta, A . Sano, D.Ahtcrton , ''Stat: iariable n i f t h o J s i n antsmatic
introtlriced by transmission mecliariisniR,t.g., a belt and gears i n control" \VII,EY I986
a liiiear type inverted pendulriin. [7] I1 hleier Z u Farwig and 11. Unhehaiien . "PisCrete c j m p u t z r control
The advaiilages of the designed pendrilrim arc as follows: " p t . CO i t . A p r . & I . l e t h n i ~ , wI.11,
of a triple-inverted p ~ n d i i l i ~ t n@
p p 151-171, l ? ' l O
I ) I t is small i n size and snvrs an experimental rooiii
181 \ Y . R . S t a r e g r o n , and h1.V. ImscutcR , "i\pplication of modal control
2) Rol,ustness of corilrol algorithms can be easily testecl w i t l i it and dynamic observers to control of a douhle in-:erted pendulum" Proc.
since kiiowri para,sitics c a n he acltletl as iincerlainlies i n t h e Ji\CC. Stanford, pp.P57-865, 1972
control loops w i t h intentions, e.g., a flexible arin can Iw used
iiist.ea(l of a rigid a r m .
2198 I ECON '91

You might also like