You are on page 1of 6

Fuzzy Supervisory PI Controller Using Hierarchical Genetic Algorithms

Kiatkajohn Worapradya and Suvalai Pratishthananda Department of Electrical Engineering, Faculty of Engineering Chulalongkorn University, Bangkok 10330 Thailand e-mail: john@control.ee.eng.chula.ac.th, suvalai@ee.eng.chula.ac.th

Abstract
This paper presents a fuzzy supervisory PI controller using a Hierarchical Genetic Algorithm (HGA). HGA which is an optimization algorithm is used to dene the optimal number and shape of membership functions, and fuzzy rules. The fuzzy supervisory PI controller is designed and simulated on a heat exchanger system. Sum of square error and sum of absolute error are used as objective functions. Simulation results are compared with the PI controller using strm A o and Hgglund tuning. Improved performances can be a noticed.

[1] suggested a Hierarchical Genetic Algorithms which can nd the optimal number and shape of membership functions, and rules. In this paper, we propose the design of fuzzy supervisory system which is used for supervising the PI controller. We use the HGA for designing optimal membership functions and rules. The obtained fuzzy supervisory PI controller is simulated on the heat exchanger. To demonstrate the better performance, we compare the designed responses with the response of PI controller tuning via strm and Hgglund method. A o a

1 Introduction
The general structure of fuzzy systems consists of three principle components: a fuzzier unit which is a process to transform input signals into fuzzy sets, an inference engine which is a decision process to approximate reasoning with fuzzy rule bases, and, nally, a defuzzier unit which transforms the fuzzy sets into output signals. In order to work eciently, this structure has to use optimal membership functions and rule bases. However, there are no exact methods to construct them. Therefore, the conventional approaches usually base on the operators skills, experience, and trial-and-error method. To solve this problem, many researchers designed optimal membership functions and rule bases by using dierent methods such as neural network [2], clustering [3, 4], gradient method [5], simulated annealing [6, 9], and genetic algorithms [7, 8, 9, 10]. Among these methods, the genetic algorithms method is the most interesting. For examples, it dose not use derivative information, it searches from a population of points (not a single point), and it is a powerful tool for solving a multi-objectives function problem. Although genetic algorithms can search the optimal shape of membership functions and optimal rules, it cannot nd the proper number of membership functions and rules. Therefore, Man, Tang, Kwong and Liu

2 Hierarchical Genetic Algorithms


HGA is a type of the genetic algorithms, introduced by Man, Tang, Kwong and Liu [1] . Its structure is more exible than the conventional genetic algorithms (GAs) while it still has important genetic operations. The only dierence between HGA and GAs is the chromosome form. 2.1 Hierarchical Chromosome Formulation Concept of hierarchical chromosome is regarded as DNA in a biological chromosome. DNA consists of two types of genes which are structure genes and regulatory genes. The structure genes contain the genetic information and the regulatory genes control coding of the structural genes. Similarly, a hierarchical chromosome can be classied into two dierent types, i.e., parametric genes and control genes. The parametric genes, which contain parameter values, are analogous to the structure genes. The activation of the parametric genes is governed by the value of the control genes which is analogous to regulatory sequences. In Figure 1, a three levels gene structure is illustrated. The parameter genes are governed by the rst level control genes which are governed by the second level control genes, respectively. The value 0 or 1 is used to dene the activation of the parametric genes, an integer 1 is assigned for each control gene that is being ignited, where 0 is for turning o. When the value

2nd level control gene

1st level control gene

parametric gene

control genes (z c )
1a 1b 1c 2a

parameter genes (z p )
2b 2c na nb nc

Chromosome
1a 1b 1c na nb nc

Figure 1: General form of a hierarchical chromosome of control gene is 1, the associated parametric genes corresponding to that control gene are activated and they are inactivated when the value of control gene is 0. 2.2 Genetic Operations Genetic operation of HGA consists of three processes which are selection, crossover, and mutation. Crossover and mutation are operated independently between control genes and parametric genes. A mutation method depends on the coding of a chromosome.

Figure 2: A membership chromosome


U U U of e, ka , kb , kc dene the input membership function of the kth fuzzy subset of u

