FUZZY
sets and systems ELSEVIER
Fuzzy Sets and Systems 91 (1997) 279-284
Genetic algorithms based fuzzy controller for high order systems X . M . Qi, T.C. Chin* School of Electrical and Electronic En,qineerin~l, Nanyany Technoloyical University, Nanyamt Avenue. Sin~tapore 639798, Sin,qapore
Received September 1995; revised May 1996
Abstract
This paper presents a fuzzy control algorithm for high order processes. The algorithm includes design of a basic fuzzy controller with its rule definition based on the qualitative reasoning in the phase plane and an incremental controller with the purpose to correspond with the order of the process. The genetic algorithms (GAs) are then utilized to the design and development for the fine tuning of the controller. Simulation results shown in the paper demonstrate the efficiency of this approach and the power of the GAs. (~) 1997 Elsevier Science B.V. Keywords: Fuzzy logic control; High order systems; Genetic algorithms
1. Introduction
Fuzzy logic controllers (FLCs) have been used successfully in an increasing number of application areas by the control community. FLCs are rule-based systems that use fuzzy linguistic variables to model human rule-of-thumb approaches to problem solving; and thus overcome the limitation that classical expert systems may meet because of their inflexible representation of human decision making. However, conventional FLCs are unsuitable for controlling processes where the order is higher than two because they only make use of the system error e and the change of error Ae. Although A2e (or A3e . . . . ) can be introduced in order to meet the requirement, we have to meet the increasing complexity of the design of FLCs, even more, high order differential equations are impractical to implement in computer realization.
*E-mail:
[email protected].
We propose a new structure based on the work of Boverie and Demaya [1]. The basic structure is the association of a conventional fuzzy controller and an incremental block (F.I.A), and thus allows the adaptation of the overall controller to the order of the process to be controlled. However this structure makes the tuning of the FLCs more complex. Genetic algorithms are search algorithms based on the mechanics of natural selections and natural genetics. GAs have the properties that make them a powerful technique for selecting high-performance parameters for FLCs. For example, Lee and Takagi [4] design a fuzzy system using a genetic algorithm for the inverted pendulum. They simulate the system over a variety of initial conditions so that in some respects a fuzzy controller capable of handling widely different scenarios is obtained. Karr and Gentry [3] control the pH of the acid-base system with a fuzzy systems's input membership functions manipulated by a GA. Park et al. [5] optimize a fuzzy reasoning model by
0165-0114/97/$17.00 (~ 1997 Elsevier Science B.V. All rights reserved PH S0165-0114(96)00151-0
)d M. Qi. 7~c. Chin~Fuzz3, Sets and Systems 91 (1997j 279 284
280
genetic algorithms to control a direct current series motor. in this paper the robustness and simple mechanics o f GAs have been descriptively applied to the establishing o f the afore-stated controller. The remainder o f this paper is organized as follows. In Section 2, we present the structure o f the fuzzy controller for high order systems. Section 3 gives a brief review o f genetic algorithms and the implementation o f GAs for the tuning o f the fuzzy controller is given in Section 4. In Sections 4 and 5, we demonstrate the effectiveness o f the controller based on the simulation results•
Table I The Rule Base ~e\e
NB
NM
NS
ZE
PS
PM
PB
PB
ZE
PS
PM
PB
PB
PB
PB
PM
NS
ZE
PS
PM
PB
PB
PB
PS
NM
NS
ZE
PS
PM
PB
PB
ZE
NB
NM
NS
ZE
PS
PM
PB
NS
NB
NB
NM
NS
ZE
PS
PM
NM
NB
NB
NB
NM
NS
ZE
PS
NB
NB
NB
NB
NB
NM
NS
ZE
[1]. Thus we can deduce our algorithms:
U=Ko
Au(z) d r + K i A u + K 2 A u
It)
2. Description of the FLC for high order systems + ... + K,>_2Au ~'~-21 The control structure can be represented by the block diagram as shown in Fig. 1. The basic fuzzy controller is designed with qualitative technique applied in the e, Ae phase plane, based on the analysis o f the evaluation o f the error between the reference signal, the output o f the process to be controlled and the change o f the error. The qualitative reasoning method can only determine the sign of the control action which ensures the convergence o f the closed loop system toward the equilibrium point. In order to modulate these control actions with the fuzzy IF THEN structure, we divide the universe o f discourse o f e and Ae into fuzzy sets and define some fuzzy control decision related with the membership degree o f e and Ae to these fuzzy sets. Finally we can obtain the rule sets as shown in Table 1. It is well known that the order o f the control system must be n - 1 for a nth-order process (pole compensation method). The fuzzy controller here can be looked as a PD type, thus, in order to respect the condition, the incremental block must have (n - 2)th-order form
(1)
while in the discrete time domain we get:
/ldjt i
Lll~j -- ~U/-i AUj
d u(i2 )
At 2Auj_t + Auj_2 At 2
(2)
z Aut/, 2 ) = /'(Au/, .... Aui ,,+2) At,-2 Here Auj is the value o f control increment at instant j calculated by the fuzzy controller at the sampling period At. We obtain the final control structure: i=]
U
K,~ Z
Aui + K ~ A u / + e ~ A u /
,
i=O
(3)
+ ... + K,~ I Au/_,+2 where K¢~ = Ko, K2 K,, 2 KI* = KI q- ~7 -- "'" + "At -~'
F.I.A Controller ) FLC
block
lu. _
Fig. 1. Fuzzy incremental controller.
K2 K3 A t + 2q75 + ' "
/£2* = -
K~* I
(
l ) " - I K~ 2 Atn_ 2 •
K,,-2 + (n - 1),~7~,_~/, (4) /Jl- /
281
)LM. Qi, 7~(~ Chin~Fuzzy Sets and Svstems 91 (I997~ 27~284
We can see the whole control block has n degrees of freedom for a nth-order process. Although the structure makes use of three system states e, Ae and Au, it is easy to design. The tuning of the above parameters is left for GAs as described in the next section.
Uniform P(1)
(~
Chromoseme 1
Random Selection
Chromoseme2 3. Genetic algorithms - mechanism and implementation
GAs are search algorithms based on the mechanics of natural selections and natural genetics. Unlike many classical optimization techniques, genetic algorithms do not rely on computing local derivatives to guide the search process. Genetic algorithms also include random elements, which helps to avoid getting trapped in local minima [2]. GAs generally consist of three fundamental operators: reproduction, crossover and mutation. Given an optimization problem, simple GAs encode the parameters concerned into finite bit strings, and then run iteratively using the three operators in a random way but based on the fitness function evolution to perform the basic tasks of copying strings, exchanging portions of strings as well as changing some bits of strings, and finally find and decode the solutions to the processing ofa GA, the following paragraphs explains the details: (1) Coding the parameters: It has become a standard to translate the parameters into binary bit strings. Several parameters are coded into one long string. (2) Initialgeneration: It always begins by randomly generating an initial population of N strings, each of length m. The population size N is a compromising factor. Large N increases the possibility of including the solution in the first few generations but decreases the running speed of the GAs mentioned above, the string length m determines the resolution. Later we introduce an optimal candidate list method to solve the problem which small population may encounter. (3) Fitness evaluation: In the current generation, each of the strings is decoded to be its corresponding actual parameter. Then, these parameters are sent to a judgement machine which yields a measure of the solution's quality, evaluated with some objective functions and assigned individually with fitness values. (4) Reproduction: Reproduction is a process by which the strings with larger fitness values can produce accordingly with higher probabilities large
Chromosem 3 ~ ' - ' ~ t
P(2)
"~xJ
p(3)
'--
Fig. 2. Weightedrouletteselection.For relativefitness l'(Chrom 1) >f(Chrom 3)>f(Chrom 2). number of their copies in the new generation. The most common method used is the weighted roulette selection shown in Fig. 2. (5) Crossover: Crossover is a process by which the systematic information exchange between two strings is implemented using probabilistic decisions. In a simple 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. This process can combine better qualities among the preferred good strings. Uniform crossover does not select a set of crossover points. It simply considers each bit position of the two parents, and swaps the two bits with a probability of 50%. (6) Mutation: Mutation is a process by which the chance for the GA to reach the optimal point is reinforced through just an occasional alteration of a value at a randomly selected bit position. The mutation process may quickly generate those strings which might not be conveniently produced by the previous reproduction and crossover processes. Mutation may suddenly spoil the opportunity of the current appropriate generation, so, this process usually occurs with a small probability and is complementary to reproduction and crossover. (7) Iteration: The GA runs iteratively repeating the processes (3)-(7) until it arrives at a predetermined ending condition. The speed of iteration depends not only on the population size N and the string length m but also has something to do with the selection of probabilities. Finally, the acceptable solution is obtained and decoded into its original pattern from the resulting binary strings [6].
X.M. Qi, 72C Chin~Fuzzy Sets and Systems 91 (1997)279 284
282
Due to their properties, GAs differ fundamentally from the conventional search techniques. For example, they: • Consider a population of points, not a single point; • Work directly with strings of characters representing the parameter set, not the parameters themselves; • Use probabilistic rules to guide their search, not deterministic rules; • GAs require only information concerning the quality of the solution produced by each parameter set. This differs from many optimization methods which require derivative information or in some cases, complete knowledge of the problem structure and parameters.
4. Illustrative examples
to 7 (1 1 l). While 0 means NB, 1 means NM . . . . . 7 means PB. Substring two: Scaling factors G~,
Conventional FLC Parameters
K 0 , K , . . . . . X~ , . . . . . . ~; . . . . ~. . . . . . . ; . . . . ~. . . . . . .~ . . . . ~ substring I
substring 2
(5)
substring 3
The conventional FLC is represented as a long string composed of three substrings: • Substring one: Rule structure rule 1
fuzzy terms 1: e.g. positive small A.
100101010010101
~1
010 0 110 ..rule value rule value
(8)
-z
(9)
with parameter x~} and ai/. The Gaussian form is chosen on the basis of formal considerations; membership functions of any other form, for example, triangular or trapezoidal, can be considered as well.
4.2. PerJormance criteria The parameters for the GAs simulation are set as follows: 1. Initial population size: 50 2. Maxnumber of generation: 100 3. Crossover: Uniform crossover with probability 0.8 4. Mutation probability: 0.01 (final value 0.02) In this paper, the performance is measured using the following criteria: 1. Minimum time-weighted integral of squared errors.
(6t
There are four bits to represent one rule. The first bit is used to indicate whether the rule is used or not. A rule is selected by the GA search if the bit is set to 1. Otherwise, it will not be used in the testing of the fuzzy controller. The next three bits represent the rule value which takes in the interval 0 (0 0 0)
...
where aij and xi*j are parameters of the symmetrical Gaussian membership functions given by:
TW|SE =
rule 2
(7)
Parameters G~, G~e and Go,t are shown in Fig. 2. Substring three: Membership functions
Bij(xj) = exp
Now we can discuss our controller based on the block diagram as shown in Fig. 3. To incorporate genetic algorithms into our scheme, we encoded the afore-mentioned parameters (K~,K( ..... etc) together with the FLC parameters (scaling factors, membership function parameters, rule structure). The controller we will obtain is the integrationally optimized FLC for high order system as expected. The coding is illustrated in Eq. (5):
G,,ut
"i0100001()'i 00001000i'O001010101 d
4.1. Encode
Critical Parameters A
Gjj
1/
tk'e 2 dt,
kl = 0,1,2 . . . . . n.
(10)
2. Combined performance index using overshoot (To) and rise time (Tr). cpI
= k2ro + k3rr,
(11)
where in Eqs. (10) and (11), kl,k2,k3 are experimental parameters in order to emphasize our requirement about To or Ft.
283
)~M. Qi, T.C Chin~Fuzzy Sets and Systems 91 (1997) 279-284
Genetic Algorithms
it'
I I I
I I
t Fuzzifier
/
I
Rule Base
I
ttnference E n g i n ~ Defuzzifier ~-G
tt ,tit
1 I
Fuzzy Logic Controller
I
Plant/Process
.
Noise & Disturbance~
Fig. 3. Blockdiagramof GA based FLC. MATLAB for Windows have been found to be helpful tools in the simulation of a fuzzy logic controlled system, and was also the software tool used to implement the Genetic Algorithms in this study. Simulations of a traditional second order process, a third order system and a fourth order system, have tested the capabilities of this GA model in training the FLC to learn better control when a new plant was introduced. Plant A has its type zero plant transfer function: 2 GA(S) -- s2 + 1.4s + 2
(12)
while plant B have the transfer function with real parts of three poles very close to each other: (13)
Plant C is a fourth order system with the transfer function: 4 Gc(s) = s4 + 3s 3 + 6.5s 2 + 5.8s + 4'
1
08
~ 06 0
.
4
~
O2 0
0
20
40
60
80 100 Time (0, I s)
120
140
160
Fig. 4. Step responseof plant A.
1
GB(s) = s3 + 1.75s2 + 2.15s + 1"
Step Response(Plant A) 12
(14)
The optimizations results are shown in Figs. 4-6. For plant A, the F.I.A degrade to be a normal PD-like FLC, the incremental block is of no use in this case.
The result of step response shows the flexibility of this scheme. From Fig. 5, we can see that the controller performs well with small overshoot, quick and zero error response while the simple fuzzy contoller without GAs for K 7 (i = 0, 1.... ) is intrinsically unable to ensure a good behaviour because of the mismatch of the order of the system and the controller. The unsatisfied dynamic character of simple fuzzy controller for high
284
)LM. Qi, T C
Chin~Fuzzy Sets and Systems 91 / 1 9 9 7 ) 2 7 9 ~ 8 4
Step Response(Plant B)
Table 2 Performance indices comparison (plant B)
12
08
Perfonnance indices
ISE
T~(s)
1~(s)
MI,
Error ripple
Before optimization
16.55 3.90
2.50 1.31
5.11 2.60
0.1128 0.0630
0.049 0.012
Error ripple
After optimization
~o 6
Table 3
04
Pertbrmance indices comparison (plant C)
02 OI&
o
20
40
B0
80 100 Time (01s)
120
140
160
Performance indices
ISE
T~(s)
T~(s)
AII,
Before optimization After optimization
709.41 9.80
2.45
5.29
0.4603 0.121 I
0.002
Fig, 5. Step response of plant B.
5. Conclusions Step Response (Plant C) 15
Fuzzy logic controller for higher order systems was introduced in the paper and proposed genetic algorithms were then employed to optimize the performance of the designed controller. Then employ the genetic algorithms to optimalize the controller. From the simulation results obtained, the proposed genetic algorithm model has demonstrated its capabilities in terms of higher robustness, flexibility and reliability. Further study may focus on the use of GAs to on-line optimization of fuzzy logic controller.
2
/
I
,,,?"
"" /
(8
:E {35
',--
I
i
I
20
40
60
I
I
80 100 Time ~.ls)
i
I
120
140
160
Fig. 6. Step response of plant C.
order system can also be seen clearly in Fig. 6; while the fourth order system can be controlled acceptably by F.I.A controller. Tables 2 and 3 display different performance indices of the F.I.A controller and the simple fuzzy controller or plant B and C. It must be pointed out that GAs do not possess expert knowledge of the workings of FLCs system, nor of the behaviour of the plant to be controlled. We can say that the F.I.A controller and GAs had proven very effective in the optimization of control for high order systems.
References [I] S. Boverie and B. Demaya, Fuzzy logic control for high order systems, Proc. 1EEE lnternat. Con[~ on Fuzzy Systems (1993) 117 121. [2] D.E. Goldberg, Genetic Algorithms in Search. Optimization and Machhw Learning (Addison-Wesley, Reading, MA, 1989). [3] C. Karr and E. Gentry, Fuzzy control of pH using genetic algorithms, 1EEE Trans. on Fuzzy Systems 1(1) (1993) 46-53. [4] M.A. Lee and H. Takagi, Integrating design stages of fuzzy systems using genetic algorithms, Proc. IEEE Internat. Con/; on Fuzzy Systems (1993) 612 617. [5] D. Park, A. Kandel and G. Langholz, Genetic-based new fuzzy reasoning models with application to fuzzy control, IEEE Trans Systems Man ()~bernet. 24(1 ) (1994) 39 47. [6] P. Wang and D.P. Kwok, Auto-tuning of classical PID controllers using an advanced genetic algorithm, IECON'92, Vol. 3 (1992) 1224 1229.