Sie sind auf Seite 1von 5

Fourth International Conference on Natural Computation

Real-coded adaptive genetic algorithm applied to PID parameter optimization on


a 6R manipulators
Yuan-Ming Ding
State Key Laboratory of Fluid Power
Transmission and Control, Zhejiang
University, China
jdadai@zju.edu.cn

Xuan-Yin Wang
State Key Laboratory of Fluid Power
Transmission and Control, Zhejiang
University, China
xywang@zju.edu.cn

A new matching crossover real-code adaptive genetic


algorithm base on the population maturity is presented to
optimize the parameters of a PID controller. The
individual is coded in real number, and its crossover
probability varies according to the individual fitness and
the population maturity in course of evolution. New
individuals generated by the crossover between
individuals with the best fitness and the second best
fitness are added into the population to decrease the
search size of the real-coded genetic algorithm. To a
certain extent, this algorithm can improve the crossover
efficiency of the real-coded adaptive genetic algorithm,
solve the premature problem and generate new
preponderant individuals much more efficiently. The
experiments on the PID parameter optimization of a 6R
series arc welding manipulators demonstrate that this
algorithm can enhance the performance of searching
global optimum and keep the population diversity at a
high level at the same time. The optimization result of this
algorithm is better than the one of the others.

The strategy of changing the crossover and mutation


probability adaptively is more effective, such as the
adaptive genetic algorithms presented by M. Srinivas[4],
WANG Xiao-ping[5], ZHENG Jun[6] etc.
The experimental results show that the strategies
mentioned above do not work well with the real-coded
genetic algorithm. Therefore, an improved real-coded
adaptive genetic algorithm is presented in this paper. The
strategy of the algorithm is that the crossover and
mutation probability changes according to not only the
individual fitness but also the population maturity, and
new individuals generated by the crossover between
individuals with the highest fitness and the second highest
fitness are added into the population to decrease the
search size and improve the accuracy of the real-coded
genetic algorithm. To a certain extent, this algorithm
solves the problems of big search size, low accuracy and
easy premature problem of the real-coded genetic
algorithm. Moreover, this improved algorithm is used in
the experiments on the PID parameter optimization of a
6R series arc welding manipulators and better
performance indicators are got.

1. Introduction

2. Real-coded adaptive genetic algorithm

According to statistics, in the existing industrial


products, more than 95% of industrial motion controllers
use the PID algorithm, but most of them are still operating
in manual mode [1]. At present, there are many PID
parameter optimization methods, such as Ziegler-Nichols,
IST2E, pole assignment and the amplitude phase margin
method etc. However, all these conventional optimization
methods are based on the first order model of the object,
and when the model cannot fit the actual object, these
conventional optimization method will not work well.
The genetic algorithm works in a different way, it does
not need the first order approximate model of the object,
then there will be no model error, and therefore better
optimization results can be got. The genetic algorithm has
advantages such as simplicity and high robustness, and
also has some shortcomings such as premature and local
optimum. The adaptive genetic algorithm can overcome
the shortcomings of the conventional genetic algorithm.

The genetic algorithm coded in real number has more


advantages than the one coded in binary number [3]. It
can treat the variables as the genes and the real strings as
the chromosomes directly, thus the coding and decoding
process can be saved, and it is easy to mix the genetic
algorithm with other algorithms. However, the real-coded
genetic algorithm has bigger search size than the binary coded one. Assuming Pa, Pb are two real-coded
individuals, and the survival probability of Pa is Pr, Pr
(0,1), then the crossover between Pa and Pb will be:
r
1
r ;
1
1
r
r.
where, Pa, Pb are new individuals after the crossover.
Suppose:
And
0
(2)
then
1
r
(3)

Abstract

978-0-7695-3304-9/08 $25.00 2008 IEEE


DOI 10.1109/ICNC.2008.82

635

As shown in (3), Pa distributes in (Pa-P, Pa)