To code a fuzzy rule into a fuzzy rule chromosome, the number of rules depend on the number of fuzzy subset of e and e which is corresponding to the number of actived control genes. Therefore, the fuzzy rule base should be classied, corresponding to the number of actived control genes. In order to make it easy, the fuzzy rule base should be coded in matrix form which is similar to a fuzzy rule table as shown in Table 1. Table 1: D1 E1 U1 E2 U2 . . . Ei . . . Ew Ui
The Rule Base in Tabular Form

3 HGA for fuzzy system


3.1 Coding of fuzzy system Generally, problems solved by GAs, the variables are coded to chromosome form. Similarly, in HGA the parameters of membership functions and fuzzy rules are coded to hierarchical chromosome form which is dierent between membership chromosomes and fuzzy rule chromosomes. The HGA chromosome consists of the usual two types of genes, the control genes (zc ) and parametric genes (zp ). The control genes, in the form of bits, determine the membership function activation, whereas the parametric genes are in the form of real numbers to represent the membership functions. The HGA coding is shown in Figure 2. With the two input fuzzy sets of error signal (e) and error rate (e) and the output fuzzy set of u, we can dene the parametric genes of the membership chromosome as zp
E E E E E E = {1a , 1b , 1c , ... , ma , mb , mc , E E E E E E 1a , 1b , 1c , ... , na , nb , nc , U U U U U U 1a , 1b , 1c , ... , pa , pb , pc } (1)

D2 U2 U3

Dj Uk

Dx Uj Uj

..

. .. . Uy

We code the fuzzy rule table in Table 1 into the fuzzy rule chromosome H(w,x,y) which is formulated in the form of an integer matrix h1,1 h1,j . . .. . H(w,x,y) = . (2) . . . hi,1 hi,j

where hi,j [1, y] and i w, j x and the i j element implies the following rule: Rij : If e is Ei and e is Dj then u is Uk where Ei , Dj and Uk are the linguistic names which characterize the fuzzy subsets of e, e, and u , respectively. 3.2 Genetic Operations for fuzzy system Due to the fact that the membership chromosomes consist of control genes and parametric genes, each type of gene has to use dierent genetic operations. For the crossover operation, a one-point crossover is applied

where m, n, and p are the maximum allowable numbers of the fuzzy subset of e, e, and u, respectively, E E E ia , ib , ic dene the input membership function E E E of the ith fuzzy subset of e, ja , jb , jc dene the input membership function of the jth fuzzy subset

separately for both the control and parametric genes of membership chromosomes within certain operation rates. The fuzzy rule chromosome has no crossover operation because there is only one fuzzy rule chromosome per one matrix dimension. Bit mutation is applied for the control gene of the membership chromosome. Each bit of the control gene is changed from 1 to 0 or from 0 to 1 if a probability test is satised (a big probability). As for the parametric genes, which are real-number represented, random mutation is applied. The random mutation is presented by g = g + (, ) (3)

Blower Shutter

Heater

Process
Detector Thyrister unit Power input Bridge circuit Temperature measurement

To

Ti , Fi Inlet

Figure 4: Heat exchanger system 4.1 Characteristic and mathematical model of a heat exchanger A heat exchanger is shown in Figure 4. A constant velocity blower draws the air into the tube and the air volume is controlled by a shutter. The air which passes through the tube is heated by a heater. The heater power is applied by thyrister as the actuator corresponding to control signal. The heated air ows to the end of the tube and is detected by the temperature sensor. The detected temperature is transformed into the voltage by bridge circuit and transmitted to control the system. For linearized model of the heat exchanger, which is a rst order plus time delay system, Wang [7] as: G(s) = 10e0.13s 0.33s + 1 (5)

where g is the real value gene, is a random function which may be Gaussian or normally distributed, and are the mean and variance related with the random function, respectively. To mutate the fuzzy rule chromosome, a special mutation operation is applied. It is called delta operation which alters each element in the fuzzy rule chromosome as follows: hi,j = hi+i,j+j (4)

where i and j have an equal chance to be 1 or -1, with a small probability.

4 Design example: The fuzzy supervisory PI controller of a heat exchanger


Hierarchical Genetic Algorithm Input Membership funtions Fuzzifier Fuzzy Rule Inference Engine Output Membership funtions Defuzzifier Kp, Ki PI Controller

