Genetic algorithms based on an intelligent controller

Genetic algorithms based on an intelligent controller

Expert Systems With Applications, Vol. 10, No. 314, pp. 465-470, 1996 Published by Elsevier Science Ltd Printed in Great Britain. All fights reserved ...

461KB Sizes 0 Downloads 137 Views

Expert Systems With Applications, Vol. 10, No. 314, pp. 465-470, 1996 Published by Elsevier Science Ltd Printed in Great Britain. All fights reserved 0957-4174/96 $15.00+0.00

Pergamon

S0957-4174(96)00026-7

Genetic Algorithms Based on an Intelligent Controller I PATAYA DANGPRASERT AND VICHIT AVATCHANAKORN Graduate Schoolof ComputerInformationSystems,AssumptionUniversity,Bangkok,Thailand

Abstract--Genetic algorithms (GAs) have been proven as robust search procedures. Numerous researchers have established the validity of GAs in optimization, machine learning and control applications. This paper presents a new intelligent control scheme using the robust search feature of GAs incorporating the basic idea of self-tuning regulators. The proposed controller utilized GAs to search for the changes of system parameters and to calculate the corresponding control law. The optimum parameters and control law are chosen based on the selection mechanism of GAs, which employs the square of the difference between the actual and the estimated outputs as the fitness function. The controller has an on-line parameters identification function and does not require prior knowledge or training data for learning. The proposed intelligent controller is applied to the load frequency control of a power system to investigate the effectiveness from results obtained from computer simulations, the intelligent controller has been proven to provide good system characteristics. Copyright © 1996 Elsevier Science Ltd

1. INTRODUCTION

success of STR implementation is based on the on-line system parameters identification which has been laid on recursive off-line methods such as least-squares, maximum likelihood or instrumental variable. Those recursive schemes are, in essence, local search techniques that search for the optimum by using a gradient-following technique (Kristinsson & Dumont, 1992). They often fail to search for the global optimum if the real characteristics of the problem are not differentiable and parameters non-linear. This paper presents a new intelligent controller, which takes the features of GAs incorporating the concepts of self-tuning regulators. The proposed intelligent control makes use of the input--output linear model to represent the process dynamics of a controlled system. GAs are introduced as a search strategy to estimate the changes in the parameters as the system is operating. The system parameters are encoded as binary strings in chromosomes, and for any generation, a new population of chromosomes is created based on the genetic operators. The best chromosome, which minimizes the fitness function given as the square of the difference between the actual and estimated outputs, is selected and decoded with the decoding factor for real parameter values. For the results, the control law is calculated based on the identified parameters from the GAs. The effectiveness of the proposed intelligent control is examined with application to the load frequency control (LFC) of a power system. Investigation is performed by

GENETIC ALGORITHMS(GAs) are techniques simulating the adaptive processes of natural systems. Theoretical developments by Holland (1975) have proven that GAs are robust search algorithms. Numerous papers and dissertations have established the validity of GAs in optimization, machine learning and control applications. The robustness for application systems implies that higher levels of adaptation can be achieved. Consequently, costly system redesigns can be reduced or eliminated. Recently, numerous researchers have been interested in intelligent controller designs because conventional controllers cannot correctly track the changes in the parameters of a controlled system since system operating points change. A wide variety of studies in controller designs have been undertaken using self-tuning regulators (STR), model reference adaptive control, fuzzy control, neural networks, etc. Among the various control theories and applications of artificial intelligence concepts, STR seems to be the more practical for implementation because it does not require any reference model of a controlled system, such as model reference adaptive control, rules extraction of fuzzy control or learning data, to teach neural networks. However, ~Due to circumstances beyond the publisher's control, this paper appears in print withoutauthorcorrections. 465

466

P. Dangprasert and V. Avatchanakorn

