Fuzzy Controller Design For Ball and Beam System With An Improved Ant Colony Optimization
Fuzzy Controller Design For Ball and Beam System With An Improved Ant Colony Optimization
problem [10].
Abstract—In this paper, an improved ant colony optimization In the literatures, some ACO-based fuzzy control strategies
(ACO) algorithm is proposed to enhance the performance of global have been proposed [11][12], however, only the conventional
optimum search. The strategy of the proposed algorithm has the ACO is utilized. In this paper we first propose an improved
capability of fuzzy pheromone updating, adaptive parameter tuning,
ACO algorithm with fuzzy pheromone updating. Then the
and mechanism resetting. The proposed method is utilized to tune the
parameters of the fuzzy controller for a real beam and ball system. proposed improved optimization algorithm is applied to a real
Simulation and experimental results indicate that better performance ball and beam system for the position balance control.
can be achieved compared to the conventional ACO algorithms in the Compared with other ACO related methods, the superiority of
aspect of convergence speed and accuracy. the proposed work can be evaluated from the simulation and
experimental results.
Keywords—Ant colony algorithm, Fuzzy control, ball and beam This paper is organized as follows. Section II the common
system. concepts of ACO algorithm are presented. The proposed
improved ACO algorithm is described in Section III. As for the
I. INTRODUCTION
ball and beam system, the simulation results, based on the
616
World Academy of Science, Engineering and Technology 56 2009
z An environment is the discrete time; they lay the pheromone are significantly accumulated for the best path, and
pheromone trail on the sample time. the choosing probability is influenced by the pheromone trails.
The ant system (AS) was the first algorithm within the ACO In order to increase the range of solution space and decrease the
algorithms framework [2]. The AS algorithm was successfully number of iteration, the D can be undated by
applied to the traveling salesman problem, and it had
satisfactory results compared with traditional methods such as D D 'D (3)
GA, EA, and SA. The TSP is typically a combinational
optimization problem, which can be modeled as G (V , E ) , where 'D is a heuristic value.
where V {1,2,..., N } is a set of nodes and B. The Fuzzy Pheromone
E {(i, j ) | (i, j ) V u V } is a set of arcs. The object of the TSP The pheromone level is updated by (2) and 'W ij 1 / Lgb ,
is to find the minimum length Hamiltonian circle on G . The
Lgb is the length of the optimal global tour from the beginning
cost function is defined as the distance of edge (i, j ) . The
of the trail. In this paper, a modified pheromone updating is
distance between each pair of nodes ( xi , yi ) and ( x j , y j ) is given as follows
represented by d (i, j ) that is the Euclidean distance between
node i and j , where d (i, j ) d ( j , i ) . Let W ij be the value of W ij UW ij f ( Lgb ) (4)
¯0, otherwise is the output variable, Ai1 is the fuzzy set in antecedent part,
and Bi is the fuzzy set in the consequent part. To calculate the
where K ij 1 / d ij is the heuristic value of moving from city i output Y , the centroid method is used for defuzzification. With
to city j , N ik is the set of cities remaining to be visited by the the fuzzy pheromone mechanism, the input and output
membership functions are shown in Fig. 1, and the fuzzy
ants, D and E are the relative weights of pheromone and
inference rules are developed in Table 1 with the fuzzy sets VS
visibility, respectively. The pheromone level of the selected (vary small), S (small), M (medium), L (large), and VL (very
element is updated by large).
W ij UW ij 'W ij (2)
617
World Academy of Science, Engineering and Technology 56 2009
the exploitation iterations. However, it is not easy to xk and ek xk* xk is the error of state variable, k 1,...,4 .
simultaneously perform the exploration and exploitation
From the state equations in (1), it is indicated that there are two
procedures. In conventional ACO methods, the pheromone
dynamic objects, i.e. beam and ball. Therefore, the control of
trails arise quickly on the best path that can lead to most ants
the ball and beam system is decoupled into two subsystems, the
toward this path. The pheromone of the best path is much larger
position control of ball and the balance control of beam. Two
than other paths and the selection probability of the other paths
unique fuzzy control strategies are utilized to balance the beam
could be much smaller. Therefore, the phenomenon of
and to keep the ball in the designated position. The proposed
stagnation will be occurred. In this paper, a clear mechanism is
FACO optimized control scheme contains a fuzzy
proposed as follows
beam-balance controller, a fuzzy ball-position controller, and
the FACO tuning mechanism.
0, if Prandom Pclear
W ijmax ® max (6)
¯W ij , otherwise l
r o4
Wb
o3
T
the clear mechanism. When the clear mechanism is performed, Wm o1
o0
the pheromone trails of the best path will be reset to zero.
d
Consequently, the ants can select other paths and deviate from
the local optimal solution. Fig. 2. Scheme diagram of ball and beam system.
u
gear that is mounted on a DC motor which provides the >e3 e4 @ C1 C 2 P1 P6 k P1 k P6
>x3 x4 @
necessary torque of interest, o1 represents the big gear that can >x3d x4 d @
kB
EB
control the angle of the beam, o2 , and o3 denote the link and kB1 kB6
C3 C4 B1 B6
618
World Academy of Science, Engineering and Technology 56 2009
The FFBPC and FFBBC are denoted as output vectors of FBPC Integral of Square Error (ISE)
N
and FBBC, respectively. For the output fuzzy sets, the
membership functions are defined to be fuzzy singleton
ISE ¦ (( x1* (t ) x1 (t )) 2 (11)
t 1
functions. The input variables ( E P and E B ) and output
variables ( FFBPC and FFBBC ) be fuzzily partitioned into nine Integral of the Absolute value of the Error (IAE)
N
fuzzy sets, negative very big (NV), negative big (NB), negative
medium (NM), negative small (NS), zero (ZO), positive small
IAE ¦ x1* (t ) x1 (t ) (12)
t 1
(PS), positive medium (PM), positive big (PB), positive very
big (PV). The fuzzy IF-THEN rules are expressed as
Integral of the time multiplied by the Absolute value of the
RBi : IF Γ
E B is MFBi , THEN FFBBC is OBi (8) Error (ITAE)
N
RPi : IF Γ
E P is MFPi , THEN FFBPC is OPi (9) ITAE ¦ t x1* (t ) x1 (t ) (13)
t 1
where the fuzzy sets MFBi , MFPi , OBi , OPi , i 1,2,...,9 are
defined in Table 3. The initial states of the ball and beam system are set to be
x >0 S 0 0@ and the disturbance is added at 10 sec. Fig. 5
indicates the responses of the ball and beam system with
1 conventional ACO and FACO fuzzy controllers. It can be seen
EP that, from Fig. 5(a) and Fig. 5(b), before 10 sec, the ball is
0 EB stopped as desired and the beam is also at the required angle,
1 P1 P2 P3 0 P4 P5 P6 1 respectively. In Fig. 5(a), the response of the proposed method
1 B1 B2 B3 0 B4 B5 B6 1
has no overshoot and quickly converges to he desired position.
1 In particular, with the disturbance added at 10 sec, the proposed
method still has the best performance among other
FFBPC
FFBBC conventional ACOs. The Table 5 presents the criteria with all
0
1 k P1 k P2 k P3 0 k P4 k P5 k P6 1
methods. It can be shown that the proposed algorithm is better
1 k B1 k B2 k B3 0 k B4 k B5 k B6 1 than other conventional ACO optimization methods.
Fig. 4. Membership functions for the FBPC and the FBBC.
Table 4. Parameter table
Table 3. Fuzzy rule base Membership Function
Error Constant, C j
i 1 2 3 4 5 6 7 8 9 Method MF Value, Pi , Bi , k Pi , kbi
i 1 i 2 i 3 i 4 i 5 i 6 j 1 j 2 j 3 j 4
E P ( MFPi )
input NV NB NM NS ZO PS PM PB PV E P -0.75 -0.57 -0.04 0.04 0.57 0.75
E B ( MFBi ) in
AS E B -0.76 -0.70 -0.25 0.25 0.70 0.76
13 8 12 0.85
FFBPC (OPi ) PV PB PM PS ZO NS NM NB NV [2] FFBPC -0.75 -0.54 -0.25 0.25 0.54 0.75
output out
FFBBC (OBi ) NV NB NM NS ZO PS PM PB PV FFBBC -0.75 -0.50 -0.21 0.21 0.50 0.75
E P -0.55 -0.54 -0.05 0.05 0.54 0.55
in
To show the effectiveness of the proposed method, the ACS E B -0.70 -0.54 -0.23 0.23 0.54 0.70
7 4 13 0.7
FACO is proposed to adjust the parameters of the mentioned [1] FFBPC -0.75 -0.54 -0.25 0.25 0.54 0.75
out
fuzzy controllers. The parameters of controllers contain the FFBBC -0.76 -0.50 -0.22 0.22 0.50 0.76
error constant, c1 ~ c4 , the parameters of the input membership in
E P -0.92 -0.80 -0.10 0.10 0.80 0.92
MMAS E B -0.85 -0.50 -0.15 0.15 0.50 0.85
functions, B1 ~ B6 , P1 ~ P6 , and the parameters of the output 14 7 11 0.6
[13] FFBPC -0.75 -0.50 -0.15 0.15 0.50 0.75
membership functions, k B1 ~ k B6 , k P1 ~ k P6 . In this case, the out
FFBBC -0.75 -0.5 -0.25 0.25 0.5 0.75
aim of optimization is that minimizes the cost function. The E P -0.76 -0.60 -0.05 0.05 0.60 0.76
in
cost function is the root mean square error (RMSE), and it is E B -0.97 -0.60 -0.25 0.25 0.60 0.97
FACO 10 7 8 1
defined as follows FFBPC -0.95 -0.50 -0.20 0.20 0.50 0.95
out
FFBBC -0.75 -0.55 -0.25 0.25 0.55 0.75
N
1
Cost
N
¦ (( x1* (t ) x1 (t )) 2 ( x3* (t ) x3 (t )) 2 ) (10)
Table 5. Simulation performance criterion with disturbance
t 1
IAE ISE ITSE
where N is the number of samples. The optimized parameters AS 4.05 u 10 4 4.53 u 105 7.99 u 108
are represented in Table 4. For evaluating the proposed method ACS 3.66 u 10 4 3.97 u 105 7.00 u 108
and other algorithms, some criteria are selected as MMAS 2.96 u 10 4 3.39 u 105 3.67 u 108
FACO 2.79 u 10 4 3.14 u 105 2.67 u 108
619
World Academy of Science, Engineering and Technology 56 2009
40
Proposed proposed improved ACO algorithm is applied to optimize the
ACS
ball position (cm)
35
30
MMAS
AS
parameter settings of the input and output membership
25 Ȑaȑ functions. Simulation and experimental results illustrate that
20 the improved ACO algorithm can provide better control
15
0 2 4 6 8 10 12 14 16 18 20
performance subject to disturbance.
time (sec)
0.2
Proposed
ball velocity (m/sec)
ACS
0.1 MMAS
AS
0
Ȑbȑ
-0.1
-0.2
0 2 4 6 8 10 12 14 16 18 20
time (sec)
0.1
Proposed
ACS
beam angle (rad)
0.05 MMAS
AS
0
Ȑcȑ
-0.05
-0.1
0 2 4 6 8 10 12 14 16 18 20
time (sec)
beam angle velocity (rad/sec)
1
Proposed
0.5
ACS
MMAS
Fig. 6. Control scheme of the beam and ball control system.
AS
0
Ȑdȑ
-0.5
-1
0 2 4 6 8 10 12 14 16 18 20
time (sec)
20
Proposed
motor voltage (volt)
ACS
10 MMAS
AS
0
Ȑeȑ
-10
-20
0 2 4 6 8 10 12 14 16 18 20
time (sec)
Fig. 5. Simulation response: (a) ball position, (b) ball velocity, (c)
beam angle, (d) beam angle velocity, (e) controller output.
620
World Academy of Science, Engineering and Technology 56 2009
40
equation (A.1) yields
d ª wL º wL
ball position (cm)
35
J
WB r(mB B2 ) mB rD 2 mB g sin D (A.4)
dt «¬ wr »¼ wr
30
25 Ȑaȑ R
d ª wL º wL
20
Wb
dt «¬ wD »¼ wD
15
0 1 2 3 4 5 6 7 8 9 10
ti ( )
1
l
ball velocity (m/sec)
0.05
K K K l
0
Ȑcȑ W b n( b Va b t Tm ) cos D cos T (A.6)
-0.05
Ra Ra d
-0.1 In (A.4), there is no external force, i.e. W B 0 . From
0 1 2 3 4 5 6 7 8 9 10
ti ( ) (A.4)-(A.6), the state equation of the ball and beam system can
beam angle velocity (rad/sec)
1
be represented as (7)
0.5
0 Ȑdȑ ACKNOWLEDGMENT
-0.5
This work is partially supported by Ministry of Economic
-1
0 1 2 3 4 5 6 7 8 9 10 Affairs, Taiwan under Technology Development Program for
20
Academia (TDPA) in the project “Developing A Brain Medical
motor voltage (volt)
-20
REFERENCES
0 1 2 3 4 5 6 7 8 9 10
time(sec) [1] M. Dorigo, L.M. Gambardella, “Ant colony system : a cooperative
learning approach to the traveling salesman problem, ” IEEE Tran. on
Fig. 8. Experiment response ( x1 (0) 38cm, x3 (0) 1 ):
$
Evolutionary Computation, vol. 1, no. 1, pp. 53-66, 1997.
(a) ball position, (b) ball velocity, (c) beam angle, (d) beam angle [2] M. Dorigo, V. Maniezzo, and A. Colorni, “Ant system: optimization by a
velocity, (e) controller output. colony of cooperating agents,” IEEE Tran. on Systems, Man, and
Cybernetics, Part B: Cybernetics, vol. 26, no. 1, pp. 29-41, 1996.
[3] C. Blum, “Ant colony optimization: Introduction and recent trends, ”
Physics of Life Reviews, vol. 2, no. 4, pp. 353-373, 2005.
APPENDIX [4] Y. Li and S. Gong, “Dynamic ant colony optimisation for TSP, ” The
The ball and beam system is a classic underactuated International Journal of Advanced Manufacturing Technology, vol. 22,
pp. 528-533, 2003.
nonlinear system. The system parameters for the ball and beam [5] C.F. Tsai, C.W. Tsai, and C.C. Tseng, “A new hybrid heuristic approach
system model are listed in Table 2. To obtain the possible for sloving large travling salesman problem, ” Information Sciences, vol.
mathematical model of a ball and beam system, the associated 166, no. 1, pp. 67-81, 2004.
Euler-Lagrange dynamic equation is first addressed in (A.1). [6] S.C. Negulescu, C.V. Kifor, and C. O, “Ant colony solving multiple
constrains problem: Vehicle route allocation, ” International Journal of
d ª wL º wL Computers, Communications and Control, vol. 3, no. 4, pp. 366-373,
« » Q (A.1)
dt ¬ wq ¼ wq 2008.
[7] J. Heinonen and F. pettersson, “Hybrid ant colony optimization and
where q >r D @T Q >W B W b @T , L=(the kinetic energy, K)-(the visibility studies applied to a job-shop scheduling problem, ” Applied
Mathematics and Computation, vol. 187, no. 2, pp. 989-998, 2007.
potential energy, P), r is the position of the ball, D is the [8] L.Y. Tseng and S.C. Liang , “A hybrid metaheuristic for the quadratic
beam angle, W b is a torque provided by a DC motor to the beam assignment problem,” Computational Optimization and Applications, vol.
14, no. 1, pp. 85-113, 2006.
via gear and linker, and W B is an exogenous torque to the Ball. [9] S. Tsutsui, “Solving the quadratic assignment problems using parallel
It is noted that W B is physically considered as the disturbance to ACO with symmetric multi processing, ” Transactions of the Japanese
Society for Artificial Intelligence, vol. 24, no. 1, pp. 46-57, 2009.
the ball. As show in Fig. 1, to derive the dynamic equation of [10] A.P. Engelbrecht, Computational Intelligence: An Introduction, 2nd,
the ball and beam system, the kinetic energy K and P can be Wiley, 2007.
represented as follows: [11] C. Martinez, O. Castillo, and O. Montiel, “Comparison between ant
colony and genetic algorithms for fuzzy system optimization, ” Studies in
1 1 r 2 1 1 Computational Intelligence, vol. 154, no. 4, pp. 71-86, 2008.
K mB r 2 J B ( ) 2 ( J B mB r 2 )D 2 J bD 2 (A.2) [12] C.F. Juang and C. Lo, “Zero-order TSK-type fuzzy system learning using
2 2 R 2 2
a two-phase swarm intelligence algorithm, ” Fuzzy Sets and Systems, vol.
l
P mb g sin D mB gr sin D (A.3) 159, no. 21, pp. 2910-2926, 2008.
2 [13] T. Stutzle, H.H. Hoos, “Max-Min ant system, ” Future Generation
Computer Systems, vol. 16, no. 8, pp. 889-914, 2000.
Substituting (A.2) and (A.3) into Lagrange dynamic
621