DESIGN OF DC MOTOR FUZZY-PI CONTROLLER USING
GENETIC ALGORITHMS
Mehmet Bulut Galip Cansever S.Vakkas Ustun
[email protected] [email protected] [email protected]
Yidiz Techical University, Faculty of Engineering, Department of Electrical Engineering, Istanbul, Turkey
Key words: FuzzyLogic,Genetic Algorithms, Learning Rule base, DcMotor
ABSTRACT logic control, genetic algorithms and dc motor system. In
In this study, genetic algorithms are used to Section IV-V-VI, we demonstrate the implementation of
learn fuzzy PI control rules for PC based direct GAs for the design of the fuzzy-PI controller, and the
current motor speed control . It is developed in three effectiveness of the controller based on an intensive
stages: the first one is a fuzzy rule genetic generating simulation and experimental study.
process based on a rule learning iterative approach,
the second applying rules to process which is best rule II. FUZZY LOGIC CONTROLLER (FLC)
base in each generation, and the third one is ended In the design of a fuzzy logic controller, the rules
learning process if the best rule have desired fitness may have multiple input and output variables. However, it
value. The three components of the learning process has been observed that the majority of the applications in
are developed to formulate suitable genetic algorithms. the literature are of the multiple input, single output
configuration [5]. For example, in the case of a PD-like
I. INTRODUCTION fuzzy logic controller, a rule may appear as:
(FLCs) are now considered as one of the most
important applications of the fuzzy-rule-based systems. IF error is PB AND change of error is SZ
The experience of skilled operators and the knowledge of THEN control is PS
control engineers are expressed qualitatively by a set of
where error, change of error and control are linguistic
fuzzy control rules. The construction of fuzzy rules has
variables; and PB (Positive Big), SZ (Small around Zero)
been mainly based on the operator's control experience or
and PS (Positive Small) are linguistic values taken by
actions. However, converting the experts know-how into
these variables. A rule in the rule base of the system may
if- then rules is difficult and often results are incomplete,
have the following generic form:
unnecessary and include conflicting knowledge, since
operators and control engineers are not capable of specific
details or cannot express all their knowledge including IF X1 is µn1 (x1) X2 is µn1 (x2) AND µn1 (x1) AND ....
intuition and inspiration [1] . X m is µnm (xm) THEN Y is λq( y)
Genetic algorithms (GAs) are search algorithms
based on the mechanics of natural selection and natural µn1 (x1) : fuzzy sets as linguistic values of XJ (e.g. PM
genetics. GAs have the properties that make them a (positive medium), NB (negative big), etc.)
powerful technique for selecting high-performance λq( y) : fuzzy sets as linguistic values of output.
parameters for FLCs. For example, Lee and Takagi [2] q =1, 2, 2 , r and r is the number of possible
design a fuzzy system using a genetic algorithm for the fuzzy sets for the consequent linguistic variable.
inverted pendulum. Karr and Gentry [3] control the pH of Xj : jth linguistic variable of the antecedent part of a
the acid base system with fuzzy system's input rule ( j=1, 2, 2 , m).
membership functions manipulated by a GA. Park et al. Y : linguistic variable of the consequent part of a rule.
[4] optimise a fuzzy reasoning model by genetic algorithm The deterministic output of the fuzzy system is computed
to control a direct current series motor. by using the product-operation inference mechanism and
∫ [ ! w λ ( y ) ] ydy
Previous works are focused only on optimising the centroid method as follows:
p
the FLC parameters and on reducing the number of the
∫ [ ! w λ ( y)]dy
i =1 i q
rules, in this paper.Genetic algorithms are used to search y= p
(2)
for an extracting rules with high performance. The ill-
i =1 i q
defined+ and conflicting rules are also eliminated through
the search process. The rest of the work is divided as where ∪ stands for union (MAX operation).
follows.In Section II-III, we give the review of fuzzy
III. GENETIC ALGORITHMS depends not only on the population size N and the string
length m but also selection of probabilities. Finally, the
GAs are search algorithms based on the mechanics
acceptable solution is obtained and decoded into its
of natural selection and natural genetics. Unlike many
original pattern from the resulting binary strings.
classical optimization techniques, genetic algorithms do
not rely on computing local derivatives to guide the
IV. GA BASED LEARNING FUZZY SYSTEMS
search process. GAs generally consist of three
fundamental operators: reproduction, crossover and In the few years many different approaches have been
mutation. The following explains procedure of genetic presented taking the genetic algorithms (GAs) as a base
algorithms with the details [2]. It has become a common of the learning process. GAs have demonstrated to be a
way to translate the parameters into binary bit or real tool powerful for automating the definition of the fuzzy
number strings. Several parameters are coded into one control rule knowledge base [8]. These approaches called
long string the general name of genetic fuzzy systems (GFSs)
a. Initial generation. It always begins by
randomly generating an initial population of N strings, We propose a GFS methodology based on three
each of length m bits. The population size N is a stages. The first stage is a fuzzy-PI rule genetic
compromising factor. generating process based on a rule learning iterative
b. Fitness evaluation. In the current generation, approach, the second applying rules to process which best
each of the strings is decoded to be its corresponding rule base in each generation, and the third one is ended
actual parameter. Then, these parameters are sent to a learning process if best rule have desired fitness value.
fitness function which yields a measure of the solution's The three components of the learning process are
quality, evaluated with some objective functions and developed formulating suitable genetic algorithms. This
assigned individually with fitness values. methodology as is shown in Fig 5.
c. Reproduction. Reproduction which is
arranged with larger fitness values can produce
accordingly with higher probabilities large number of
their copies in the new generation. The most common
method is used which is weighted roulette selection
shown in the Fig. 1.
d. Crossover. Crossover is a process by which
the systematic information exchange between two strings
is implemented using probabilistic decisions. In a
crossover process, two newly reproduced strings are
chosen from the mating pool and arranged to exchange
their corresponding portions of binary strings at a
randomly selected partitioning position along them. Fig. 5. Genetic based Learning Fuzzy-PI Control System
This process can combine better qualities among Genetic generating process is based on an
the preferred good strings. Crossover example. iterative rule learning approach and consists of a fuzzy
Before crossover rule generating method together with an iterative covering
A = 110111101 11011101011 method. The fuzzy rule generating method is developed
B = 000100010 00010010010 (3) by means of a real coding GA that codes as all fuzzy rule
in each chromosome. The GA finds the best rule base in
After crossover every run over the application to system according to the
A = 110111101 j 00011010010 features included in its fitness function. The fitness
B = 000100010 j 11011101011 (4) function used in this work that reflects small steady-state
errors, a short rise time, low oscillations and overshoots
e. Mutation. Mutation is a process by which the with a good stability is given by eqn 10.
chance for the GA to reach the optimal point is reinforced
through just an occasional alteration of a value at a a
∑
T
randomly selected bit position. Mutation may suddenly fitness = exp − t =0
t * e 2 + t * (∆e) 2 (10)
spoil the opportunity of the current appropriate T
generation, so, this process usually occurs with a small
probability and is complementary to reproduction and where T is the the duration of the simulation in
crossover. In Eq. (4), Because of mutation the underline evaluating the design; a is a positive number used to scale
bit is changed from 0 to 1. the maximum fitness up or down, t is the time index in
The GA runs iteratively (b-e) until it arrives at a simulation, ei is the error between measured signal and the
predetermined ending condition. The speed of iteration desired signal at simulation step t; ∆e is the change of
error. This statement of the fitness yields 0 through 1.
Higher values corresponds to better controller e
performance. -5 -4 -3 -2 -1 0 1 2 3 4 5
-5 -1 -1 -1 -1 -1 -1 -0.8 -0.6 -0.4 -0.2 0
-4 -1 -1 -1 -1 -1 -0.8 -0.6 -0.4 -0.2 0 0.2
-3 -1 -1 -1 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4
-2 -1 -1 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6
-1 -1 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8
∆e 0 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 1
2 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 1 1
3 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 1 1 1
4 -0.2 0 0.2 0.4 0.6 0.8 1 1 1 1 1
5 0 0.2 0.4 0.6 0.8 1 1 1 1 1 1
Table 1. Rule base for PD-like Fuzzy Controller
Fig 6. Used triangle membership function
Each gene in chromosome represents one
membership function for control action; an example 1 is
shown E1 (Fig. 7).
Fig 7. Chromosome with encoded Rule Base have Fuzzy
sets
The fuzzy rule base focuses 11x11 possible control
actions corresponding to values in input error and integral
of error, therefore 121 bits are used in chromosome to Fig 8. Step Response of PD-like Fuzzy Controller for
form the look-up table, where a single bit represents each used DC motor
control action. This is illustrated in Table 1.
We have taken results from designed genetic fuzzy
V. SIMULATION RESULTS system for dc motor are given in Table 2. and Fig 9,
10,11. Although learning process is executed for 10
In this paper a dc motor from Sinano Co. is used and generation take good results. During all generations have
parameters is given by company are; taken all best fitness values of chromosome that
Moment of inertia ( J ) : 0.225 g-cm-s2 represents rule base is shown in Table 2. Best fitness in 9th
Damping ratio (B) : 1.75 Kg-cm generations have maximum fitness value.
Armature resistance (Ra) : 12.6 ohm
Armature inductance (La) : 9 mH
Ki : 1.5 Kg-cm/A
Kb : 15.4 mV/rpm
Under this parameters values motor transfer function is
0.7407
G ( s) = 2
(10)
s + 9.178 s + 22.3
For comparasion of the results and measure
performance GFS a PD-like FLC with 11 rules was
designed. The rule base of the system is given in Table 1.
The fuzzy sets used in the controller are represented by
triangle membership functions For dc motor system that
Table 2. Best fitness values in all generations
we used this work step response of PD-like fuzzy
controller is shown in Fig.8. It seems that rule base at
We designed GFS learning system is executed for 10
Table 1 is not convenient for near zero steady state error.
generations and taken step response outputs in fig 9.
VI. EXPERIMENTAL RESULTS
In this work, genetic algorithms which is a popular
research technique are used for generating the DC
generator fuzzy-PI control rule base. For this purpose a
fuzzy control software runs on a PC is used to control the
generator via the PC’s parallel port. General diagram of
this control system is shown at the figure 12.
Fig 9. Step responses of dc motor system during
generations for best fitness values
Fig 12. General diagram of targeted control system
Fuzzy PI controller using the rule base obtained
from 30 generations, run of GFS algorithm designed in
this work is applied to a unloaded DC generator system
and the results are given in figures 13 a,b. A disturbing
effect is given to this system to experiment system
response. As it can be seen in figure 13-b, system settles
to given reference point in a short time when the
disturbing effect is removed.
Fig 10. Step response of learned best rule base in the all
generations for fuzzy-PI controller using GA
Step response of dc motor system by rule base
have best Fitness is shown in Fig 10. i.e step response
designed learning rule base of Fuzzy PI Controller for dc
motor. When compared with PD-like Fuzzy Controller, it
is seen that, the designed Fuzzy-PI Controller using
genetic algorithms have better results. Surface of Rule
base for designed Fuzzy-PI controller is shown in Fig 11.
(a)
Fig 11. Learning Rule base surface for best fitness value
(b)
It seems that learned rule base disperses unregulerly in
Fig 13. DC motor responses for 1000 rpm at reference
figure. Because of GA has random process, learned rule
value without load and with disturbance
base is complex that contains most situations.
(GFS) provides a method to automatize design of the
knowledge base a direct fuzzy controller.
In this work, we are interested in automatically
learning rule-base for a fuzzy logic based dc motor
controller. In this article we provide an analysis of
Genetic Fuzzy-PI System (GFS) for dc motor control
system. It seems that the designed GFS is a good method
for control of dc motor and gives well performance. At
the work. Figures are drawed by using Pentium 120 MHz
computer and Turbo C program. Hence, it provides an
approach to computer aided design automation for dc
motor control system.
As a result, this approach can provide a low-cost
(a)
and robust means of design for the fuzzy-PI rule-based
controller. From the results obtained, the proposed genetic
algorithm model has been demonstrated its capabilities in
term so flexibility and reliability by improving the rule
base of the fuzzy logic controller.
REFERENCES
1. Bimal K. Bose, “Expert system, Fuzzy Logic and
Neyral Networks Applications in Power Electronics
and Motion Control”, Proceedings of The IEEE, vol
82. No.8, 1303-1324, August, 1994.
2. M.A. Lee and H. Takagi, Integrating design stages
of fuzzy systems using genetic algorithms, Proc.
IEEE Internat. Conf. on Fuzzy Systems, 612 617,
(b)
1993.
Fig 14. DC motor responses for 810 rpm at reference 3. C.Karr and E.Gentry, Fuzzy control of pH using
value with load and for 1000 rpm with plus disturbance genetic algorithms, IEEE Trans. Fuzzy Systems 1,
46-53, 1993.
4. D.Park, A. Kandel and G. Langholz, Genetic-based
Furthermore, this fuzzy PI controller is
new fuzzy reasoning models with application to
experimented with load given in various reference input
fuzzy control, IEEE Trans. Systems Man Cybernet.
points and obtained results are given in figure 14 a,b.
24, 1994.
When the loaded system is applied at 810 rpm (revolution
5. Timothy J. Ross, “ Fuzzy ogic with Engineering
per minute) and 1000 rpm reference values; System
Applications”, McGraw-Hill Inc.,469-514, 1995
reaches reference point below Tr <1 sec overshooting
6. D.E. Goldberg, Genetic Algorithms in Search,
time and settles to steady-state at Ts=1.5 sec.
Optimization and Machine Learning (Addison-
Wesley, Reading, MA, 1989.
Experimental results are shows that the
7. Gopal K. Dubey, C. Rao Kasarabada, “Power
implemented genetic fuzzy system algorithm is applicable
Electronics and Drivers”, Tata McGraw-Hill Pub,
to DC generator, Also it has flexible structure and high
261-281, New Delhi, India, 1993.
performance for fuzzy-PI controller. As a conclusion, the
8. F. Herrara, M.Lozano, J.L.Verdegay," Generating
proposed approach in this study realizes a fuzzy-PI
Fuzy Rules from Examples Using Genetic
controller having low steady-state error and low settling
Algorithms", Department of Computer Science and
time for a DC generator control.
Artificial Intelligence. University of Granada, Spain,
1995.
VII. CONCLUSION
Recently, this work has been studied in
developing well-performing fuzzy rule-base without help
of human expertise. Learning rule-base requires human
experience with a long time. Genetic Fuzzy System