You are on page 1of 6

A Novel Methodology to obtain Optimal PI

Controller Gains using Multi-gene Genetic


Programming for FOPTD Systems
D. Pozo L. Morales, D. Maldonado J. Aguilar
Ingeniería en Tecnologías de la Información Departamento de Automatización y Control CEMISID, Universidad de
Universidad De Las Américas, Av. de los Industrial Escuela Politécnica Nacional, Ladrón Los Andes
Granados E12-41 y Colimes esq. de Guevara, E11-253. Mérida-Venezuela
Quito-Ecuador Quito-Ecuador aguilar@ula.ve
david.pozo@udla.edu.ec {luis.moralesec;diego.maldonadoa}@epn.edu.ec

Abstract— This paper presents a novel method for tuning a PSO was proposed by [5], it is inspired by the evolution
PI controller for a first-order plus time delay (FOPTD) system of collective behavior, trying to imitate the social behavior of
based on a Multi-gene Genetic Programming (MGGP) and a groups of animals, such as flocks, herds, schools, etc. It is a
Particle Swarm Optimization (PSO) algorithm. In our metaheuristic optimization algorithm that uses analogies
approach, the PSO stablishes a set of optimal gains of the with the previous process to solve a given problem.
controller for a FOPTD system, based on the plant parameters.
Then, the MGGP obtains the mathematical equations to Evolutionary computing could be seen like a series of
estimate the optimal gains determined by PSO. Finally, to rules and heuristics that try to emulate the natural evolution
validate the methodology proposed, a group of random systems behavior. It takes in to account genetic operators (selection,
were selected and tested in MATLAB-SIMULINK, using the copy, crossover and mutation) to generate offspring from a
calculated equations, focused in its behavior with respect to the group of individuals of previous generations, to get the better
maximum overshoot (Mp) and the Integral Square Error characteristics in order to give the best solution to a problem
(ISE). based on an objective function [6].
Keywords—PSO; GP; MGGP; first order System. In many of its applications, both evolutionary computing
and particle swarm algorithms offer excellent quality results,
I. INTRODUCTION however, it has been demonstrated that particle swarm
In the field of automatic control, different proposals have algorithms are more efficient, due to their low computational
been developed with the aim of controlling all types of cost [7].
systems. One of the most common due to its simplicity, ease Particularly, the Genetic Programming (GP) [8] is a
of implementation and good performance, which is widely technique of the evolutionary computing that uses the same
used today is the PID controller, with its different variants, genetic operators but in addition, solves problems with a tree
such as P, PI or PD. Specifically, the PI controller is used to syntax codification. Based on the GP technique, a series of
eliminate the error in steady state, result of the proportional new versions have been proposed, among which could be
part, however, in terms of response speed it has a negative mentioned [9]: Strongly Typed GP (STGP), Automatically
effect. Defined Functions (ADF), Linear GP (LGP) Gene-
There are different calibration techniques for these Expression Programming (GEP), Grammatical Evolution
controllers, such as Ziegler Nichols, based on the response (GE), Multi-Expression Programming (MEP), Cartesian GP
curve. In [1] is proposed a similar method for first order plus (CGP), Parallel Distributed GP (PDGP), Parallel Algorithm
time delay (FOPTD) systems, that give a starting point for Discovery and Orchestration (PADO), Multiple Interacting
the calibration of the controller gains; another method very Programs (MIPs), the Multi-Stage GP (MSGP) and Multi-
used is the heuristic, that is, making the parameterization of Gene GP (MGGP).
the controller by trial and error. GP and its variant MGGP have been widely used to
However, when working with these alternatives, it is not develop models for predictions and estimations in diverse
guaranteed to meet optimality criteria, based on restrictions fields, such as structural and materials engineering [10,11],
such as establishment time, overshoot, controller geotechnical and earthquake engineering problems [12,13],
performance, control action, among others. medical applications [14], and control engineering [15].
Techniques inspired by evolutionary computing, or those In this document, the MGGP technique was used to
based on social behavior and dynamic movements of insects, stablish a set of equations, in order to get the appropriate
such as Particle Swarm Optimization (PSO), have been gains for a PI controller for a FOPTD system. The necessary
widely used to optimize controller parameters for linear and information to the correct operation of the model equation
nonlinear systems in different fields of application. proposed depends of the basic characteristics of a First Order
Specifically, in [2-4], they have been used to determine the System.
optimal gains of PI controllers.

