# Advanced Fireworks Algorithm and Its Application Research in PID Parameters Tuning

Authors: Jun-jie Xue; Ying Wang; Hao Li; Xiang-fei Meng; Ji-yang Xiao
Journal: Mathematical Problems in Engineering
 (2016)

---

## Abstract

Proportional-Integral-Derivative (PID) controller is one of the most widely used controllers for its property of simplicity and practicability. In order to design high-quality performances PID controllers, an Advanced Fireworks (AFW) algorithm based on self-adaption principle and bimodal Gaussian function is proposed, which is built to optimize the PID controller by parameters tuning. Firstly, a compound index of optimization performance is formulated, and then the extremal optimization method of PID control system is proposed. Secondly, a PID parameters tuning model combined with AFW is built. At last, 5 typical transfer functions are simulated to obtain optimal parameters by AFW and contrast tuning method, such as Ziegler-Nichols method, Enhanced Fireworks (EFW) algorithm, and Particle Swarm Optimization (PSO). Simulation results show that AFW are effective and are easily implemented methods to solve PID control problems of different transfer functions.


---

## Body

## 1. Introduction

It is not only the simplest but also the most efficient control strategy to solve many real-world control problems by Proportional-Integral-Derivative (PID) control system [1]. Optimal parameters of PID controller may obtain high-quality performances such as high stability and satisfied transient response, but it is difficult to be tuned to control a complex system [2, 3]. In order to get better parameters of PID controller, more and more researchers pay attention to setting the parameters beyond cut-and-try or Ziegler-Nichols method, which always get low-quality performances and waste a lot of time.The evolutionary algorithm (EA) principle is a hot research topic in optimization techniques and several of them have been adopted to solve these problems in the past decade, such as PSO (Particle Swarm Optimization) [4–6], GA (Genetic Algorithm) [7, 8], ACO (Ant Colony Optimization) [9], and BBO (Biogeography-Based Optimization) [10, 11].A novel evolutionary algorithm named Fireworks Algorithm (FWA) is proposed and enhanced by Tan et al. [12, 13]. And then, Janecek and Tan applied Fireworks Algorithm to nonnegative matrix [14]. Gao and Diao applied Fireworks Algorithm to digital filters design [15]. He et al. used Fireworks Algorithm for spam detection [16]. Du solved nonlinear equations with Fireworks Algorithm and compared it with Artificial Bee Colony (ABC) algorithm [17]. Although nearly all of these applications get effective results, its application to control systems is scarce and rarely found in the published literature [18].As a consequence, this paper focuses on PID controller parameters tuning with optimization on Advanced Fireworks (AFW) algorithm in the attempt to obtain better performance. Firstly, compound index of PID optimization performance by analyzing PID controller and several traditional performance indices is built. Then, based on the simulation model combined with AFW, 5 typical transfer functions of control system were simulated to obtain optimal parameters by AFW and compared with Enhanced Fireworks (EFW) algorithm, Particle Swarm Optimization (PSO), and Genetic Algorithm (GA). Results show that AFWA is an effective and easily implemented method to solve PID control problems with different transfer functions.


## 2. PID Controller and Optimization Performance Index

### 2.1. PID Controller

A lot of practice showed that every PID controller parameter (proportional gain, integral gain, and derivative gain) has its own effectiveness to control system clearly, which is very easy to operate and also very effective. The structure of standard control system with PID controller is shown in Figure1, and the transfer function in the Laplace Domain of the PID controller is described as follows:(1)
L
s
=
K
p
+
K
i
1
s
+
K
d
s
s
/
N
+
1
,where K
p is the proportional gain, K
i is the integral gain, K
d is the derivative gain, s is the complex number frequency, N is the filter coefficient, and s
/
s
/
N
+
1 will be deduced to ideal differentiator s when N is large enough.Figure 1
The structure of typical control system With PID controller.For a typical feedback control system, a continuous form of the PID controller is described as follows:(2)
u
t
=
K
p
e
t
+
K
i
∫
e
t
d
x
+
K
d
d
e
t
d
t
, where u
(
t
) is the out of the PID control signal and e
(
t
) is the system error, e
(
t
)
=
R
(
t
)
-
y
(
t
), which means the difference between the output value and the target value.Furthermore, the discrete PID controller is written as follows:(3)
u
k
=
K
p
e
k
+
K
i
T
s
∑
j
=
1
k
e
j
+
K
d
T
s
e
k
-
e
k
-
1
, where T
s is the sampling interval time.


### 2.2. Hybrid Index with Linear Weighted Method

There are several indices measuring the performance of the control system, such as the integral of the absolute value of error (IAE), the integral of time multiplied by the absolute value of error (ITAE), the integral of the square value of error (ISE), and the integral of time multiplied by the square of error (ITSE). These indices did not fully express the control performances comprehensively, so we present another novel index which is more reasonable.The index we proposed is a hybrid index ITUE which is created by the linear weighted method and combined ITSE output of PID controller and rate of system error into a single index by linear weighted method according to the importance of each index. It is defined as follows:(4)
ITUE
=
∫
ω
1
t
e
2
t
+
ω
2
u
t
+
ω
3
d
e
t
d
t
d
t
, where ω
1, ω
2, and ω
3 are the weight value of ITSE, output of PID controller, and rate of system error, respectively. Besides ITSE, u
(
t
) is applied to avoid exporting too large control value that may be beyond the amplitude of PID controller in engineering and the rate of system error is used to avoid excessive rate of error which may cause the sensor delay in engineering.Furthermore, the discrete performance index of control system is written as follows:(5)
ITUE
=
∑
ω
1
e
2
k
+
ω
2
T
s
u
k
+
ω
3
e
k
-
e
k
-
1
T
s
.