where the input is the voltage supplied to heater and the output is the temperature measured by the detector. 4.2 Simulations To simulate, we consider the set point change problem. The temperature at the detecting point is required to be increased to 60 C from an initial value of 20 C at 6th second and then decreased back to 20 C at 12th second. The parameters of optimization are as follows: The parameters of the fuzzy system. e [50, 50] and e [5000, 5000]. KP [0.06, 0.3] and KI [0.2, 0.5]. Minimum inference engine. Center average defuzzier. The parameters of HGA . The maximum number of the input fuzzy subsets of e and e = 5 and the number of the output fuzzy subsets of KP and KI = 2 (m = n = 5 and p = q = 2). The number of generations=20. The other parameters are shown in Table 2.

-1

+ -

e e

r+
-

u
Process

Figure 3: The fuzzy supervisory PI controller In this section, we present an example of the fuzzy supervisory control system design using HGA which is discussed in last section. This fuzzy supervisory system, as a second level controller, is used for supervising a PI controller of heat exchanger. The fuzzy supervisory control system is shown in Figure 3. The membership functions and fuzzy rules, are dened by HGA and this fuzzy structure is used for Kp and KI parameters tuning of the PI controller. The tuning occurs when disturbance is applied or the set point is changed.

Table 2: The parameters of HGA


Membership Chromosome Control Parameter Genes Genes Binary Real 20 20 2 2 One point One point Crossover Crossover 0.9 0.9 Bit Random Mutation Mutation 0.01 0.01 Roulatte Wheel Selection Fuzzy Rule Chromosome

E1
1

E2

E3

E4

Representation Population Size No. of Ospring Crossover Crossover Rate Mutation Mutation Rate Selection

Integer 16 1 Delta Operation 0.01 Base on the no. of active fuzzy subsets

-50

-40

-30

-20

-10

10

20

30

40

50

Figure 5: Membership function of e: Case I


D1
1

D2

D3

D4

-5000 -4000 -3000 -2000 -1000

1000 2000

3000 4000

5000

Figure 6: Membership function of e: Case I


U1 U2 V1 V2
1

To dene the tness functions (F ), the tness functions are selected as inverse proportion to the objective function (J). This process will yield a high sentivity string selection, as suggested by Wang [7]. In this paper, two dierent objective functions and tness functions are used. These objective functions are standard for disturbance rejection and set point following problems. Case I: Sum of squared error objective function is shown as formula (6) and the tness function is shown as formula (7).
k

0.06

0.1

0.2

0.3

0.2

0.3

0.4

0.5

(a)

(b)

Figure 7: (a) Membership function of KP (b) Membership function of KI : Case I

Table 3: Optimal rule table for KP : Case I D1 U2 U2 U2 U2 D2 U1 U2 U1 U1 e D3 U1 U2 U1 U2 D4 U1 U2 U1 U1

J1 F1

=
i=1 6

e2 i

(6) (7)

10 J

E1 E2 E3 E4

Case II: Sum of absolute error objective function is shown as formula (8) and the tness function is shown as formula (9).
k

Table 4: Optimal rule table for KI : Case I D1 V2 V2 V2 V2 D2 V1 V2 V1 V2 e D3 V1 V2 V1 V2 D4 V1 V2 V1 V2

J2 F2 where e is error.

=
i=1 5

|ei | 10 J

(8) (9)

E1 E2 E3 E4

4.3 Simulation results In Case I, the largest tness function gives the fuzzy structure as: the optimal number of the input fuzzy subsets of both e and e are 4. The shape of them are shown in Figure 5 and Figure 6, respectively. The optimal number of output fuzzy subsets of both KP and KI are 2 and the shape of them are shown in Figure 7(a) and 7(b), respectively. The optimal fuzzy rule bases of KP and KI are shown in Table 3 and 4, respectively. In case II, The optimal number of the input fuzzy subsets of e and e are 3 and 2, and the shape of them

are shown in Figure 8 and 9, respectively. The optimal number of output subsets of both KP and KI are 2 and the shape of them are shown in Figure 10(a) and 10(b), respectively. The corresponding rule tables are shown in Table 5(a) and 5(b), respectively. The best objective values in each generations are ploted in Figure 11. These optimal fuzzy supervisory systems are simulated on the heat exchanger. Simulation results, which are compared with the PI controller using strm and A o Hgglund tuning, are shown in Figure 12 and 13. a Case I has the shortest rise time, while Case II has the shortest settling time and the smallest overshoot.

