You are on page 1of 6

Copyright © IFAC Advances in Control Education

Massachusetts, USA, 1991

A NEW INVERTED PENDULUM


APPARATUS FOR EDUCATION
K. Furuta*, M. Yamakita*, S. Kobayashi** and M. Nishimura***
*Tokyo Institute of Technology, Oh-Okayama, Meguroku, Tokyo, Japan
**Nippon Seiko Co., Soujya, Maebashi, Gunma, Japan
***Tokuyama Soda Co., Mileage, Tokuyama, Yamaguchi, Japan

Abstract. An inverted pendulum fixed by a hinge to a rotating arm is proposed for control researches
and for control laboratory experiments. It does not have the driving means such as belt or wire which
yields uncertainties, and can also be used for the experiments of a running inverted pendulum. A
controller is designed for a double inverted pendulum taking the uncertainties into consideration. A
partial nonlinear controller is studied to expend the conventional linear one for linearizing the part of
the nonlinear pendulum model.

Keywords. Education; control equipment; inverted pendulum; microcomputer-based control; state-


space model.

1. INTRODUCTION dynamics induced from the driving belt and students can
also experience the control of inverted pendulum running on
Control systems can be examined by stabilizing unstable me- an infinitely long rail.
chanical system. Inverted pendulum has been a good ex-
ample not only for studying control practically but also for The linear model of pendulum has used for the control de-
verifying designed linear control systems (Bakri, 1988). Sev- sign, and the linear controller is designed for the derived lin-
eral researches have been done using inverted pendulum. A ear model, since no exact linearized control law exists. This
single pendulum is used to demonstrate stabilization as well paper also proposes a partial nonlinear controller taking par-
as feedforward control of swinging up from the down to up tial nonlinearity into account.
position (Mori, 1976). Double inverted pendulum is used to
evaluate approaches in control system design (Furuta, 1980; This paper organizes as follows. Section 2 describes the spec-
Maletinsky, 1981; Stutegeton, 1972). Several modified ver- ification of the proposed double pendulum system concerning
sions of pendulums have also been studied (Furuta, 1984; hardware and software. Section 3 gives the derivation of the
Meier, 1990). model, and in Section 4, the control system is designed.

In addition to using for researches, many universities recently The experimental system is briefly depicted in the following
use inverted pendulums as control laboratory experiments, figures. The control system for double inverted pendulum
since they are simple but typical unstable systems. The con- is described and that for a triple inverted pendulum is chal-
ventional inverted pendulum is hinged to a moving cart on a lenged.
linear rail of a certain length and the cart is driven by timing
belt or wire rope which yields unmodelled dynamics. During
control system design course, students design unacceptable
controllers which can not cope with unmodelled dynamics
and nonlinearity, Then the system has its cart crashing to
the stopper at the end of the rail, and the pendulum system
should be repaired.

To avoid this kind of collision and to make inverted pendu-


lum more robust and suitable for control laboratory experi-
ments, this paper proposes to use a new inverted pendulum
mechanism, where the cart is settled on an end of a bar whose
other end is fixed to the rotating shaft of a motor. A direct
drive motor is used in our experiment. Proposed apparatus
(a) Conventional type (b) New type
has rather strong nonlinearity in comparing with the con-
ventional one. Rut it does not have the strong unmodelled Fig. 1. Outline of apparatus