randomly. If the difference between Pa and Pb increases,
which means P increases, the distribution range of Pa
will get more widely. At this point, the search size gets
bigger and it will decrease the efficiency and accuracy of
the real-coded genetic algorithm.
In course of evolution, changing the crossover and
mutation probability of the individuals can increase the
accuracy of the real-coded genetic algorithm. This
strategy was first proposed by M. Srinivas in 1994, which
is called SAGA for short, and his strategy can be
described as:
k
4
k
k
5
P
k
where, fmax is the maximum of the individual fitness , favr
is the average of the individual fitness, f is the individual
fitness, ki(i=1,2,3,4) is a constant.

Figure 2. The crossover and mutation probability


curve of PAGA
The difference between SAGA and PAGA is the
crossover probability adaptive changing strategy. PAGA
believes [7] that the bigger the individual fitness is, the
higher the crossover probability should be, so that the
superiority individual can expand its gene advantages in
the population, which is more in line with the law of the
natural genetic evolution. The actual experimental results
show that the strategy can solve the premature problem.
However, because the individual has been maintaining a
relatively high crossover probability, the number of the
low fitness individual keeps increasing, so that it may take
the algorithm a longer time to get the optimum results.

3. Matching real-coded adaptive genetic


algorithm
Based on the above analysis, SAGA convergents fast
and PAGA guarantees the global optimum. With these
two characteristics, a matching real-coded adaptive
genetic algorithm based on the population maturity is
presented in this paper, which is called MAGA for short,
that is, the individual crossover probability changes
according to not only the individual fitness but also the
population maturity which is measured by the average of
fitness. Moreover, if the population is mature, a matching
crossover will be done to do a neighborhood search to
decrease the search size of the real-coded genetic
algorithm. The strategy is:
k
,

Pm
Pm
0

favr f fmax

Figure 1. The crossover and mutation probability


curve of SAGA
As shown in Fig. 1, the higher the individual fitness is
the lower the crossover and mutation probability is, or
even zero, which keeps the population evolving in a high
speed, so that the results can converge to the optimal
quickly. However, due to this high speed evolution, this
adaptive strategy is also likely to cause local optimum
especially to the real-coded genetic algorithm.
After comparing a variety of genetic algorithms with
adaptive changing crossover and mutation probability, a
new adaptive strategy based on the superiority inheritance
principle was presented in [7], which is called PAGA for
short. The strategy can be described as follows:

k
k

k
k

,
,
8

k
where, fset is the population maturity set point.

3.1. Reproduction
The reproduction number is computed by the
individual fitness. Supposedly, fi_p is the fitness of the
individual P, fi_sum is the sum of the population fitness, N
is the number of the individual in the population, Np is the
reproduction number of P in the next generation.

Pm

Pm
0

,
k

favr f fmax

If the number of the population after the reproduction


is smaller than the one before, add the superiority
individual to complete the population.

636

3.2. Crossover
The operator is a neighborhood individual crossover,
which will work when Pr<Pc, where Pr is the complete
survival probability of the individual P, and Pc will be
computed by Form. 7. The operator is shown in Form. 1.
Figure 4. Single-joint control system diagram

3.3. Mutation
Supposedly, P distributes in [Pmin, Pmax] randomly,
when Pr<Pm,
(10)
where, Pm is computed by Form. 8, P is the new
individual after the mutation.

4.1. Transfer function of the object


G

JL

JR

k
bL

bR

k k

11

where, J, the moment of inertia; L, the motor coil


inductance; k, the motor current-torque conversion
factor; R, the motor impedance; kb, the motor counter
electromotive force constant; b, the friction coefficient.
In the simulation, L=0.005H, R=5, kb=0.125 vs/rad,
k=15 Nm/A, b=0.01 Nms/rad.

3.4. Matching
When the population is mature, replace the individual
according a descending order of the individual fitness and
match the first pair of different individuals to do a
crossover operation, and then reproduce the individuals
for the second time to form the population again.
The main viewpoint of the MAGA is, when the
population is immature, let the individuals with low
fitness have high crossover probabilities to make the
population converge quickly, when the population is
mature, let the individuals with high fitness have high
crossover probabilities to expand the superiority genes, at
the same time, add the matching crossover between
individuals with the best fitness and the second best
fitness to do a neighborhood search, and then reproduce
the individuals to complete the population again.

4.2 Objective function


w |

w |

| d

12

