Escolar Documentos
Profissional Documentos
Cultura Documentos
1, March 2007
© 2007 TFSA
C.-C. Wong, et al.: Fuzzy Controller Designed by GA for Two-wheeled Mobile Robots 23
tion 2, the kinematics model of the considered the robot (the xm-axis) and θ = ω denotes the rotational
two-wheeled mobile robot is described and a motion
angle velocity of the robot. The value of θ is positive
fuzzy control structure is proposed. The motion fuzzy
when the robot rotate counterclockwise and the value of
controller with four input variables: d (the distance be-
tween the robot and the destination), ∆d (the change θ is negative if the robot rotate clockwise. The robot’s
quantity of motion distance), α (the rotation angle of ro- motion is controlled by its velocity v and angular veloc-
bot), and ∆α(the change quantity of rotation angle) are ity w, which are function of time.
proposed to determine two velocities of UL and UR to Y
vL
independently control the left-wheeled motor and ym
right-wheeled motor, respectively. In the motion fuzzy xm
control structure, two 2-input-and-1-output fuzzy sys- v
tems: distance fuzzy controller and angle fuzzy control-
θ
ler are proposed to reduce the design complexity. In Sec- X
p( xo , yo ) vR
tion 3, a GA-based fuzzy controller is described, where a
2L
membership function ratio coefficient coding method
and a variable fitness function is proposed to select the 2R
input and output membership functions of fuzzy systems.
In Section 4, some simulation results are discussed, X
where three motion control methods are compared: (1) Figure 1. Schematic diagram of a two-wheeled robot for the
the parameter motion control method; (2) the experi- motion control.
ence-based motion fuzzy control method; (3) the
GA-based motion fuzzy control method. Finally, some Two wheels are fixed in the considered mobile robot
conclusions are made in Section 5. and each wheel is controlled independently by each mo-
tor, so the forward velocity of the robot and the wheel
2. Motion Fuzzy Controller Design angular velocity are described by
1 1
A two-wheeled mobile robot is considered and its v 2 vL
= 2 (2)
structure is described in Figure 1, where X-Y is the ω - 1 1
vR
global coordinates and xm-ym is the local coordinates 2L 2L
which is fixed to the robot with its center p as the origin. where L is the displacement from the center of robot to
As shown in Figure 1, its body is of symmetric shape the center of wheel. vL=RωL and vL=RωR are the linear
and the center of mass is at the geometric center p of the velocities of the left-wheel and right-wheel, respectively.
body. R is the radius of the wheel and L is the displace- R is the radius of the wheel and ωL and ωR are angle ve-
ment from the center of robot to the center of wheel. The locities of the left-wheel and right-wheel, respectively.
set (xo, yo) represents the position of the geometric center Based on equations (1) and (2), we can obtain the fol-
p in the world X-Y coordinates, and the angle θ indicates lowing equation:
the orientation of the robot. The angle θ is taken coun- x
terclockwise from the X-axis to the xm-axis. These two v L cosθ sin θ L
fixed wheels are controlled independently by two motors, v = y (3)
R − cosθ − sin θ L θ
and the passive wheel prevents the robot from tipping
over as it moves on a plane. In this paper, the motion of In this paper, a fuzzy control structure is proposed to
passive wheels is ignored in dynamics of the mobile ro- control the two-wheeled robot so that it can move to any
bot. desired position effectively. The robot has two degrees
According to the schematic of the two-wheeled mo- of freedom in its relative position and orientation, so the
bile robot described by Figure 1, its kinetic equation can robot posture can be represented by the vector (x ,y ,θ).
be described by Two postures of the robot are described in Figure 2,
x
cos θ 0 where p(xo, yo, θ) and pd(xd, yd, θd) denote the current
y = sin θ 0 v (1) posture and the desired (target) posture of the robot, re-
ω spectively. θd is the angle of robot at the desired position.
θ 0 1
d is the distance between the current position (xo, yo) and
where x and y denote the velocity of the robot in the the desired position (xd, yd) of the robot, θ is the angle
direction of X-axis and Y-axis, respectively. v denotes between the x-axis and the head direction of the robot, φ
the linear velocity of the robot in the head direction of is the angle between the X -axis and the direction of the
current position of the robot toward the desired position
24 International Journal of Fuzzy Systems, Vol. 9, No. 1, March 2007
y
−1 d − yo
180 − tan x − x , if yd − y ≥ 0 and xd − xo < 0 (5) In order to reduce the design complexity, the motion
ϕ= d o
fuzzy control structure is decomposed into two structures:
180 + tan −1 dy − yo
, if yd − y ≤ 0 and xd − xo > 0 distance fuzzy system and angle fuzzy system, which are
xd − xo
two-input-and-one-output fuzzy systems. As shown in
360 − tan −1 yd − yo , if yd − y ≤ 0 and xd − xo < 0 Figure 4, UL and UR can be obtained by
xd − xo UL = Ud + Ua (9)
ϕ −θ , if ϕ − 180 < θ < 180 and
α = (6) UR = Ud - Ua (10)
(ϕ − θ ) − 360 , if − 180 < θ < ϕ − 180
where Ud and Ua are determined by distance fuzzy sys-
Two wheels are fixed in the considered mobile robot
tem and angle fuzzy system, respectively. They are de-
and each wheel is controlled independently by each mo-
scribed as follows:
tor, so the mobile path of the controlled robot is deter-
In the distance fuzzy controller, d and ∆d are used to
mined by the velocities and the directions of these two
be the input variables and Ud is the output variable of
motors. In this paper, the design object is to determine
this fuzzy system. In the angle fuzzy controller, α and ∆α
the velocities UL and UR of the left-wheeled motor and
are used to be the input variables and Ua is the output
right-wheeled motor so that the robot can effectively
variable of this fuzzy system. The proposed fuzzy rule
move from the current position (xo, yo) to the desired po-
bases for these two fuzzy systems are described in Table
sition (xd, yd). The control system block diagram can be
1 and Table 2, respectively.
described in Figure 3, where a 4-input-and-2-output
fuzzy controller with four input variables: d (the distance
between the robot and the destination), ∆d (the change
quantity of motion distance), α (the rotation angle of ro- α
Ua
bot), and ∆α (the change quantity of rotation angle) are ∆α UL
considered to determine two velocities UL and UR to
control the left-wheeled motor and right-wheeled motor,
respectively. The values d and α can be respectively de- UR
d
termined by Equation (4) and (6), then the values ∆α and −1
Ud
∆d can be calculated by ∆d
∆α (t ) = α (t ) − α (t − 1) (7)
∆d (t ) = d (t ) − d (t − 1) (8) Figure 4. System block of the motion fuzzy
Y Table 1. Fuzzy rule base of distance fuzzy system.
pd ( xd , yd ,θ d )
d
Ud
NB NM NS ZO PS PM PB
PB ZO PS PM PB PB PB PB
D PM NS ZO PS PM PB PB PB
xm PS NM NS ZO PS PM PB PB
α ϕ ∆d ZO NB NM NS ZO PS PM PB
NS NB NB NM NS ZO PS PM
θ NM NB NB NB NM NS ZO PS
X NB NB NB NB NB NM NS ZO
p (xo , yo ,θ )
Figure 2. Description of the current posture p(xo, yo, θ) and the
desired posture pd(xd, yd, θd) of the robot.
C.-C. Wong, et al.: Fuzzy Controller Designed by GA for Two-wheeled Mobile Robots 25
PB
NB
ZO
NM
PS
NS
PM
ZO
PB
PS
PB
PM
PB
PB
PB
∑ ∑ min(µ
j1=−3 j2 =−3
A j ( d ),
1
µ B j (∆d )) ⋅ c(C j3 )
2
PM NS ZO PS PM PB PB PB Ud = 3 3
(19)
∆α
PS
ZO
NM
NB
NS
NM
ZO
NS
PS
ZO
PM
PS
PB
PM
PB
PB ∑ ∑ min(µ
j1=−3 j2 =−3
A j ( d ),
1
µ B j ( ∆d ))
2
NS NB NB NM NS ZO PS PM
NM NB NB NB NM NS ZO PS
NB NB NB NB NB NM NS ZO
And
3 3
Ud is C j3 j1, j2, j3 ∈ {-3,-2,-1,0,1,2,3} (11) Therefore, Ud and Ua are determined by equations (19)
and (20) based on the data d, ∆d, α, and ∆α obtained by
RU a (j1,j2): IF α is E j1 AND ∆α is F j 2 , THEN equations (4) ~ (8). The left-wheel velocity UL and the
right-wheel velocity UR can be obtained by equations (9)
Ua is G j j1, j2, j3 ∈ {-3,-2,-1,0, 1, 2, 3} (12) and (10). The next posture ( x(k + 1), y (k + 1),θ (k + 1))
3
of the mobile robot can be determined by the 3D robot
A j1 ∈ T(d), B j2 ∈ T(∆d), C j3 ∈ T(Ud), E j1 ∈ T(α),
soccer simulator of FIRA.
F j2 ∈ T(∆α), and G j3 ∈ T(Uα). The following term sets
µ A (d ) NB NM NS ZO PS PM PB
are used to describe the fuzzy sets of each input and A−3 A− 2 A−1 A0 A1 A2 A3
output fuzzy variables:
T (d ) = {NB, NM , NS , ZO, PS , PM , PB} =
(13)
{A− 3 , A− 2 , A−1 , A0 , A1 , A2 , A3 }
T (∆d ) = {NB, NM , NS , ZO, PS , PM , PB} =
(14)
{B− 3 , B− 2 , B−1 , B0 , B1 , B2 , B3 } a−3 a− 2 a−1 0 a1 a2 a3 d
aj = 0 if j1 = 0 (21)
How to appropriately code and design a fitness func- 1
a
tion is an important key point for genetic algorithms to j 1
if 0 < j1 ≤ n
effectively search a good result. In this paper, a ratio co-
efficient coding method and a variable fitness function − b j if − n ≤ j2 < 0
2
cj = 0 if j3 = 0 (23)
3.1. Ratio Coding Method 3
c
Consider a fuzzy system with two input variables x1 j 3
if 0 < j3 ≤ n
and x2, and output variable y. If there are 2n+1 linguistic That is, only n values are needed to determine all the
terms and membership functions have the symmetric membership functions for each variable. In this paper,
properties, the ceter values of each membership func- the following ratio coefficient coding method is pro-
tions can be described as follows: posed to determine the values of a j1 , b j 2 , and c j 3
µ D (α ) NB NM NS ZO PS PM PB so that all the membership functions of these three vari-
D−3 D−2 D−1 D0 D1 D2 D3 ables x1, x2, and y are determined.
n
a j1 = x1max ∏ k1 p 1 ≤ j1 ≤ n (24)
p = j1
n
b j 2 = x2max ∏ k2 p 1 ≤ j2 ≤ n (25)
d −3 d −2 d −1 0 d1 d 2 d3 d p = j2
(a) n
µ E ( ∆α ) NB NM NS ZO PS PM PB c j3 = y max ∏ k3 p 1 ≤ j3 ≤ n (26)
E−3 E−2 E−1 E0 E1 E2 E3 p = j3
[ ] [
where xi ∈ − ximax , ximax , y ∈ − y max , y max . kij is de- ]
scribed by
wij + 1
k ij = , i ∈{1,2,3} j ∈{1,2,..., n} (27)
23 + 1
e where wij ∈ {0,1,2,3,4,5,6,7}. In the proposed GA-based
e−3 e−2 e−1 0 e1 e2 e3
method, each wij is considered as a gene and used to de-
(b) termine a ratio coefficient kij.
µ F (U α ) NB NM NS ZO PS PM PB In the proposed motion fuzzy control structure de-
F−3 F−2 F−1 F0 F1 F2 F3 scribed by Section 2, seven linguistic items (n=3) are
considered for the input and output variables as de-
scribed in Figures 5 and 6. Three ratio coefficients are
needed to decide all the membership functions for each
variable. Each chromosome represents a fuzzy system
f −3 f −2 f −1 0 f1 f 2 f3 Ud and each fuzzy system has three linguistic variables, thus
(c) each chromosome can be described by
chro = w11 w12 w13 w21 w22 w23 w31 w32 w33 (28)
Figure 6. Membership functions: (a) the antecedent fuzzy sets
for α, (b) the antecedent fuzzy sets for ∆α, and (c) the conse- where each gene wij is coded by
quent fuzzy sets for Ua. ( wij ) 2 ∈ {000,001,010,011,100,101,110,111} (29)
That is, each gene is coded by three bits and the bit
length of the considered chromosome is 27 bits.
C.-C. Wong, et al.: Fuzzy Controller Designed by GA for Two-wheeled Mobile Robots 27
3.2 Variable Fitness Function Table 4. Control results of three methods in the distance
In the proposed GA-based method, a variable fitness control.
Distance control Tr IAE
function is proposed as follows: Parameter control method 21 210
Tr (chro ) 2 IAE (chro ) 2 Experience-based distance fuzzy control
f i = F (chroi ) = exp − i
⋅ exp −
i
method
18 185
δ1g δ 2g GA-based distance fuzzy control method 17 173
i=1,2,…,N; g=1,2,…,G (30)
where N is the population size, G is the maximum num-
ber of generation, fi is the fitness function value of the
i-th chromosome chroi in the g-th generation, Tr(chroi)
and IAE(chroi) denote the rise time and the integral ab-
solute error of the i-th chromosome chroi, respectively.
δ1g and δ 2g are variables which are determined by
(a) (d)
δ1g = Tr (chro g −1 ) (31)
and
δ 2g = IAE (chro g −1 ) (32)
g-1
where chro is the chromosome with the best fitness
value in the (g-1)-th generation.
80 50
70
40
60
30
50
40 20
α
d
30
10
20
0
10
0 -10
0 5 10 15 20 25 30 35 40 45 0 5 10 15 20 25 30 35 40 45
Time Time
(a) (b)
150 140
120
100
50
100
(c)
Figure 10. Control results of three methods: (a) the parameter
80
Ud
Ua
0 60
-50
40 control method, (b) the experience-based angle fuzzy control
-100
20
method, (c) the GA-based angle fuzzy control method.
0
-150 -20
0 5 10 15 20 25 30 35 40 45 0 5 10 15 20 25 30 35 40 45
Time Time
(c) (d)
250 150
200
100
150
50
100
UR
0
UL
50
0
-50
-50
-100
-100
-150
-150 0 5 10 15 20 25 30 35 40 45
0 5 10 15 20 25 30 35 40 45
Time
Time
(e) (f)
Figure 9. Time responses of (a) d, (b)α, (c) Ud, (d) Uα, (e)
(a)
UL, and (f) UR, where 0.0167 sec/clock.
(b)
(a)
(c)
(b) Figure 11. Control results of three methods: (a) the parameter
control method, (b) the experience-based distance fuzzy con-
trol method, (c) the GA-based distance fuzzy control method.
C.-C. Wong, et al.: Fuzzy Controller Designed by GA for Two-wheeled Mobile Robots 29