133
2. SYSTEM CONSTRUCTION 3. MODELLING OF CONTROLLED
OBJECT
A personal computer is included in our control system. Fig.
2. shows the signal flow of the system. We derive fundamental dynamics by Euler-Lagrange's
method. The results become nonlinear ordinary differential
equations. Next, to apply linear control theory we linearize
2.1 Hardware them to obtain state space model. We compute model pa-
rameters from measured data.
The detail of Each part is as follows:
1) The controlled object : Pendulum on the rotating arm.
3.1 Calculation of Energy and Input Torque
The apparatus requires a few space comparing with the con-
ventional type. In fact, our apparatus needs only about 50cm
On the use of notations, see Fig. 3. and Table 1. Subscripts
x 50cm area.
0,1,2 represent every variables on the arm, the 1st, and 2nd
2) The sensor part : Two potentiometers and a resolver. pendulums, respectively. Kinetic energy 7^, potential energy
Three kinds of variables are observed, each one is measured V{, and dissipation energy V{ (i — 0,1,2) are obtained as fol-
with the following detectors. lows. Three kinds of total energy T, V, V are obtained as
(1) Rotation angle of arm 90 : sum of arm, the 1st, and 2nd pendulums. The input torque
Resolver with 102400 pulses/round. is applied to only the arm, so (7) is obtained.
(2) Rotation angle of 1st pendulum 0y :
Potentiometer with 0~15V/340°. 1. The arm
(3) Rotation angle of 2nd pendulum 02 :
Potentiometer with 0~15V/340°. % = 2J°0o ' V
° = ° ^Co^n (1)

3) The actuator part : D.D. motor (4-inch MTM) 2. The 1st pendulum
-10~10V signal is given as torque.
4) The signal converter part : I/O board
Here is the interface part at which the signal inside and out-
„- 1 T k-> 1
\di
(LQ sin #o + *l sin #i cos 0o

+ i j f (L 0 cosflo - h sin0i cos0 o ) i + { ^ {h cos0i) j


r
side the personal computer is exchanged. (2)
(1) A/D board : converting 6i,62 to 12-bit data.
(2) D/A board : converting 12-bit data to voltage. Vi = migli cos#i 2>x = -del (3)
(3) Counter board : converting pulse signal to 12-bit data.
5) The controller part : Personal computer with the math 3. The 2nd pendulum
co-processor 80287. T2 = 2J2°o

+ -W2 < — {LQ sin 0,) + L\ sin 0i cos #0 + ^2 sin 02 cos0 o ) \


2.2 Software

{
1 \2
— (Lo cos 0O - L\ sin 6\ cos 0O - h sin 02 cos 0O) >
We use original realtime software (MRCOS Ver. 201) which
was developed in our laboratory. The program is made of
+ |-^(L1cos014-/2cos02)| (4)
• off-line part and on-line control calculation part
written in C language.
V2 = in2g{Li cos0i + f 2 cos0 2 ) » V* = o 6 * 2 ^ 2 ~ ^ ) (5)
• on-line input-output part, interrupt part
written in macro assembler. 4. Total energy T , V, V
Changes of control law can be done by modifying the control
calculation part written in C language.

5. Input torque F

F0 = V , Fi=0 , F2 = 0 (7)

TABLE 1 Notation
physical variables notations
rotational angle e
mass m
total length L
distance to I
center of gravity
inertia J
Personal computer friction coefficient C
input torque V

F i g . 2. Construction of the system Fig. 3. Illustration of variables

134
3.2 Euler-Lagrange's Dynamic Equations 3.4 Identification of Parameter
(Nonlinear Model)
Coefficient matrices are represented by physical variables of
According to Euler-Lagrange's method, mass, total length, distance to center of gravity, inertia, and
friction coefficient of the arm, the 1st and the 2nd pendu-
£9L_d-L OIL ?R. lums. Table 3 shows the measured and estimated values of
(t = 0.1.2) (8)
<it d9i o$i +
odi +
O0i ~ ' these variables. Inertia and friction coefficients are estimated
from the following experimental data (see Fig. 4. in the next
are calculated, then the following equations are obtained. page).
r 0o i [00 1 rv] 1) A response curve of the arm
0i + M 0i +W= 0 (0) 2) A damping curve when the pendulum is oscillated
[o2 J L <?2 J 0 slightly.
where coefficient matrices L, M , N are given in the left From these values, the state space model is obtained as
hand side of Table 2. (15)~(19).

3.3 Making of State Space Model


T A B L E 3 List of Measured and Estimated Values
From dynamical equation derived in Section 3.2, each coeffi- physical value
cient matrix of #i, #,,#,- (i = 0,1,2) involves 0i,#2 taking the value notation unit arm 1st pendulum 2nd pendulum
form of sm0j,cos0i(i = 1,2), so this equation is nonlinear mass 0.10 0.16 0.1C
ITli IkRl
ordinary equation. By linearizing this one on the vertical total length Li [in] 0.215 0.19 0.19
inverted state 0i = 0,02 = 0, following equation is obtained. distance to
gravity center h H 0.10 0.17 0.17
[0o 1 [0o 1 [ 0o 1 ' V " inertia Ji [kg-m2] 1.75 x 10~2 3.41 x 10" 2 3.41 x 10" 2
L' 01 + M' 0i + tf' 01 — 0 (10) friction
coefficient Ci [N-m-s] 1.18 x 10" 1 2.32 x 10" 1 2.32 x 10" 1
L02 J 1.02 J Ih\ 0
where coefficient matrices L, M, N are given in the right
hand side of Table 2. [ 0 3.55 x 101 -1.60 x 10° 1
£/-i ( _ # ' ) =o 9.43 x 101 -5.66 x 101 (15)
[ 0 -1.03 x 102 1.71 x 102 J
Consequently, by rewriting into the state space model, we
-6.57 x 10° -1.48 x 10 _ 1 1.62 x 10" 1 1
have
L'-1 {-M') = | -7.54 x 10° -6.03 x 10" 1 1.10 x 10° | (16)
r 0o" 8.25 x 10° 1.10 x 10° -2.59 x 10°
0i 03 3.90 x 101
o3 h 02 L'" 1 4.47 x 101 (17)
L'-l{-N') L'-l{-M')m
00
+ L'-1 "rV (11)
-4.89 x 101
0i 0
L 02. 0
•System poles: 13.1,6.21,0,-3.16,-8.75,-17.1 (18)
• Condition number of the controllability matrix : 5.04 x 10 - 1 5 (19)
(So, this system is unstable and controllable. )

T A B L E 2 Linearization

Linearization
at upright state
Coefficient matrix of nonlinear model Coefficient matrix of linear model
(Function of 0) (Constant)

./„ + ?n.i (L 2 + /fsin 2 0! J 0 +777,!Lo + 777-2 L§ ( 77l l l2 + m2 L\ ) L0 m2l2L0


2X (m-ili+m2L\) LQ cosQ1 in^hLo cos6
+?n.2{Lj + (Lisin0 1 +/ 2 sin02) }
L= >L' = (777^/2 + m2Li) L0 Ji + 777^/5 + m2L\ m2l2L1
(m\ l\ + ir\.2L\) LQ COS 0I J\ + mi/ 2 + ?n2L2 in2l2Li cos (0i - 92
?7l2/2 £o COS 02 m2l2Li cos (0! - 02) J2 + 777.2/2 in2l2L0 m2l2Li J2 + m2lj
(12)

C 0 + 2777.1/Jsillf?1 COS0!0!
+ 2777,2 (Zq Sill 01 + l2 Sill 0 2 ) - ( w i l l + 7 n 2 L i ) L 0 sin 0 i 0 i — 777.2/2Lo Sill 0202 C0 0 0
(Li COS 010! + / 2 C O S 0 2 0 2 )
M= >M'-- 0 Ci+C2 -C2 (13)
{77i!/ 2 sin 20i cos 0i + 7n 2 {L\ sin 0i
Ci + C2 -C2 + m2l2L0 sin (0i - 02) 02
+ / 2 sili 0 2) L\ cos 0 i } 0O
0 -c2 c2
L ?"2 {Li sin 0i -I-1 2 sili 02) l2 cos 0 20o -C2 - m2l2L0 sin (0i - 02) 02 C2

0 0 0 0 0 0
0 — (7711/1 + 7 n 2L i ) <7sin0i 0 >N' ■- 0 -{m^i +777,2 Li) 0 (14)
0 0 — 7772/2tfsin02 0 0 -m2l2g

135
Fig. 4. shows the experimental data used for the parameter 4. CONSTRUCTION OF CONTROL
estimation. SYSTEM

The parameters Jo a n c l Co of the arm are decided by on-line With state space model (10) obtained for the inverted pen-
closed-loop identification experiment with the self-tuning dulum on the rotating arm, we construct control system
control. Fig. 4.(a) shows trend of input torque K, the re- which keeps pendulum upright at 61 = 62 = 0. Here, we
sponse curve of the arm 60 and its differential velocity 90, use observer-based optimal regulator control system funda-
when the reference pulse of -0.3 and 0.3[rad] is added. Fig. mentally.
4.(b) shows the change of J 0 a nd Co. In about 2[s] after
start, both parameters converge.
4.1 Application of Linear Control Theory
The parameters Ji, Cu J2, and C2 of the 1st and 2nd pen-
dulum are decided from a damping curve which is obtained 1) Design of the optimal regulator
when the pendulum is oscillated slightly. Fig. 4.(c) shows Consider the quadratic criterion function J
the result. From the figure, it is obtained that one cycle time poo , .
is 0.825[s] and the damping ratio is 0.9. In our experiment, J = / (xTQx + ru2) dt (20)
the 1st and 2nd pendulums have the same length, so we use
the equal value on both and the optimal feedback gain / . If the design parameter
weights Q and r are decided, then / is obtained.
BadxIO"
5.00
2) Design of observer
We use minimal order observer. And we select observer poles
as design parameters, and F, Q, R, Si, S2 are obtained by
Gopinath's method.

z = Pz + Qy + Ru (21)
-1.00
x = S\z + S2y (22)

3)Design of closed loop system


-5.00 Using the optimal regulator and the minimal order observer
0.00 0.30 0.G0 0.90 1.20 1.50 1.80 2.10 2.40
obtained in 1) and 2), we construct closed loop system with
[SEC]

(a) Input torque & response curve of the arm u = -fTx (23)
r2

4.2 Utilization of Nonlinear Terms

We know that nonlinear terms of inverted pendulum on the


rotating arm have their representations as in (8). So, we
consider a method to compensate nonlinear terms for con-
trol system designed with linearized system. Here, by the
concept of compensating input, we construct an improved
control architecture using V which is the sum of V and the
undertilded nonlinear terms of (8).
0.00
0.00 0.30 0.G0 0.90 1.20 1.50 1.80 2.10 2.40
[SEC]
V = V+ [ MnMl2Mu ] (24)
(b) E s t i m a t i o n values of t h e p a r a m e t e r s

where
[ r 9c i ] x l cT 2
27ni/Jsin0i cosfl^i +m2 (Zq sinfli + / 2 sm02)
5.00
x(L 1 cos^ 1 ^ 1 + / 2 cos0 2 02) (25)
M 12 -{in^i +m2Li)L0 sin0i<?i (26)
3.00
M13 -m2h LQS'U\02 02 (27)

1.00
/ Nonl i noar "\
\ compensation/
-1.00 h « I i
( =V) | + i
+ - F Object
*sJ *
( O u t s i d e of
-3.00 ,- Optimal (1 i v e r t e d Pend j 1 urn ) Computer)
I One cycle time Damping ratio fiain
0.825 0.9 ( I n s i d e of
Computer )
-5
0.00 1.00 2.00 3.00 4.00 5.00 G.00 7.00 8.00 Observer
>
[sec]
(c) Damping curve when the pendulum is oscillated

F i g . 4. Experimental data Fig. 5. C o n s t r u c t i o n of c o n t r o l s y s t e m

136
5. EXPERIMENTAL RESULTS <C discussion >
In the case of double inverted pendulum, selection of weight
Two illustrative examples will now be given. At the begin- affects control property strongly. The proper combinations
ning of each experiment, we set both pendulums into their are very limited, which enables inverted pendulums to keep
upright position. upright. Our combination was found after many trial and
error.
It is well known that use of observer occurs less robust prop-
5.1 Position Control of Double Inverted Pendulum erty than use of state feedback. To examine how extent of
robust property our designed control system, we draw the
First, the experimental result using the control law with non- Nyquist plot. The plotted transfer function is the open loop
linear term stated in section 4.2 is shown. transfer function broken at point x in Fig. 5. The figure
says that robust property recovers comparably.
<C experimental condition »
Im
• angle change of arm : 0—>5[rad]
• weight : Q=diag[3 ,100,10000,0,0,0], r = l 10.0
• estimation of velocities : observer with four poles at -10+0i
• sampling time : 6[ms] 8.00
<C results >
6.00 Optimal
Control can be done with no saturation of input torque.
The disturbance to the extent of strength touched by a finger 4.00
enable inverted pendulums to keep upright.
2.00

0.00

-2.00

-4.00

-6.00
Optimal + Observer
-8.00

-10.0
-12.0-10.0-8.00-6.00-4.0O-2.00 0.00 2.00 4.00 6.00 8.00
Re
0.00 0.G0 1.20 1.B0 2.40 3.00 3.GO 4.20 4.80 Fig. 7. Nyquist diagram
[sec]
(a) Angles
[rad/s] 5.2 Slight Angle Control of Single Inverted Pendulum
20.0
We use single pendulum in this experiment. This type of
experiment reveals the originality of our apparatus.
10.0
<C experimental condition >
0.00 h • reference angle : 0.1 [rad]
• weight : Q=diag[l x 10- 5 ,100,0,0], r = l
• estimation of velocities : difference of angles
-10.0
t sampling time : 4[ms]
<C results >
-20.0, In about 5[s], arm continued rotating to one direction.
0.00 0.G0 1.20 1.80 2.40 3.00 3.GO 4.20 4.80
In the case of conventional type, soon the cart will soon crash
[sec]
(b) E s t i m a t e d velocities w i t h observer
to the stopper, so this kind of control is impossible.
Input [v] [rad]
1U .U

5.00

0.00
\^P0^\?^fM^
-5.00

_m n
0.00 0.G0 1.20 1.80 2,40 3.00 3.GO 4.20 4.80
[sec]
0.00 0.40 0.80 1.20 1.G0 2.00 2.40 2.80 3.20
(c) Input torque
[sec]
Fig. 6. Experimental data Fig. 8. Experimental data

137
6. CONCLUSION

A new inverted pendulum is designed for the examination of


the control system. The pendulum is attached by a hinge to
a rotating arm fixed to a direct drive motorshaft and found
to have less uncertainties induced by the driving actuator of
the cart. It is not only small in size but also used for variety
of control experiments such as studying the effects of model
uncertainties in the control system design, since flexible arm
can be used for the rigid one for such purpose.

The control system is designed for stabilizing the double in-


verted pendulum and realized with ease. The robustness of
the controlled system is evaluated from the frequency do-
main analysis. The proposed system works satisfactorily to
study the control system design and is useful for not only
university students but also control engineers in industries.

REFERENCES

Mori, S., H. Nishihara, and K. Furuta (1976). Con-


trol of unstable mechanical system Control of pendulum.
Int. J. Control, 23, 673-692.

Bakri, N., N. Becker, and E. Ostertag (1988). Application


of control disturbance observers for the control and compen-
sation of dry friction. Automatisierungstechnik, 36, 50-54.

Furuta, K., H. Kajiwara, and K. Kosuge (1980). Digital


control of a double inverted pendulum on an inclined rail.
Int. J. Control 32, 907-924.

Furuta, K., T. Ochiai, and N. Ono (1984). Attitude control


of a triple inverted of pendulum. Int. J. Control, 39, 1351-
1365.

Maletinsky, W., M.F. Senning, and F. Wiederkehr


(1981). Observer based control of a double pendulum.
Proc. IFAC World Congr., _,3383-3387.

Meier Zu Farwig, H., and H. Unbehauen (1990). Dis-


crete computer control of a triple-inverted pendulum.
Opt. Cont. App. k Methods, U , 157-171.

Mori, S., H. Nishihara, and K. Furuta (1976). Control


of unstable mechanical system — Control of pendulum.
Int. J. Control, 23, 673-692.

Sturegeon, W. R., and M.V. Loscutoff (1972). Application


of modal control and dynamic observers to control of a dou-
ble inverted pendulum. Proc. JACC. Stanford, , 857-865.

138

You might also like