computer simulation on output responses, the characteristics of the estimated parameters, the effects of the decoding factor, etc. 2. G E N E T I C A L G O R I T H M S Genetic algorithms (GAs) are search procedures based on natural genetic evolution to evolve solutions to problems. The search procedures can be viewed as general-purpose optimization methods and have been seen more in application to difficult search, optimization and machine-learning problems. There are good reasons for which more applications of GAs are found in business, scientific and engineering applications (Goldburg, 1989): (1) GAs are not fundamentally limited to assumption concerning continuity, existence of derivatives nor unimodality of search spaces; (2) GA operations are simple and an improvement in search spaces is noticeably powerful even in a non-linear system; (3) the major advantage of GAs is their ability to hop randomly from one point in search space to another which gives them an immunity to local optimal. The basic idea of GAs is to maintain a population of a constant size and set candidate solutions to the current problem. Each candidate in the population competes with many other iterations to give the best candidate to the objective of the problem. The candidates are also controlled by GA operations. Theoretical analyses have shown that GAs exploit the knowledge accumulated during search in a way that efficiently balances the need to explore new areas of the search space with the need to focus on high-performance regions of that space (Grefenstette, 1993). Simple GAs are composed of binary strings, statistically-defined control parameters, a fitness function, genetic operations (reproduction, crossover and mutation), a selection mechanism and a mechanism to encode the solution as binary strings. GAs operate in cycles called generations. The algorithm first randomly generates a population of binary strings called chromosomes. Each string in a population is an encoding of the candidate solution. This population is maintained by a selection mechanism. Selection starts with the current population, goes through three genetic operators, reproduction, crossover and mutation, and with the use of the fitness function as a criterion, the population of the next generation is generated accordingly.

chance to explore more information than currently exists. By this operator, chromosomes in the present population can exchange information. Crossover begins with randomly choosing two chromosomes and the unity cross site. Finally two new chromosomes are created from crossing the two chromosomes at the same crossing site, for example, if the two chromosomes are (0, 0, 0, 0, 0, 0, 0, 0, 0, 0) and (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) and the crossing site is at the third position then the new chromosomes are (0, 0, 0, 1, 1, 1, 1, 1, 1, 1) and (1, 1, 1, 0, 0, 0, 0, 0, 0, 0). The two new chromosomes are entered to the next generation population. Without crossover, the population only dominates by high fitness value chromosomes, no new search space is created. A mutation operator is a way to introduce new information to the population. This operator simply alters the bit at a chosen site from 0 to 1 or 1 to 0, for example, if a chromosome is represented by (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) and the mutation occurs at position 5, the new chromosome becomes (1, 1, 1, 1, 0, 1, 1, 1, 1, 1). The mutation operator plays a decidedly secondary role by being sparingly used compared with reproduction and crossover. This insures against premature loss of important information. All strings in a population evolve simultaneously to search for the target solution. 3. GAs-BASED I N T E L L I G E N T C O N T R O L L E R Figure 1 illustrates the basic idea of a GAs-based intelligent controller. The proposed controller uses GAs in the parameters identification part and control law calculation. Since the controller sues the genetic search strategy with three basic operators, i.e. reproduction,

GAs-based intelligent controller

~

Chromosornes

IZ

(Reproduction,Crossover and Mutation ) ~ clecodedparameters ~

GA operators GAs use three basic operators to manipulate a constant size population. A reproduction is an operator that replicates the highest fit value chromosome and enters it to the next generation population replacing the lowest fit value member. Hence, candidate chromosomes with a high fitness value have more chances to survive while chromosomes with a low fitness will die out. A crossover operator allows the population to have a

~(t)i and u(t)i

~ ~(t)~ and u(t)i Sei~,ion Meehanisna

I"

!

L

"l M~,[.,~yo)-~o)'+w~:.
u,,,(t)~ ..... '.....................................

-. .....

FIGURE 1. GA~based Intelligent controller.

Genetic Algorithms

467

crossover and mutation, differentiation can be avoided. The intelligent controller makes use of the inputoutput linear model to represent the dynamics of a controlled system. Consequently, a plant is represented by the following mathematical model:

A(q-~)y(t)=B(q-~)u(t-k)+C(q-l)w(t),

(1)

where y(t) is the output, u(t) is the input and At) is noise. The backward shift operator, q-l, is used such that y(t-1)=q-ly(t) and

A(q- 1)= 1 +alq- l+a2q-2+ • •. + anq -n B(q-l)=bo+blq-l +b2q-2+ . . . + bmq -m C ( q - I ) = l +clq-I +c2q-2+ . . . + Cpq-p. The polynomials A ( q - t) and C(q- ~) are assumed to be of the same degree and degree A - d e g r e e B=k. At any instant time t, output from plant y(t) together with previous collected outputs, y(t - 1), t ( t - 2) . . . . . y ( t - n), and inputs, u ( t - 1), u ( t - 2 ) . . . . . u ( t - m ) , are used to calculate the estimated output ~(t) according to the following equation:

