Advanced Fireworks Algorithm and Its Application Research in PID Parameters Tuning

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.


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 highquality 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.
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.

PID Controller and Optimization
Performance Index

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 Figure 1, and the transfer function in the Laplace Domain of the PID controller is described as follows: where   is the proportional gain,   is the integral gain,   is the derivative gain,  is the complex number frequency,  is the filter coefficient, and /(/ + 1) will be deduced to ideal differentiator  when  is large enough.For a typical feedback control system, a continuous form of the PID controller is described as follows: where () is the out of the PID control signal and () is the system error, () = () − (), which means the difference between the output value and the target value.Furthermore, the discrete PID controller is written as follows: where   is the sampling interval time.

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: where  1 ,  2 , and  3 are the weight value of ITSE, output of PID controller, and rate of system error, respectively.Besides ITSE, () 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)

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.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 Figure 2.

Advanced Fireworks Algorithm.
In order to improve computational efficiency of PID parameters tuning, Advanced Fireworks algorithm is proposed.
In the beginning, 1st-generation location of firework  in dimension  is generated randomly as follows: where   min ,   max are the lower and upper boundary of searching space in dimension  and rand(0, 1) is displacement parameter generated from a standard uniform distribution on the open interval (0, 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 firework  is expressed follows: where   is constant of total sparks number,  max is the maximum value of the objective function among the  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  max and no less than  min : that is,   should be replaced by  max if   is bigger than  max , and   should be replaced by  min if   is smaller than  min .The amplitude of fireworks explosion by firework  is expressed as follows: where   is constant of the maximum explosion amplitude and  min is the worst value of the objective function among  fireworks.
And then,   sparks are generated in the amplitude space randomly.th dimension location of spark  generated from firework  is defined as follows: where    is the location of firework  in th dimension coordinate,   1 is changing factor which will be 0 or 1 randomly, and rand(−1, 1) is displacement parameter generated from uniform distribution over [−1, 1].  1 denotes whether th dimension location of spark  generated from firework  should be different from th dimension location of firework .Once    is out of searching space in dimension ,    will be regenerated as (9) until it is located in the searching space.

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 define th dimension location of mutation spark  generated from firework  as follows: where   2 is changing factor of mutation explosion which will be 0 or 1 randomly and  2 is displacement parameter generated from bimodal Gaussian function follows: where  1 and  2 are the mean square error of bimodal Gaussian function,  1 is a random number generated from rand(0, 1), and heaviside() is a MATLAB function which has the value 0 for  < 0, 1 for  > 0, and 0.5 for  = 0. Once    is out of searching space in dimension ,    is regenerated as (10) until it is located in the searching space.

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,  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  − 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  is selected to be firework in next generation is expressed as follows: where  is the set of all current locations of elements.

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 coefficient  as a constant which is large enough.The model of PID parameters tuning based on AFWA is depicted as in Figure 3.
Step 1. Set parameters of AFW, number of fireworks , maximum number of iterations  max , and number of mutation sparks.
Step 2. Initialize sets of PID parameters 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 Figure 2) with all set of PID controller parameters and then get corresponding performance index ITUE/ITAE.
Step 6. Select  elements to be fireworks in next generation.That is to say, select  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 iterations  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 (  ,   , and   ).Otherwise go to Step 3.

Simulations and Analysis
4.1.Comparison Tuning Method: Ziegler-Nichols Method.In order to evaluate the PID controller parameters (  ,   , and   ) 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 gain   and derivative gain   as zero.The proportional gain   is then increased (from zero) until it reaches the ultimate gain   , at which the output of the control loop has stable and consistent oscillations.  and the oscillation period   are used to set the PID controller parameters (  ,   , and   ) as follows:   = 0.60  ,   =   /2, and   =   /8 [19].

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 gain   , integral gain

Generate location of 1st-generation
Sent location of fireworks to PID controller of control system in Figure 2 Simulation PID control system Get out 1/out 2 of control system in Figure 3 to be gorgeous degree of fireworks ITAE/ITUE: Yf Calculate number of sparks generated by firework i N i as (7) Calculate amplitude of firework explosion by firework i A i as (8) fireworks explosion as ( 9 Sent location of all elements (fireworks, sparks, and mutation sparks) X to PID controller of control system in Figure 2 Simulation PID control system Get out 1/out 2 of control system in Figure 3 to be gorgeous degree of elements ITAE/ITUE: Y Choose location of the element with best gorgeous degree and other n − 1 elements based on ( 11) to be the next generation fireworks Whether the optimization is achieved Choose location of element with best gorgeous degree to be parameters of PID controller fireworks Xf = [K p , K i , K d ] as (6) sparks Xm = [K p , K i , K d ] as (10)   , and differential gain   ) 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 were  1 = 1,  2 = 0.1, and  3 = 0.01, respectively.Besides, other main parameters were chosen as in Table 1.
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 overshoot   and setting time   .Overshoot is the occurrence of a signal or function exceeding its target, Based on PID control parameters tuned by Z-N method and optimal parameters (  ,   , and   ) 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.
It 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 Table 2.
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 Table 2, Figures 4 and 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.

2 MathematicalFigure 1 :
Figure 1: The structure of typical control system With PID controller.

Figure 2 :
Figure 2: Simulink structure of testing performance index on PID control system.

Figure 3 :
Figure 3: PID parameters tuning model based on Advanced Fireworks algorithm.

Figure 4 :
Figure 4: PID parameters tuning model based on Advanced Fireworks algorithm.

5 Figure 5 :
Figure 5: PID parameters tuning model based on Advanced Fireworks algorithm.