150
Development of a PI Controller through an Ant
Colony Optimization Algorithm Applied to a
SMAR R
Didactic Level Plant
L. C. Gonçalves ∗, M. F. Santos †, R. J. F. de S ‡, J. L. da Silva § H. B. Rezende ¶
Centro Federal de Educação Tecnológica de Minas Gerais,
CEFET-MG, Leopoldina, MG, 36700-000, Brazil
∗lucas.encautcefetmg@gmail.com
†murillo.ferreira@cefetmg.br
‡rafaeljfsa@gmail.com
§josue.cefetmg@cefetmg.br
¶henrique.rezende@engenharia.ufjf.br
Abstract—This work is the development of a method to solve
an optimization problem applied to tuning the PI controllers
parameters since traditional methods do not often find desired
expectations. The search for solutions to this problem requires
the discovery of new efficient algorithms able to find acceptable
answers and, naturally, better than those obtained by traditional
methods, which do not guarantee that it is the best one. This
approach is based on an essential computational model used
in optimization problems: the Ant Colony Optimization, which
is based on the strategy used by ants in search of food.
The procedure investigates the potentiality of this optimization
method, using it to tuning PI controllers. The evaluation of this
method is a result of a didactic plant level control application, and
the results are presented in this work, where it was compared to
classical PI controller tuning method. As expected, the PI tuning
from Ant Colony Optimization performed better results than the
other ones.
Keywords—Ant Colony Optimization, PI Controller Tuning,
Level System.
I. INTRODUCTION
Even today, plants in the process industries predominantly
use PID controllers (Proportional, Integral and Derivative)
to sustain important process variables in their desired set-
points (SP). They were introduced into industrial production
between the 1930s and 1950s, and today, large-scale with
several hundred, if not thousands, of digitally implemented
PID control loops [1]. A topology derived from the PID is the
PI (Proportional and Integral), much applied in level systems.
Classical controller tuning methods such as IMC (Internal
Model Control) and the Haalman method, of 1965, may
present responses with very high overshoot and lengthy ac-
commodation time, thus failing to meet the requirements of
today’s applications, and represents a high cost for the industry
[2]. Besides, these parameters are often tuned by trial and
error methods, affecting, in many cases, the performance of
industrial meshes [3].
Therefore, optimization techniques have the possibility of
making strategic process control, to increase the lifespan of the
actuators, improve the speed of system response and increase
energy efficiency, leading to economic and environmental
advantages [4].
Population metaheuristics are based on collective intelli-
gence. It is an intelligence distributed everywhere, in which
all knowledge is in the collective, since, nobody knows every-
thing, but everyone knows something [5].
ACO (Ant Colony Optimization) algorithm is one of them,
formulated in the 1990s by Marco Dorigo. The idea was
inspired by the behavior of real ants, related to their ability to
find the shortest path between the nest and the food. Because
of this cooperative and effective search behavior, they are
building better alternatives along the way to find the food [6].
Brief literary research highlights some important works of
level control with several controllers, showing its extreme
importance in the industrial routine. In [7] is presented the
control of a level system using an auto-tuning function,
adjusted by the second method of Ziegler-Nichols, in a PID
topology embedded in a PLC. In [8], a free software, called
Scilab, is used to model a system of tanks in series, where
the level of the second would be controlled by a PID, whose
parameters are adjusted by 2 methods: second method of
Ziegler-Nichols and Tyreus-Luyben. In [9] are modeled all the
elements of the level system, which is controlled by estimating
the parameters through the least squares method. In all cases, it
was observed that the final objective was reached, the systems
were controlled, but all of them presented a high tuning time,
in addition to showing high percentages of overshoot.
Taking into account other types of optimization problems,
some works can be cited respecting to their relevance. In work
[10], a clustering algorithm study is applied to several issues,
among them a nonlinear dynamic system model, as well as a
level system. According to the authors, the responses obtained
are equal to or better than existing approaches and significantly
reduce computational overhead.
Reference [11] shows a synergy of Fuzzy logic and nature-
inspired optimization using two different algorithms: Sim-
978-1-5386-4762-2/18/$31.00 2018 IEEE
151
ulated Annealing and Particle Swarm in a nonlinear ABS
(Anti-lock Braking Systems). As in this work, the model is
linearized, and the optimal tuning is performed in the input
association functions of a Takagi-Sugeno-Kang (TSK) Fuzzy
class. The results were obtained in real time form, where
the optimized Fuzzy TSK models are more straightforward
and more consistent with the training and validation data,
outperforming the initial Fuzzy TSK models.
Also within this context, work [12] depicts a self-organized
clustering algorithm of shape-based epitaxial droplet nanos-
tructures. Also, some possible clustering methods have been
described. Finally, in [13], the authors proposed the combi-
nation of cluster intelligence algorithms and stability by the
optimal fit of the Takagi-Sugeno Fuzzy controller parameters,
using stability conditions expressed as Linear Matrix Inequal-
ities (LMI) to play the role of constraints optimization prob-
lems. Three of these algorithms were used: Particle Swarm
Optimization, Simulated Annealing, and Gravitational Search
Algorithm. Simulation results for an inverted pendulum system
are given for the proposed design illustration.
From the above, the ACO, as well as the optimization
algorithms itself, is shown as an excellent alternative to solve
the problem presented [14]. To optimize the PI controller
constants of a SMAR R
didactic level system, it also seeks the
lowest overshoot and the best possible accommodation time
for the system.
As for the system identification, the three-parameter method
was used, which uses the system’s continuous response curve,
obtained in open loop by a reference signal, such as a unitary
step. After performing the curve survey, the data collected
by the master machine was saved in the document format of
MATLAB R
. Then, through a toolbox named System Identifi-
cation Tool, the system transfer function was identified.
This work is divided as follows: Section II describes the
level system used, a didactic plant of SMAR R
; the section III
presents the methodology adopted in the development of the
ACO algorithm; Section IV discusses the identification of the
level system; in Section V, the experimental results of the level
control system with PI controller are shown; finally, Section
VI presents the results of the method implementation.
II. PROTOTYPE USED: SMAR R
DIDATIC PLANT
The SMAR R
Didactic Plant merely represents and ob-
jectively, the operation of several control loops that can be
implemented in an industrial plant. Using the same field
instruments and software applications for configuration and
operation that are developed for large-scale applications [15].
The Figure 1 shows this system.
It uses digital technology to perform temperature, flow and
level control. Besides, most instruments, such as transmitters,
valve positioners, and controllers have been designed and
manufactured by companies for Foundation Fieldbus technolo-
gies, Highway Addressable Remote Transducer (HART) and
Profibus technologies [15].
Figure 1. Illustrative picture of the SMAR R
didactic plant used in this work.
In the level system, the measurements are performed by the
differential transmitter LD-302 and based on the hydrostatic
principles.
The flow of water into the tank takes place through the
opening of a pneumatic control valve, and the outflow through
a manual valve, which simulates the consumption of water and
disturbances. If the system is operated in steady-state, even in
open or closed loop, the Mass Conservation Law is observed
[16]. This process is represented in Figure 2 by a simplified
schematic diagram.
Figure 2. Simplified schematic diagram of the SMAR R
plant’s loop level.
Through Figure 2, it can be seen that the pump B1 pumps
the water from the storage tank TA to the level tank T1, passing
through the control valve FY-31, where its flow is measured by
the FIT-31 sensor. When variations in tank level T1 occur, the
LIT-31 level sensor performs measurements of this quantity,
and these changes occur with the opening of the manual valve,
which simulates the water output of the system.
III. ANT COLONY OPTIMIZATION ALGORITHM
ACO is non-deterministic parallel and and adaptive algo-
rithm, since a population of agents moves simultaneously,
independently [17].
152
Figure 3 shows the flowchart used for the ACO implemen-
tation. Its realization will be elucidated later.
Figure 3. ACO implementation flowchart.
Initially, the parameters of the algorithm are chosen, such as
quantity of ants seeking food, a number of iterations (if this is
the stopping criterion), a rate of evaporation, a probability of
an ant following the trail with more pheromone or searching
for new sources (better solutions).
The number of ants actively interferes in the diversity of
solutions, especially in the first algorithm iteration. In contrast,
the more significant this parameter, the higher the amount
of memory required and the longer the computational time
needed to complete a repetition.
Then, the number of iterations implies computational time,
mainly when this parameter is used as the algorithm stop
criterion.
Moreover, the evaporation rate is inversely related to the
convergence, i.e., the lower the evaporation rate, the earlier
convergence occurs, besides the probability of an ant following
the pheromone path is related to the frequency with which
new solutions will be sought or not. If the likelihood of the
ant following the trail is too high, the algorithm will tend to
stagnate in the initial solutions.
For the work, a population of 100 ants was considered, with
60% continuing to follow the same path and evaporation rate
being 15%.
It is worth mentioning that each ant is a solution set (Kp,
Ki). From a previous methodical study of the system, Kp is
placed between 0 and 10 and Ki from 0 to 5.
Then, simulating the appearance of the obstacle, the deci-
sion of the paths to be chosen (possible solutions) begins at
random. These solutions are within the search space defined.
In the third step, the objective function (OF) is obtained.
For this application, the OF is considered as the closed
loop response error, represented by the ITSE (Integral of
Time multiplied by the Squared Error) performance index.
It was chosen because it presents better selectivity among
performance indices since the minimum integral value is
readily discernible when the system parameters are varied.
This error is nothing more than the gap between the measured
value and the system SP.
Subsequently, the solution pheromone is calculated by:
∆τk
ij =
 Q
