16 - Inverted Pendulum Control System Based On GA Optimization
16 - Inverted Pendulum Control System Based On GA Optimization
•• ••
(I + ml ) θ + mg.l sin θ + ml x cos θ = 0
2
(2)
We assume θ and Φ are very small and are
respectively the displacement and deviate angle of the
Figure. 1 One stage elastic inverted pendulum rod .According to the assumption above the elastic
model can be simplified into a linear model( cos θ =0;
The inverted pendulum is an important subject in •
control theory and experiments . Many physical sin θ =-Φ; θ 2
=0) . Setting the horizontal line
models can be simplified as elastic inverted pendulums. through the hinge is the zero potential position.
[1].[ 2 ]
such as rockets and walking robots.The inverted Substituting (1) and (2), Laplace transforms,
pendulum system is illustrated in Fig . 1. A motor into (3)
drives a moving cart. The cart is connected with an
inverted pendulum with a hinge . he kinetic
parameters of this device , including position and
G(S) =
φ ( s) 0.02725
(4)
function of penalty JL is increasing evidently ,When
=
v( s ) 0.0102125s 2 − 0.26705 phase margin φm > φ0 , the evaluation index of
The transfer function for PD controller : function of penalty JL is unaltered.
The better adaptability function is :
G C (S) = k p (1 + TD S
) 1
TD S K D + 1
F= *1/J (9)
Reflect the phase margin degree of the control system 1 + e − α (φ m − φ 0 )
robustness:
φ m = arg[G ( jω c )GC ( jω c )] + π ; 3. Genetic algorithms (GA)
G ( jω c )G c ( jω c ) = 1 (5) Step1:Searching space of GA [ 4][5][ 6] regards result
[3]
of Z-N method as the center and extends left and
there into: KP is the ratio coefficient. K D =2.8,TD
right equally to form n=30*2 genes. Thus, it can use
differential coefficient , ω c is cut frequency. The reasonable kernel of Z-N method and reduce GA
index sign of time domain for evaluating the control searching time. It adopts decimal coding to get one
system adopts the functions as: follows. gene at random from P、D 、gene, connects from
.∞ beginning to end, so to form initial chromosome of
J= ∫ .0
[ w1 e(t ) + w2 u 2 (t )]dt + w3 t p (6) n=30 as the following and compose optimized initial
population:
There into-e ( t ) is systemic error , u 2 (t ) is the
x1P ...x1D x1
output of controller, t p is the rise time of the control
x 2 P ...x 2 D x2
system, w1 ; w2 ; w3 is weight coefficient of the index
X(n,2)= = ... (10)
sign of time domain. ..............
Among the index functions of time domain for xn
evaluating the control system, the first item is to x nP ...x nD
achieve the satisfied dynamic identity. The second Step2:Define adaptation probability expression of
item is to spend less energy for system control. The each chromosome(individual) in equation:
third one is to achieve a good systemic speed. n
Meanwhile adopts two kinds of functions of penalty.
In order to avoid over movement, the following Psi = fi ∑f
i =1
i (11)
function of penalty is adopted:
if ΔY<0 ; J= There into: Psi is the probability distribution of “s”
.∞ generation and “i” piece chromosome; f i is the
∫.0
[ w1 e(t ) + w2u 2 (t ) + w4 ∆Y ]dt + w3t p (7) adaptation of i piece chromosome.
Step3: Reproduction operation
348
Reproduction operation simulates competing process There into: Pm is mutation probability, n =30 is
of biology pollution and genetic algorithms also obey the number of one generation biology population, n (i)
this rule. It produces number r at random distributed is i individual in biology population. Computer deals
between 0 and 1 equably at first, then the as the following method: Sort order of current biology
chromosome with adaptation probability Psi >r was population adaptation as direction of small to big.
copied, and chromosome with adaptation probability Then produces number “r” at random distributed
Psi <r was washed out. equably between 0 and 1.If Pm>r , execute
Step4: Crossover operation chromosome mutation population to produce new
Crossover operation simulates multiplying chromosome individual; if Pm<r , not to execute
process of biology population, exchanging and chromosome mutation population without producing
combination of two chromosomes to produce new new chromosome individual. With mutation
optimized breed. Crossover operation process of GA probability Pm descending, population with bad
is-select two chromosomes at random in matching adaptation carries on mutation operation first.
pool, use the following crossover expression:
s +1 4. Optimizing method for Inverted
= βx1 + (1 − β ) x2
s s
x1 ; Pendulum to control parameter
s +1
= βx2 + (1 − β ) x1
s s
x2 (12) Figure. 2 Comparing figure between Z-N method
Two new chromosomes combination were produced.
There into:β produces coefficient distributed equably
between 0 and 1, superscript “s” is the algebra to born
new body for chromosome. Crossover operation of
GA is controlled by crossover probability Pc=0.9,
the computer produces number “r” between 0 and 1 at
random equably. If Pc>r,execute chromosome
crossover operation to produce new chromosome
individual; if Pc<r,not execute crossover operation
without producing new chromosome individual.
Step5: Mutation operation
Mutation operation simulates gene mutation of
biology population under natural environment
because of incidental reasons. Mutation operation of
GA changes inherit gene at random as small and genetic algorithms
probability Pm, producing method of chromosome Figure 3:Systematic bode diagram
gene mutation is
s +1
x1 = ( xmax + xmin ) / 2 +
( xmax − xmin ) * ( r − 0.5) (13)
There into: xmax , xmin is the upper limit and
lower limit of chromosome real codes constructed by
P、D parameter, superscript “s” is the algebra to born
new body for chromosome, r is the number
distributed equably between 0 and 1 and produced by
computer at random.
Mutation operation of chromosome is controlled
by mutation probability Pm. Mutation of biology Use Z-N correcting method to produce controller
population usually incurred on population with bad parameter P、D of inverted pendulum, and regard
adaptability, which is good for produce excellent P、D parameter as off-line optimized initial points of
breed. For this character of bionics biology GA. Kp*=37、 TD *=0.1。 Genes made up of P、D
population, it adopts the following the expression of
mutation probability: parameters to form initial population, population
Pm=0.10- n(i) / n (14) number n=30 , penalty function 。 α =10 、 phase
349
margin φ0 =π/6 , set crossover probability evaluating and control system in GA method include
Pc=0.9..Mutation probability Pm was brought by output increment of GA control system absolute value
expression (12), weight coefficient of time and space of system error, and square of controller output; and
add penalty function that regard lifting time and phase
performance index . w1 =0.999; margin as adaptation. So Inverted Pendulum can get
dynamic character with good speediness performance
w2 =0.001; w3 =2.0; w4 =100 。 Range of K P and robust stability, and controlling energy of system
is small, too. In order to improve speediness
is[0 , 74] 、 range of T D is[0 , 0.2] , maximum
performance, adopt two penalties function at the same
heritage afterworld s max =100 , number of time. Good result is certificated: optimized Inverted
Pendulum PD control parameters obtained by GA
population chromosome n=30,finally simulated by
method acquire satisfied result in real application.
Matlab7.0 system. For figure 2, it indicates the time
and space dynamic response when the PD parameters
(produced by Z-N method and GA method) were References
acted on inverted pendulum. From response speed of
controlling system, the difference between Z-N [1]. Xiao-Bing Mao , Guo-Zhang Gao ,“ Analysis of the
method and GA method is not too much; but from Controllability of a Nonlinear Inverted Pendulum with the
super-adjusting index and stabilization time index, New Method of a Rational Function System ” Control,
Communication and Network Systems, Technologies and
GA method is much better than Z-N.
Applications。USA, 2004 ,vol.8,pp.247-250.
[2.]. Haresh A. Suthar; Kaushal B. Pandya。“ DESIGNING
FUZZY LOGIC CONTROLLER FOR INVERTED
PENDULUM” 。 Artificial Intelligence Applications and
Innovations Beijing , 2005, pp.61-68.
[3]. Ziegler J.G. N.B. Nichols. “Optimum settings for auto-
mastic controllers Trans.” ASME , 1942,pp.759-768.
[4].FU SHUANWEN, “ etal..New Approach to Alarm
Process in gin Power Systems Based on the et Covering
Theory and A Refined Genetic Algorithm ” .
ELECTRICMACHINEANDPOWERSYSTEMS,
1998,25(1), pp.50--67.
[5]. Hatsuda ,Takeshi,Yoneta and Sadayoshi.“Genetic
Algorithm Application to Efficient Utilization of the
GSO ” IEEE Transactions on Aerospace & Electronic
Figure4 :Optimization process diagram Systems, 2004(4), pp.1217- 1221.
350