978-1-5386-6657-9/18/$31.00 ©2018 IEEE


II. BACKGROUND position, also called "best local", and the best position of all
the group of particles, called "best global". In each
A. First-Order Plus Time Delay Systems
generation, the velocity and position of the particles will be
The dynamic properties of some systems can be updated by mean of the Eqs. (2) and (3) [5].
approximated by the temporal characteristics of simpler
systems, such as a FOPDT. This model is commonly found ( ) ( )+
= + − − (2)
in the field of industrial process control, robotics, power
electronics, etc. The order of a system corresponds to the = + (3)
degree of its characteristic polynomial. The transfer function
of a FOPDT system is: Where is the current position of the particle, is the
( )= (1) best position of the particle, is the best global position,
+1 is the velocity of each particle, ( ) is a decreasing
Where K is the static gain, T the response time (time function, and , , are the weights of each
constant) and t0 is the dead time. component. The algorithm is the next:

In a first-order system, its parameters can be determined 1. Start a set of particles with random velocities and
experimentally by means of the observation of the response positions within the search space.
produced in the system by a step input. The static gain “K”
will be the final value of the output signal, and the time 2. Evaluate the objective function for each particle.
constant “T” approximates the time that output reaches about 3. Determine the best value of a particle ( )
63% of the value of the stationary gain. Generally, when the 4. Identify the particle of the swarm with the best value of
value of the input variable is modified, the effect of that the objective function (this is )
change on the dynamic response of the system is not 5. Adjust the velocity and the position according to
immediately observed, it can take some time for the system the equations.
to start responding to the effect of the change made (dead 6. If the termination criterion is reached, stop the
time), as show Fig. 1.
algorithm; otherwise go back to step 2.

K=
C. Genetic Programming
The GP algorithm is used in problems where a program,
or a defined equation, must be determined from a series of
0.632K
outputs-inputs [6]. There are many examples of application,
such us symbolic regression, Data classification, Multi-agent
Cooperation, among others [9].
to
It is based on a syntax tree codification (see Fig. 2),
T
composed by a space of non terminals elements N (nodes)
and terminal elements T (leaves). N corresponds to
Fig. 1. First-order plus time delay System Response
mathematical operators {*, /, -, +, …}, Boolean logic
functions {AND, OR, NOT…}, trigonometric functions
{sin, cos, tan…} or any other user defined functions. T
B. Particle Swarm Optimization
represents numerical constants and variables (inputs) [9]. Is
Particle Swarm Optimization (PSO) is an intelligence important to stablish that the spaces T and N chosen for the
algorithm based on swarms [5] related to the social behavior proposed problem must satisfy the closure and sufficiency
of animals, such as a group of birds or a swarm of fishes. properties [8], moreover is necessary to delimit the size of
This algorithm studies the animal behavior from three point the syntax tree to avoid the bloat effect. [6,9]
of views: its habits, its memory capacity and its cooperation The process begins choosing a population P, which size is
capability. associated with the number of root nodes to be used for the
The movement of the different particles is coordinated by algorithm (individuals). Each root node belongs to the space
a speed that has a magnitude and a direction, respectively. N and is chosen randomly. After this, the syntax tree begins
Each particle position in any instance of time is influenced its growing, taken in to account a specific initialization
by its best position and the position of the best particle in a approach, like the grow method and the full method (see Fig.
problematic space. The performance of a particle is 2), these methods are detailed in [9].
measured by an adjustment value, which is specific to the Once the initialization method is chosen, the offspring is
problem. In PSO, the population is the number of particles generated based on the use of genetic operators: crossover
in a given space, which are initialized in a random way. and mutation. The better individuals, therefore the best
Each particle will have an adjustment value, which will be characteristics that could solve the proposed problem, are
evaluated by an adjustment function that will be optimized chosen based of a fitness function, to continue generating
in each generation. For each particle, it knows its best offspring [6,9].
Population E. Multigene Symbolic regression
Individual 1 Individual n In MGGP, symbolic regression (Fig. 4) is a weighted
linear combination of the final results in the syntax trees
/ + (genes) of an individual [11]. The symbolic regression in
general has a linear form, but each of its terms could
0
represent a non-linear behavior, making this method useful
* - * for the representation of complex systems with a good
predictive equation model. The coefficients for each gene of
0
an individual are calculated based on a least squares method
0 2 1
Grow method scheme [13]. In this document, the Open-Source Software for
Full method scheme
Genetic Programming Toolbox for Identification of Physical
N = {*, /, +…} System “GPTIPS” will be used over Matlab [16, 17].
T = { , ,… , , , ….}
Deep tree =2 Individual
Fig. 2. Two individuals of a population.
+ 1 * 2 +
D. Multi-gene Genetic Programming (MGGP) 3