Lk
, ant k uses trail (i, j) on the way
0, otherwise
(1)
where Q is a design constant and Lk is the path length of the
kth
ant. This value, obtained when the ant completes a path in
time [to, to + n] consists of a cycle of n iterations and is used
to update the amount of substance deposited previously in the
trail, based on:
τk
ij(t + n) = ρτk
ij(t) + ∆τk
ij (2)
where ρ is a coefficient that represents the persistence of the
track during the cycle (between time t and t + n). For this
work it was considered as 0.85, heuristically defined. On the
other hand, the value of (1 - ρ) represents the evaporation of
the track between time t and t + n:
∆τk
ij =
m
X
k=1
τk
ij (3)
Bringing it to controller tuning context, as it is desired to
minimize the design error, Q was arbitrated as 1 and Lk is the
OF, i.e., the ITSE index. Thus, the response error is minimized
by increasing the system performance.
In sequence, a process called roulette starts, which is
nothing more than the probabilistic choice of the solutions that
will be maintained in the next iteration and will be received
a new pheromone deposit. This choice is made by adding all
the pheromone values already obtained along the iterations,
and then dividing the pheromone value of each solution by
the total sum. Therefore, all values will be between 0 and 1,
which sets up a percentage of chance of choosing the solution.
Thus, responses with higher estimates of pheromone present
higher rate, soon they are more likely to be selected. This step
of the algorithm is equivalent to the choice of the path by the
ants.
The number of ants that followed previously chosen solu-
tions depends on the percentage arbitrated at the start of the
algorithm, so the higher the portion, the more the algorithm
will be confined to existing solutions, and the smaller the
chances of convergence. Similarly, the remaining percentage
represents those ants that, for some reason, choose alternative
paths to those already found.
The evaporation rate is then applied to counterbalance the
positive evaluation, i. e., the pheromone. As shown in (3), if
it is a previously chosen solution it is necessary to add to the
pheromone value, the importance obtained in the last iteration.
Then, it is verified if the stop criterion was reached. This
criterion is the number of iterations chosen at the beginning of
the algorithm, but this way of discerning about the optimiza-
tion is suspect since it is not guaranteed that the best answer
found so far is good.
153
An alternative to solve the problem is to characterize the
stopping criterion as the percentage of pheromone accumula-
tion of the ant that is on the best path about the total collection
of pheromone, considering the value of 80% for this study. It
can be done from the normalization of pheromone accumu-
lation. Thus, the higher the amount of the accumulation, in
percentage, for a given solution, the higher the rate of ants
that follow that solution.
Thus, when it reaches the decision-making process on the
stopping criterion, if it is reached, the process is terminated,
otherwise repeat the steps from obtaining OF, as shown in
Figure 3.
IV. LEVEL SYSTEM IDENTIFICATION
As previously mentioned, the level system identification was
made through MATLAB R
, using the Control System Toolbox,
providing the ability to design and analyze control systems
[18].
In sequence, the steps taken to identify the system will
be listed. First, the open-loop curve was surveyed, with
approximately 85.048% of the total heating tank level. A
ball valve opening controls this level percentage (manually
operated, which corresponds to a second system’s consume),
placed at the level tank outlet. Initially, the heating tank was
empty, and the inlet valve to the tank closed. According to
[19], this valve is vital for the system, since any change in it,
even if minimal, considerably interferes with the dynamics of
the system.
Once the curve was surveyed, the transfer function of the
system was identified through a first-order transfer function,
given by:
G(s) =
K
τs + 1
e−θs
(4)
where K = ∆y
∆u stands for the static gain, derived from the
relation between the response ∆y and the input step signal ∆u
amplitudes; θ the transport delay; and τ for the time constant.
The results obtained were K = 0.85048, θ = 3.5 seconds
and τ = 152.1026 seconds. The Figure 4 shows the response
identified in open loop.
A transfer function model of the pneumatic valve opening
was also presented. This model was presented from a system-
atic study of the plant where it was observed that the valve
takes approximately 1.6 to 2.0 seconds to open from 0 to
100%. According to [20], the accommodation time is four
times the value of the time constant τ. Because the modeling
was done from a heuristic study of the system, τ values
between 0.4 and 0.5 are indicated for use. Therefore, the first
order transfer function of the obtained valve was K = 1 and
τ = 0.4 sec, using the lowest value of the range.
V. EXPERIMENTAL RESULTS
In this section will be described 2 experimental tests to
show the PI controller performance tuned here in this work.
The first one will show their performance for just one SP, and
the second one will have 2 SPs, to show their responses due
to different situations.
To perform comparisons, two classical PI control techniques
were used: IMC proposed by Rivera et al. (1986) and Halmaan
(1965). The first one is based on a method where the precision
of the process model is taken into account in the controller and
can be hybridized with the PID controller [21].
The Haalman tuning technique was also used, where a dis-
turbance is applied to the process, and the obtained data (criti-
cal frequency, critical gain, etc.) are used for the identification
of the controller parameters from mathematical formulas [22].
The choice of these two methods was due to preliminary
performance tests of several classic controllers, in the same
system used here. Table I shows the adjustment parameters of
these PI controllers.
TABLE I
PARAMETERS OF THE PI CONTROLLERS OBTAINED BY THE HAALMAN,
IMC AND ACO TECHNIQUES.
PI Kp Ki
ACO 1.7782 0.0311
Haalman 28.9719 0.1905
IMC 25.8430 0.1680
These parameters for the ACO were found after 31 itera-
tions, i.e., this solution obtained a value of at least 80% of the
total pheromone value accumulating all the solutions searched
after 31 iterations.
A. Scenario 1
As previously described, the first experimental test consisted
in performing the control of the didactic plant’s level tank with
a SP of 50 % of its capacity. The Figure 5 shows the results
found, as well as the control actions and errors presented by
each tuning.
Through Figure 5, it is possible to perceive the superiority
presented by the tuning made by the ACO metaheuristic
concerning the classical tunings used in work. Note that the
response of the tank does not show considerable overshoot
when using the parameters found by the ACO, whereas with
the classical tunings this overhead is approximately 20%
and still with oscillations around the SP. Another important
consideration is the settling time, much lower when using ACO
tuning, around 160 seconds. With the classical tunings, in 350
seconds of experimentation, it was not possible to perceive
this settlement, only a very close oscillation around the SP.
It is also important to realize the difference in the control
action. With ACO, the pneumatic valve is not saturated at
all, i. e., completely open or completely closed. Besides at a
given instant, approximately 200 seconds, the valve stabilizes
at around 68% of its total capacity. When using the classical
tuning, it is possible to perceive several points of saturation
of the valve, also, not being able to stabilize, oscillating more
and more the control action.
About the error, it is known that it is complementary to
the SP values, that is, the closer to the SP the level is, the
lower the error value. It implies, from the above that with
154
0 100 200 300 400 500 600 700 800 900 1000
Time (sec)
0
10
20
30
40
50
60
70
80
90
Level
(%)
Open-loop Response
System Identification
Figure 4. Simulated and experimental reaction curve of Didactic Plant SMAR R
’s level loop.
0 50 100 150 200 250 300 350
0
20
40
60
Tank
Level
(%)
ACO
SetPoint
IMC
Haalman
0 50 100 150 200 250 300 350
2000
4000
6000
8000
10000
Control
Action
(0.01%)
0 50 100 150 200 250 300 350
Time (sec)
-20
0
20
40
60
Error
(%)
Figure 5. Experimental response of Scenario 1 for 3 PI controller perfomance.
the parameters of the ACO, at the moment when the SP was
reached, this error was annulled, which does not happen in the
other tunings, since they make the response oscillate close to
the SP value.
B. Scenario 2
Similarly, the second experimental test occurred, but at 350
seconds of experimentation, a new value of SP was defined to
the system, is 60% of the total tank capacity.
It is interesting to note that all the considerations made in
the previous subsection are valid for this. There are just a few
more comments to add concerning when the SP was changed.
For this, consider the results shown in Figure 6.
Note that by changing the SP, in the experiments performed
with the classical methods, the valve operated again for an
extended period at its maximum saturation, which does not
happen when using the ACO-tuned PI controller. In this case,
the valve increases its control action for a period, but without
much difficulty regains stability at 68%.
The same can be said with the error, an increase occurs
in the error, due to the SP change, being quickly canceled
using the ACO. The new SP is reached with approximately
60 seconds after its changes.
VI. CONCLUSIONS
This work presented an ant colony optimization application
for tuning a PI controller, whose control action was applied to
SMAR R
didactic plant’s level loop. The responses obtained
under the PI controller actions were satisfactory, which may
imply an increase in the pneumatic valve lifespan since there
is no saturation of the valve and even stabilization in its
control action occurs, which is not the case in the other
tuning techniques. Moreover, it is an excellent alternative for
the chemical industry where extreme precision is required,
sometimes of almost 100%.
Thus, the optimization method appears as an alternative for
the optimal adjustment of PI controller parameters in real-level
systems, where the application of traditional control methods
is complex until then.
ACKNOWLEDGMENT
The authors thank CEFET-MG and FAPEMIG for the
financial support.
REFERENCES
[1] M. Bauer, A. Horch, L. Xie, M. Jelali, and N. Thornhill, “The current
state of control loop performance monitoring – A survey of application
in industry,” Journal of Process Control, vol. 38, pp. 1–10, 2016.
155
0 100 200 300 400 500 600 700
0
20
40
60
80
Tank
Level
(%)
BSO
SetPoint
IMC
Haalman
0 100 200 300 400 500 600 700
2000
4000
6000
8000
10000
Control
Action
(0.01%)
0 100 200 300 400 500 600 700
-20
0
20
40
60
Error
(%)
Figure 6. Experimental response of Scenario 2 for 3 PI controller perfomance.
[2] A. F. dos Santos Neto and F. J. Gomes, “Controladores PID: intro-
duzindo inteligência computacional no controle industrial,” XXXVIII
COBENGE, 2010.
[3] M. J. Carmo, “Ambiente educacional multifuncional integrado para
sintonia e avaliação do desempenho de malhas industriais de controle,”
Master’s thesis, (UFJF), 2006.
[4] J. O. O. Souza, “Metaheurı́sticas aplicadas na sintonia de controladores
PID: estudo de casos,” Master’s thesis, UniSinos, 2013.
[5] P. Lévy, “A inteligência coletiva: por uma antropologia do ciberespaço,”
São Paulo: Loyola, 1999.
[6] R. M. Koide, “Algoritmo de colônia de formigas aplicado à otimização
de materiais compostos laminados,” Master’s thesis, UTFP, 2010.
[7] F. M. Guimarães, N. T. d. Nascimento, A. B. Lugli, and Y. M. C.
Masselli, “Controle de nı́vel utilizando algoritmo PID implementado
no CLP,” Instituto Nacional de Telecomunicações - Inatel, 2013.
[8] A. M. Ribeiro and R. B. Santos, “Sintonia de um controlador PID em um
sistema de controle de nı́vel de tanques em série utilizando um software
gratuito,” XII COBEQIC, 2017.
[9] F. J. Sousa Vasconcelos and C. M. Sá Medeiros, “Modelagem, simulação
e controle de uma planta de nı́vel didática.,” VII CONNEPI, 2012.
[10] R. D. Baruah, P. P. Angelov, and D. Baruah, “Dynamically evolving
fuzzy classifier for real-time classification of data streams,” International
Conference on Fuzzy Systems (FUZZ-IEEE), IEEE, pp. 383–389, 2014.
[11] R.-E. Precup, M.-C. Sabau, and E. M. Petriu, “Nature-inspired optimal
tuning of input membership functions of takagi-sugeno-kang fuzzy
models for anti-lock braking systems,” Applied Soft Computing, vol. 27,
pp. 575–589, 2015.
[12] A. Ürmös, Z. Farkas, M. Farkas, T. Sándor, L. T. Kóczy, and Á. Nem-
csics, “Application of self-organizing maps for technological support of
droplet epitaxy,” Acta Polytechnica Hungarica, vol. 14, no. 4, 2017.
[13] S. Vrkalovic, T.-A. Teban, and I.-D. Borlea, “Stable takagi-sugeno fuzzy
control designed by optimization,” International Journal of Artificial
Intelligence, vol. 15, pp. 17–29, 2017.
[14] A. H. Bertachi, “Otimização de parâmetros via metaheuristicas popula-
cionais e validação de um controlador de estrutura variável,” Master’s
thesis, UTFP, 2014.
[15] E. I. SMAR Ltda, Instructions, operation and maintenance manual -
Didatic pilot plant, 2015.
[16] L. F. Carraro, L. D. Chiwiacowsky, A. T. Gómez, and A. C. M.
de Oliveira, “Uma aplicação das metaheurı́sticas algoritmo genético
e colônia artificial de abelhas através da codificação por regras para
resolver o problema de carregamento de navios-contêineres,” XLV
Simpósio Brasileiro de Pesquisa Operacional, pp. 1792–1803, 2013.
[17] L. S. Coelho and R. F. Tavares Neto, “Colônia de formigas: Uma
abordagem promissora para aplicações de atribuição quadrática e projeto
de layout,” XXIV ENEGEP, 2004.
[18] R. H. Bishop and R. C. Dorf, Modern control systems. Technical and
Scientific Books, 2001.
[19] M. F. Santos, “Ambiente guide-matlab R
para o controle de um processo
dinâmico assimétrico,” 2011.
[20] N. S. Nise and F. R. da Silva, Control systems engineering. LTC, 6 ed.,
2013.
[21] D. E. Rivera, M. Morari, and S. Skogestad, “Internal model control: PID
controller design,” Industrial  engineering chemistry process design
and development, vol. 25, no. 1, pp. 252–265, 1986.
[22] M. E. Bergel, “Estudo de alternativas para o ajuste de controladores PID
utilizando métodos baseados em dados,” Master’s thesis, UFRS, 2009.