## 2.1. PID Controller

A lot of practice showed that every PID controller parameter (proportional gain, integral gain, and derivative gain) has its own effectiveness to control system clearly, which is very easy to operate and also very effective. The structure of standard control system with PID controller is shown in Figure1, and the transfer function in the Laplace Domain of the PID controller is described as follows:(1)
L
s
=
K
p
+
K
i
1
s
+
K
d
s
s
/
N
+
1
,where K
p is the proportional gain, K
i is the integral gain, K
d is the derivative gain, s is the complex number frequency, N is the filter coefficient, and s
/
s
/
N
+
1 will be deduced to ideal differentiator s when N is large enough.Figure 1
The structure of typical control system With PID controller.For a typical feedback control system, a continuous form of the PID controller is described as follows:(2)
u
t
=
K
p
e
t
+
K
i
∫
e
t
d
x
+
K
d
d
e
t
d
t
, where u
(
t
) is the out of the PID control signal and e
(
t
) is the system error, e
(
t
)
=
R
(
t
)
-
y
(
t
), which means the difference between the output value and the target value.Furthermore, the discrete PID controller is written as follows:(3)
u
k
=
K
p
e
k
+
K
i
T
s
∑
j
=
1
k
e
j
+
K
d
T
s
e
k
-
e
k
-
1
, where T
s is the sampling interval time.


## 2.2. Hybrid Index with Linear Weighted Method

There are several indices measuring the performance of the control system, such as the integral of the absolute value of error (IAE), the integral of time multiplied by the absolute value of error (ITAE), the integral of the square value of error (ISE), and the integral of time multiplied by the square of error (ITSE). These indices did not fully express the control performances comprehensively, so we present another novel index which is more reasonable.The index we proposed is a hybrid index ITUE which is created by the linear weighted method and combined ITSE output of PID controller and rate of system error into a single index by linear weighted method according to the importance of each index. It is defined as follows:(4)
ITUE
=
∫
ω
1
t
e
2
t
+
ω
2
u
t
+
ω
3
d
e
t
d
t
d
t
, where ω
1, ω
2, and ω
3 are the weight value of ITSE, output of PID controller, and rate of system error, respectively. Besides ITSE, u
(
t
) is applied to avoid exporting too large control value that may be beyond the amplitude of PID controller in engineering and the rate of system error is used to avoid excessive rate of error which may cause the sensor delay in engineering.Furthermore, the discrete performance index of control system is written as follows:(5)
ITUE
=
∑
ω
1
e
2
k
+
ω
2
T
s
u
k
+
ω
3
e
k
-
e
k
-
1
T
s
.


## 3. PID Parameters Tuning Model Based on Advanced Fireworks Algorithm

In this section, the methodology for tuning the optimization of PID controllers is described. Firstly, a novel evolutionary algorithm named AFW is proposed, which is constituted of fireworks explosion, mutation explosion, and selection of explosion locations. And then, structure of PID parameters tuning model based on AFW is introduced.


### 3.1. Simulink Structure of Testing Performance Index on PID Control System

Simulink, developed by MathWorks, is a graphical programming environment for modeling, simulating, and analyzing control systems and offers tight integration with the rest of the MATLAB environment and can either drive MATLAB or be scripted from MATLAB. For Simulink is widely used in automatic control and digital signal processing simulation, testing performance index ITAE and ITUA on PID control system is built as in Figure2.Figure 2
Simulink structure of testing performance index on PID control system.


### 3.2. Advanced Fireworks Algorithm

In order to improve computational efficiency of PID parameters tuning, Advanced Fireworks algorithm is proposed.Advanced Fireworks space is made up byn firework devices and D-dimensional variable space (arguments space of optimization function), location of elements (fireworks, sparks, or mutation sparks), X
i
=
(
X
i
1
,
X
i
2
,
…
,
X
i
D
)
,
i
=
1,2
,
…
,
n, and gorgeous degree (objective function value) of elements Y
i
=
f
(
X
i
). Fireworks Algorithm is constituted by three steps (fireworks explosion, mutation explosion, and selection of explosion Locations).In the beginning, 1st-generation location of fireworki in dimension z is generated randomly as follows:(6)
X
f
i
z
=
X
min
⁡
z
+
X
max
⁡
z
-
X
min
⁡
z
×
rand
⁡
0,1
, where X
min
⁡
z, X
max
⁡
z are the lower and upper boundary of searching space in dimension z and rand
⁡
(
0,1
) is displacement parameter generated from a standard uniform distribution on the open interval (
0,1
).


#### 3.2.1. Fireworks Explosion