MGGP is an evolution over the GP syntax tree, and its


principal difference lies in the way how the individuals are
1
* + sin 1
*
generated on the population. In the MGGP there’s not a
single root node for each individual tree, instead there are 0 2 - 0 2
several root nodes or genes ( ), each of one belongs to
the space N. This characteristic of generating several genes
per individual provides a better response to solve regression
problems with linear and nonlinear behaviors. However, if 1 2
the is not well defined by the user, could cause
problems related with overfitting, very complex solutions or = + +( ∗ ) + ( + ) ∗ sin( − )
useless computational processing (horizontal bloat) [16]. + +( ∗ )
When the initial population is generated, the genetic
3
operators and a selection method, combined with the fitness,
permits to obtain the offspring. The crossover genetic Fig. 4. Symbolic regression based on MGGP.
operator differs from traditional GP in the way that it’s
performed. It is based on two levels, a high level implies that III. METHODOLOGY
one or more genes could be exchange between a couple of The proposed methodology is summarized in the scheme of
individuals without exceed a constraint, and as a result Fig 5. The first step is to generate randomly FOPDT
one offspring for each parent will appear (see Fig 3). The models, in which the PSO algorithm is used. These models
low level is referred to the traditional crossover sub-tree GP
are based on the , and parameters and the controller
operator. [11, 16]
gains and . The objective function to minimize is:
Parent 1 Parent 2 Offspring Offspring 2

4 4 1
= − (4)

2 3 2
5
Where is the output of the system and is the desired
reference. The ISE has been chosen since it corresponds to a
performance measure of the controlled system, as is shown
in Fig. 4, in the control loop. When ISE is smaller, means
3
5
that the output of the controlled system quickly reaches the
reference.
Next, Table I is constructed, containing the parameters of
the plant and the optimal gains of their respective controllers
Fig. 3. High level MGGP Crossover with two individuals.
found by the PSO.
Particle swarm optimization
for parammeters tunning iterations

yref y
Controller
+
- Desired output
≤ 20%
Step signal
≤ 0.05

Random FOPDT
chosen system
( )= ∗
+1

train train
[ …… ], [ …… ] [ …… ] ,[ …… ], [ …… ]

MGGP ( , , )
Fig. 4. Scheme of the methodology in the control loop

Generate 200 random


FOPDT models
estimation of the controller parameters and , using
K = [0.1:20] 80% of the dataset for the training stage and the remaining
τ = [0.1:20]
to = [0:10] 20% for the test stage.

