You are on page 1of 5

The Modelling and Control of Flywheel Inverted Pendulum System

Xiao-gang Ruan Yu-feng Wang


Artificial Intelligence and Robot Institute Artificial Intelligence and Robot Institute
Beijing University of Technology Beijing University of Technology
Beijing, 100124, China Beijing, 100124, China
adrxg@bjut.edu.cn Wangyufeng198411@emails.bjut.edu.cn

Abstract--Inverted pendulum is a control system, with the complex. [7] Takes a vertical downward pendulum with a
feature of high order, muti-variable , non-linearity and flywheel stabled at vertical upward position finally by
unstable naturally. It is quite important for us to study its packet control method. Due to control difficulty is much
balance and stability in control engineering field. In this paper, larger, so the pendulum have been stabilized in±6.34'. [8]
a flywheel inverted pendulum, as an object to be controlled, Used a method which said that neural network NARMA
the dynamic model has been established, and the mathematical control of gyroscopic inverted pendulum to control
model which established has been certificated and did system flywheel-inverted pendulum (the paper said gyroscopic
performance analysis. Then, as the linear model, the fuzzy
inverted pendulum), the results shows that the control
controller is designed based on packet control. The method can
method is effect for pendulum deviate vertical
decrease the number of fuzzy rules and avoid the rule's
explosion. The simulation results show that the fuzzy controller
position±1O' .
makes the system achieve stabilization and balance control. At present, it is fewer for the research about flywheel
inverted pendulum in our country. Especially, its research of
Keywords-flywheel inverted pendulum system; control method is at primary stage, need to further
dynamic model; fuzzy control exploration.
In this paper, taking an inverted pendulum balance
I. INTRODUCTION control system based on flywheel, the planar dynamic
model have been established by Lagrange equation, then
Inverted pendulum is a control system, with the feature
designed a fuzzy controller which based on packet control,
of high order, muti-variable , non-linearity and unstable
in order to realized balance control of inverted pendulum
naturally. In a traditional, the model of inverted pendulum
based on flywheel.
balance research which concentrate on pendulum fixed on a
moving cart, by control the moving cart so that control the II. DESCRIPTION AND MODELLING FOR AN
balance of pendulum[l][2]. [3] Advanced that biped robot INVERTED PENDULUM SYSTEM BASED ON
step forward have been abstracted an inverted pendulum FLYWHEEL
model which based on a turning flywheel, support leg have
been abstracted a massless pendulum, and the pendulum In this paper, the inverted pendulum system based on
that have been flexed, and body have been abstracted a flywheel can be abstracted a flywheel with circular ring and
flywheel. The mathematics model of inverted pendulum a rod with uniform quality. Flywheel depends on motor
established by Newton-Euler approach, however, author's driving formed reaction torque in vertical plan makes the
analysis method very complex. pendulum finally stabled at vertical upward position.
Up to mow, there are already many research methods for As showed in Figure 1, rectangular coordinates system
o - xy have been appeared in moving plane. Denote by
conventional control method of inverted pendulum, [4] used
�, 0[, (xI'Y[)' II' () L
[
PID method, optimal control strategy LQR method and the pendulum mass, its
and pole assignment method to design controllers, at the center of mass, its position coordinates, its moment of
same time, these simulation effect have been studied by inertia relative to the origin 0, the angle between pendulum
comparison. [5]established a T-S fuzzy control rules based and vertical direction and the distance from the origin 0 to
on fuzzy model identification for cart-pendulum model of the centre of mass of pendulum, respectively. Denote by
state space discretization, compare to directly control for
cart-pendulum nonlinear model, the fuzzy rules much
m2, °2, (x2,yJ, 12, rp and L2 the flywheel mass,
simple, and the control effect is rather better. [6] Used its center of mass, its position coordinates, its moment of
variable universe adaptive fuzzy controllers realized inertia relative to the center of mass of flywheel, flywheel
simulation experiment of four inverted pendulum. The rotation angle and the distance from the flywheel centre of
results of simulation show that system is very well for mass to the centre of mass of pendulum, respectively.
stability and robustness, and by the way, it also shows that Taking Lagrange equation derived kinematics equation
cart-pendulum moved to an appointed location. [9]:
However, up to now, it is very few for learn to flywheel L(q, q) = T(q,q)- V(q,q)
(1)
inverted pendulum, and the method of research also much Here, L,T,V and q are respectively, the Lagrangian operator,

978-1-4244-5540-9/10/$26.00 ©2010 IEEE

423
the kinetic energy of system, the potential energy of system (a+I2)8+I/�=bsin8-c/J
and the generalized coordinates of system. Lagrange 12(8+q;) =U-c2<P
equation can be showed in q; and L:
a
(12)
2 2
!!....(aL)_ aL _ aD = Where =m,11 +4�4 +11' b=(� +�)g4.
J;
dt aq; aq; aqi I
In condition of ignored air resistance, the upper is exact
(2) mathematical model expression of flywheel-inverted
Where i=l , 2, 3 ...n, J; and D corresponding respectively pendulum system .
to the external force which systen by generalized
coordinates and disspative force function. Let fJ and qJ III. THE LINEAR MODEL AND SYSTEM
PERFORMANCE ANALYSIS OF INVERTED
are system generalized coordinates.
PENDULUM
The total kinetic energy of system:
In order to convenient analysis and computation, when
T = TO( +1',,2 (3) 8 is smaller, according to taylor series expansion using
Where TO( and Toz are respectively, the kinetic energy of
the pendulum bar and the flywheel. {(a
approximate treatment, obtained:
+ 12!.B � 12� = bfJ c/i
. �
The kinetic energy of pendulum bar: 12 (fJ + qJ) - U - c2qJ
(13)
2
1'", = "2(ml vOI V Ol +/18 )
1 T • The upper is linearized mathematical model of inverted
(4) pendulum based on flywheel.
The kinetic energy of flywheel:
Selecting x = (XI'X2,X3,x4 l = (8,e,<jl,cjJl is state
1 2
T"2 ="2(�Vo] TVOl +128 +12<jl·2)

variable of system, here the state space expression of


(5)
The total kinetic energy of system: system:
0 0 0 0
T = "2(�vq v"2 +lp;Q ) +"2 (n;vot TVOl +lp;Q +12'p
�,J.
1 T 1
) b _s. 2.
(14)

The potential of pendulum bar:


VO( =�g� cosO
(6)

(7)
r�j·
a
0
b
a
0
a

.s.
a
0
0
o
,
-(
a

a +I
aI
,) c
'
r�l --1

a+ I
aI
a
0

,
,
u

The potential of flywheel: Here, c, 9.4xIO-J NmlV C2 =3.0xlO-4Nmesec


=

Voz =m2g(� +L2)cos8 LI = O.25m ml = 1.2kg m, = 0. 4 6kg


(8) , ,
=3.423 X 10-3 kgm
2 2 2
1\ = 2.504xlO- kgm 12
The total potential energy of system: , taking these
V =�� cos8+n;g(4 +Lz)cas8 (9)
parameters into expression(14), the state space expression

rO:j r
Combined upside equations, let LI = L2 , and obtained the of system changed into:
Lagrangian operator:
2 2
L=�[ m,4 +4mz4 +/1 +I2]fi +�I2<ji - (m, +21t1z)� cas8
2 2 (10)
jj
=
0


-24 158
1
24.158 -0.044
0 0
0 0.0014 0

0. 44� � -0.�89 :
lrB] r 1
(15) +
0
-4.651

296 667 �
u

The generalized moment of system: According to optimal control theory of linear quadratic
f = [-Izi� u - I/J]T form, in condition of state feedback control law, the system
(11)
performance index can be reached the minimum.
Where u are driving moment of flywheel(that is output det{AI - A} = 0
moment of reducer). Characteristic equation of system , by
calculating, the eigenvalue
Disspative force of pendulum bar:
1"1 = -c/i were -'I =O,� 4 8924 � -4 9378, A. -Q.0876
=
. ,
=
.
As one of =
.

eigenvalues is located in right half-plane of complex


Disspative force of flywheel: frequency domain, so, the system is unstable. The
contro11ab'l'
. M [B AB A'B A'B ] , =

1"2 = -c2¢' I Ity matrIx 0f system


Where CI and C2 are respectively, the friction factor of rank( M) = 4 , therefore, the system is complex control.
pendulum bar around 0 rotation and flywheel around
IV. MODEL VERIFICATION
O2 rotation. Finally,
Above derivation process, we used a lot of approximate
conditions, so the model whether is correct or not need to

424
verification. Here we used said necessary condition method, The \6Tiable 01 pendulum angle with input moment is zero and wrtical delinalion is 0.1 rad

that means using MATLAB tools to simulation.

!: �\
A. Verification of exact model
First, we will verify a model that before linearized. We
were only ignored air resistance, even the angle of
pendulum changed a lot, the model should be more exactly.
�4 I ��w II I II \ II '�
Using MATLAB/Simulink toolbox to verify the model,

���\
the model of system showed in Figure 2. According to

::
actual situation, because of air resistance, the angle of
pendulum shoud be do damping motion when input torque
is zero and vertical upward declination of pendulum is
111I1
O.lrad, variation curve of pendulum should be change
nearby 3.14rad, and less than 6 . 28rad, and stabled at
vertical direction finally, that is 3.l4rad. Figure 3 shows o L-�_-L_-L_�_����L-�_-L_�
simulation curve which according to upper simulation block o 10 15 20 25 30 35 40 45 50
limels\
diagram. Figure 3. The variable of pendulum angle with input moment is zero and
According to Figure 3, as the time being, we can see that vertical declination is O. l rad
the declination of vertical pendulun gradually tend to
3.14rad, the phenomenon matched with actual situation, so Step response curve of pendulum angle
2O ,--,--,--,-�-,--.--,
the results shows that the exact model is correct.
B. Verification of model after linearization
Here we used exact model and model after literalized � -20

separately calculating step response of system (the initial �


§

-40
value of pendulum angle is zero (vertical upward)).
According to Figure 4 and Figure 5, we can seen that � -SO

"0
both the model of exact and that of after linearization are � -60
nearly same about stepresponse, but the declination the
� -100

more, the last the error is larger. However, both show that
the system is unstable naturally when the initial value of � -120
pendulum angle is zero.
-140

o
-160 L-----'____'____'__-L_-'--_-'--_-'---_L-----'_----'
10
timels)

Figure 4. Response curve of pendulum angle when input torque of exact

r
model is step

17 Step response CUI'\e of pendulum angle


X 10

L------rl ,
O ,-�--,-,_-,_-._-,,_-,--,-�--,

-2

Ga,5

Figure 2. The exact model of inverted pendulum under


MATLAB/Simulink circumstance

-12

-14 L-�___'____'___-'--_-'---�L-___'____'__-'--____'
o W
lime(s)

Figure 5. Response curve of pendulum angle when input torque of model


after linearization is step

425
V. DESIGN OF FUZZY CONTROLLER BASED ON VI. SIMULATION RESULTS
PACKET CONTROL Let initial state of inverted pendulum based on flywheel
From the equation(15), we can seen that the system of is X [ 0. 1 5r ad , 0, 0, of ' that is declination of inverted
=

inverted pendulum based on flywheel have four state pendulum is 0.15rad, other initial values of input are all zero.
variable, as to ensure that the exact of inverted pendulum Used fuzzy controller which section V designed, and
system, the four state variable should be the system output utilized MATLAB/Simulink toolbox that can be realized
and return to system input, therefore, the number of input fuzzy control simulation of inverted pendulum based on
variable of fuzzy controller would be four. If we designed flywheel, simulation results as showed in Figure 7. In these
fuzzy controller directly, must be meet the problem rule figures, black curve stand for variable of declination, red
explosion, in order to avoid this problem and advance curve stand for variable of angular velocity.
efficiency of controller. In this paper, we used fuzzy From the simulation results, we can see that fuzzy
controller based on packet control. controller which designed based on packet control can be
For the four inputs available of fuzzy controller, the effect for balance control of inverted pendulum based on
relation between declination and angular velocity of flywheel in this paper. By 0.7s, the system makes pendulum
pendulum are very close, and the relation between stabled at vertical position, the response speed of whole
declination and angular velocity of flywheel are very close course does quickly, and overshooting becomes less.
too. However, the relationship between pendulum and Robustness of the controller which designed in thispaper
flywheel are alleviation a little. Hence, the four input would be verified as following, between 3s and 4s, step
variable of fuzzy controller can be divided into two groups, disturbance which amplitude is unit have been joined in
that is pendulum declination and angular velocity are one system, response curve of system as showed in Figure 8.
group; flywheel rotation angle and angular velocity are Simulation results shows that controller have better
another. As a result, the rules of control can be divided into robustness, the system can be able to stable fast again after
two kinds. One is pendulum declination and angular encountered disturbance.
velocity looked as condition, the other is flywheel rotation
angle and angular velocity looked as condition, there TABLE I. THE CONTROL RULE TABLE OF PENDULUM DECLINATION
conclusion both are control torque. Control torques of input
both relationship to pendulum and flywheel. Thus, the size e
of control torque both consideration to pendulum NB NM NS Z PS PM PB
declination and flywheel angular velocity two control NB NB NB NM NM NS NS Z
targets, so that can be realized successfully for pendulum NM NB NM NM NS NS Z PS
NS NM NM NS NS Z PS PS
system[lO].
Z NM NS NS Z PS PS PM
iJ
A. Design oJJuzzy controller PS NS NS Z PS PS PM PM
PM NS Z PS PS PM PM PB
PB Z PM PM PB PB
According to above discussion about fuzzy control rules,
PS PS
fuzzy controller would be use Mamdani class, there have
four input variable, where e, iJ, rp , ip, f are TABLE II. THE CONTROL RULE TABLE OF FLYWHEEL ROTATION
respectively, the declination of pendulum, the angular rp
NB NM Z PM PB
velocity, the rotation angle of flywheel and angular velocity,
output variable which is driving moment of flywheel. The
universe are separately [-3,3], [-3,3], [-2,2], [-2,2], [-3,3] , NB NB NB NM NM Z

using triangle, uniform distribution and total overlapping. ip NM NB NM NM Z PM


The fuzzy subsets of pendulum declination, angular and Z NM NM Z PM PM

PM NM Z PM PM PB
control torque are [NB NM NS Z PS PM PB] , that of
flywheel rotation angle and angular velocity are [NB NM Z
NM NB]. Fuzzy rules tables are showed as table I and table PB Z PM PM PB PB
II.
According to Figure 6, we can realize that the design of
fuzzy controller based on packet control of inverted VII. CONCLUSION
pendulum system. Where ko' kiJ' krp, kip and k fare According to an inverted pendulum based on flywheel,
establishing a dynamics model, and analyzing its dynamics
respectively, the quantization factor of pendulum
characteristics. In addition, we are designed a fuzzy
declination, the quantization factor of angular velocity,
controller that based on packet control, realized motion
quantization factor of rotation angle of flywheel, the
balance control of system. The method decreased the
quantization factor of rotation angular velocity of flywheel
number of fuzzy rules, advanced the control quality of
and the scale factor of input torque. By adjusting reasonably
system. Simulation results show that fuzzy controller which
quantization factor and scale factor, it can be make fuzzy
our designed can control inverted pendulum based on
controller better.
flywheel effectively, realizing stable control of inverted

426
pendulum. The whole control process which is fast, smaller [4] Xu Guoling, Yang Shiyong. "Simulationresearch of single inverted
pendulum system". Sichuan university journal, vol. 44, no.6, 2007,
overshoot and have better disturbance rejection ability.
pp. 1 01 3 - 1 01 6.

ACKNOWLEDGEMENT [5] Ma Zhitao, Houtao, Zhang Hongbin, Dong Haiying." Study of T -S


fuzzy control in inverted pendulum system". Microcomputer
This work was supported by the National Natural Information. Vo1.22, no.lO, 2006, pp.69 - 7 1 .
Science Foundation of China under Grant NO.60774077. [6] L i Hongxin, Miao Zhihong, Wang Jiayin. "Variable universe adaptive
fuzzy control of four inverted pendulum". Science of China, vo1.32,
REFERENCES no. l , 2002, pp.65 - 75.

[I] Xiao Lilong, Pen Hui. "Upswing and Stabilization Control of a Single [ 7] A.V. Beznos, A. A. Grishin, A, V, Lensky, D.E.Okhotsimsky, and
Inverted Pendulum System Based on the Langrangian Modelling". A.M.Formal'sky. "A Flywheel use-Based Control for a Pendulum
Control Theory and Application, vo1.26, no.42007, pp.4 - 7. with a fixed suspension Point". Journal of Computer and Systems
Sciences International. Vo1.43, no. l , 2004, pp.22-33.
[2] Luo Cheng, Hu Dewen, Zhu Xiaocai, Dong Guohua."Quintuple
inverted pendulum control based on LQR and fuzzy piecewise [ 8] F.Chetouane and S.Darenfed. "Neural Network NARMA Control of
interpolation". Control and Decision. Vo1.20, no.4, 2005, Gyroscopic Inverted Pendulum". Engineering.vol. 1 6, no.3, 2008.
pp.392-397. [9] Liu Yanzhu. Advanced dynamics.Beijing: Higher Education Press,
[3] Pratt, Jerry; Carff, John and Drakunov, S, "CapturePoint: A Step 2001
toward humanoid Push Recovery". Proceedings of the 2006 6th [ 1 0] Li Lijuan. "Study and application on the intelligent control method
IEEE-RAS international Conference on Humanoid Robots, based on the inverted pendulum". Nanjing: Nanjing University of
HUMANOIDS, 2006, pp.200-207. Technology, 2004.4.
Response curves of delination and angular ...elocily
0.2 ,--�-�-�-�--�-�-�-�-�----,


. -0.2 - - + - - -1 - - - 1- - - + -
-
-; 1 -
----
- + -- -1- - -1- --


iii
'S - 0
il'
.
4
I
1
I
j _ i
J
I
I I
:
_________
I I
: I
i J
I
__
I
I
______ :
I
� __ � ______:
I - - - - - - - I- - - -
� 0.6 - - - - - - - - 1- --

T T
- T 1 1 - -,---- 1 ...,
I I I I
.�

I I I J I I I I I I
:
-0 . 8 - - � - - _1 - _____ 1 � __ .J ______
1 L __ .J ___1___
I
I
II
1/ I I I I I I I I I
-1 f- - T - - -1 - - - 1- - - T ---,---- 1 - - T - - -, - - -1- --
I I I I I I I

1.2
-

0 -0
:"-
.5
::--L--..J
1.L5--'---:2.L
.5,---L--3
="
.::--
5 1---4.L5-....J
time(s)
Figure I. The model of inverted pendulum system based on flywheel
Figure 7. Response curves of declination and angular velocity

Response CUM of declination and angualr >velocity under the disturbance


O .4 ,---,-�--.---,------,"::"- " --,----,---
" ,-"::"-,-
.
I,

g
>. 0.2 - _ ..! - - _ - __
1 � __ ..! ___1___ !... __ ....! ___ILl __
I I I I I I I 1/ \

� ol\,� , : - -! ' : \

I
I
1 -0.2
"'C
I I I II I
� - .! - - _1 - __ '- __ ..!. ___1___ !.. � _ J ___1__ _
I
I
I I

I I I I I I I\! I I
!6
o I I I I I I �( I I
I
a
-0.4 4. _ 1 ___1___ L __ .1 ___1___ !... __ J ___1___
.� I I I I I I I I
� I I I I I I I I I
a
- 06. � � - - - _1 - - - L __ .1 ___1___ L __ .J ___1___ L __

� l r I I I I I I I I
� -0.8 __
f J. ___1___ L __ .1 ___1___ L __ .J ___1___ L __

E

� _1 ,1- _ J. ___1___ L __ J. ___1___ L __ .J ___1___ L __
I

Figure 6. Fuzzy control schematic diagram of flywheel-inverted -1 2


. !:-0---::'0-:- .5--="---:,-':.5--
, --:�-::'.5 ---':---:3-':.5---.JL--J
2-:- .4 .=-
5. ­
pendulum system time(s)

Figure 8. In the condition of disturbance, response curve of declination


and angular velocity

427

You might also like