Fireworks explosion is proposed to generate sparks scattered all around the explosion location of father fireworks, which can be viewed as a searching process around a specific spot. High-quality fireworks generate numerous sparks which centralize the explosion center. That is to say, spot closed to the optimal location needs to be well searched. However, low-quality fireworks generate quite few sparks which are scattered in the space. In order to obtain splendid fireworks explosion, it is wise to set sparks number and explosion amplitude according to gorgeous degree (objective function value) of fireworks.The number of sparks generated by fireworki is expressed follows:(7)
N
i
=
round
N
c
·
f
max
⁡
-
f
X
i
+
ε
∑
i
=
1
N
y
max
⁡
-
f
X
i
+
ε
, where N
c is constant of total sparks number, f
max
⁡ is the maximum value of the objective function among the n fireworks, and ε is the machine epsilon. Due to the limitation of manufacturing process, number of the sparks generated by fireworks should be no more than N
max
⁡ and no less than N
min
⁡: that is, N
i should be replaced by N
max
⁡ if N
i is bigger than N
max
⁡, and N
i should be replaced by N
min
⁡ if N
i is smaller than N
min
⁡.The amplitude of fireworks explosion by fireworki is expressed as follows:(8)
A
i
=
A
c
·
f
X
i
-
f
min
⁡
+
ε
∑
i
=
1
N
f
X
i
-
f
min
⁡
+
ε
, where A
c is constant of the maximum explosion amplitude and f
min
⁡ is the worst value of the objective function among n fireworks.And then,N
i sparks are generated in the amplitude space randomly. zth dimension location of spark j generated from firework i is defined as follows:(9)
X
s
i
j
z
=
X
f
i
z
+
δ
1
z
×
A
i
×
rand
⁡
-
1,1
, where X
f
i
z is the location of firework i in zth dimension coordinate, δ
1
z is changing factor which will be 0 or 1 randomly, and r
a
n
d
(
-
1,1
) is displacement parameter generated from uniform distribution over [
-
1,1
]. δ
1
z denotes whether zth dimension location of spark j generated from firework i should be different from zth dimension location of firework i. Once X
s
i
j
z is out of searching space in dimension z, X
s
i
j
z will be regenerated as (9) until it is located in the searching space.


#### 3.2.2. Mutation Explosion Based on Bimodal Gaussian Function

In order to keep the diversity of sparks, mutation explosion is proposed to generate mutation sparks which are able to escape from original location. Location of mutation spark is generated from and escape from local extremum area as much as possible. So we definezth dimension location of mutation spark j generated from firework i as follows:(10)
X
m
i
j
z
=
δ
2
z
×
X
f
i
z
×
N
2
, where δ
2
z is changing factor of mutation explosion which will be 0 or 1 randomly and N
2 is displacement parameter generated from bimodal Gaussian function follows:(11)
N
2
=
X
min
⁡
z
+
σ
1
∗
e
∗
heaviside
r
1
-
r
+
X
max
⁡
z
+
σ
2
∗
e
∗
heaviside
r
-
r
1
,
r
=
X
f
i
z
-
X
min
⁡
z
X
max
⁡
z
-
X
min
⁡
z
, where σ
1 and σ
2 are the mean square error of bimodal Gaussian function, r
1 is a random number generated from rand
⁡
(
0,1
), and heaviside
(
x
) is a MATLAB function which has the value 0 for x
<
0, 1 for x
>
0, and 0.5 for x
=
0. Once X
m
i
j
z is out of searching space in dimension z, X
m
i
j
z is regenerated as (10) until it is located in the searching space.


#### 3.2.3. Selection of Explosion Locations

After fireworks explosion and mutation explosion, we already get the location of fireworks, sparks, and mutation sparks. At the same time, the gorgeous degree (objective function value) can be calculated too. Then,n locations are selected to be fireworks in next generation. The element with best gorgeous degree (objective function value) is kept to be firework in next generation and the other n
-
1 fireworks are selected based on their distance to other elements so as to keep diversity. Distance can be measured by any one of Manhattan distance, Euclidean distance, Angle-based distance, and so on. The probability of whether the element i is selected to be firework in next generation is expressed as follows:(12)
p
i
=
R
i
∑
j
∈
K
R
j
,
R
i
=
∑
j
∈
K
d
i
,
j
=
∑
j
∈
K
X
i
-
X
j
, where K is the set of all current locations of elements.


### 3.3. PID Parameters Tuning Model Based on AFW

In order to obtain the optimal performance of PID control system on different transfer function, it is necessary to get a set of PID controller parameters (optimal location of element) which promote minimum performance index ITUE/ITAE. Note that filter coefficient may vary under different physical implementation. Without loss of generality, we set filter coefficientN as a constant which is large enough. The model of PID parameters tuning based on AFWA is depicted as in Figure 3.Figure 3
PID parameters tuning model based on Advanced Fireworks algorithm.Step 1.
Set parameters of AFW, number of fireworksn, maximum number of iterations N
max
⁡, and number of mutation sparks.Step 2.
Initialize sets of PID parametersx
i
=
[
K
p
,
K
i
,
K
d
], that is, location of fireworks randomly.Step 3.
Set off fireworks (sets of PID controller parameters) to generate sparks (new sets of PID controller parameters).Step 4.
Generate mutation sparks (the other new sets of PID controller parameters) according to mutation explosion.Step 5.
Check out gorgeous degree of all elements (fireworks, sparks, and mutation sparks). That is to say, simulate PID control system (shown as in Figure2) with all set of PID controller parameters and then get corresponding performance index ITUE/ITAE.Step 6.
Selectn elements to be fireworks in next generation. That is to say, select n sets of parameters to generate new set of parameters in simulation of next generation.Step 7.
If the performance of PID control system meets the requirement or the generation of searching evolution reaches the maximum number of iterationsN
max
⁡, fireworks with best gorgeous degree are chosen to be best solution of problem. That is to say, the set of PID parameters with best performance index is chosen to be the optimal PID parameters (K
p, K
i, and K
d). Otherwise go to Step 3.


## 3.1. Simulink Structure of Testing Performance Index on PID Control System