Stablish a PI controler
= ( , , ) (5)
for the plant
= ( , , ) (6)
Constraints
Run PSO to found
Mp<20%
optimal Kp and Ki IV. EXPERIMENTS AND RESULTS
e<0.05
Two tests are carried out to determine the validation of
Stopping criteria
no
the proposal and its performance. The first one, based on the
met?
obtained equations of the controller's gains, in order to
yes
evaluate the performance of the MGGP algorithm. The
Data base of the plants and their
optimal controller parameters second one, using the equations previously obtained, for
calculating controller’s gains for simulated plants, and
comparing them with the parameters obtained from
80% training data 20% test data equations presented in [1].
a) Equations of parameters Kp and Ki
MGGP MODEL The testing stage has been carried out by generating 175
random FOPDT models, whose range of variation of their
Validation parameters are:
Fig. 5. Scheme of the proposed methodology. = [0.1: 20]; = [0.1: 20]; = [0: 15] (7)
These values have been established because many real
Table I. models have their values in this range.
DATA BASE OBTAINED AFTER RUNNING PSO
MODEL Optimized The parameters for run PSO are shown in Table II.
Model Parameters
Controller Gains Table II.
Model 1 SET VALUES IN PSO
⋮ ⋮ ⋮ ⋮ ⋮ ⋮ Swarm Input Output Stalltime
Constraints
Model n Size variables Variables Limit
≤ 20%
100 { , , } { , } 30
≤ 0.05
Now, MGGP runs, in which the input variables are
, and , with the aim of finding the models for the
The parameters for the MGGP algorithm are shown in In this test, the parameters obtained through the Eqs. (8)
Table III (GPTIPS V2 library). and (9) are validated. Their performance is compared with
Table III.
the tuning Eqs. (10) and (11) taken of [1], corresponding to
SET VALUES IN GENETIC PROGRAMMING Tuning Formulas for Quarter Decay Ratio Response
Pop. Gene- Max. Deep Functions Input Controller.
size rations Genes Tree Variables
1500 100 4 4 {*, /, +, -} { , , } 1
= (10)
Once the algorithm has run, the equations are obtained
for the gains and . The qualities of these equations,
with the test set, are presented in Figs. 6 and 7, respectively. = (11)
3.33
RMS training set error: 0.044663 R 2 : 0.99707
The controller’s responses are tested in two different
4 Predicted plants that are not part of the training and test data group,
Actual
obtaining the following results.
2
1) The first transfer function (plant 1) used for the
0 validation stage is:
20 40 60 80 100 120 140
Data point 7.54 .
( ) = (12)
RMS test set error: 0.051244 R 2 : 0.98903 3.72 + 1
1.5
The values of gains of the controller and performance
metrics for this transfer function are shown in Table IV, and
1
the responses of the controller with both pairs of gains are
0.5 shown in Fig. 8.
0
5 10 15 20 25 30 35 Table IV.
Data point CONTROLLER AND METRIC VALUES FOR PLANT 1
Parameter
Fig. 6. Proportional Gain
Our approach 0.1362 0.0236 12% 4.712
2
Smith & Corripio [1] 0.1350 0.0124 -12% undershoot 5.449
RMS training set error: 0.0030062 R : 0.99987
3
Predicted
1.2
2 Actual

1 1

0
20 40 60 80 100 120 140 0.8 Reference
Data point Response Gains S&C[1]
Response Gains Our Approach
RMS test set error: 0.0091461 R 2 : 0.86959
0.6
0.1
0.08
0.06 0.4
0.04
0.02
0.2
5 10 15 20 25 30 35
Data point
0
Fig. 7. Integral Gain 0 10 20 30 40 50 60 70
time [s]

Fig. 8. Comparative controller response with two pairs of gains (plant 1)


Based on these results (see Figs. 6 and 7), it can be noted
that there is a very good fit of the models found, with a very
low general adjustment error. The corresponding equations
obtained for calculating the optimal gains and of the 2) The second transfer function (plant 2) used for the
validation stage is:
controllers are:
.
15.37
( ) = (13)
9.88 + 1
0.7( + ) − 0.012 − 0.591 1.219
= − (8) The values of gains of the controller and performance
+ ( − 1) metrics for this transfer function are shown in Table V, and
0.4604 + 0.6737 the responses of the controller with both pairs of gains are
= − 8.1 × 10 (9) shown in Fig. 9.

b) Validation of the equations in FOPDT


