EXPLORATION OF AUTOMATIC
CONTROLLER SYNTHESIS FOR MOTION
SYSTEMS USING GENETIC PROGRAMMING
Dennis Bruijnen
∗
Iris Soute
∗∗
Ren´e van de Molengraft
∗
Maarten Steinbuch
∗
∗
Eindhoven University of Technology,Control Systems
Technology Group,The Netherlands
∗∗
Philips CFT,Motion Control Group,The Netherlands
Abstract:In this paper a method for automatic controller synthesis based on
Genetic Programming (GP) is presented.We propose a GP algorithm linked with
Matlab/Simulink,a well known tool amongst control engineers.The GP algorithm
performs its evolutionary steps to create controllers,whilst Matlab/Simulink
evaluates these controllers for their appropriateness.The engineer no longer
needs design rules,he only needs to specify both time and frequencydomain
requirements for the controller.Simulations have been carried out successfully,
applying GP to ﬁnd a linear controller for a fourth order motion system.
Keywords:genetic algorithms,artiﬁcial intelligence,control system design,
structural optimization,parameter optimization
1.INTRODUCTION
This paper presents a GPbased approach for mo
tion controller design.Until now,control engineers
use all kinds of design rules for controller design.
These rules will,at least in the case of linear
dynamics,more or less guarantee that certain
performance criteria are met.In our approach the
controller design problemis formulated as a global
nonlinear optimization problem that is solved via
GP.
Many controller design methods can not handle
directly time domain speciﬁcations,or the com
bination of them can not be cast into a convex
optimization problem (Boyd and Barratt,1991).
These methods require the user to make the trans
lation to frequency domain speciﬁcations before
the synthesis,like H
∞
(Burl,1999).Specifying a
constraint in the timedomain,such as an actuator
limit,is not possible in the frequencydomain,al
though it often is a crucial limitation of the perfor
mance.Furthermore,these methods require a pre
ﬁxed controller structure.Using GP,time domain
as well as frequency domain requirements can be
speciﬁed in a direct way and no assumptions on
the controller structure have to be made.For now,
we restrict ourselves to linear controller design for
linear systems.As linear controller design is a well
established ﬁeld,it will be easy to assess the GP
results.Once the principle of working has been
showed we expect to be able to extend the GP
controller design to nonlinear cases.
Recently GP has been applied to several topics in
the ﬁeld of controller design:
• In (Keane et al.,2002),GP generated linear
controllers are compared to PID controllers
tuned with commonly used design rules.Gen
eralized controllers for industrial plants are
created,whereas our target is to create ded
icated controllers for motion systems.
• In (ChunLiang Lin and Shieh,2003) the
type of controller is ﬁxed,only linear PID
controllers are optimal tuned using a Genetic
Algorithm.By ﬁxing the controller topology,
other types of controllers are not explored.
GP does not have this limitation,since it
is able to determine the structure of the
controller by itself.
• In (Koza et al.,2000b) a linear controller is
designed for a plant with real poles only.
In motion controller design,the (anti) resonance
phenomena,caused by complex poles and zeros,
of the mechanics are often crucial.Stability is
often at stake due to phase lag caused by these
phenomena.
Using GP,we can construct a ﬁtness function that
will evolve to a stable and wellperforming con
troller by using a mix of requirements in the time
and frequencydomain.The main contribution of
this paper is the application of GP for motion
controller design.
Furthermore,GP is complemented with an addi
tional parameter optimization method to optimize
the parameters of a created controller by GP,
because GP lacks eﬃciency when optimizing con
trollers with a large amount of parameters.This
problemwas also noted in (Gray et al.,1996).The
parameter optimization method can be any non
linear local multivariable optimization method.
We used a Genetic Algorithm (Holland,1975).
The working of it will not be described in detail
here.
In section 2 GP will be clariﬁed in short,and in
section 3 the implementation of the GP algorithm
combined with Matlab/Simulink is explained.Sec
tion 5 describes the necessary steps for applying
GP for controller design,and in section 6 the
results are presented.The paper is concluded in
section 7.
2.GENETIC PROGRAMMING
ELABORATED
GP (Koza,1992) is an algorithm that creates and
optimizes a variable structure according to user
speciﬁed requirements.For controller design,both
time and frequencydomain requirements can be
speciﬁed in a socalled ﬁtness function.In our case
we call it a penalty function for the reader’s con
venience to emphasize that a higher return value
means a worse controller.The penalty function
evaluates each controller with respect to proper
ties like stability,performance and robustness.
The generation of the GP candidate solutions,
called programs or individuals,is based on a pro
cess seen in nature:survival of the ﬁttest and
evolution.It involves selecting programs,based on
their ﬁtness to solve a problem,and subsequently
evolving them into new,and possibly better,pro
grams.GP is based on the Genetic Algorithm
(GA) (Holland,1975).The major diﬀerence is the
representation of the solution.GA returns a ﬁxed
length sequence of binary numbers which has to
be interpreted,whereas GP is capable of returning
a readytorun computer program with a variable
size.This is the power of GP;it is able to adapt
itself to the complexity of the given problem.
GP is capable of creating the structure of a con
troller,not ’hindered’ by prior knowledge of con
troller design.Therefore,(where human control
designers often revert to the proven concept of
the PIDcontroller),GP is able to create a whole
new dedicated controller structure,from scratch,
often resulting in better performing controllers,
e.g.(Koza et al.,2000a).
More detailed information about GP can be
found in (Koza,1992),(Banzhaf et al.,1998) and
(Langdon and Poli,2002) or on the internet e.g.
www.geneticprogramming.org.
3.IMPLEMENTATION OF GP
To implement GP for automated controller syn
thesis,a computer programhad to be written.We
used the Evolving Objects (EO)library (Keijzer
et al.,2001) available on the internet,in com
bination with Matlab/Simulink.It is a template
based,ANSI C++ compliant evolutionary com
putation library.We have used Matlab/Simulink
as an assisting simulation tool.This way,we do
not need to implement functionality for evaluating
controllers into the GP algorithm,and we can
take full proﬁt of the sophisticated functionality
Matlab and Simulink oﬀer.
In Matlab/Simulink,controllers are represented
as block diagrams.Each block has one output
and zero or more inputs,so that blocks can be
interconnected resulting in a controller.
In GP,programs are often represented in the
treeform to facilitate genetic operations during
the evolution process (Banzhaf et al.,1998).An
2
plant input
1
output
u y
Plant
ref_acc
ref_vel
position error
output
Controller
5
ref_pos
4
ref_vel
3
ref_acc
2
sensor noise
1
disturbance
Fig.1.Simulink model of the general closed loop
system used by GP to create controllers.
elementary part of the tree is called a node.Trees
are constructed by interconnecting nodes.Two
kinds of nodes can be deﬁned:the terminal node
and the function node.A terminal node has one
output and no inputs,e.g.a constant value,or a
userdeﬁned variable.A terminal node functions
as an input for the tree.On the other hand,a
function node has one or more inputs and can be
placed in succession with other nodes.Function
nodes shape the tree and determine its complexity.
Genetic operations are performed on the GP tree
structure,and when it is time to evaluate the
controller,it is transformed to a Simulink model,
by mapping nodes to Simulink blocks.To evaluate
this model with the penalty function,it is embed
ded into a larger model (see Fig.1) containing the
plant and disturbance signals.This larger model
can be evaluated using Matlab/Simulink,and in
Matlab a penalty value is calculated.This value
is returned to the GP algorithm,after which the
evolution process can continue.The penalty func
tion is written as a Matlab mﬁle.So users are not
required to have knowledge of C++.
4.MOTION SYSTEM TEST CASE
The system under study is a 4th order motion
system with time delay,which is a model of an
existing experimental setup.This system consists
of two rotating masses connected by a ﬂexible
beam(see Fig.2).At one mass an electromotor is
connected and the angular position of both masses
mass
motor
mass
load
x
motor
x
load
flexible
beam
V
electro
motor
Fig.2.Schematic view of the setup.
10
0
10
1
10
2
−80
−60
−40
−20
0
20
Frequency [Hz]
Magnitude [dB]
Measurement
Model
10
0
10
1
10
2
−700
−600
−500
−400
−300
−200
Frequency [Hz]
Phase [degree]
Fig.3.The grey line is a measurement from the
experimental setup,measured at the load
side.The black line is a ﬁtted model of the
experimental setup.
are measured by encoders with a resolution of
2000 increments per revolution.
In Fig.3 the frequency response function is plot
ted,measured at the loadside (grey line) from
the real setup.The black line is a ﬁtted transfer
function which will be used for simulations in
Simulink.
We want to create a wellperforming controller
that will let the system perform a pickandplace
like task,minimizing the settling time.Addition
ally,stability and robustness requirements have to
be maintained.
5.SETTINGS OF GP FOR CONTROLLER
DESIGN
Before controllers can be generated with GP,ﬁrst
some choices have to be made for the GP settings.
In this section these choices are discussed.
5.1 Representation
Individuals are created using a tree structure (see
Fig.4).Such a tree is created by selecting nodes
from the function and terminal set randomly.
These nodes can be directly mapped to a Simulink
block.Nodes from the terminal set stop branches
from growing further,whereas nodes from the
function set cause the branches of a tree to grow.
If an individual’s penalty value has to be de
termined,ﬁrst the individual will be converted
to a Simulink model before running the penalty
function.
5.2 Terminal Set
In the terminal set the following nodes are avail
able for GP to use:setpoint acceleration,setpoint
velocity and tracking error between setpoint and
plant output.With these nodes,GP is able to
create both feedforward and feedback controllers.
It is up to the evolutionary process of GP what is
used.
5.3 Function Set
For now,we limit the search space to linear con
trollers.In future research the function set will
be extended enabling creation of nonlinear con
trollers by simply adding nodes to the function
set which represent some useful nonlinear building
blocks,e.g.a signfunction.To create arbitrary
linear controllers using a tree structure,the fol
lowing building blocks are used:add,subtract,
integrate,1st order transfer function,2nd order
transfer function,gain.
function node:
Gain
function node:
1
st
order TF
function node:
2
st
order TF
function node:
Add
function node:
Subtract
terminal node:
Input 1
terminal node:
Input 2
terminal node:
Input 2
1
Output
K
Gain
num(s)
den(s)
2nd order TF
num(s)
den(s)
1st order TF
2
Input 2
1
Input 1
GP individual Simulink model
Output
Fig.4.Example of a GP individual and its conversion to a Simulink model.
5.4 Parameter Optimization
Both 1st and 2nd order transfer function blocks
are needed to place both real/complex poles and
zeros arbitrarily.A result of this is that a single
block can contain up to ﬁve parameters.Optimiz
ing these parameters using the genetic operators
of GP is virtually impossible,because GP only
exchanges/mutates whole blocks.As mentioned
before,a Genetic Algorithm is used to assist GP
in the parameter optimization of the controller.
5.5 Genetic Operators
Genetic operators are used to create new individ
uals (oﬀspring) out of existing individuals (par
ents).The two mostly used operators are crossover
and mutation.Crossover exchanges a branch of
two parents,whereas mutation replaces a part of
a parent with a new created part.This part could
be a branch or a single node.Another used genetic
operator is ”branch addition” which connects an
individual with a new created tree using a node
with two inputs.This stimulates linear combina
tions of controller elements which has shown to be
proﬁtable for speeding up the evolutionary process
in the case of controller design.
5.6 Penalty Function
Creating a penalty function for controller design
is a challenging task.Each model has to be judged
properly,else GP will come up with wrong con
trollers with an apparently low penalty value.GP
optimizes what the user speciﬁes,no more no less.
So the user has to consider carefully what he really
desires of a controller without using assumptions
valid for e.g.PIDlike controllers.
The basic idea of the penalty function is that
the controllers are judged at the objectives we
are most interested in.The worse a controller
performs,the higher penalty value it will be
assigned.
5.6.1.Performance Direct performance require
ments are timedomain based,like settling time,
overshoot,static error etc.Since the GP program
can handle time and frequencydomain criteria,
the performance is speciﬁed in the timedomain.
The penalty function is based on a pickandplace
like task.For the trajectory u
r
a 3th order set
point is chosen (see Fig.5).T
c
is the time that the
trajectory becomes constant again.T is the total
simulation time.T
s
is the settling time,which is
speciﬁed as the time after which the diﬀerence
between the plant output and the trajectory stays
within an error band of 0,1% until the end of the
simulation time T.e
max
is the maximumabsolute
error y−u
r
 between T