Simulink, developed by MathWorks, is a graphical programming environment for modeling, simulating, and analyzing control systems and offers tight integration with the rest of the MATLAB environment and can either drive MATLAB or be scripted from MATLAB. For Simulink is widely used in automatic control and digital signal processing simulation, testing performance index ITAE and ITUA on PID control system is built as in Figure2.Figure 2
Simulink structure of testing performance index on PID control system.


## 3.2. Advanced Fireworks Algorithm

In order to improve computational efficiency of PID parameters tuning, Advanced Fireworks algorithm is proposed.Advanced Fireworks space is made up byn firework devices and D-dimensional variable space (arguments space of optimization function), location of elements (fireworks, sparks, or mutation sparks), X
i
=
(
X
i
1
,
X
i
2
,
…
,
X
i
D
)
,
i
=
1,2
,
…
,
n, and gorgeous degree (objective function value) of elements Y
i
=
f
(
X
i
). Fireworks Algorithm is constituted by three steps (fireworks explosion, mutation explosion, and selection of explosion Locations).In the beginning, 1st-generation location of fireworki in dimension z is generated randomly as follows:(6)
X
f
i
z
=
X
min
⁡
z
+
X
max
⁡
z
-
X
min
⁡
z
×
rand
⁡
0,1
, where X
min
⁡
z, X
max
⁡
z are the lower and upper boundary of searching space in dimension z and rand
⁡
(
0,1
) is displacement parameter generated from a standard uniform distribution on the open interval (
0,1
).


### 3.2.1. Fireworks Explosion

Fireworks explosion is proposed to generate sparks scattered all around the explosion location of father fireworks, which can be viewed as a searching process around a specific spot. High-quality fireworks generate numerous sparks which centralize the explosion center. That is to say, spot closed to the optimal location needs to be well searched. However, low-quality fireworks generate quite few sparks which are scattered in the space. In order to obtain splendid fireworks explosion, it is wise to set sparks number and explosion amplitude according to gorgeous degree (objective function value) of fireworks.The number of sparks generated by fireworki is expressed follows:(7)
N
i
=
round
N
c
·
f
max
⁡
-
f
X
i
+
ε
∑
i
=
1
N
y
max
⁡
-
f
X
i
+
ε
, where N
c is constant of total sparks number, f
max
⁡ is the maximum value of the objective function among the n fireworks, and ε is the machine epsilon. Due to the limitation of manufacturing process, number of the sparks generated by fireworks should be no more than N
max
⁡ and no less than N
min
⁡: that is, N
i should be replaced by N
max
⁡ if N
i is bigger than N
max
⁡, and N
i should be replaced by N
min
⁡ if N
i is smaller than N
min
⁡.The amplitude of fireworks explosion by fireworki is expressed as follows:(8)
A
i
=
A
c
·
f
X
i
-
f
min
⁡
+
ε
∑
i
=
1
N
f
X
i
-
f
min
⁡
+
ε
, where A
c is constant of the maximum explosion amplitude and f
min
⁡ is the worst value of the objective function among n fireworks.And then,N
i sparks are generated in the amplitude space randomly. zth dimension location of spark j generated from firework i is defined as follows:(9)
X
s
i
j
z
=
X
f
i
z
+
δ
1
z
×
A
i
×
rand
⁡
-
1,1
, where X
f
i
z is the location of firework i in zth dimension coordinate, δ
1
z is changing factor which will be 0 or 1 randomly, and r
a
n
d
(
-
1,1
) is displacement parameter generated from uniform distribution over [
-
1,1
]. δ
1
z denotes whether zth dimension location of spark j generated from firework i should be different from zth dimension location of firework i. Once X
s
i
j
z is out of searching space in dimension z, X
s
i
j
z will be regenerated as (9) until it is located in the searching space.


### 3.2.2. Mutation Explosion Based on Bimodal Gaussian Function

In order to keep the diversity of sparks, mutation explosion is proposed to generate mutation sparks which are able to escape from original location. Location of mutation spark is generated from and escape from local extremum area as much as possible. So we definezth dimension location of mutation spark j generated from firework i as follows:(10)
X
m
i
j
z
=
δ
2
z
×
X
f
i
z
×
N
2
, where δ
2
z is changing factor of mutation explosion which will be 0 or 1 randomly and N
2 is displacement parameter generated from bimodal Gaussian function follows:(11)
N
2
=
X
min
⁡
z
+
σ
1
∗
e
∗
heaviside
r
1
-
r
+
X
max
⁡
z
+
σ
2
∗
e
∗
heaviside
r
-
r
1
,
r
=
X
f
i
z
-
X
min
⁡
z
X
max
⁡
z
-
X
min
⁡
z
, where σ
1 and σ
2 are the mean square error of bimodal Gaussian function, r
1 is a random number generated from rand
⁡
(
0,1
), and heaviside
(
x
) is a MATLAB function which has the value 0 for x
<
0, 1 for x
>
0, and 0.5 for x
=
0. Once X
m
i
j
z is out of searching space in dimension z, X
m
i
j
z is regenerated as (10) until it is located in the searching space.


### 3.2.3. Selection of Explosion Locations

After fireworks explosion and mutation explosion, we already get the location of fireworks, sparks, and mutation sparks. At the same time, the gorgeous degree (objective function value) can be calculated too. Then,n locations are selected to be fireworks in next generation. The element with best gorgeous degree (objective function value) is kept to be firework in next generation and the other n
-
1 fireworks are selected based on their distance to other elements so as to keep diversity. Distance can be measured by any one of Manhattan distance, Euclidean distance, Angle-based distance, and so on. The probability of whether the element i is selected to be firework in next generation is expressed as follows:(12)
p
i
=
R
i
∑
j
∈
K
R
j
,
R
i
=
∑
j
∈
K
d
i
,
j
=
∑
j
∈
K
X
i
-
X
j
, where K is the set of all current locations of elements.


