You are on page 1of 4

20 1O International Conference on Computer, Mechatronics, Control and Electronic Engineering (CMCE )

Intelligent Control in Two-wheel Self-Balanced Robot

WuWei Ma Xiaoning Wang Jijun


School of Electrical Engineering, School of Electrical Engineering, Personnel Testing Bureau of
Shenyang Shenyang Liaoning Province
University of Technology University of Technology Shenyang, China
Shenyang, China Shenyang, China wangjijun2005@sina.com
wuweiedu@ 163.com maxiaoningxiaoyan@ 126.com

Abstract-To balance the two-wheel self-balanced robot, it is


essential that the system is able to quickly rectify after it
deviates from the balance. This paper proposes to combine
fuzzy control and traditional PID control which in turn
minimizes the impact of disturbance. Fuzzy control is
independent on the mathematical model of the controlled
system, and it is applicable to non-linear system as well. It
minimizes the impact of disturbance and parameter variation,
and improves the effectiveness of the control system. It is
tested by experiment and simulation that fuzzy PJD
controller is fast and robust.

Keywords-two-wheel self-balanced robot;/uzzy control;PID


control

I. INTRODUCTION
Two-wheel self-balanced robot which belongs to wheel
Figure I. Structure of two-wheel self-balanced robot
robot was introduced in 1990s. It is simple in structure,
agile in movement, and capable to operate in narrow and After it measured the current position of the system,
dangerous environment; therefore, it can be widely used in the sensor sends the data to MCU to process. Based on the
military, civil, and aviation industry. At the same time, due
control algorithm in MCU, required angular speed is
to its unstable dynamic behaviours, Two-wheel self­
calculated. The speed is then transformed to PWM control
balanced robot also becomes the ideal terrace to verifY
signal, and sent to L298N drive module of the motor,
various control algorithms.It is a fast, multi-parameterized,
non-linear, and unstable system in nature. Therefore, it which makes the motor rotate and reduces speed. Then the
must be improved to be more accurate, stable, and robust. system is re-balanced.
It is difficult to achieve this with traditional Proportion B. System modeling
Integration Differentiation (PID) controller; whereas fuzzy
control mechanism is effective to solve the non-linear and Lagrange equation is heavily used in modeling of the
fast-changing problem, and minimize the impact of dynamic system [3], shown as the following figure.
disturbance and change of parameters. Fuzzy control is
independent on the mathematical model and complication
of the studied system. It is able to operate properly with the
control rules defined by the operator. This thesis is focused
on the control strategy on speed adjusting of DC motor.
This thesis proposes to combine traditional PID control
and fuzzy control together. It proves that proposed method
improves the disturbance resistance, speediness and
robustness of system [ 1-2].

II. SYSTEM DESCRIPTION AND MODELING

Figure 2. Schematic diagram of the system


A. System description
Two-wheel self-balanced is illustrated in figure 1. MJ, M2, M3: mass of left wheel, right wheel and
After gyro sensor evaluated the inclination, the rotating pendulum respectively; FJ, F2: moment coefficient of
motor quickly reacts back, according to that measured
friction of left wheel, right wheel; F3: moment coefficient
angle, and maintains the system inclination at around 0°,
of friction of pendulum shaft ; Jj , J2 :rotation inertia of
so that the system is dynamicalJy balanced.

978- 1-4244-7956-61 10/$26.00 ©20 10 IEEE CMCE 20 10


470
left wheel, right wheel ; J3 , J3 p : rotation inertia of
pendulum; R: radius of left and right ; D: the pitch between
left wheel and right wheel; LI : the distance between
pendulum and shaft; 01 ,O2 ,03 :comer of left wheel, right
wheel and pendulum; r , OJ: inverted pendulum overall
speed and rotational angular velocity.
Model and control system design are as follows:
Figure 3. Fuzzy PID parameter control system schematic diagram
_ oL _
!!....[ ]OL
Q ( 1)
dt oqk oqk B. Selection ofQuantity and Proportionality Factors
Which: We need transform actual domain of inputs in to
Ek-Total system kinetic energy, correspondent domain of fuzzy set while fuzzifying and it
is implemented by quantity factors Ke and Kec. Controlled
Ep-Total system potential energy,
variables which come from fuzzy algorithm in each
qk-Generalized coordinates, sampling should transform into the basic domain of the