Table V. in multi area interconnected power systems. International
CONTROLLER AND METRIC VALUES FOR PLANT 2 Journal of Electrical Power & Energy Systems, 64, 880-893.
Parameter
Our approach 0.0774 0.0034 20% 14.97 [5] Eberhart, R., & Kennedy, J. (1995, October). A new
Smith & Corripio [1] 0.0545 0.0022 -11% undershoot 16.85 optimizer using particle swarm theory. In Micro Machine
and Human Science. MHS'95., Proceedings of the Sixth
As it can be observed in the two tested plants, the International Symposium on (pp. 39-43). IEEE.
discovery of the equations (model) obtained by our approach [6] Gestal, M. et al. (2010). Introducción a los
presents good results. The system response is better with Algoritmos Genéticos y la Programación Genética,
respect to ISE, it can also be seen that the overshoot in both Universidade da Coruña.
cases is equal or less than 20%, as was established when
training the models through the PSO. So, it is shown that the [7] Hassan, R., Cohanim, B., de Weck, O., & Venter, G.
methodology applied in this work is valid. (2004). A comparison of particle swarm optimization and the
genetic algorithm. American Institute of Aeronautics and
1.2 Astronautics.
[8] Koza, J. R. (1992). Genetic Programming: On the
1
Programming of Computers by Means of Natural Selection.
The MIT Press. Cambridge, MA.
0.8 Reference
Response Gains S&C[1] [9] Pétrowski, A., & Ben-Hamida, S. (2017).
Response Gains Our Approach Evolutionary Algorithms. Chapter 6, First Edition. Published
0.6
by ISTE Ltd and John Wiley & Sons.

0.4
[10] Bayazidi, AM. et al. (2014). Multigene Genetic
Programming for Estimation of Elastic Modulus of Concrete.
Hindawi Publishing Corporation, Mathematical Problems in
0.2
Engineering.

0
[11] Gandomi, A., Alavi, A. (2011). A new multi-gene
0 20 40 60 80 100 120 140 160 180 genetic programming approach to nonlinear system
time [s] modeling. Part I: materials and structural engineering
Fig. 9. Comparative controller response with two pairs of gains (plant 2) problems, Neural Comput & Applic, Springer.

V. CONCLUSIONS [12] Chen, J., Zeng, Z., Jiang, P. (2016). Displacement


Prediction Model of Landslide based on Multi-Gene Genetic
In the present work a novel methodology has been Programming. 31st Youth Academic Annual Conference of
presented to obtain the models of equations to calculate the Chinese Association of Automation, Wuhan, China. IEEE.
and gains in PI controllers, in a first stage generating
[13] Gandomi, A., Alavi, A. (2011). A new multi-gene
random models to obtain the optimal gains for each one, and
genetic programming approach to non-linear system
then, using this database to find their equations according to modeling. Part II: geotechnical and earthquake engineering
the parameters of a FOPTD that should be known. The problems. Neural Comput & Applic. Springer.
proposal has been validated, obtaining good results,
improving them with respect to equations proposed by other [14] Hasan, Md., Islam, M., and Hashem, M.M.A.
authors. (2016). Mathematical Model Development to Detect Breast
As future work, this methodology will be extended to PID Cancer Using Multigene Genetic Programming. 5th
controllers, and controllers that do not have calibration International Conference on Informatics, Electronics and
equations, as it is the case of the Slide Mode Control. Vision (ICIEV). IEEE
[15] Feng, Q., Lian, H., Zhu, J. (2017). Model Predictive
VI. BIBLIOGRAPHY Control of Nonlinear Dynamical Systems Based on Genetic
[1] Smith, C. A., & Corripio, A. B. (1985). Principles and Programming. Proceedings of the 36th Chinese Control
practice of automatic process control New York: Wiley. Conference, Dalian, China.
[2] Liu, C. H., & Hsu, Y. Y. (2010). Design of a self- [16] Searson, DP. (2015). GPTIPS 2: an open-source
tuning PI controller for a STATCOM using particle swarm software platform for symbolic data mining. Chapter 22 in
optimization. IEEE Transactions on industrial Electronics, Handbook of Genetic Programming Applications, A.H.
57(2), 702-715. Gandomi et al., (Eds.), Springer, New York, NY.
[3] Yau, H. T., Lin, C. J., & Liang, Q. C. (2013). PSO [17] Searson, DP., Leahy, E., and Willis, J. (2010).
based PI controller design for a solar charger system. The GPTIPS: An Open Source Genetic Programming Toolbox
Scientific World Journal. For Multigene Symbolic Regression. Proceedings of the
International MultiConference of Engineers and Computer
[4] Sahu, R. K., Panda, S., & Sekhar, G. C. (2015). A Scientists Vol I, IMECS, Honk Kong.
novel hybrid PSO-PS optimized fuzzy PI controller for AGC

You might also like