## 3.2.1. Fireworks Explosion

Fireworks explosion is proposed to generate sparks scattered all around the explosion location of father fireworks, which can be viewed as a searching process around a specific spot. High-quality fireworks generate numerous sparks which centralize the explosion center. That is to say, spot closed to the optimal location needs to be well searched. However, low-quality fireworks generate quite few sparks which are scattered in the space. In order to obtain splendid fireworks explosion, it is wise to set sparks number and explosion amplitude according to gorgeous degree (objective function value) of fireworks.The number of sparks generated by fireworki is expressed follows:(7)
N
i
=
round
N
c
·
f
max
⁡
-
f
X
i
+
ε
∑
i
=
1
N
y
max
⁡
-
f
X
i
+
ε
, where N
c is constant of total sparks number, f
max
⁡ is the maximum value of the objective function among the n fireworks, and ε is the machine epsilon. Due to the limitation of manufacturing process, number of the sparks generated by fireworks should be no more than N
max
⁡ and no less than N
min
⁡: that is, N
i should be replaced by N
max
⁡ if N
i is bigger than N
max
⁡, and N
i should be replaced by N
min
⁡ if N
i is smaller than N
min
⁡.The amplitude of fireworks explosion by fireworki is expressed as follows:(8)
A
i
=
A
c
·
f
X
i
-
f
min
⁡
+
ε
∑
i
=
1
N
f
X
i
-
f
min
⁡
+
ε
, where A
c is constant of the maximum explosion amplitude and f
min
⁡ is the worst value of the objective function among n fireworks.And then,N
i sparks are generated in the amplitude space randomly. zth dimension location of spark j generated from firework i is defined as follows:(9)
X
s
i
j
z
=
X
f
i
z
+
δ
1
z
×
A
i
×
rand
⁡
-
1,1
, where X
f
i
z is the location of firework i in zth dimension coordinate, δ
1
z is changing factor which will be 0 or 1 randomly, and r
a
n
d
(
-
1,1
) is displacement parameter generated from uniform distribution over [
-
1,1
]. δ
1
z denotes whether zth dimension location of spark j generated from firework i should be different from zth dimension location of firework i. Once X
s
i
j
z is out of searching space in dimension z, X
s
i
j
z will be regenerated as (9) until it is located in the searching space.


## 3.2.2. Mutation Explosion Based on Bimodal Gaussian Function

In order to keep the diversity of sparks, mutation explosion is proposed to generate mutation sparks which are able to escape from original location. Location of mutation spark is generated from and escape from local extremum area as much as possible. So we definezth dimension location of mutation spark j generated from firework i as follows:(10)
X
m
i
j
z
=
δ
2
z
×
X
f
i
z
×
N
2
, where δ
2
z is changing factor of mutation explosion which will be 0 or 1 randomly and N
2 is displacement parameter generated from bimodal Gaussian function follows:(11)
N
2
=
X
min
⁡
z
+
σ
1
∗
e
∗
heaviside
r
1
-
r
+
X
max
⁡
z
+
σ
2
∗
e
∗
heaviside
r
-
r
1
,
r
=
X
f
i
z
-
X
min
⁡
z
X
max
⁡
z
-
X
min
⁡
z
, where σ
1 and σ
2 are the mean square error of bimodal Gaussian function, r
1 is a random number generated from rand
⁡
(
0,1
), and heaviside
(
x
) is a MATLAB function which has the value 0 for x
<
0, 1 for x
>
0, and 0.5 for x
=
0. Once X
m
i
j
z is out of searching space in dimension z, X
m
i
j
z is regenerated as (10) until it is located in the searching space.


## 3.2.3. Selection of Explosion Locations

After fireworks explosion and mutation explosion, we already get the location of fireworks, sparks, and mutation sparks. At the same time, the gorgeous degree (objective function value) can be calculated too. Then,n locations are selected to be fireworks in next generation. The element with best gorgeous degree (objective function value) is kept to be firework in next generation and the other n
-
1 fireworks are selected based on their distance to other elements so as to keep diversity. Distance can be measured by any one of Manhattan distance, Euclidean distance, Angle-based distance, and so on. The probability of whether the element i is selected to be firework in next generation is expressed as follows:(12)
p
i
=
R
i
∑
j
∈
K
R
j
,
R
i
=
∑
j
∈
K
d
i
,
j
=
∑
j
∈
K
X
i
-
X
j
, where K is the set of all current locations of elements.


## 3.3. PID Parameters Tuning Model Based on AFW

In order to obtain the optimal performance of PID control system on different transfer function, it is necessary to get a set of PID controller parameters (optimal location of element) which promote minimum performance index ITUE/ITAE. Note that filter coefficient may vary under different physical implementation. Without loss of generality, we set filter coefficientN as a constant which is large enough. The model of PID parameters tuning based on AFWA is depicted as in Figure 3.Figure 3
PID parameters tuning model based on Advanced Fireworks algorithm.Step 1.
Set parameters of AFW, number of fireworksn, maximum number of iterations N
max
⁡, and number of mutation sparks.Step 2.
Initialize sets of PID parametersx
i
=
[
K
p
,
K
i
,
K
d
], that is, location of fireworks randomly.Step 3.
Set off fireworks (sets of PID controller parameters) to generate sparks (new sets of PID controller parameters).Step 4.
Generate mutation sparks (the other new sets of PID controller parameters) according to mutation explosion.Step 5.
Check out gorgeous degree of all elements (fireworks, sparks, and mutation sparks). That is to say, simulate PID control system (shown as in Figure2) with all set of PID controller parameters and then get corresponding performance index ITUE/ITAE.Step 6.
Selectn elements to be fireworks in next generation. That is to say, select n sets of parameters to generate new set of parameters in simulation of next generation.Step 7.
If the performance of PID control system meets the requirement or the generation of searching evolution reaches the maximum number of iterationsN
max
⁡, fireworks with best gorgeous degree are chosen to be best solution of problem. That is to say, the set of PID parameters with best performance index is chosen to be the optimal PID parameters (K
p, K
i, and K
d). Otherwise go to Step 3.


