Beruflich Dokumente
Kultur Dokumente
0
.4 Genetic algorithms and their application to control
system design
10.4.1 Evolutionary design techniques
In any design problem there is a multi-dimensional space of possible solutions. Some of
these solutions may be acceptable, but not the best (local optima) and there may exist
a single best solution (global optimum).
It has been shown in Chapter 9 that it is possible to obtain an optimal mathemat-
ical solution for a control system with linear plant dynamics. An alternative
approach is to use 'heuristics', or knowledge acquired through experience, to search for
optimal solutions. One such technique is to employ a Genetic Algorithm (GA). This is
a search algorithm based upon the evolutional process of natural selection of the fittest
members of a given population to breed the next generation.
Pointer
Crossover Point
V
P1 1 1 0 0 1 0 1 1 01 1 1 0 0 0 1 1 0
P2 1 0 1 1 0 1 1 0 02 1 0 1 1 1 0 1 1
Example 10.5
A system has a fitness function
J = 1 + sin ax (10.97)
as shown in Figure 10.35. Assume that the solution space has 31 values and that each
solution can be represented by a five digit binary string ranging from 00000 to 11111. The
value of a in equation (10.97) is therefore 11.6° (0.203 rad). If the population has four
members, spinning a coin (heads = 1, tails = 0) produced the following initial
population
Solution
From Figure 10.35 it can be seen that the optimal solution occurs when x10 = 8, or x2
= 01000.
Table 10.1 shows the selection of parents for mating from the initial population. If a
random number generator is used to generate numbers between 0.0 and 1.0, then the
cumulative probability values in Table 10.1 is used as follows:
2.5
0.5
0
0 5 10 15 20 25 30
Xio
The random number generator produced the following values: 0.326, 0.412, 0.862 and
0.067. Hence Parent 1 was selected twice, Parents 2 and 4 once and Parent 3 not at all.
The selected parents were randomly mated with random choice of crossover points.
The fitness of the first generation of offsprings is shown in Table 10.2.
From Tables 10.1 and 10.2 the total fitness of the initial population was 5.412,
whereas the total fitness of their offsprings was 5.956, an increase of 10%. Note that if
each offspring was perfect, they would have a value of 810, or 010002, thus giving the
maximum fitness that any population could have of 2 x 4 = 8.0.
The next spin of the random number generator produced values: 0.814, 0.236,
0.481 and 0.712, giving the roulette wheel hits shown in Table 10.2.
The second generation of offsprings is shown in Table 10.3. From Table 10.3 the
total fitness of the second generation of offsprings is 7.204, or an increase of 33%
above the initial population. As things stand, since the two most significant binary
digits in the second generation offsprings are 00, subsequent breeding will not
368 Advanced Control Engineering
produce strings greater than 00111, or 710. If all four offsprings had this value, then a
total fitness for the population would be 7.953, which is close to, but not the ideal
fitness of 8.0 as explained earlier. However, if mutation in a particular offspring
changed one of the two most significant digits from 0 to 1, a perfect optimal value
could still be achieved. Also to bear in mind, is the very limited size of the population
used in this example.
Example 10.6
The block diagram for an angular positional control system is shown in Figure 10.36. The
system parameters are:
Using a GA with a population of 10 members, find the values of the controller gain
K1 and the tachogenerator constant K4 that maximizes the fitness function
N-1
= 100/ E {(0i(kT) — 0o(kT))2T (10.98)
k=0
when the system is subjected to a unit step at time kT = 0. Perform the summation
over a time period of 2 seconds (N = 40). Allow a search space of 0-15 for K1 and
Intelligent control system design 369
Servomotor Load
Controller Amplifier
0 Oe(s)
(s) + U(s) 0,(s)
Velocity Feedback
0-1 for K4. Assume that the solution space has 255 values and that each solution can
be represented by an eight digit binary string, the first four digits representing K1 and
the second four representing K4.
Solution
The plant transfer function is
190 , K2K3n
—k,$) = (10.99)
Rf4s2
If the state variables are x1 = 00(t) and x2 = O0(t) = xl, then the state equations
become
0
[X11 [0 11 [X1
K2K3n I u
[X2] [0 0 ] X2 ]
Rf i e
u (10.100)
= 011 [ [ 10.096]
For a sampling time of 0.05 seconds, the discrete form of equation (10.100) is
Hence values of K1 and K4 generated by the GA are inserted into equation (10.102) and
the control u(kT) used to drive the discrete plant equation (10.101). The fitness function
J is updated at each sampling instant to give an overall value at the end of each
simulation. For a population of 10 members, 10 simulations are required per generation.
Since the required search space is K1 0-15, K4 0-1, the following are examples of
population membership
K1 K4
1111 1111 K1 = 15 K4 = 1
0011 0111 K1 = 3 K4 = 7/15 = 0.467
1001 1100 K1 = 9 K4 = 12/15 = 0.8
Table 10.4 shows the parent selection for mating from a randomly seeded initial
population. The random numbers (0-1) from the roulette wheel spins were: 0.145,
0.422, 0.977, 0.339, 0.607, 0.419, 0.075, 0.027, 0.846, 0.047.
The fitness of the first generation of offsprings is given in Table 10.5. Further
breeding produced the sixth generation of offsprings given in Table 10.6. Inspection of
Table 10.6 reveals that values of K1 = 15, K4 = 0.333 produces a global maximum of J =
1065. Figure 10.37 shows the unit step response of the system in Example 10.6 for
(a) the maximum of the first generation of offsprings (J = 841)
(b) the global maximum of the sixth generation of offsprings (J = 1065)
111**1**
Table 10.4 Parent selection from initial population for Example 10.6
Parent Offspring K1 K4 J
Offspring Ki K4 J
1110 0101 14 0.333 1030
1111 0110 15 0.400 1029
1110 0100 14 0.267 1021
1111 0101 15 0.333 1065
1111 0111 15 0.467 970
1111 0100 15 0.267 1041
1110 1000 14 0.533 858
1110 0111 14 0.467 923
1111 1000 15 0.533 905
1111 0101 15 0.333 1065
Total 9907
Mean 990.7
Maximum 1065
1.2
00(t) Sixthgeneration
1 / 11111111 ___
■—___
0.8
First generation
0.6
0.4
0.2
0 01 02 03 04 05 0.6 07 08 09
Time (s)
Fig. 10.37 Comparison between best first generation and best sixth generations solutions for Example 10.6.
372 Advanced Control Engineering
(b) Self-Organizing Fuzzy Logic Control: Genetic Algorithms may be used to adapt
both membership functions and rulebase structures in a SOFLC system.
Figure 10.38 shows an input window with three triangular fuzzy sets NB, Z and PB.
Each set is positioned in its regime of operation by the centre parameter c so that, for
example, NB can only operate on the negative side of the universe of discourse. The
width of each set is controlled by parameter w.
The chromosome string could take the form
02
Cl C3
11
U
Wi W3
4
W2