~(t) = - t i f f ( t - 1) - ~ 2 y ( t - 2) - . . . - h ~ y ( t - n) +bOu(t- k) +b~u(t - l - k) + . . . +bmU(t-- m -- k). (2) where h~, a2. . . . . b0, b] . . . . are the estimated parameters which are decoded from each chromosome in the population. The principle of controller design is to determine the process parameters al, a2. . . . . b0, b~. . . . which are unknown. The GA-based intelligent controller uses chromosomes to represent changes of process parameters from the previous time step t - 1. Each chromosome is composed of m + n + l orders of process parameter changes concatenated to form a string. A parameter change is represented by ten bits. The first bit represents the positive/negative sign, while the remaining nine bits represent the change values. To decode the nine binary bits to real values, the decoding factor a is used. The range of parameter change is limited by a. The decoded values are parts of the search spaces that GAs have to work around to find the process parameters. Thus, the control law obtained from each chromosome, at any time t, is calculated as:

where w~ and w2 are the weights of E(y __~)2 and Zu2, respectively. Eu 2 is included in the fitness function to maintain the changes of the control law to a suitable change rate. The estimated parameters with the minimum fitness value are kept as the base parameters. The process parameters are changed adaptively by increasing or decreasing their value, depending on the + or - sign, by the decoded value of the base chromosome. Note that the integral control effect Eu(t), as indicated in Fig. 1, is introduced to eliminate steady state errors due to unit step disturbances. The mechanism goes through many steps until the output returns to the predetermined state, i.e. stable state. The proposed GAs-based intelligent controller has an on-line estimator. The controller on-line regulate the system change, and according adapts the control law to the change. No prior input--output pair knowledge is required. 4. APPLICATION TO T H E LOAD FREQUENCY CONTROL (LFC) SYSTEM To illustrate the effectiveness of the proposed GA-based intelligent controller, the application to the LFC (Avatchanakorn et al., 199) of a power system shown in Fig. 2 is studied. The objective of the LFC is to keep the frequency deviation Af, which is the output of the system, within an acceptable range following load disturbances. The frequency, change, Af(t), together with its previously collected values, control law u(t), and a set of decoded parameters in the current candidate population are used to calculate a set of frequency deviations A~(t) and a set of control laws u(t). A control law, uopt(t), is selected according to the following criterion:

Uop,(t)=min[wlg(Af(t) - A~(t))2 +w2zu(t)2]i,

(5)

where i is the population size. To eliminate the steady state error due to the step load changes in the system, the control law computed from the controller is accumulated with previous ones (to formulate the integral control

I

J--

L r

u(t)= 1/b0 [y(t)+~hy(t- 1)+hzy(t- 2) + . . . + h , y ( t - n)

- b l u ( t - 1) - b ~ u ( t - 2) - . . . - b m u ( t - m)].

(3)

Pc

Ms+D

The selection mechanism selects Uo,(t) from among the chromosomes in a population that optimizes the following fitness function: fitness = w] y~(y(t)__~(/))2 + W25,u2(t),

(4)

APd

FIGURE 2. Block diagram of the load frequency control system.

468

P. Dangprasert and V. Avatchanakorn TABLE 1 LFC System Parameters

Tg=governor time constant Tt-turbine time constant T=speed regulation D=load damping coefficient M= inertia constant

0.1 0.5 2 0.0083 1/6

EL~(t)2 seconds seconds

1.6

Hz/puMW puMW/Hz puMW/Hz

1.2

1.4

action) as: PC = Z

uopt(t).

(6)

0. • 0.6. 0.4, 0.2, 0 0.0002 0.0003 0.000470.000475 O.0005

t=0

The effectiveness of the GA-based intelligent controller is investigated using computer simulations with a sampling period of 0.02 s. A load disturbance, APd, has been assumed to be a step load change with a magnitude of 0.01 puMW. The LFC system parameters are defined in Table 1. The orders of the model for the study are set as n=4, m=3. In estimating the process parameters, the initial parameters are set as zero and the initial parameters changes are randomly generated in the range of --2 90~ tO +2 9 O:. The GA parameters used in the operation are as follows: • • • •

crossover rate, p : l mutation rate, Pm=0.01 number of crossing site = 1 number of best individuals passed on the next generation = 1.

The effects of the following three factors are studied based on the goodness of the controller which is related to the lowest value of the accumulated deviation of frequency, ZAj~t)2:

(I) population size (2) decoding factor,a (3) weight w~ and w2.

t.t 0.001

RGURE 3. Effect of decoding factor a.