## 4. Simulations and Analysis

### 4.1. Comparison Tuning Method: Ziegler-Nichols Method

In order to evaluate the PID controller parameters (K
p, K
i, and K
d) tuned by AFW, the Ziegler-Nichols tuning method (Z-N method) is introduced to be comparison tuning method. Z-N method is a heuristic method of tuning a PID controller which was developed by John G. Ziegler and Nathaniel B. Nichols.Z-N method is performed by setting the integral gainK
i and derivative gain K
d as zero. The proportional gain K
p is then increased (from zero) until it reaches the ultimate gain K
u, at which the output of the control loop has stable and consistent oscillations. K
u and the oscillation period T
u are used to set the PID controller parameters (K
p, K
i, and K
d) as follows: K
p
=
0.60
K
u, K
i
=
T
u
/
2, and K
d
=
T
u
/
8 [19].


### 4.2. The Simulation Environment and Evaluation Standards

With the PID parameters tuning model based on AFW, simulation is carried out to test the performance of PID tuning index ITUE and optimizing capacity of AFW on the problem of PID controller parameter tuning. AFW and several compared evolutionary algorithms are applied to optimize the PID controller performance index (ITAE or ITUE) by parameters (the proportional gainK
p, integral gain K
i, and differential gain K
d) tuning of PID controller with step response on 5 different typical transfer functions.In order to fully compare the performance of different evolutionary algorithms and test performance of different PID controller performance index, it is essential to set similar simulation environment as soon as possible. Population size (partial size in PSO, fireworks size in AFW and EFW) was set as 50 and the maximum evaluation number as 100 for all algorithms on all functions. Simulation time of PID control system was set as 20 seconds, filter coefficient of PID controller was 100, and the weights values of the performance index ITUE werew
1
=
1,  w
2
=
0.1, and w
3
=
0.01, respectively. Besides, other main parameters were chosen as in Table 1.Table 1
Main parameters of evolutionary algorithms.
Method
Main parameters
AFW/EFW
N
c
=
50, N
m
i
n
=
2, N
m
a
x
=
40, A
c
=
40,
mutation spark numberN
m
=
5
PSO
Inertia weightw
=
0.7298, learning factor c
1
=
c
2
=
1.4946,
individual speed limitation is [−0.5, 0.5]In order to evaluate the quality of the controller, step response is applied in this section. Step response is the time behavior of the outputs of a general system when its inputs change from zero to one in a very short time. Then several quantities related to time behavior may be obtained, such as overshootM
p and setting time t
s. Overshoot is the occurrence of a signal or function exceeding its target, which reflects the oscillation behavior of the system transient process. In particular, overshoot reflects the relative stability of the system. Settling time is defined as the time required for the response curve to reach and stay within a range of certain percentage (usually 5% or 2%) of the final value. t
s reflects overall rapidity of control system on step response.


### 4.3. Simulation and Analysis