where, u(t), the control signal; e(t), the system error; tu, the
system rising time.
wi(i=1,2,3,4) is the weight coefficient. In order to
suppress the system overshoot, a punishment coefficient
w4 is set, when e(t)0, w4=0, when e(t)<0, w4>>w3. In
the simulation, w1=0.999, w2=0.001, w4=100, w3=2.

4.3. Individual fitness function

4. Simulation and analysis

13

where, is a very small positive real number, in case J=0


makes fi have a infinite value.
In the simulation, KpKiKd is coded in real number
and optimized to get the minimum of the objective
function by SAGA, PAGA, MAGA separately. The initial
number of the population is 30, and the maximum of the
evolutionary generation is 100. Under the same initial
population, the simulation is done 10 times each. The
simulation results are shown in Table 1. The conclusion
can be made that the optimization result got by MAGA is
better than the one by SAGA and PAGA. As concerning
the parameter Ki, the SAGA and PAGA can only get
0.0004 and unable to continue searching, however, the
MAGA can optimize the result to 0.001. These are all
because of the search size of the real-coded genetic
algorithm, so that it is obvious that the MAGA can
decrease the search size greatly.

To test the reliability


and
effectiveness
of
MAGA, the algorithm
was applied to the PID
parameter optimization of
a 6R series arc welding
manipulators, which is
shown in Fig. 3. Fig. 4
shows the single-joint
control system diagram.

Figure 3. 6R series arc


welding manipulators

637

Table 1. Experiment data of SAGA, PAGA and MAGA


SAGA
Kp
26.287
15.923
20.244
22.092
21.218
14.158
22.668
21.131
30.838
20.244

Ki

Kd

0.0004 0.061
0.0004
0.0004
0.0004
0.0004
0.0004
0.0004
0.0004
0.0004
0.0004

0.0878
0.074
0.086
0.075
0.067
0.141
0.075
0.055
0.074

J
13.753
16.107
14.776
15.974
14.916
14.158
21.447
14.936
13.536
14.776

PAGA
Kp
33.504
35.951
27.701
22.228
30.550
32.031
35.951
28.065
33.548
35.951

Ki
0.0004
0.0004
0.0004
0.0004
0.0004
0.0004
0.0004
0.0004
0.0004
0.0004

5. Experiments

Kd
0.052
0.051
0.059
0.071
0.056
0.054
0.051
0.057
0.053
0.051

MAGA
Kp
23.759
26.390
34.369
31.396
29.353
30.876
27.603
33.3634
37.745
32.294

J
13.490
13.493
13.658
14.544
13.539
13.499
13.493
13.594
13.490
13.493

Ki
0.0002
0.0001
0.0001
0.0002
0.0001
0.0003
0.0003
0.0001
0.0003
0.0003

0.065

0.075

0.055

0.065

Kd
0.060
0.056
0.050
0.054
0.054
0.049
0.055
0.052
0.061
0.050

J
10.805
10.030
9.246
11.508
10.311
12.214
11.960
10.223
12.788
12.149

0.07

0.06
0.055

Fig. 5 shows one simulation results of ten, where fi_max,


fi_avr, fi_min and fi_sd means the maximum, the average, the
minimum and the standard deviation of the population
fitness separately. fi_avr shows the population maturity, and
fi_sd shows the dispersion of the individual. The greater
fi_avr is, the more the number of the superiority individual
is. The greater fi_sd is, the higher the dispersion of
individual and the diversity of the population are.
Fig. 5 (a) shows, SAGA has a fast converge speed, and
in the late evolution fi_avr goes near fi_max, which means the
individuals with high fitness are dominant in the
population and the population has a low diversity.
Because the individuals have great fitness, the crossover
and mutation probability is small, or even near zero, so
that the algorithm can hardly avoid the superiority
individuals and continue searching the optimum.
Fig.5 (b) shows, PAGA keeps converging, but the
speed is slow. Because fi_avr and fi_sd have remained
relatively low values, the individuals with low fitness are
dominant in the population and the population has a low
diversity. As the real-coded genetic algorithm always has
a big search size, in the late evolution, fi_avr fluctuates a lot
and the efficiency of the algorithm turns worse.
Fig.5 (c) shows, at the beginning of MAGA, the
population evolutes fast, fi_avr maintains an upward trend
and goes near fi_max, individuals convergence to the
superiority individual and the population turn mature. In
the late evolution, after changing the crossover
probability, the population keeps converging; fi_avr turns a
declining trend and eventually goes near (fi_max+fi_min)/2.
fi_sd has a greater value and remains stable, which means
the individuals distribute discretely and the population
have a better diversity. Overall, MAGA works well in
both keeping the population diversity at a high level and
enhancing the optimization efficiency.