E1

E2

E3
Objective function (J )
1

10.1 10.05 10 9.95 9.9 9.85 9.8 9.75

x 10

3150 Objective function (J ) 5 10 15 Generation 20 25


2

3100

-50

-40

-30

-20

-10

10

20

30

40

50

3050

Figure 8: Membership function of e: Case II


D1
1

3000

10 15 Generation

20

25

D2

Figure 11: The best objective values in each generations

-5000

-4000 -3000 -2000 -1000

1000 2000

3000 4000

5000

70

AstromHagglund HGAFS case 1 HGAFS case 2

Figure 9: Membership function of e: Case II


Temperature (Celcius)

60

50

U1
1

U2

V1

V2

40

0.06

0.1

0.2

0.3

0.2

0.3

0.4

30

0.5
20

(a)

(b)

Figure 10: (a) Membership function of KP (b) Membership function of KI : Case II

10

10 Time(sec)

12

14

16

Control signal (Volts)

Table 5: (a) Optimal rule table for KI (b) Optimal rule table for KI : Case II (a) (b) e e D1 D2 D1 D2 E1 U1 U2 E1 V 1 V 1 e E2 U2 U1 e E2 V2 V2 E3 U1 U2 E3 V 1 V 1

Figure 12: The responses of closed-loop system


14 12 10 8 6 4 2 0 2 4 6 AstromHagglund HGAFS case 1 HGAFS case 2

Case I uses almost the same control signal as the strm-Hgglund while Case II uses the smallest. A o a

5 Conclusions
In this paper, the design of the fuzzy supervisory PI controller by HGA is proposed. HGA is used to search for the optimal number and shape of membership functions, and fuzzy rules. The fuzzy supervisory PI controller for heat exchanger is designed. Sum of squared error and sum of absolute error are used as objective functions and the set-point following problem is considered. After optimization processes and simulation, the fuzzy subsets are reduced. The closeloop performance is better than the strm-Hgglund. A o a However, selection of the objective functions depends on applications.

10 Time (sec)

12

14

16

Figure 13: The control signals

References
[1] Tang K. S., K. F. Man, S. Kwong and Z. F. Liu, Minimal Fuzzy Memberships and Rule Using Hierarchical Genetic Algorithms, IEEE Trans. Ind. Electron., Vol. 45, No. 1, pp. 162169, 1998. [2] Jang R., Fuzzy controller design without domain experts, IEEE Int. Conf. Fuzzy Systems, pp. 289296, 1992.

[3] Hong T. P., and C. Y. Lee, Induction of fuzzy rules and membership functions from training examples, Fuzzy Sets and Systems, pp. 3347, 1996. [4] Klawonn F., and R. Kruse , Constructing a fuzzy controller from data , Fuzzy Sets and Systems, pp. 177193, 1997. [5] Araki S., H. Nomura, I. Hayashi, and N. Wakami, Self-generating method of fuzzy inference rules, Int. Fuzzy Engineering Sysposium, pp. 10471058, 1992. [6] Huyghe E., and Y. Hamam, Simulated annealing for fuzzy controller optimization: Principles and applications, IEEE Int. Conf. System, Man and Cybernetics, Vol. 5, No. 1, pp. 45094514, 1995. [7] Wang P., and D. P. Kwok, Optimal fuzzy PID control based on genetic algorithm, Proc. of the IEEE, pp. 977981, 1992. [8] Karr C. L., and E. J. Gentry, Fuzzy Control of pH Using Genetic Algorithms, IEEE Trans. Fuzzy Syst., Vol. 1, pp. 4653 , 1993. [9] Nakamura E., and N. Kehtarnavaz, Optimization of fuzzy membership function parameter, Proc. IEEE Int. Conf. Syst., Man and Cyber., Vol. 1, pp. 16 , 1995. [10] Harmaifar A., and E. McCormick, Simultaneous Design of Membership Function and Rule Sets for Fuzzy Controllers Using Genetic Algorithms, IEEE Trans. Fuzzy Syst., Vol. 3, pp. 129139, 1995. [11] O Dwyer A., PI and PID controllers for time delay processes: performance and robustness issues, Proceedings of the Wismarer Automatisierungssymposium, pp. 227234, September 1999.

You might also like