Simulate the PID parameters tuning model based on AFWA with 5 typical transfer functions, respectively, in which filter coefficient is set as 100 according to testing benchmarks. Results of best ITAE, best ITUE, and their corresponding PID controller parameters are given as in Table2. The best results between different methods are drawn in bold writing.Table 2
Statistical results.
Function
Pa.
Z-N
AFW
EFW
PSO
ITAE
ITUE
ITAE
ITUE
ITAE
ITUE
ITAE
ITUE
(1) 1
S
2
+
0.1
S
+
1
J
5.225
0.4536
0.0174
0.3646
0.0814
0.3649
0.0814
0.3672
K
p
13.3021
0.6771
0.2594
30
0.2873
30
0.2791
K
i
1.2164
7.5184
2.9116
30
3.1724
30
3.31
K
d
12.0285
7.5108
2.9064
22.2751
3.1694
22.275
3.2908
t
s
—
0.489
1.31
0.735
1.2
0.735
1.16
M
p
4.36%
0%
0%
4.74%
0%
4.74%
0.0649%
(2) 300
s
+
30
S
s
+
10
s
+
40
J
0.05974
0.1008
1.917
e
-
04
0.1046
0.0016
0.1043
0.0016
0.1223
K
p
1.1504
23.1311
0.5909
8.6633
0.7817
8.7425
2.7446
K
i
0.7772
0
0
30
0
30
9.2965
K
d
0.0705
2.0809
0.052
0.36304
0.09986
0.3646
0.1514
t
s
0.587
0.0643
0.288
0.155
0.342
0.154
0.375
M
p
10.4%
49.7%
0%
25.2%
0%
25.3%
8.12%
(3) 250
S
+
500
S
3
+
12
S
2
+
100
S
+
10
J
23.29
7.8
0.0042
0.1211
0.0039
0.1190
0.0061
0.1226
K
p
0.0271
21.6408
1.3742
30
1.1759
30
1.4559
K
i
0.0043
2.1830
11.7829
24.2796
9.2061
30
13.6554
K
d
0.0866
0.74008
0.12561
15.2678
0.105
3.1136
0.14221
t
s
23.9
0.0938
0.67
0.0718
0.808
0.0697
0.59
M
p
7.41%
43.5%
3.77%
75.7%
4.26%
57.3%
3.9%
(4) S
+
5
S
4
+
17
S
3
+
60
S
2
+
10
S
J
13.19
2.938
0.1055
0.5265
0.4358
0.5265
0.4358
0.5265
K
p
0.7484
5.2644
2.8763
30
2.8741
30
2.8886
K
i
0.0020
0
0
0
0
0
0
K
d
2.6791
29.9807
14.6236
30
14.623
30
14.6463
t
s
21.1
2.4
1.07
2.85
2.41
2.85
2.39
M
p
5.04%
0.784%
0.0349%
18.9%
0.778%
18.9%
0.804%
(5) S
+
5
S
4
+
17
S
3
+
60
S
2
+
5
S
+
5
J
5.67
0.9095
0.1211
0.6971
1.1880
0.6974
1.1880
0.6985
K
p
21.5801
1.7623
0.94238
30
0.95494
30
1.0341
K
i
0.92192
2.508
1.2476
11.3251
1.2849
11.3253
1.3078
K
d
30
29.5197
14.6483
30
15.0704
30
15.1394
t
s
0.706
2.73
1.18
6.07
2.66
6.07
2.54
M
p
10%
0%
0%
26.1%
0.0874%
26.1%
0.449%Based on PID control parameters tuned by Z-N method and optimal parameters (K
p, K
i, and K
d) with best ITAE (ITUA) performance optimized by AFW, EFW, and PSO, step response curves of PID control system on 5 typical transfer functions are drawn in Figure 4 (Figure 5), respectively.Figure 4
PID parameters tuning model based on Advanced Fireworks algorithm.
(a)
Function 1
(b)
Function 2
(c)
Function 3
(d)
Function 4
(e)
Function 5Figure 5
PID parameters tuning model based on Advanced Fireworks algorithm.
(a)
Function 1
(b)
Function 2
(c)
Function 3
(d)
Function 4
(e)
Function 5It is shown that AFW almost has the best performance index value of 2 different performance indexes ITAE and ITUE in PID parameters tuning with transfer functions as (1) (2) (4) (5) or has little difference with the best performance index value but much better than the other evolutionary algorithms with transfer functions as (2) (3) according to Table2.Besides, curves with hybrid performance index ITUE get small overshoot and small rate of curve changing than cures with ITAE in each transfer function or each evolutionary algorithm according to Table2, Figures 4 and 5.


## 4.1. Comparison Tuning Method: Ziegler-Nichols Method

In order to evaluate the PID controller parameters (K
p, K
i, and K
d) tuned by AFW, the Ziegler-Nichols tuning method (Z-N method) is introduced to be comparison tuning method. Z-N method is a heuristic method of tuning a PID controller which was developed by John G. Ziegler and Nathaniel B. Nichols.Z-N method is performed by setting the integral gainK
i and derivative gain K
d as zero. The proportional gain K
p is then increased (from zero) until it reaches the ultimate gain K
u, at which the output of the control loop has stable and consistent oscillations. K
u and the oscillation period T
u are used to set the PID controller parameters (K
p, K
i, and K
d) as follows: K
p
=
0.60
K
u, K
i
=
T
u
/
2, and K
d
=
T
u
/
8 [19].


## 4.2. The Simulation Environment and Evaluation Standards

With the PID parameters tuning model based on AFW, simulation is carried out to test the performance of PID tuning index ITUE and optimizing capacity of AFW on the problem of PID controller parameter tuning. AFW and several compared evolutionary algorithms are applied to optimize the PID controller performance index (ITAE or ITUE) by parameters (the proportional gainK
p, integral gain K
i, and differential gain K
d) tuning of PID controller with step response on 5 different typical transfer functions.In order to fully compare the performance of different evolutionary algorithms and test performance of different PID controller performance index, it is essential to set similar simulation environment as soon as possible. Population size (partial size in PSO, fireworks size in AFW and EFW) was set as 50 and the maximum evaluation number as 100 for all algorithms on all functions. Simulation time of PID control system was set as 20 seconds, filter coefficient of PID controller was 100, and the weights values of the performance index ITUE werew
1
=
1,  w
2
=
0.1, and w
3
=
0.01, respectively. Besides, other main parameters were chosen as in Table 1.Table 1
Main parameters of evolutionary algorithms.
Method
Main parameters
AFW/EFW
N
c
=
50, N
m
i
n
=
2, N
m
a
x
=
40, A
c
=
40,
mutation spark numberN
m
=
5
PSO
Inertia weightw
=
0.7298, learning factor c
1
=
c
2
=
1.4946,
individual speed limitation is [−0.5, 0.5]In order to evaluate the quality of the controller, step response is applied in this section. Step response is the time behavior of the outputs of a general system when its inputs change from zero to one in a very short time. Then several quantities related to time behavior may be obtained, such as overshootM
p and setting time t
s. Overshoot is the occurrence of a signal or function exceeding its target, which reflects the oscillation behavior of the system transient process. In particular, overshoot reflects the relative stability of the system. Settling time is defined as the time required for the response curve to reach and stay within a range of certain percentage (usually 5% or 2%) of the final value. t
s reflects overall rapidity of control system on step response.


