You are on page 1of 8

SAMOPODEŠAVANJE PID KONTROLERA

POMOĆU VEŠTAČKE INTELIGENCIJE


AUTO TUNING OF PID CONTROLLER
USING ARTIFICIAL INTELLIGENCE
Velimir ČONGRADAC, Slađana LAZAREVIĆ i Dubravka BOJANIĆ
Faculty of Technical Sciences Novi Sad, Novi sad

U ovom radu je predstavljeno automatsko podešavanje parametara PID


regulatora upotrebom veštačke inteligencije sa primenom u KGH sistemima. Para-
metri su podešavani koršćenjem genetskog algoritma i PSO algoritma, čija je efika-
snost u pronalaženju optimalnih rešenja ocenjena pomoću fuzzy logike. Rezultati su
verifikovani na primeru regulacije pritiska vazduha koji se iz klima komore distribu-
ira ka termalnim zonama objekta.
Ključne reči: PID regulator; automatsko podešavanje parametara; veštačka
inteligencija
This paper presents auto tuning of PID controller using artificial intelligence
with the application in HVAC systems. Controller parameters are adjusted using
Genetic Algorithm and Particle Swarm Optimization, and their efficiency in attai-
ning optimal solutions is graded by concepts of fuzzy logic. Results are verified in
the example of supply air pressure regulation which is distributed from the air
chamber to the thermal zones.
Key words: PID controller; auto tuning; artificial intelligence

1. Introduction
As in other industrial fields, PID (Proportional, Integral and Derivative) con-
troller is the most commonly used heating, ventilation and cooling (HVAC) systems,
because it is simple and usually sufficient for various processes. [1] If a mathemati-
cal model of a process can be derived then it is possible to determine parameters of
the controller so that closed-loop performance, regarding steady-state behavior, can
be achieved. [2] The standard tuning procedures are time consuming, and poorly
tuned control system may waste energy, reduce occupant comfort and cause
excessive wear of actuators.
Auto tuning has been successfully applied in many industries, taking into
account linear [1], nonlinear [3] and fractional [4] systems, systems of variable order
[5] and the systems with time delay [1][6]. To this day, many different methods for
self-tuning were studied [1], such as Global Search, One Parameter Search, Hooke
Jeeves Search, Genetic Algorithm [7][8], Particle Swarm Optimization [9], fuzzy
logic [8] etc., and minimization of energy consumption was the only optimization

393
criteria. Research has shown that analyzing performance indicators such as oversho-
ot [10] and transient time [11] provide improved control law, and therefore, occu-
pant comfort can be assured.

2. Method
The PID controller continuously calculates the error value e(t) as the diffe-
rence of the desired set point and a measured process variable and applies correction
based on proportional, integral and derivative actions, Figure 1.

Figure 1 PID controller


Controller output u(t) which ensures the minimization of e(t) over time is
given as:
t
de ( t )
u (t ) = ∫
K p e ( t ) + Ki e (t ) dt + K d
0
dt
(1)

The tuning is the adjustment process of proportional gain Kp, integral gain Ki
and derivative gain Kd to the optimum values for the desired response. To the time,
tuning is mostly intuitive, but it can be hard if multiple and often conflicting
requirements are to be achieved. The basic requirement for tuning is stability, but
regarding different systems behavior, others can be considered such as peak overs-
hoot, rising and transient time.
In this paper, parameters of PID controller are determined using the methods
of artificial intelligence: Genetic Algorithm and Particle Swarm Optimization. The
SISO system of interest is described with second order transfer function:
Y (s) b1s + b0
G
= (s) = (2)
U ( s ) a2 s 2 + a1s + a0

Potential solutions are given in three dimensional space as (Kp, Ki, Kd). Every
potential solution is graded using fuzzy logic based on peak overshoot and transient
time.

394
2.1 Genetic Algorithm
Genetic Algorithm – GA is global stochastic search algorithm based on the
principles of evolution, such as mutation, crossover and selection. Each potential
solution is called individual having a set of properties (chromosomes or genotype)
which can be changed, i.e. mutated. A set of individuals is called population. The
algorithm starts from a population of randomly selected individuals which is modifi-
ed through generations (i.e. iterations). In each generation, measure of quality is
evaluated for every individual using the fitness function. Based on the individual’s
fitness, they are selected as the parents for crossover forming a new generation of
descendants. Descendants are the result of recombination of parent’s chromosomes
and random mutation of the genes. The new generation of descendants is used in the
next iteration of the algorithm.
2.2 Particle Swarm Optimization
Particle Swarm Optimization – PSO is iterative algorithm based on imitation
of the behavior of animal groups or individuals in these groups such as birds, fish or
insects.

Figure 2 Principles of PSO algorithm


The algorithm works by having a set, i.e. swarm, of randomly selected possi-
ble solutions called particles. The swarm propagates from iteration to iteration and
moves through space of solutions trying to improve candidate solution with regard
to given measure of quality. In addition to the particle’s current position x (represen-
ting a potential solution), each particle is described by its current velocity v. Particles
are able to remember their best position p and swarm, as a whole, remembers the
best position ever attained by any of its particles, g. The movement of one particle is
shown in Figure 2.
x [ k + 1=
] x [k ] + v [k ] (3)

