We use the second ZN method and our proposed method to specify KP, KI and KD
parameters of PID controller for the model and we obtain results that are described in
Table 1. The results show that all integral performance criteria such as ITAE, IAE,
ITSE and ISE are smaller so that all performance indices of the CRO algorithm are
better than the ones in the traditional method. To compare performance of the traditional
method and our proposed method, we use a unit step change of rotor speed. Figures 6
and 7 show some unit step responses of the system with PID controller tuned by the
traditional method and the CRO method.
Conclusions
In this paper, we present the traditional rules and a meta-heuristic random search
algorithm CRO for tuning PID controller. CRO combines advantage features of both
GA and SA algorithms to find global optimal solution for given problem. To test
performance of applying CRO algorithm for tuning PID controller, we perform
simulation on the DC motor model. The simulated results show that our proposed
method is better than the traditional rules with respect to performance integral indices.
In the future, we will study how to solve multi-objective optimization problems using
the CRO algorithm.
12 trang |
Chia sẻ: hachi492 | Lượt xem: 1 | Lượt tải: 0
Bạn đang xem nội dung tài liệu Tuning pid controller bases on chemical reaction optimization algorithm, để tải tài liệu về máy bạn click vào nút DOWNLOAD ở trên
161
HNUE JOURNAL OF SCIENCE DOI: 10.18173/2354-1059.2019-0044
Natural Sciences, 2019, Volume 64, Issue 6, pp. 161-172
This paper is available online at
TUNING PID CONTROLLER BASES ON CHEMICAL REACTION
OPTIMIZATION ALGORITHM
Nguyen Ba Nghien and Nguyen Van Tinh
Department of Information Technology, Hanoi University of Industry
Abstract. Chemical Reaction Optimization (CRO) algorithm plays an important
role to determine optimal parameters of PID controller in which the model of DC
motor is used as a plant. Tuning PID controller using the traditional Ziegler-
Nichols (ZN) method usually produces large overshoot and Integral time absolute
error, Integral absolute error and Integral square error performance indices.
Therefore, recently researchers have applied random search approaches such as
Genetic algorithm (GA), Particle Swarm Optimization (PSO) and Grey Wolf
Optimizer (GWO) to find optimal parameters for PID controller. Among modern
heuristic algorithms, CRO was introduced in 2010, it combined advantage features
of both GA and Simulated Annealing (SA) to find global minimum in search space.
In this paper, we describe the application of CRO algorithm to search optimal
parameters for PID controller because CRO combines both features of local and
global searching techniques to increase the chance of finding global solution. The
comparison of tuning PID controller by CRO and traditional Ziegler-Nichols
method is also presented. The simulated results show the advantages of tuning PID
using CRO compared to traditional methods in terms of performance indices and
transient responses.
Keywords: Tuning PID, CRO algorithm, Ziegler-Nichols method, performance
index, optimization.
1. Introduction
Proportional Integral and Derivative (PID) controllers have been used in industrial
control applications for a long time. This is due to its simplicity, low-cost design and
robust performance in a wide range of operating conditions. According to a survey in
1998, nearly 90% of the controllers used in industries are PID controllers [1]. By adding
a derivative term into Proportional Integral (PI) controller, it improves the stability of
control loop. The combined effect of Proportional and Derivative (D) controllers
introduces a predictive capability in the controller since D term is able to react to
foreseeable future control errors. The proportional term works as a fast acting correction
Received May 30, 2019. Revised June 21, 2019. Accepted June 28, 2019.
Contact: Nguyen Van Tinh, e-mail address: nguyenvantinh_cntt@haui.edu.vn
Nguyen Ba Nghien and Nguyen Van Tinh
162
which will produce a change in the output as quickly as the error arises. The integral
action takes a period of finite time to act but has the capability to make the steady zero
state error. Unfortunately, tuning the PID of controllers is tedious and it might be
difficult to tune the PID gains properly due to the nonlinearity and the high complexity
of the system [2]. Therefore, besides the traditional tuning methods, we need heuristic
methods for tuning parameters of controller. Recently, random search algorithms are
widely chosen to solve nonlinear optimization problems. The categories of these
algorithms do not require differentiable and continuous objective functions. Some
random search algorithms are used for tuning PID controller such as GA [3-5], PSO [2, 6-9]
and GWO [10].
Among random search optimization algorithms, the CRO combines advantage
features of both GA and SA random search algorithms [11]. It was proposed by Albert
Y. S. Lam and Victor O. K. Li in 2010. This algorithm is successfully applied to
maximize expectation clustering [12] and solve many problems such as Quadratic
assignment problem, Resource-constrained project scheduling problem, Channel
assignment problem in wireless mesh networks, Population Transition Problem in peer-
to-peer live streaming, Cognitive radio spectrum allocation problem, Grid scheduling
problem, Standard continuous benchmark functions, Stock portfolio selection problem,
Artificial neural network training problem and so on [11]. CRO is a modern meta-
heuristic algorithm for optimization problem. It simulates the nature of chemical
reaction. When chemical reaction is in balance state, the produced substances are stable
and have minimal energy. In other words, chemical reaction converts unstable
substances to stable ones. In chemical point of view, the chemical reaction begins with
some molecules which have large energy reacting with each other through a sequence of
elementary reactions [11]. Finally, they are transformed to the molecules with minimal
energy for existence. This nature is implemented in the CRO algorithm for solving
optimization problems. In this paper, we use the CRO algorithm to find global
optimization for parameters of PID controller and compare results with the traditional
Ziegler-Nichols tuning method with respect to integral performance indices.
2. Content
2.1. PID controller
Proportional Integral Derivative (PID) controller is widely used in industry and
practice. PID is often used in close loop control system presented in Figure 1.
PID controller combines the features of three P, I and D controllers. The P element
instantaneously adjusts proportional control variable to the error signal. This is quite
logical and it may be compared to the natural reaction of a process operator. The larger
the error signal is, the larger the proportional control variable should be adjusted. One
drawback of the P term is any change in the operating conditions which will result into
an offset, which is a steady state deviation of controlled variable from the set points. To
overcome this drawback, the I term is added to form a PI controller. Meanwhile, the D
term is added to the PI controller to form a PID controller because this element
considers change rate of the error. Therefore, using the derivative element in controller
allows the control variable to anticipate and counteract the cause of the error signal
Tuning PID controller bases on chemical reaction optimization algorithm
163
before it can take significant values. In PID controller, the control variable is related to
the error signal by equation (1).
Figure 1. Block diagram of close loop control system with PID controller
( ) ( ) ∫ ( )
( )
(1)
This expression is often written in other form.
( ) ( ( )
∫ ( ) ( )
( )
) ( ( )
∫ ( ) ( )
( )
) (2)
Where
is referred as the integral time constant or reset time of controller.
is derivative time constant.
The transfer function of PID controller can be written as the following form:
( )
( )
( )
(
)
(3)
where KP, KI, KD are proportional gain, integral gain and derivative gain respectively.
By tuning these three parameters, the controller can provide control action which is
designed for specific process requirements. There are some traditional methods to
determine KP, KI, KD such as Ziegler - Nichols, CHR modification of the Ziegler -
Nichols settings, Cohen-Coon controller settings, Lambda Tuning Technique, Haalman
Controller Settings. In addition, there are some optimization methods widely used for
tuning controller. In these methods, the controller parameters are determined with a
view to minimizing the given integral performance criteria such as integral of the
absolute error (IAE), integral of the square error [13] listed as below:
∫ | ( )|
(4)
∫ ( )
(5)
∫ | ( )|
(6)
∫ ( )
(7)
In case of PID controller, error signal e(t) is function of KP, KI, KD. We can choose
one of integrals above as objective function for the modern heuristic random search
algorithms.
Nguyen Ba Nghien and Nguyen Van Tinh
164
2.2. CRO algorithm
CRO is a modern meta-heuristic algorithm for optimization problem. It simulates
the loosely couple of chemical reacts with optimization [11]. A chemical reacting
system consists of the chemical substances and its environs. Each chemical material has
potential and kinetic energies and energy of the environs are presented by central energy
buffer [11]. The chemical reactions are divided into two types: endothermic which
needs of supplied heat from environs to initialize the reaction process and exothermic
which releases heat of chemical substances to the surroundings. To implement two
types of chemical reactions, in the CRO, it needs to assign the initial buffer size:
positive value means endothermic reaction and zero value means exothermic reaction.
When the chemical reaction reaches balance state, all chemical substances are stable
and have minimal potential energy. The CRO captures that phenomenon by converting
potential energy to kinetic energy and by gradually releasing the energy of chemical
molecules to the environs. The CRO bases on four kinds of elementary reaction which
are on-wall ineffective collision, decomposition, inter-molecular ineffective collision,
and synthesis. Two ineffective collisions perform a local search and the rest perform a
global search. Therefore, the CRO mixtures two types of searching to make effectively
a search of the global minimum in a solution space. The CRO combines advantage
features of both SA and GA. The energy conservation requirement gives similar effects
of the Metropolis Algorithm used in SA while the decomposition and synthesis
operations share the similarities with the crossover and mutation operations of GA.
When the number of molecules is small, the CRO is more likely to the SA. When some
crossover and mutation operators are implemented in decomposition and synthesis, the
CRO is more likely the GA [11]. The CRO simulates each solution for a problem given
by a molecule. Each molecule has some essential properties such as the molecular
structure (ω) which is presented for a solution of the given problem, potential energy
(PE) which is an objective function value that corresponds to the given solution
presented by ω, kinetic energy (KE), number of hit (NumHit) which counts the number
of collision that the molecule has been taken. When the molecule undertakes a collision
with a wall of container or other molecules, one of elementary reactions will happen and
it may make a change in the molecular structure (change solution). Other attributes of
the molecule include a minimum structure (MinStruct) which stores a molecular
structure that has minimum objective function value, a minimum potential energy (PE)
value which can be obtained when the molecule reaches to its minimum structure. The
last property of molecule is the minimum hit number (MinHit) that is the number of hit
molecules achieving the MinStruct. There are four elementary reactions implemented in
CRO including [11]:
- On-wall ineffective collision: This reaction happens when a molecule collides
with the wall of container. This reaction changes the structure of molecule from ω to ω’
(neighborhood of ω) so that it leads to some changes of energy. In addition, a portion of
the transformed molecule’s kinetic energy is released to central energy buffer (buffer).
Let KElossRate denotes a parameter of the CRO and its value is in the range of 0 to 1,
Tuning PID controller bases on chemical reaction optimization algorithm
165
and k is a random number generated from the range of KElossRate to 1. The kinetic
energy of transformed molecule can be calculated by the equation (8) below:
( ) (8)
where (
) with f is objective function. Remaining energy is released to
buffer to be determined as ( ) ( ) and the condition of energy
conservation holds:
(9)
- Decomposition: This elementary reaction takes place when the molecule hits a
wall of container and then it is broken into several parts (In this case, for the simplicity,
we consider that it is broken into 2 parts). It means that we change the solution with two
new ones. In other words, the decomposition reaction permits the system to search in
other region of the solution space after performing all local searches by taking On-wall
ineffective collision. To be satisfied the condition of energy conservation, the inequality
(10) must be held:
(10)
where: are random numbers generated from the range of 0 to 1 and
are
produced from ω.
If the inequality (10) is held, then we can replace the existing molecule with ω by
two new ones with
respectively and their kinetic energy can be
determined by the following (11) – (13) formulas:
( ) ( ) (11)
(12)
( ) (13)
where is random number generated from the range of 0 to 1.
And the buffer is assigned to a new value by:
( ) (14)
- Inter-molecular ineffective collision: This reaction happens when two molecules
collide with each other produced two new ones. The conservation energy can be
expressed by (15)
(15)
If the inequality (15) is satisfied then two old molecules are replaced by two new
ones and their kinetic energy can be calculated as follows:
( ) ( ) (16)
(17)
( ) (18)
Nguyen Ba Nghien and Nguyen Van Tinh
166
- Synthesis: This reaction takes place when two molecules hit each other and fuse
together to result only one molecule. The conversation energy can be shown by (19):
(19)
If the inequality (19) is satisfied, then two old molecules are replaced by a new one
and the new molecule’s kinetic energy can be calculated as the following:
( ) (20)
The CRO algorithm has three steps. The first step is initialization. In this step, we
initialize parameters of algorithm including: PopSize that is the number of molecules in
which each molecule structure represents for a solution of the given problem;
KelosssRate and MoleColl which is the parameter that decides whether it is a mono-
molecular collision or an inter-molecular collision. If we generate a random number in
range of 0 to 1 that is greater than MoleColl, then a mono-molecular collision takes
place. Otherwise, an inter-molecular collision happens; the buffer is initial energy of
environs; InitialKE is initial kinetic energy of each molecule; δ and θ are parameters
related to decomposition and synthesis reactions. If the inequality (21) is met, then
decomposition reaction takes place and if the inequality (22) is satisfied then synthesis
reaction happens.
(21)
(22)
The next step of the algorithm is iteration. In this step, we make a sequence of sub
steps. Firstly, we generate a random number c that belongs to the range of 0 to 1 then
we check the condition: if it is greater than MoleColl or the system has only one
molecule so we have a mono-molecular collision. Otherwise, we have an inter-
molecular collision. In the case of a mono-molecular collision, we choose randomly one
molecule from the system and check the condition (21) on it. If it meets the given
condition, we perform a decomposing reaction. Otherwise, we perform an on-wall
ineffective collision. For an inter-molecular collision, we also randomly choose two
molecules from the system then check the condition (22) on each molecule. If both
molecules are satisfied by the condition (22) then we perform a synthesis reaction on
them. Otherwise, we perform an inter-molecular ineffective collision reaction. After
performing an elementary reaction, we check whether the conversation energy condition
is met or not. If it does not meet the condition then the change is canceled. Next, we
check objective function value of any new solutions. If it is better than the best-solution
before, then we update the new best-solution. Finally, we check the stopping criterion.
If it is satisfied then we move to the final step. Otherwise, we will start a new iteration.
In the final step, we find the best solution for the given problem and its objective
function value.
In summary, the CRO algorithm can be expressed by flowchart as Figure 2.
Tuning PID controller bases on chemical reaction optimization algorithm
167
Inter-molecular
ineffective
collision
Synthesis
On-wall
ineffective
collision
Decomposition
Condition
(21) is
satisfied?
Randomly select two or
more molecules from system
Randomly select one
molecule from system
Condition
(22) is
satisfied?
START
Initiate parameters of algorithm
Create the PopSize of molecules
Create a random number k ∈ [0 ]
k > MoleColl?
True
False
True False
False
True
Is a new minimum
solution?
Update the best solution
Stopping
criterion?
Solution
END
False
True
False
True
Figure 2. Flowchart of CRO algorithm
Nguyen Ba Nghien and Nguyen Van Tinh
168
2.3. Tuning PID controller
In this article, we use the oldest traditional Ziegler Nichols (ZN) method for tuning
PID controller and our proposed method using the CRO algorithm to find optimal
parameters of PID controller in order to minimize integral performance indices. ZN
method was proposed by John Ziegler and Nathaniel Nichols in 1942 and is still a
simply and fairly effective PID tuning method. Ziegler and Nathaniel Nichols proposed
two methods for tuning PID controller. The first method is applied for a process model
in the type of First order system with transport lag. It has a step response as shown in
Figure 3 [14].
Figure 3. Step response of plant for first ZN method
From this response, we can estimate a delay time L, a constant time T and a state
value K. Then KP, KI and KD parameters of the PID controller can be calculated by
equations (23) - (25) as follows:
(23)
0
0
(24)
0 0 (25)
The second ZN method for tuning PID controller can be expressed in the following steps:
- Decrease integral and derivative gains to zero value (to disable the integral and
derivative effects)
- Increase proportional gain from zero value to ultimate value Ku at which
oscillations occur with period Tu.
From the estimated Ku and Tu, we can calculate parameters of PID controller as follows:
0 (26)
(27)
0
(28)
To apply the CRO algorithm for finding optimizational parameters of PID
controller, we can choose one of the integral performance indexes listed in the equations
(4) - (7) as the objective function. In our case, we choose the integral of time absolute
error (ITAE) as the objective function. We encode KP, KI and KD parameters as a
molecule structure (solution) and then we run the CRO algorithm to search global
Tuning PID controller bases on chemical reaction optimization algorithm
169
minimum of ITAE. When the stopping criterion is satisfied, we obtain the optimal
parameters of PID controller.
2.4. Experiment
To test our proposed method, we consider the model of DC motor which is
described in Figure 4.
Figure 4. Diagram of DC motor
And model can be expressed by the system equations (29) as below:
{
( )
( )
( )
( )
( )
( )
(29)
Substitute ( )
( )
which is angular velocity of the motor to system equations
(29), we obtain
{
( )
( ) ( )
( )
( ) ( )
(30)
where:
J is the moment of inertia of the rotor: 0.01 kg.N
2
b is the motor viscous friction constant: 0.1 N.m.s
Ke is the electromotive force constant: 0.01 V/rad/s
Kt is the motor torque constant: 0.01 N.m/A
R is the electric resistance: 1 Ω
L is the electric inductance: 0.5 H
K = Ke = Kt
We perform the Laplace transform on both two sides of the system equations (30).
Finally, we obtain a transfer function of the system as the following:
( )
( )
( )
( )( )
(31)
We apply PID controller to the system so that we can get the best step-response
presented in Figure 5.
Nguyen Ba Nghien and Nguyen Van Tinh
170
Figure 5. Schema of system with PID controller
We use the second ZN method and our proposed method to specify KP, KI and KD
parameters of PID controller for the model and we obtain results that are described in
Table 1. The results show that all integral performance criteria such as ITAE, IAE,
ITSE and ISE are smaller so that all performance indices of the CRO algorithm are
better than the ones in the traditional method. To compare performance of the traditional
method and our proposed method, we use a unit step change of rotor speed. Figures 6
and 7 show some unit step responses of the system with PID controller tuned by the
traditional method and the CRO method.
Table 1. The comparison of performances of the traditional and CRO methods
for tuning PID controller
Method KP KI KD ITAE IAE ITSE ISE
The traditional
tuning method
15.00 75.00 0.80 5.5759 5.1906 1.9052 2.6326
The CRO tuning
method
13.60 28.50 0.14 2.5061 3.5635 1.5307 2.5261
Figure 6. Unit step responses of the system with ZN tuning method
Tuning PID controller bases on chemical reaction optimization algorithm
171
Figure 7. Unit step responses of the system with CRO tuning method
3. Conclusions
In this paper, we present the traditional rules and a meta-heuristic random search
algorithm CRO for tuning PID controller. CRO combines advantage features of both
GA and SA algorithms to find global optimal solution for given problem. To test
performance of applying CRO algorithm for tuning PID controller, we perform
simulation on the DC motor model. The simulated results show that our proposed
method is better than the traditional rules with respect to performance integral indices.
In the future, we will study how to solve multi-objective optimization problems using
the CRO algorithm.
REFERENCES
[1] M. Araki. PID Control in Control systems. Robotics and Automation, Vol. II,
edited by Heinz Unbehauen, Encyclopedia of Life Support Systems (EOLSS),
Developed under the Auspices of the UNESCO, Eolss Publishers, Oxford, UK.
[2] Qiao W, Venayagamoorthy GK, Harley RG, 2006. Design of optimal PI
controllers for doubly fed induction generators driven by wind turbines using
particle swarm optimization. In: IEEE 2006 international joint conference on neural
networks (IJCNN ‘06). Georgia Institute of Technology, Atlanta, pp. 1982-1987.
[3] Ioan Constantin Tarca, Komal Khuwaja D/O Shoukat Ali Khuwaja, 2018. PID
Controller Tuning Optimization with Genetic Algorithms for a Quadcopter. Recent
Innovations in Mechatronics (RIiM) Vol. 5.
[4] Ian Griffin, 2003. On-line PID Controller Tuning using Genetic Algorithms,
Dublin City University.
[5] Shubham Pareek, Meenakshi Kishnani, Rajeev Gupta, 2014. Optimal Tuning of
PID Controller Using Genetic Algorithm and Swarm Techniques.
Nguyen Ba Nghien and Nguyen Van Tinh
172
[6] Mahmud Iwan Solihin, Lee Fook Tack, Moey Leap Kean, 2011. Tuning of PI
controller using Particle Swarm Optimization (PSO). Proceeding of the
international conference on advance science, engineering and information
technology, Malaysia.
[7] Wei Qiao, 2006. Design of optimal PI controllers for Doubly Fed Induction
Generators Driven by Wind Turbines using Particle Swarm Optimization.
International Joint Conference on Neural Networks.
[8] Sasmita Behera, Bidyadhar Subydhi, Bibhuti Bhusan Pati, 2016. Design of PI
controller in Pitch control of Turbine: A comparison of PSO and PS algorithm,
International journal of Renewable energy research.
[9] Gauri Mantri, N. R. Kulkarni, 2013. Design and optimization of PID controller
using Genetic Algorithm. International Journal of Research in Engineering and
Technology.
[10] Al-Said AbdElAziz Osman, Dr. Amged S. El-Wakeel, Dr. A.kamel, Hatem M.
Seoudy, 2015. Optimal tuning of PI Controllers for Doubly - Fed Induction
Generator-Based Wind Energy Conversion System using Grey Wolf Optimizer.
Journal of Engineering Research and Applications, Vol. 5, Issue 11, pp. 81-87.
[11] Albert Lam, Victor O. K. Li, 2012. Chemical Reaction Optimization: A tutorial,
Meme tic Computing, March.
[12] Li Ni, Pen ManMan, Li KenLi, 2016. Chemical Reaction Algorithm for
Expectation Maximization Clustering. World Academy of Science, Engineering
and Technology International Journal of Computer and Information Engineering
Vol. 10, No.11.
[13] Allaoua B, Gasbaoui B, Mebarki B, Setting up PID DC Motor speed control
alteration parameters using particle swarm optimization strategy, Leonardo
Electron J Pract Technol 4:19-32.
[14] Brian R Copeland, 2008. The Design of PID Controllers using Ziegler Nichols
Tuning, March.
Các file đính kèm theo tài liệu này:
tuning_pid_controller_bases_on_chemical_reaction_optimizatio.pdf