0.045

0.05
0.045
0.035

0.04
0.035
0.03

0.025

0.025
0.02
0.015

0.015
0.01
0.005

0.005
0

-0.005

-0.005
0

10

20

30

40

50

60

70

80

90

100

10

20

30

40

50

60

70

80

90

100

0.4

0.45

0.5

(b) PAGA

(a) SAGA
0.1
0.095
0.09
0.085

0.08
0.075
0.07
0.065

0.8

0.06
0.055
0.05

0.6

0.045
0.04
0.035
0.03

0.4

0.025
0.02
0.015

0.2

0.01
0.005
0
-0.005

10

20

30

40

50

60

70

80

(c) MAGA

90

100

0.05

0.1

0.15

0.2

0.25

0.3

0.35

(d) Step Response

Figure 5. Population fitness curves with the


generation and step response of 6R manipulators
single joint
Fig.5 (d) shows the experiment curves about the single
joint position step response on a 6R series arc welding
manipulators, which is shown in Fig.3. Chose the best
optimization result of SAGA, PAGA and MAGA and
apply it to the first joint control system of the
manipulator. The test data are as follows:
Table 2. Test data
Kp
Ki
Kd
SAGA
30.838
0.0004
0.055
PAGA
33.548
0.0004
0.053
MAGA
34.369
0.0001
0.050
In the experiments, the system rise time of the three
sets of data is 230ms, 180ms, 170ms separately. So it is
obvious that the MAGA optimization result can
significantly enhance the system response time without
overshoot, which is 50ms than SAGA and 10ms than
PAGA.

638

[2] Feng Xu, Dong-Hai Li, Ya-Li Xue, Comparing and


optimum seeking of PID tuning methods base on ITAE
index, Proceedings of the CSEE, 23(8):206-210, 2003.
[3] Kwang Y. Lee, et.al, A real-coded genetic algorithm
involving a hybrid crossover method for power plant
control system design, Proceedings of the Congress on
Evolutionary Computation, 2002(2): 1069- 1074.
[4] M. Srinivas, L.M. Patnaik, Adaptive probabilities of
crossover and mutation in genetic algorithms, IEEE
TRANSACTIONS ON SYSTEMS, MAN AND
CYBERNETICS, 24(4):656-667, 1994.
[5] Xiao-Ping Wang, Li-Ming Cao, Genetic algorithm
theory, application and software implementation,
Publishing house of Xian Jiaotong University, 2002.
[6] Jun Zheng, Jing Zhu, Image matching based on
adaptive genetic algorithm, Journal of Zhejiang
University(Engineering Science), 37(6):689-692, 2003.
[7] Shi-Zhe Chen et al, Adaptive genetic algorithm based
on superiority inheritance, Journal of Harbin Institute of
Technology, 39(7): 1021-1024, 2007.

6. Conclusions
Through the study on the past adaptive algorithm, a
matching crossover real-coded adaptive genetic algorithm
is proposed in this paper, which the crossover probability
changes according to not only the individual fitness but
also the population maturity, and a neighborhood search
method by adding the matching crossover to the algorithm
is also presented to decrease the search size of the realcoded genetic algorithm. The experiments on the PID
parameter optimization of a 6R series arc welding
manipulators demonstrate that this algorithm can generate
the superiority individuals more effectively and keep the
population diversity at a high level at the same time. To a
certain extent, this algorithm can solve the premature and
big search size problem and enhance the overall accuracy
of the real-coded genetic algorithm.

7. References
[1] Aidan ODwyer, PI and PID controller tuning rules:
an overview and personal perspective, ISSC 2006 Dublin
Institute of Technology, June 28-30.

639

Das könnte Ihnen auch gefallen