395
v [ k=
] w [ k ] ⋅ v [ k − 1] +
c p [ k ] ⋅ rp [ k ] ( p [ k ] − x [ k ]) + (4)
cg [ k ] ⋅ rg [ k ] ( g [ k ] − x [ k ])

The first addend in (4) is called inertial component and performance of the
algorithm, especially the precision around solution, can be substantially improved
when the inertial factor w decreases from 0.9 to 0.4 through the iterations. Second
and third addends in (4) are called cognitive and social components, retrospectively.
Variable acceleration factors cp and cg increase the ability of the algorithm to search
the space of solutions reducing the likelihood of getting stuck in a local optimum.
Initially, the particles are driven by their own experience, but the influence of cogni-
tive component is reduced over time by decreasing the cp factor. Consequently,
social component is improved by increasing the cg factor, encouraging the group
experience.

3 Results and discussion


Both optimization algorithms start from the same initial set of candidates for
solution. Measure of quality calculated using fuzzy logic is used during selection of
the individuals for crossover for GA, and in the case of PSO algorithm it is used for
determining the step size of the particle in the search space. Termination condition
for both algorithms is achieving the given number of iterations so they have the
same number of attempts to attain the best solution.
3.1 Example – Supply air pressure
In the heating, ventilation and cooling system, supply air pressure is regula-
ted by the speed of supply air fan. The relation between fan speed and air pressure
can be described with second order transfer function [1]:
1
Gsap ( s ) = (5)
0.12 s 2 + 1.33s + 1.24
Set point for supply air pressure during PID controller tuning was 8 Pa. In
this example, 30 potential solutions are propagated through 30 iterations, but both
algorithms return the ordinal in which the best solution was attained.
Genetic Algorithm obtained the best solution after 22 iterations giving
following control for fan speed, show in Figure 3:
 1.5221 
U ( s )=  0.92303 + − 0.021553s  E ( s ) (6)
 s 

396
Figure 3 GA optimization – control signal

Figure 4 GA optimization – system response


System response with the PID parameters tuned by genetic algorithm is
shown in Figure 4. It has mild overshoot of 3.79% and settling time of 6.29 s.
PSO algorithm obtained optimal solution after 7 iterations, giving the
following control for fan speed, shown in Figure 5:
 1.9504 
U ( s ) = 1.802 + + 0.2473s  E ( s ) (7)
 s 

397
Figure 5 PSO algorithm – control signal

Figure 6 PSO algorithm – system response


The system response with PID parameters tuned by PSO algorithm is shown
in Figure 6. It has overshoot of 0.1942% and settling time of 3.31 s.

4. Conclusion
Since both algorithms are stochastic and depending on the initial population,
it is preferable to have large set of solution candidates over the search space. This
entails considerable number of calculations and it can be time consuming. Indeed,
multiple executions of the auto tuning algorithms have shown that even with smaller
sets of candidates PSO algorithm is faster in obtaining the optimal PID parameters.
Nonetheless, final result, i.e. system response, was always better regarding the over-

398
shoot and settling time. The reason for this is hidden in the fact that GA descendants
are limited by their parent’s genes which shouldn’t be overwhelmed by the mutation.
PSO particles are much more flexible having greater freedom of movement in the
search space. This auto-tuner could be applied in other industry fields. In the future,
the solution could be improved including other performance indicators in the opti-
mization criteria.

5. References
[1] Bi, Q., et. al., Advanced controller auto-tuning and its application in HVAC
systems, Control Engineering Practice, Vol. 8 (2000), pp. 633-644
[2] Yu, C. C., Autotuning of PID Controllers: A Relay Feedback Approach, 2nd
Edition, Springer, 2006
[3] Tan, K.K., Ferdous, R., Huang, S., Closed-loop automatic tuning of PID con-
troller for nonlinear systems, Chemical Engineering Science, Vol. 57 (2002),
pp. 3005-3011
[4] Alagoz, B. B., Ates, A., Yeroglu, C., Auto-tuning of PID controller according
to fractional-order reference model approximation for DC rotor control, Mec-
hatronics, Vol. 23 (2013), pp. 789-797
[5] Tavakoli, S., Griffin, I., Fleming, P. J., Tuning of decentralized PI (PID) con-
trollers for TITO processes, Control Engineering Practice Vol. 14 (2006), pp.
1069-1080
[6] Wang, Y. G., Shao, H. H., PID auto-tuner based on sensitivity specification,
Trans IChemE, Vol. 78 (2000), pp. 312-316
[7] Huang, W., Lam, H. N., Using genetic algorithms to optimize controller
parameters for HVAC systems, Energy and Buildings, Vol. 26, pp. 277-282
[8] Sharkawy, A. B., Genetic fuzzy self-tuning PID controllers for antilock braking
systems, Engineering Applications of Artificial Intelligence, Vol. 23 (2010), pp.
1041-1052
[9] Omar, M. H. T., Ali, W. M., Mostafa, M. Z., Auto Tuning of PID Controller
Using Swarm Intelligence, International Review of Automatic Contrl, Vol. 4,
No. 3 (2011), pp. 319-327
[10] Pavković, D., Polak, S., Zorc, D., PID controller auto-tuning based on pro-
cess step response and damping optimum criterion, ISA Transactions, Vol. 53
(2014), pp. 85-96
[11] Boiko, I., Self-tuning PI controller, IFAC Symposium on Power Plants and
Power Systems Control, Kananaskis, Canada, 2006

399

You might also like