Development of a PI Controller through an Ant Colony Optimization Algorithm Applied to a SMAR Didactic Level Plant.pdf

  • 1.
    150 Development of aPI Controller through an Ant Colony Optimization Algorithm Applied to a SMAR R Didactic Level Plant L. C. Gonçalves ∗, M. F. Santos †, R. J. F. de S ‡, J. L. da Silva § H. B. Rezende ¶ Centro Federal de Educação Tecnológica de Minas Gerais, CEFET-MG, Leopoldina, MG, 36700-000, Brazil ∗lucas.encautcefetmg@gmail.com †murillo.ferreira@cefetmg.br ‡rafaeljfsa@gmail.com §josue.cefetmg@cefetmg.br ¶henrique.rezende@engenharia.ufjf.br Abstract—This work is the development of a method to solve an optimization problem applied to tuning the PI controllers parameters since traditional methods do not often find desired expectations. The search for solutions to this problem requires the discovery of new efficient algorithms able to find acceptable answers and, naturally, better than those obtained by traditional methods, which do not guarantee that it is the best one. This approach is based on an essential computational model used in optimization problems: the Ant Colony Optimization, which is based on the strategy used by ants in search of food. The procedure investigates the potentiality of this optimization method, using it to tuning PI controllers. The evaluation of this method is a result of a didactic plant level control application, and the results are presented in this work, where it was compared to classical PI controller tuning method. As expected, the PI tuning from Ant Colony Optimization performed better results than the other ones. Keywords—Ant Colony Optimization, PI Controller Tuning, Level System. I. INTRODUCTION Even today, plants in the process industries predominantly use PID controllers (Proportional, Integral and Derivative) to sustain important process variables in their desired set- points (SP). They were introduced into industrial production between the 1930s and 1950s, and today, large-scale with several hundred, if not thousands, of digitally implemented PID control loops [1]. A topology derived from the PID is the PI (Proportional and Integral), much applied in level systems. Classical controller tuning methods such as IMC (Internal Model Control) and the Haalman method, of 1965, may present responses with very high overshoot and lengthy ac- commodation time, thus failing to meet the requirements of today’s applications, and represents a high cost for the industry [2]. Besides, these parameters are often tuned by trial and error methods, affecting, in many cases, the performance of industrial meshes [3]. Therefore, optimization techniques have the possibility of making strategic process control, to increase the lifespan of the actuators, improve the speed of system response and increase energy efficiency, leading to economic and environmental advantages [4]. Population metaheuristics are based on collective intelli- gence. It is an intelligence distributed everywhere, in which all knowledge is in the collective, since, nobody knows every- thing, but everyone knows something [5]. ACO (Ant Colony Optimization) algorithm is one of them, formulated in the 1990s by Marco Dorigo. The idea was inspired by the behavior of real ants, related to their ability to find the shortest path between the nest and the food. Because of this cooperative and effective search behavior, they are building better alternatives along the way to find the food [6]. Brief literary research highlights some important works of level control with several controllers, showing its extreme importance in the industrial routine. In [7] is presented the control of a level system using an auto-tuning function, adjusted by the second method of Ziegler-Nichols, in a PID topology embedded in a PLC. In [8], a free software, called Scilab, is used to model a system of tanks in series, where the level of the second would be controlled by a PID, whose parameters are adjusted by 2 methods: second method of Ziegler-Nichols and Tyreus-Luyben. In [9] are modeled all the elements of the level system, which is controlled by estimating the parameters through the least squares method. In all cases, it was observed that the final objective was reached, the systems were controlled, but all of them presented a high tuning time, in addition to showing high percentages of overshoot. Taking into account other types of optimization problems, some works can be cited respecting to their relevance. In work [10], a clustering algorithm study is applied to several issues, among them a nonlinear dynamic system model, as well as a level system. According to the authors, the responses obtained are equal to or better than existing approaches and significantly reduce computational overhead. Reference [11] shows a synergy of Fuzzy logic and nature- inspired optimization using two different algorithms: Sim- 978-1-5386-4762-2/18/$31.00 2018 IEEE
  • 2.
    151 ulated Annealing andParticle Swarm in a nonlinear ABS (Anti-lock Braking Systems). As in this work, the model is linearized, and the optimal tuning is performed in the input association functions of a Takagi-Sugeno-Kang (TSK) Fuzzy class. The results were obtained in real time form, where the optimized Fuzzy TSK models are more straightforward and more consistent with the training and validation data, outperforming the initial Fuzzy TSK models. Also within this context, work [12] depicts a self-organized clustering algorithm of shape-based epitaxial droplet nanos- tructures. Also, some possible clustering methods have been described. Finally, in [13], the authors proposed the combi- nation of cluster intelligence algorithms and stability by the optimal fit of the Takagi-Sugeno Fuzzy controller parameters, using stability conditions expressed as Linear Matrix Inequal- ities (LMI) to play the role of constraints optimization prob- lems. Three of these algorithms were used: Particle Swarm Optimization, Simulated Annealing, and Gravitational Search Algorithm. Simulation results for an inverted pendulum system are given for the proposed design illustration. From the above, the ACO, as well as the optimization algorithms itself, is shown as an excellent alternative to solve the problem presented [14]. To optimize the PI controller constants of a SMAR R didactic level system, it also seeks the lowest overshoot and the best possible accommodation time for the system. As for the system identification, the three-parameter method was used, which uses the system’s continuous response curve, obtained in open loop by a reference signal, such as a unitary step. After performing the curve survey, the data collected by the master machine was saved in the document format of MATLAB R . Then, through a toolbox named System Identifi- cation Tool, the system transfer function was identified. This work is divided as follows: Section II describes the level system used, a didactic plant of SMAR R ; the section III presents the methodology adopted in the development of the ACO algorithm; Section IV discusses the identification of the level system; in Section V, the experimental results of the level control system with PI controller are shown; finally, Section VI presents the results of the method implementation. II. PROTOTYPE USED: SMAR R DIDATIC PLANT The SMAR R Didactic Plant merely represents and ob- jectively, the operation of several control loops that can be implemented in an industrial plant. Using the same field instruments and software applications for configuration and operation that are developed for large-scale applications [15]. The Figure 1 shows this system. It uses digital technology to perform temperature, flow and level control. Besides, most instruments, such as transmitters, valve positioners, and controllers have been designed and manufactured by companies for Foundation Fieldbus technolo- gies, Highway Addressable Remote Transducer (HART) and Profibus technologies [15]. Figure 1. Illustrative picture of the SMAR R didactic plant used in this work. In the level system, the measurements are performed by the differential transmitter LD-302 and based on the hydrostatic principles. The flow of water into the tank takes place through the opening of a pneumatic control valve, and the outflow through a manual valve, which simulates the consumption of water and disturbances. If the system is operated in steady-state, even in open or closed loop, the Mass Conservation Law is observed [16]. This process is represented in Figure 2 by a simplified schematic diagram. Figure 2. Simplified schematic diagram of the SMAR R plant’s loop level. Through Figure 2, it can be seen that the pump B1 pumps the water from the storage tank TA to the level tank T1, passing through the control valve FY-31, where its flow is measured by the FIT-31 sensor. When variations in tank level T1 occur, the LIT-31 level sensor performs measurements of this quantity, and these changes occur with the opening of the manual valve, which simulates the water output of the system. III. ANT COLONY OPTIMIZATION ALGORITHM ACO is non-deterministic parallel and and adaptive algo- rithm, since a population of agents moves simultaneously, independently [17].
  • 3.
    152 Figure 3 showsthe flowchart used for the ACO implemen- tation. Its realization will be elucidated later. Figure 3. ACO implementation flowchart. Initially, the parameters of the algorithm are chosen, such as quantity of ants seeking food, a number of iterations (if this is the stopping criterion), a rate of evaporation, a probability of an ant following the trail with more pheromone or searching for new sources (better solutions). The number of ants actively interferes in the diversity of solutions, especially in the first algorithm iteration. In contrast, the more significant this parameter, the higher the amount of memory required and the longer the computational time needed to complete a repetition. Then, the number of iterations implies computational time, mainly when this parameter is used as the algorithm stop criterion. Moreover, the evaporation rate is inversely related to the convergence, i.e., the lower the evaporation rate, the earlier convergence occurs, besides the probability of an ant following the pheromone path is related to the frequency with which new solutions will be sought or not. If the likelihood of the ant following the trail is too high, the algorithm will tend to stagnate in the initial solutions. For the work, a population of 100 ants was considered, with 60% continuing to follow the same path and evaporation rate being 15%. It is worth mentioning that each ant is a solution set (Kp, Ki). From a previous methodical study of the system, Kp is placed between 0 and 10 and Ki from 0 to 5. Then, simulating the appearance of the obstacle, the deci- sion of the paths to be chosen (possible solutions) begins at random. These solutions are within the search space defined. In the third step, the objective function (OF) is obtained. For this application, the OF is considered as the closed loop response error, represented by the ITSE (Integral of Time multiplied by the Squared Error) performance index. It was chosen because it presents better selectivity among performance indices since the minimum integral value is readily discernible when the system parameters are varied. This error is nothing more than the gap between the measured value and the system SP. Subsequently, the solution pheromone is calculated by: ∆τk ij = Q Lk , ant k uses trail (i, j) on the way 0, otherwise (1) where Q is a design constant and Lk is the path length of the kth ant. This value, obtained when the ant completes a path in time [to, to + n] consists of a cycle of n iterations and is used to update the amount of substance deposited previously in the trail, based on: τk ij(t + n) = ρτk ij(t) + ∆τk ij (2) where ρ is a coefficient that represents the persistence of the track during the cycle (between time t and t + n). For this work it was considered as 0.85, heuristically defined. On the other hand, the value of (1 - ρ) represents the evaporation of the track between time t and t + n: ∆τk ij = m X k=1 τk ij (3) Bringing it to controller tuning context, as it is desired to minimize the design error, Q was arbitrated as 1 and Lk is the OF, i.e., the ITSE index. Thus, the response error is minimized by increasing the system performance. In sequence, a process called roulette starts, which is nothing more than the probabilistic choice of the solutions that will be maintained in the next iteration and will be received a new pheromone deposit. This choice is made by adding all the pheromone values already obtained along the iterations, and then dividing the pheromone value of each solution by the total sum. Therefore, all values will be between 0 and 1, which sets up a percentage of chance of choosing the solution. Thus, responses with higher estimates of pheromone present higher rate, soon they are more likely to be selected. This step of the algorithm is equivalent to the choice of the path by the ants. The number of ants that followed previously chosen solu- tions depends on the percentage arbitrated at the start of the algorithm, so the higher the portion, the more the algorithm will be confined to existing solutions, and the smaller the chances of convergence. Similarly, the remaining percentage represents those ants that, for some reason, choose alternative paths to those already found. The evaporation rate is then applied to counterbalance the positive evaluation, i. e., the pheromone. As shown in (3), if it is a previously chosen solution it is necessary to add to the pheromone value, the importance obtained in the last iteration. Then, it is verified if the stop criterion was reached. This criterion is the number of iterations chosen at the beginning of the algorithm, but this way of discerning about the optimiza- tion is suspect since it is not guaranteed that the best answer found so far is good.
  • 4.
    153 An alternative tosolve the problem is to characterize the stopping criterion as the percentage of pheromone accumula- tion of the ant that is on the best path about the total collection of pheromone, considering the value of 80% for this study. It can be done from the normalization of pheromone accumu- lation. Thus, the higher the amount of the accumulation, in percentage, for a given solution, the higher the rate of ants that follow that solution. Thus, when it reaches the decision-making process on the stopping criterion, if it is reached, the process is terminated, otherwise repeat the steps from obtaining OF, as shown in Figure 3. IV. LEVEL SYSTEM IDENTIFICATION As previously mentioned, the level system identification was made through MATLAB R , using the Control System Toolbox, providing the ability to design and analyze control systems [18]. In sequence, the steps taken to identify the system will be listed. First, the open-loop curve was surveyed, with approximately 85.048% of the total heating tank level. A ball valve opening controls this level percentage (manually operated, which corresponds to a second system’s consume), placed at the level tank outlet. Initially, the heating tank was empty, and the inlet valve to the tank closed. According to [19], this valve is vital for the system, since any change in it, even if minimal, considerably interferes with the dynamics of the system. Once the curve was surveyed, the transfer function of the system was identified through a first-order transfer function, given by: G(s) = K τs + 1 e−θs (4) where K = ∆y ∆u stands for the static gain, derived from the relation between the response ∆y and the input step signal ∆u amplitudes; θ the transport delay; and τ for the time constant. The results obtained were K = 0.85048, θ = 3.5 seconds and τ = 152.1026 seconds. The Figure 4 shows the response identified in open loop. A transfer function model of the pneumatic valve opening was also presented. This model was presented from a system- atic study of the plant where it was observed that the valve takes approximately 1.6 to 2.0 seconds to open from 0 to 100%. According to [20], the accommodation time is four times the value of the time constant τ. Because the modeling was done from a heuristic study of the system, τ values between 0.4 and 0.5 are indicated for use. Therefore, the first order transfer function of the obtained valve was K = 1 and τ = 0.4 sec, using the lowest value of the range. V. EXPERIMENTAL RESULTS In this section will be described 2 experimental tests to show the PI controller performance tuned here in this work. The first one will show their performance for just one SP, and the second one will have 2 SPs, to show their responses due to different situations. To perform comparisons, two classical PI control techniques were used: IMC proposed by Rivera et al. (1986) and Halmaan (1965). The first one is based on a method where the precision of the process model is taken into account in the controller and can be hybridized with the PID controller [21]. The Haalman tuning technique was also used, where a dis- turbance is applied to the process, and the obtained data (criti- cal frequency, critical gain, etc.) are used for the identification of the controller parameters from mathematical formulas [22]. The choice of these two methods was due to preliminary performance tests of several classic controllers, in the same system used here. Table I shows the adjustment parameters of these PI controllers. TABLE I PARAMETERS OF THE PI CONTROLLERS OBTAINED BY THE HAALMAN, IMC AND ACO TECHNIQUES. PI Kp Ki ACO 1.7782 0.0311 Haalman 28.9719 0.1905 IMC 25.8430 0.1680 These parameters for the ACO were found after 31 itera- tions, i.e., this solution obtained a value of at least 80% of the total pheromone value accumulating all the solutions searched after 31 iterations. A. Scenario 1 As previously described, the first experimental test consisted in performing the control of the didactic plant’s level tank with a SP of 50 % of its capacity. The Figure 5 shows the results found, as well as the control actions and errors presented by each tuning. Through Figure 5, it is possible to perceive the superiority presented by the tuning made by the ACO metaheuristic concerning the classical tunings used in work. Note that the response of the tank does not show considerable overshoot when using the parameters found by the ACO, whereas with the classical tunings this overhead is approximately 20% and still with oscillations around the SP. Another important consideration is the settling time, much lower when using ACO tuning, around 160 seconds. With the classical tunings, in 350 seconds of experimentation, it was not possible to perceive this settlement, only a very close oscillation around the SP. It is also important to realize the difference in the control action. With ACO, the pneumatic valve is not saturated at all, i. e., completely open or completely closed. Besides at a given instant, approximately 200 seconds, the valve stabilizes at around 68% of its total capacity. When using the classical tuning, it is possible to perceive several points of saturation of the valve, also, not being able to stabilize, oscillating more and more the control action. About the error, it is known that it is complementary to the SP values, that is, the closer to the SP the level is, the lower the error value. It implies, from the above that with
  • 5.
    154 0 100 200300 400 500 600 700 800 900 1000 Time (sec) 0 10 20 30 40 50 60 70 80 90 Level (%) Open-loop Response System Identification Figure 4. Simulated and experimental reaction curve of Didactic Plant SMAR R ’s level loop. 0 50 100 150 200 250 300 350 0 20 40 60 Tank Level (%) ACO SetPoint IMC Haalman 0 50 100 150 200 250 300 350 2000 4000 6000 8000 10000 Control Action (0.01%) 0 50 100 150 200 250 300 350 Time (sec) -20 0 20 40 60 Error (%) Figure 5. Experimental response of Scenario 1 for 3 PI controller perfomance. the parameters of the ACO, at the moment when the SP was reached, this error was annulled, which does not happen in the other tunings, since they make the response oscillate close to the SP value. B. Scenario 2 Similarly, the second experimental test occurred, but at 350 seconds of experimentation, a new value of SP was defined to the system, is 60% of the total tank capacity. It is interesting to note that all the considerations made in the previous subsection are valid for this. There are just a few more comments to add concerning when the SP was changed. For this, consider the results shown in Figure 6. Note that by changing the SP, in the experiments performed with the classical methods, the valve operated again for an extended period at its maximum saturation, which does not happen when using the ACO-tuned PI controller. In this case, the valve increases its control action for a period, but without much difficulty regains stability at 68%. The same can be said with the error, an increase occurs in the error, due to the SP change, being quickly canceled using the ACO. The new SP is reached with approximately 60 seconds after its changes. VI. CONCLUSIONS This work presented an ant colony optimization application for tuning a PI controller, whose control action was applied to SMAR R didactic plant’s level loop. The responses obtained under the PI controller actions were satisfactory, which may imply an increase in the pneumatic valve lifespan since there is no saturation of the valve and even stabilization in its control action occurs, which is not the case in the other tuning techniques. Moreover, it is an excellent alternative for the chemical industry where extreme precision is required, sometimes of almost 100%. Thus, the optimization method appears as an alternative for the optimal adjustment of PI controller parameters in real-level systems, where the application of traditional control methods is complex until then. ACKNOWLEDGMENT The authors thank CEFET-MG and FAPEMIG for the financial support. REFERENCES [1] M. Bauer, A. Horch, L. Xie, M. Jelali, and N. Thornhill, “The current state of control loop performance monitoring – A survey of application in industry,” Journal of Process Control, vol. 38, pp. 1–10, 2016.
  • 6.
    155 0 100 200300 400 500 600 700 0 20 40 60 80 Tank Level (%) BSO SetPoint IMC Haalman 0 100 200 300 400 500 600 700 2000 4000 6000 8000 10000 Control Action (0.01%) 0 100 200 300 400 500 600 700 -20 0 20 40 60 Error (%) Figure 6. Experimental response of Scenario 2 for 3 PI controller perfomance. [2] A. F. dos Santos Neto and F. J. Gomes, “Controladores PID: intro- duzindo inteligência computacional no controle industrial,” XXXVIII COBENGE, 2010. [3] M. J. Carmo, “Ambiente educacional multifuncional integrado para sintonia e avaliação do desempenho de malhas industriais de controle,” Master’s thesis, (UFJF), 2006. [4] J. O. O. Souza, “Metaheurı́sticas aplicadas na sintonia de controladores PID: estudo de casos,” Master’s thesis, UniSinos, 2013. [5] P. Lévy, “A inteligência coletiva: por uma antropologia do ciberespaço,” São Paulo: Loyola, 1999. [6] R. M. Koide, “Algoritmo de colônia de formigas aplicado à otimização de materiais compostos laminados,” Master’s thesis, UTFP, 2010. [7] F. M. Guimarães, N. T. d. Nascimento, A. B. Lugli, and Y. M. C. Masselli, “Controle de nı́vel utilizando algoritmo PID implementado no CLP,” Instituto Nacional de Telecomunicações - Inatel, 2013. [8] A. M. Ribeiro and R. B. Santos, “Sintonia de um controlador PID em um sistema de controle de nı́vel de tanques em série utilizando um software gratuito,” XII COBEQIC, 2017. [9] F. J. Sousa Vasconcelos and C. M. Sá Medeiros, “Modelagem, simulação e controle de uma planta de nı́vel didática.,” VII CONNEPI, 2012. [10] R. D. Baruah, P. P. Angelov, and D. Baruah, “Dynamically evolving fuzzy classifier for real-time classification of data streams,” International Conference on Fuzzy Systems (FUZZ-IEEE), IEEE, pp. 383–389, 2014. [11] R.-E. Precup, M.-C. Sabau, and E. M. Petriu, “Nature-inspired optimal tuning of input membership functions of takagi-sugeno-kang fuzzy models for anti-lock braking systems,” Applied Soft Computing, vol. 27, pp. 575–589, 2015. [12] A. Ürmös, Z. Farkas, M. Farkas, T. Sándor, L. T. Kóczy, and Á. Nem- csics, “Application of self-organizing maps for technological support of droplet epitaxy,” Acta Polytechnica Hungarica, vol. 14, no. 4, 2017. [13] S. Vrkalovic, T.-A. Teban, and I.-D. Borlea, “Stable takagi-sugeno fuzzy control designed by optimization,” International Journal of Artificial Intelligence, vol. 15, pp. 17–29, 2017. [14] A. H. Bertachi, “Otimização de parâmetros via metaheuristicas popula- cionais e validação de um controlador de estrutura variável,” Master’s thesis, UTFP, 2014. [15] E. I. SMAR Ltda, Instructions, operation and maintenance manual - Didatic pilot plant, 2015. [16] L. F. Carraro, L. D. Chiwiacowsky, A. T. Gómez, and A. C. M. de Oliveira, “Uma aplicação das metaheurı́sticas algoritmo genético e colônia artificial de abelhas através da codificação por regras para resolver o problema de carregamento de navios-contêineres,” XLV Simpósio Brasileiro de Pesquisa Operacional, pp. 1792–1803, 2013. [17] L. S. Coelho and R. F. Tavares Neto, “Colônia de formigas: Uma abordagem promissora para aplicações de atribuição quadrática e projeto de layout,” XXIV ENEGEP, 2004. [18] R. H. Bishop and R. C. Dorf, Modern control systems. Technical and Scientific Books, 2001. [19] M. F. Santos, “Ambiente guide-matlab R para o controle de um processo dinâmico assimétrico,” 2011. [20] N. S. Nise and F. R. da Silva, Control systems engineering. LTC, 6 ed., 2013. [21] D. E. Rivera, M. Morari, and S. Skogestad, “Internal model control: PID controller design,” Industrial engineering chemistry process design and development, vol. 25, no. 1, pp. 252–265, 1986. [22] M. E. Bergel, “Estudo de alternativas para o ajuste de controladores PID utilizando métodos baseados em dados,” Master’s thesis, UFRS, 2009.