c
and T.The settling time
T
s
is added to the penalty value,so it will be
optimized by GP.If T
s
is greater than 0,9T,
e
max
A
will be added to the penalty value to diﬀerentiate
better between models which are stable but have
a bad performance.
5.6.2.Stability and Robustness Besides the per
formance criterion,there are some more criteria
desirable,like a stability/robustness criterion and
the actuator limit.Both criteria are implemented
as a constraint.If a constraint is exceeded,a
penalty of 1∙10
5
is added.The robustness criterion
is included as limiting the maximumsensitivity to
6 dB.This prevents the open loop from coming
too close to the point 1 in a Nyquist plot.This
criterion solely is not enough to guarantee stabil
T
c
T
s
time [s]
position [m]
T
e
max

A
u
r
y
Fig.5.Interpretation of a timedomain simula
tion.
ity,because the openloop curve in a Nyquist plot
could pass the point 1 on the wrong side.This
would result in an unstable closed loop behavior.
Together with the previous timedomain perfor
mance criterion instability is likely to be pre
vented,because most unstable models will blow
up fast so they will be caught by the performance
criterion.
5.6.3.Actuator Limit Every actuator can pro
vide a ﬁnite amount of power.Limiting the plant
input is needed to prevent creation of unrealistic
controllers with too high gains.Applying such
controllers would result in performance and sta
bility problems.For this particular test case,the
actuator voltage limit is set to 2 V.
5.6.4.Simulation Parameters The total simu
lation time is set to 2 s.Simulink is set to use the
ODE45 algorithmto simulate each control system.
As controllers are created randomly,simulation
errors can occur due to various numeric reasons.
Such errors are caught in the penalty evaluation;
controllers creating these errors receive the worst
penalty value f = 10
10
.Also,due to e.g.singulari
ties in a model,it can take Simulink a long time to
simulate a model.This is undesirable,as there are
so many models to be evaluated.Therefore,if the
simulation takes more than 10 s,the simulation is
stopped and the model is penalized with a high
penalty value.
5.7 Evolutionary Settings
The population size is 500.The maximum tree
depth (i.e.how many layers deep a tree can
grow) is set to 10 nodes.During the GP run
parents were selected for evolution according to
the Tournament Selection scheme (Banzhaf et al.,
1998).The percentages for the genetic operations
were set as follows:
crossover 70%
branch mutation 10%
branch addition 5%
point mutation 15%
GA Optimization 20%
These percentages correspond to the chance each
individual has to be undergoing the particular
operation.Thus,it is possible that an individ
ual undergoes multiple operations,but it is also
possible that an individual does not evolve,and
remains as is.
5.8 Termination Criterion
The individual with the lowest penalty value in a
generation is designated as the bestofgeneration
individual.During a GP run,the history of these
values is monitored and when it stabilizes the run
is manually terminated.The result of the run is
the bestsofar individual.
6.RESULTS
A PentiumIV 2,4 GHz with 256 MB RAMis used
for performing the GP runs.
GP returned a Simulink model with 3 transfer
function blocks,1 integrator block,2 subtract
blocks and 1 addition block.It uses only the error
signal so the GP model is a feedback controller
without feedforward.In Fig.6 the transfer func
tion of the feedback part is shown.
The controller can be interpreted as a controller
containing a lead,an integrator,a low pass and
a slant notch which compensates the resonance
peak.The results of the GP run are the following:
Simulation time 3,1 days
Penalty 0,076
Settling time (T
s
−T
c
) 9,0 ms
Bandwidth 15 Hz
Maximum sensitivity 5,9 dB
Maximum controller output 1.7 V
In Fig.7,the response of the output is shown
together with the trajectory.During movement
of the trajectory,the output lags a little bit
behind the trajectory.The output does not have
any overshoot.Fig.8 shows that stability and
robustness are preserved.The open loop system
is drawn in Fig.9.
10
−4
10
−3
10
−2
10
−1
10
0
10
1
10
2
10
3
10
4
−50
0
50
Magnitude [dB]
10
−4
10
−3
10
−2
10
−1
10
0
10
1
10
2
10
3
10
4
0
100
200
Phase [degree]
Frequency [Hz]
Fig.6.Frequency response function of the best
ofrun controller created during the GP run.
0
0.5
1
1.5
2
0
1
2
3
4
5
6
7
t [s]
x
[m]
Fig.7.Greydotted line:3rd order trajectory and
a time indication of zero velocity.Black line:
Output of the closed loop simulation of the
bestofrun controller.
−2
−1
0
1
2
−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
Re
Im
Fig.8.Nyquist plot of the open loop transfer
function of the bestofrun controller.
10
0
10
1
10
2
10
3
−80
−60
−40
−20
0
20
Magnitude [dB]
10
0
10
1
10
2
10
3
−500
−400
−300
−200
−100
0
Phase [degree]
Frequency [Hz]
bandwidth = 15 Hz
Fig.9.Open loop frequency response function of
the bestofrun controller.
7.CONCLUSIONS
A method which creates and optimizes a variable
sized dynamical model according to userspeciﬁed
requirements has been explored.It has been tested
by designing linear controllers for a motion sys
tem.The complex poles and zeros cause (anti)
resonance phenomena which make it diﬃcult to
achieve high performance.Some promising results
were achieved with GP.A controller was created
and tuned which contains a lead,an integrator,
a low pass and a slant notch which compensates
the resonance peak.Direct time and frequency re
quirements were speciﬁed without any loop shap
ing by the user.
8.FUTURE RESEARCH
This research is a ﬁrst exploration of controller
design for motion systems using GP A lot of
research is still to be done.E.g.nonlinearities such
as coulomb friction can be added to the plant,
which is often present in motion systems.Also
nonlinear elements can be allowed in the controller
with the aim to transform GP into a useful tool
for nonlinear controller design.
REFERENCES
Banzhaf,Wolfgang,Peter Nordin,Robert E.
Keller and Frank D.Francone (1998).Ge
netic Programming – An Introduction;On
the Automatic Evolution of Computer Pro
grams and its Applications.Morgan Kauf
mann,dpunkt.verlag.
Boyd,S.and C.Barratt (1991).Linear Controller
Design:Limits of Performance.Prentice
Hall.
Burl,Jeﬀrey B.(1999).Linear optimal control
:H2 and Hinﬁnity methods.Amsterdam:
AddisonWesley.
ChunLiang Lin,HornYong Jan and Niahn
Chung Shieh (2003).Gabased multiobjective
pid control for a linear brushless dc motor.
IEEE/ASME Transactions on Mechatronics
8(1),56–65.
Gray,Gary J.,Yun Li,D.J.MurraySmith and
K.C.Sharman (1996).Structural system
identiﬁcation using genetic programming and
a block diagram oriented simulation tool.
Electronics Letters 32(15),1422–1424.
Holland,J.(1975).Adaptation in Natural and
Artiﬁcial Systems..University of Michigan
Press.
Keane,M.A.,J.R.Koza and M.J.
Streeter (2002).Automatic synthesis using
genetic programming of an improved general
purpose controller for industrially representa
tive plants.In:The 2002 NASA/DoD Confer
ence on Evolvable Hardware (Adrian Stoica,
Jason Lohn,Rich Katz,Didier Keymeulen
and Ricardo Salem Zebulum,Eds.).Jet
Propulsion Laboratory,California Institute of
Technology.IEEE Computer Society.Alexan
dria,Virginia.pp.113–122.
Keijzer,Maarten,J.J.Merelo,G.Romero and
M.Schoenauer (2001).Evolving objects:a
general purpose evolutionary computation li
brary.In:EA01,Evolution Artiﬁcielle,5th
International Conference in Evolutionary Al
gorithms.
Koza,John R.(1992).Genetic Programming:On
the Programming of Computers by Means
of Natural Selection.MIT Press.Cambridge,
MA,USA.
Koza,John R.,Martin A.Keane,Jessen
Yu,Forrest H Bennett III and William
Mydlowec (2000a).Automatic creation of
humancompetitive programs and controllers
by means of genetic programming.Ge
netic Programming and Evolvable Machines
1(1/2),121–164.
Koza,John R.,Martin A.Keane,Jessen Yu,
William Mydlowec and Forrest H Bennett
III (2000b).Automatic synthesis of both
the control law and parameters for a con
troller for a threelagplant with ﬁvesecond
delay using genetic programming and simu
lation techniques.In:Proceedings of the 2000
American Control Conference.American Au
tomatic Control Council.Chicago,Illinois,
USA.pp.453–459.
Langdon,W.B.and Riccardo Poli (2002).Foun
dations of Genetic Programming.Springer
Verlag.
Comments 0
Log in to post a comment