Decoding Factor a Decoding factors within the interval 0.0001 ~< a~<0.001 are studied. A graph plotted between ~Af(t) 2 and a is shown in Fig. 3. From Fig. 3 it can be seen that a around 0.000475 gives the best result. Decoding factor ot is the factor that limits the range of parameter changes in each step of operation. To control the system smoothly, the change must not be too abrupt as the system cannot tolerate this. With a=0.000475, the change is kept in the range of - 0.2432 to +0.2432.

ZAf(t)2

.A

0.03. " k

0.02.~.~

.....

o

m i

0.I

0.5

I.I

3

5

WJ

Population Size FIGURE 4. Effect of welght w+.

Three population sizes, 50, 100 and 120, are studied. The results of the study are summarized in Table 2. The results show that the population sizes 100 and 120 have no significant differences in Z(AJ) z, while population size 50 has a very high deviation value. Since large population sizes consume more processing time, population size 100 is considered to be more practical for implementation and will be used in the remaining simulations.

0.04~ 0.0350.03. /

0.025. /

TABLE 2 Effect of Population Size

PopulaUonsize

°°51 0.0451

EAr(t)e

50

6323.71

I O0 120

0.0176 0.0176

0.02, / 0.015 / 0.01 / 0.005-

0.4 l

5 2O

FIGURE 5. Effect of weight w2.

w

2

Genetic Algorithms

469 bo,b I, b2,b3

A Pg (p.u.MW) 15

0.02

I0

0.01

5

0

0

step

,...~ "x.__

step

-5

-0.01

-I0 -0.02

-15 -20

100 200 300 400 500 600 700 800 FIGURE 6. Response of governor change.

I00 200 300 400 500 600 700 800

FIGURE 10. Characteristics of process parameters b0, b,

b~,b~. Weight APt

(p.u.MW)

0.02 0.01 [ 0 -0.01

,..step

-0.02

100 200 300 400 500 600 700 800

Figures 4 and 5 are summary results of the effects of combinations of weights wt and w 2 on the deviation of frequency. Figure 4 is a plot of the simulation results by keeping w 2 at a constant value of 10, while wt is varied within the interval 0.1 ~
FIGURE 7. Response of turbine change.

Output Responses and Parameter Characteristics Simulation results with a population size= 100, wt = 1.1,

w2= 10, a=0.00(M75 are illustrated in Figs 6, 7 and 8. A Af(Hz)

0.02 0.01 0 -0.01 -0.02' i

100 200 300 400 500 600 700 800

load disturbance of 0.01 pu.MW has been introduced steadily. As a result, APg, APt and Afstart to converge to the desired ranges at around time step t=300, which is equal to 6 s. The frequency output, after swinging as a result of load disturbance, is controlled and is brought to steady state successfully. Figures 9 and 10 show the characteristics of the estimated parameters, fi~, ~2, a3, fi4, bo, b~, b2, and b3. It is indicated that GAs can yield quite good estimation results.

FIGURE 8. Response of frequency change.

5. C O N C L U S I O N

al, a2, a3, a

20 15 IOS

?

-10 -15 -28 100 200 300 400 500 600 700 800 FIGURE 9. Characterletics of process parameters a,, aa

This paper proposes a new intelligent controller with the use of GAs based on the concept of self-tuning regulators. GAs have important roles in parameter identification, based on the genetic operations, and in choosing the best suited parameters by the selection mechanism. The fitness function is practical for implementation because it measures the square of the difference between the actual and the estimated outputs. The effective results have been illustrated with the application to the load frequency control of a power system. It is shown that the proposed intelligent control can control the system with the presence of load disturbance and correctly identify process parameters. The contribution of this paper is that the intelligent

470

P. Dangprasert and V. Avatchanakorn

controller employs GAs as an on-line parameters identification and control law calculation. There is no need for prior knowledge and/or training data to train the system. REFERENCES Avatchanakorn, V., Ueda, A., Gotoh, Y. & Mizutani, Y. (1991). Load frequency control using power demand estimation and fuzzy

control. Electrical Engineering in Japan, 111, 47-57. Golberg, D. E. (1989). Genetic algorithms in search optimization, and machine learning. Reading, MA: Addision-Wesley. Grefenstette, J. J. Genetic algorithms. IEEE Expert, 8, 6-8. Holland, J. (1975). Adaptation in natural and artificial systems. Ann Arbor, MI: University of Michigan Press. Kristiusson, K. & Dumont, G. A. (1992). System identification and control using genetic algorithms. IEEE Trans. Systems, Man, and Cybernetics, 22, 1033-1046.