## 4.3. Simulation and Analysis

Simulate the PID parameters tuning model based on AFWA with 5 typical transfer functions, respectively, in which filter coefficient is set as 100 according to testing benchmarks. Results of best ITAE, best ITUE, and their corresponding PID controller parameters are given as in Table2. The best results between different methods are drawn in bold writing.Table 2
Statistical results.
Function
Pa.
Z-N
AFW
EFW
PSO
ITAE
ITUE
ITAE
ITUE
ITAE
ITUE
ITAE
ITUE
(1) 1
S
2
+
0.1
S
+
1
J
5.225
0.4536
0.0174
0.3646
0.0814
0.3649
0.0814
0.3672
K
p
13.3021
0.6771
0.2594
30
0.2873
30
0.2791
K
i
1.2164
7.5184
2.9116
30
3.1724
30
3.31
K
d
12.0285
7.5108
2.9064
22.2751
3.1694
22.275
3.2908
t
s
—
0.489
1.31
0.735
1.2
0.735
1.16
M
p
4.36%
0%
0%
4.74%
0%
4.74%
0.0649%
(2) 300
s
+
30
S
s
+
10
s
+
40
J
0.05974
0.1008
1.917
e
-
04
0.1046
0.0016
0.1043
0.0016
0.1223
K
p
1.1504
23.1311
0.5909
8.6633
0.7817
8.7425
2.7446
K
i
0.7772
0
0
30
0
30
9.2965
K
d
0.0705
2.0809
0.052
0.36304
0.09986
0.3646
0.1514
t
s
0.587
0.0643
0.288
0.155
0.342
0.154
0.375
M
p
10.4%
49.7%
0%
25.2%
0%
25.3%
8.12%
(3) 250
S
+
500
S
3
+
12
S
2
+
100
S
+
10
J
23.29
7.8
0.0042
0.1211
0.0039
0.1190
0.0061
0.1226
K
p
0.0271
21.6408
1.3742
30
1.1759
30
1.4559
K
i
0.0043
2.1830
11.7829
24.2796
9.2061
30
13.6554
K
d
0.0866
0.74008
0.12561
15.2678
0.105
3.1136
0.14221
t
s
23.9
0.0938
0.67
0.0718
0.808
0.0697
0.59
M
p
7.41%
43.5%
3.77%
75.7%
4.26%
57.3%
3.9%
(4) S
+
5
S
4
+
17
S
3
+
60
S
2
+
10
S
J
13.19
2.938
0.1055
0.5265
0.4358
0.5265
0.4358
0.5265
K
p
0.7484
5.2644
2.8763
30
2.8741
30
2.8886
K
i
0.0020
0
0
0
0
0
0
K
d
2.6791
29.9807
14.6236
30
14.623
30
14.6463
t
s
21.1
2.4
1.07
2.85
2.41
2.85
2.39
M
p
5.04%
0.784%
0.0349%
18.9%
0.778%
18.9%
0.804%
(5) S
+
5
S
4
+
17
S
3
+
60
S
2
+
5
S
+
5
J
5.67
0.9095
0.1211
0.6971
1.1880
0.6974
1.1880
0.6985
K
p
21.5801
1.7623
0.94238
30
0.95494
30
1.0341
K
i
0.92192
2.508
1.2476
11.3251
1.2849
11.3253
1.3078
K
d
30
29.5197
14.6483
30
15.0704
30
15.1394
t
s
0.706
2.73
1.18
6.07
2.66
6.07
2.54
M
p
10%
0%
0%
26.1%
0.0874%
26.1%
0.449%Based on PID control parameters tuned by Z-N method and optimal parameters (K
p, K
i, and K
d) with best ITAE (ITUA) performance optimized by AFW, EFW, and PSO, step response curves of PID control system on 5 typical transfer functions are drawn in Figure 4 (Figure 5), respectively.Figure 4
PID parameters tuning model based on Advanced Fireworks algorithm.
(a)
Function 1
(b)
Function 2
(c)
Function 3
(d)
Function 4
(e)
Function 5Figure 5
PID parameters tuning model based on Advanced Fireworks algorithm.
(a)
Function 1
(b)
Function 2
(c)
Function 3
(d)
Function 4
(e)
Function 5It is shown that AFW almost has the best performance index value of 2 different performance indexes ITAE and ITUE in PID parameters tuning with transfer functions as (1) (2) (4) (5) or has little difference with the best performance index value but much better than the other evolutionary algorithms with transfer functions as (2) (3) according to Table2.Besides, curves with hybrid performance index ITUE get small overshoot and small rate of curve changing than cures with ITAE in each transfer function or each evolutionary algorithm according to Table2, Figures 4 and 5.


## 5. Conclusion

In this paper, PID control system parameters tuning problem is transformed into a class of 3-dimensional parameter optimization problem based on performance indexes ITUE and ITAE. In order to design high-quality performances PID controller, an Advanced Fireworks (AFW) algorithm is built to optimize the PID controller by parameters tuning. Extremal optimization method of PID control system was got by analyzing PID controller and building compound index of optimization performance. Then build a PID parameters tuning model combined with AFW. At last, 5 typical transfer functions of control system were simulated to obtain optimal parameters by AFW and were compared with Z-N tuning method, Enhanced Fireworks (EFW) algorithm, and Particle Swarm Optimization (PSO). The simulation results show that AFW algorithms are effective and easily implemented methods to solve PID control problems of different transfer functions.



---

*Source: 2534632-2016-06-20.xml*