=
Qk-Generalized Force. controlled object by proportional coefficient Ku[4].
Total system kinetic energy: Consider error signal e basic domain[-Xe -Xe], and its
Ej =Ekj+Ek2+Ek2+Ek4
corresponding domain is discrete domain { -n,-(n-
1), ... ,O,(n-1),n},thus quantity factor Ke is defined as:

==
1 2 2 1 2 2 1 · 2
=-(mjR Bj +JjBj)+-(m2R B +J2B2)+-m3 [(aJLj smB3) +
2 2 2 Ke ni X e (9)
1 2 . 2 1 2 1 2
(-B3Lj cosB - R(Bj+B2)) +( -B3Lj smB) + J3B3 + J3paJ
Similarly, if the same range of domain is selected,
"2 "2 "2
quantity factor Kec can be express in this case
(2) Kec nl X ec (10)
System potential:
And proportional coefficient is denoted as follow:
L==Ek-Ep
Ku Xu l n (II)
Ek==Epl + Ep2 + Ep3 + Ep4 == m3gLI cos 03 (3)
C. Definition ofMembership Function of Parameters
Mathematical model:
The fuzzy parameter range for e and ec are all defined

( '
m, R +J, +
m3R
4
'
+
J 3pR
D 2
'
J (
ij +
,
mJR2
4
-
J3pR2
D'
,
m L
2
3
J
ij + JR 'ij - M
1. -
as [NB, NM, NS, 0, PS, PM, PB], corresponding
represent respectively [negative big, negative medium,
negative small, zero, positive small, positive medium,
(4) positive big]. The actual domain range of e is [-24, 24]
[ ' 1 mJR
m,R + ,+ 4 +
' JJpR
D2
'
ij +
2
mJR J [
' lJpR'
4 - D 2 ij,+
m3RL'
ijJ = Mi
r
J 2
and it become [-3, 3] when quantitized. The actual domain
range of ec is [-500, 500] and it become [-3, 3] when
(5 ) quantitized. The fuzzy range for Kp' Ki and Kd are all
m3�·· m3�·· 2 \;; ( .. defined as [O,PS,PM,PB], corresponding respectively
-- OJ + °2 + m3� +J3p3 -m3gLj03
-- = 0 (6 ) represent [zero, positive small, positive medium, positive
2 2
Two-wheel self-balanced car's speed and the rotational big]. The domain range for Kp and Ki are all [0, 20], The

=
angular velocity: domain range of Kd is [0, 10]. Their membership function
is illustrated in figure 4-6.
v = (81 + 82)R / 2 (7)

":K<xX»1
OJ (-01 + 02)R / D (8)

III. DESIGN OF FUZZY PID CONTROLLER

A. Principle offuzzy P1D control


-3 -2 -1 0 1 2 3
Fuzzy PID control design fuzzy rules based on various
operational situation of the system and also consider the
Figure 4. Membership function of e and ec
relation of proportional coefficient Kp, integral coefficient
Ki , differential coefficient Kd , and then apply the fuzzy
rule adjust the three parameters. It takes error signal e and PS PM

error gradient signal ec as inputs and the outputs are Kp,


K, and Kd. It should fuzzy e and ec at first and makes
fuzzy decisions and reasoning based on the fuzzy rule,
o��
and fmally proceeds the defuzzification calculations.
Therefore, the three parameters can be adjusted online. o � 10 12 14 16 18 20
This principle is illustrated in figure 3.
Figure 5. Membership function of Kpand Ki

471
I I
PS PM
IIffilffil�I�I�I�I�l
e
I I I I I
NB I I NM

ffil
I NS 0
ec
PS PM PB

IV. TEST OF SIMULATION

To prove the effectiveness of proposed fuzzy control


mechanism, simulation is run on Fuzzy Logic, MATLAB,
to simulate the control system of motor speed adjusting
[6]. The parameters of the motor are shown as follows.
Figure 6. Membership function of Kd Voltage: 24.0 V
No-load speed: 6460 rpm
D. Definition ofthe Fuzzy control rule Rated speed: 5020 rpm
Rated torque: 44.4 Nm
According to the reference, while the system is being Rated Current: 1.30 A
controlled, the adjusting rule for different lei and leel, Electrical time constant: 15.0 ms
parameter Kp' Ki, Kd is summarized as follows[5]. According to above parameter, the mathematical
1) When lei is larger, to improve the traceability of the model of the motor is shown as below.
system, it is advisable to take larger Kp and smaller Kd;
meanwhile, in order to avoid a greater overshoot,
integration should be limited, normally it is defined as
Ki=O.
2) When lei is medium, to avoid system over adjusts,
Kp should be small. In this case, Kd has a larger impact in
the system. Ki should be properly chosen.
3) when lei is samller, to improves the stability of the
system, Kp and Ki should be larger. Meanwhile, to avoide
vibration from the defined constant, Kd depends on leel:
when leel is smaller, Kd should be larger, and vise versa.
In normal situation, Kd is medium.
According to these adjusting rules of PID parameter
and the advice of expert, the control rules for output pa­
rameter Kp' Ki, Kd is listed in table I-III.

TABLE I. CONTROL RULE OF Kl' Figure 7. Motor Speed Control System

ec
e Figure 8 shows the deviation of angular speed of fuzzy
NB NM NS 0 PS PM PB
NB PB PB PM PM PS 0 0 PID control and traditional PID control, when disturbance
NM PB PB PM PS PS 0 PS is added at t=0.22s, while dotted line represents PID
NS PM PM PM PS 0 PS PS control and solid line represents fuzzy PID control. The
0 PM PM PS 0 PS PM PM response of reducing overshoot and anti-interference
PS PS PS 0 PS PS PM PM
performance of fuzzy PID control is more superior then
PM PS 0 PS PM PM PM PB
PM PB PB
traditional PID control.
PB 0 0 PM PM

TABLE II. CONTROL RULE OF Ki

ec 7000 ,------;--�---r-�----;--r-�����-=-o
e
NB NM NS 0 PS PM PB 1 _- fuzzy PID control
- - - traditional PID control
NB PB PB PM PM PS 0 0 6000 -
NM PB PB PM PS PS 0 0
NS PB PM PS PS 0 PS PS 5000 -

0 PM PM PS 0 PS PM PM
I I
PS PM PS 0 PS PS PM PB 4000 r T
-

PM 0 0 PS PS PM PB PB
0 0 PS PM PM PB PB 3000 -, -r -, T r -
PB
I

2000 -t -t � - I t- -
TABLE IIJ. CONTROL RULE OF Kd I
I I
ec 1000 ---- � -- � -- � -- � - I-----+--�--
e I I I ' I
NB NM NS 0 PS PM PB
NB PS PS PB PB PB PM PS °0��OL. l �0�.2-� 0.3��0.4��
07
. 5 �07.6�0�
.7 -� 0. 8��0. 9��
NM PS PS PB PM PM PS 0 time(s)

NS 0 PS PM PM PS PS 0
0 0 PS PS PS PS PS 0
PS 0 0 0 0 0 0 0 Figure 8. Simulation curve of motor speed
PM PB PS PS PS PS PS PB

472
V. CONCLUSION REFERENCES

The paper discusses the method of controlling the [I] Zhou Hengda, "Design and Implementation for A Two-wheel
Vehicle," Institute of Electrical Engineering, National Central
angular speed of two-wheel self-balanced robot using
University, Taiwan, 2007, pp. 1-3.
fuzzy PID and establish simulation model in
[2] Li Shiyong, Fuzzy control, Neural control and Intelligent Control
MATLAB/Simulink. The simulation proves that fuzzy Theory, Harbin Institute of Technology Press, Harbin, 2004.
PID control has a better performance, compared with
[3] Zhang Peiren and Zhang Zhijian, 16/32-bit DSP-based Robot
traditional PID control, small vibration amplitude and Control System Design and Implementation, Tsinghua University
short adjusting time, good disturbance resistance and good Press, Beijing, 2006.
robustness. The PID control method and added fuzzy [4] Wang Lingli, "The Application of Fuzzy PID Control in Three­
algorithm improves disturbance resistance and dynamic Tank Water Level Control ," Hefei University of Technology,
tracking performance. Fuzzy PID is more suitable in Hefei, 2007, pp. 16-20.

improving control performance in two-wheel self­ [5] Yang Yongmei, "The Design of DSP Speed Control of Brushless
DC Motor and Simulation of Fuzzy Control," University of
balanced robot.
Electronic Science and Technology, Chengdu, 2006, pp. 48-51.

ACKNOWLEDGMENT [6] Zhang Guoliang and Deng Fanglin, Fuzzy control and its
application of MATLAB, Xi'an Jiaotong University Press, Xi'an,
The research was supported in part by Liaoning 2003.
Province Educational Foundation project under 200850 1.

473

You might also like