Tuning and Retuning of PID Controller for Unstable Systems Using Evolutionary Algorithm

Proportional + integral + derivative (PID) controllers are widely used in industrial applications to provide optimal and robust performance for stable, unstable, and nonlinear processes. In this paper, particle swarm optimization (PSO) algorithm is proposed to tune and retune the PID controller parameter for a class of time-delayed unstable systems. The proposal is to search the optimal controller parameters like K p , K i , and K d by minimising the cost function. The integral of squared error (ISE) criterion is considered as the cost function, which guides the PSO algorithm to get the optimised controller parameters. The procedure for PID parameter tuning and retuning is presented in detail. A comparative study is done with the conventional PID tuning methods proposed in the literature. The simulation results show that the PSO-based PID controller tuning approach provides improved performance for the setpoint tracking, load disturbance rejection, error minimization, and measurement noise attenuation for a class of unstable systems.


Introduction
Poportional integral derivative (PID) controllers are widely used in industrial applications to provide optimal and robust performance for stable, unstable, and nonlinear processes. It can be easily implementable in analog or digital form. Further, it supports tuning and online retuning based on the performance requirement of the process to be controlled.
Open-loop unstable systems are mostly observed in chemical process industries and for economical and/or safety reasons, the chemical process loops to be operated in unstable steady state [1]. For unstable systems, there exist a minimum and maximum values of controller gain, and the average of this limiting value is considered to design the controller to stabilize the system. The increase in time delay in the process narrows down the limiting value and it restricts the performance of the closed-loop system under control. In addition, these systems show unusual overshoot or inverse response due to the presence of negative or positive zeros [2]. The literature gives details about various theoretical studies on fine tuning of PID controllers for openloop unstable system [3][4][5][6][7][8]. Most of the controller tuning approaches proposed for unstable system may require an approximate first or second order transfer function model with delay. Further, for real time application, the model may not be readily available in practice or may be changing due to uncertainty [9]. The model-based controller tuning requires complex computations to identify the controller parameters. To overcome this, it is necessary to use soft computing based model independent controller autotuning methods.
Optimization is a powerful tool for finding the controller parameters. Soft computing-based PID controller parameter optimization is widely addressed by the researchers. Wang et al. have proposed a PSO-based autotuning of PID controller on a stable system [10]. Jain and Nigam have attempted a PD-PI controller tuning for a stable second order system [11]. Kim et al. have discussed the PID controller tuning for a stable system using biologically inspired algorithms [12,13]. Ali and Majhi have proposed PID controller tuning for a class of time-delayed stable systems using bacterial foraging optimization (BFO) algorithm [14]. Korani et al. presented a comparative analysis on PSO, BFO, and hybrid algorithmbased PID controller for a stable system [15]. Rajinikanth and Latha have discussed the heuristic algorithm-based PID controller tuning for unstable system with time delay [16][17][18].
In this work, the PID controller parameter tuning is proposed for unstable system using particle swarm optimization (PSO) algorithm introduced by Kennedy and Eberhart [19]. PSO is a biologically inspired algorithm, and it is successfully used for engineering applications due to its high computational efficiency, easy implementation and stable convergence. Another advantage of PSO technique is that it does not need detailed mathematical description of the process and along with the controller tuning, it also supports the retuning of controller parameters, if necessary. In this work, to evaluate the performance of the proposed method, a simulation study is carried out using a class of unstable system models.
This paper is organized as follows: principle of PSO algorithm is discussed in Section 2, the basics of PID controller and implementation of PSO to optimize PID parameter is presented in Section 3. In Section 4, simulated results obtained for a class of unstable systems are shown. At the end, conclusion of the present research work is given in Section 5.

Particle Swarm Optimization
Particle swarm optimization (PSO) algorithm is a population-based evolutionary computation technique developed by the inspiration of the social behavior in bird flocking or fish schooling. It attempts to mimic the natural process of group communication of individual knowledge, to achieve some optimum property. In this method, a population of swarm is initialized with random positions S i and velocities V i . At the beginning, each particle of the population is scattered randomly throughout the entire search space and with the guidance of the performance criterion, the flying particles dynamically adjust their velocities according to their own flying experience and their companions flying experience. Each particle remembers its best position obtained so far, which is denoted as pbest (P t i ). It also receives the globally best position achieved by any particle in the population, which is denoted as gbest (G t i ) [20][21][22][23][24][25]. The updated velocity of each particle can be calculated using the present velocity and the distances from pbest and gbest. The updated velocity and the position are given in (1) and (2), respectively. Equation (3) shows the inertia weight where C 1 and C 2 are positive constants. C 1 is the cognitive learning rate and C 2 is the global learning rate. R 1 and R 2 are random numbers in the range 0-1. The parameter "W" is inertia weight that increases the overall performance of PSObased search. The larger value of W(W max ) can favor the global wide-range search, and the lower value of W(W min ) implies a higher ability for local nearby search.
Step 3. Evaluate the objective function of every particle and record each particle's P t i and G t i . Evaluate the desired optimization fitness function in D-dimension variables.
Step 4. Compare the fitness of particle with its P t i and replace the local best value as given below. for i = 1 : N If current fitness (i) < local best fitness (i); Then local best fitness = current fitness; local best position = current position (i); end % Same operation to be performed for G t i %.
Step 5. Change the current velocity and position of the particle group according to (1) and (2).
Step 6. Steps 2-5 are repeated until the predefined value of the function or the number of iterations has been reached. Record the optimized K p , K i , and K d values.
Step 7. Perform closed-loop test with the optimised values of controller parameters and calculate the time domain specification for the system.
If the values are within the allowable limit, consider the current K p , K i , and K d values.
Otherwise perform the retuning operation for K i , by replacing the optimised numerical values for K p and K d .

PID Controller Tuning and Retuning
Industrial PID controllers are usually available as a packaged form, and to perform well with the industrial process problems, the PID controller requires optimal tuning. Figure 1 shows the diagram of a simple closed-loop control system. In this structure, the controller (G c (s)) has to provide closed-loop stability, smooth reference tracking, shape of the dynamic and the static qualities of the disturbance response, reduction of the effect of supply disturbance and attenuation of the measurement noise effect [26]. In this study reference Figure 1: Block diagram of a closed-loop control system. tracking, load disturbance rejection, and measurement noise attenuation are considered.
Closed-loop response of the system with setpoint R(s), load disturbance D(s), and noise N(s) can be expressed as (4) and (5) where the complementary sensitivity function and sensitivity function of the above loop are represented in (6) and (7), respectively The final steady state response of the system for the setpoint tracking and the load disturbance rejection is given in (8) and (9), respectively, where A is amplitude of the reference signal and L is disturbance amplitude. To achieve a satisfactory y R (∞) and y D (∞), it is necessary to have an optimally tuned PID parameters. From the literature it is observed that to get a guaranteed robust performance, the integral controller gain "K i " should have an optimised value.
In this study, a noninteracting form of PID (G PID ) controller structure is considered. For real control applications, the feedback signal is the sum of the measured output and measurement noise component. A low pass filter is used with the derivative term to reduce the effect of measurement noise.
The PID structures are defined as the following: where Figure 2 shows the block diagram of PID parameter optimization using PSO algorithm. Minimizing the cost function generates the controller parameters. The error criterion is considered as the cost function, and the values of K p , K i , and K d are continuously adjusted, until the error of the closed-loop system is minimum. Equations (14)- (16) show the normally considered error criterion in control system to evaluate the performance of controller.
where e(t) = error, r(t) = reference input, and y(t) = measured variable. In this work, ISE (15) is considered as the cost function. For unstable systems, the ISE value may be large due to excessive overshoot in the process output, which may lead to slow convergence. Employing an approximate actuator model between the controller and the process will enhance this state. After getting the optimised controller parameters, the time domain parameters like rise time, overshoot and settling time in the response are then analysed. If the values are within the specified or acceptable limit, then the current controller parameter is considered for the system. Otherwise a retuning operation is carried out for the integral term (K i ) by replacing the optimised numerical values for k p and k d , to enhance the present performance of the PID controller.

Results and Discussions
To study the closed-loop performance of the unstable process with PSO-tuned PID controller, practical examples from literature are considered.
Many studies have proposed different PID settings for the above model and the values are clearly presented in the literature [1,3]. In this study, the optimization algorithm is initiated with the following values. Dimension of search space is three (i.e., k p , k i , and k d ); number of swarm and bird step is considered as ten; the cognitive (C 1 ) and global (C 2 ) search parameter are assigned the value of 2, the minimum (W min ) and maximum (W max ) inertia weight are set to be 0.2 and 1.2 respectively. The search space for k p , k i , and k d is defined as 30% of the three dimensional space with the positive and negative values. The maximum iteration for generation is set to 400.
PSO-based PID tuning is proposed with the method as in Figure 2. The final convergence of the K p , K i , and K d is shown in Figure 3. The ISE-based controller parameter search value has converged at the 136th iteration, and the final PID parameters are tabulated in Table 1. Figure 4 shows the value of the cost function (ISE) with respect to the iteration. When the iteration increases, the   values of controller parameters will be optimized, which may help to reduce the ISE value of the process output. When the controller parameter reaches the final value, the reduced cost function for setpoint tracking has a value of 11.25 ( Table 2). The process is then controlled with the optimized values of controller parameters, and the performance of the controller is tested in terms of the overshoot, settling time and the error criterion. From Table 2, it is observed that the overshoot and the settling time for the present controller  parameter are high. A retuning operation is then carried out by taking the overshoot and/or the settling time of the closed-loop process as the reference. During the retuning operation, the proportional and derivative controllers are replaced by its numerical values. In the retuning operation, the number of parameter to be optimized is one (i.e., the dimension of the search space is one). Initially the retuning is performed by taking the overshoot into account. The optimized PID gives an overshoot of 1.2632. During the retuning, the integral controller gain (K i ) is adjusted until the considered performance criterion is minimized. Figure 5 shows the retuned value of the K i , and the final value is presented in Table 1. The retuned PID parameter is then considered as PIDr1. A retuning operation is also performed by considering the settling time. The retuned controller parameter is presented as PIDr2. From Table 2, it is observed that the PSO-based PID tuning and retuning method give a reduced overshoot and settling time compared to the conventional tuning methods available in literature. From Figure 6, it is observed that the retuning operation can improve the closed-loop performance of the process. Figure 7 shows the servo response of the previous work reported in literature [3]. Figure 8 shows the servo and regulatory operation for Process 1. For reference tracking, a unity step signal is applied as the setpoint. For regulatory  operation, a load disturbance of 0.2 (20% of setpoint) is introduced at 100 sec. Figure 8 shows that the proposed method provides a smooth setpoint tracking and load disturbance rejection. The robustness of the PSO-based PID controller is then tested with the measurement noise introduced in the feedback path. A band-limited white noise with a noise power of 0.001 is introduced along with the feedback signal and from the result it is observed that the proposed controller can perform well even in the noisy environment. Figure 9 shows the servo response of the PSO-tuned PID controller with and without the measurement noise. [27] has the transfer function model;  The values of the operating conditions are given by flow rate (Q) = 0.03333 lit/sec, volume (V ) = 1 lit, K 1 = 10 lit/s, and K 2 = 10 lit/mol, concentration, (C f ) = 3.288 mol/lit. Measurement delay is 20 sec. Linearization of the model equation around this operating condition C r = 1.3065 mol/ lit, gives the following unstable transfer function model:

Process 2. Isothermal continuous stirred tank reactor (CSTR) considered by Liou and Chien
For the above transfer function model, PSO-based PID tuning is proposed with the method as in Figure 2. The controller parameters are converged at the 97th iteration, and controller values are K p = 1.4715, K i = 0.0228, and K d = 6.3923 (with N = 10). The overshoot of the present controller setting is large, and a retuning operation is performed for the integral controller gain with minimising of the overshoot. The search value is converged at the 49th iteration, and the retuned value of the K i is 0.0147. Figure 10 shows that the retuned PID (PIDr1) provides improved performance.
The regulatory response value is recorded with a disturbance value of 0.2 (20% of setpoint) introduced at 500 s. From the performance measure values in Table 3, it is observed that the retuned PID (PIDr1) structure provides reduced ISE and IAE than PSO tuned PID.   The robustness of the PID controller is then tested with a band-limited white noise with a noise power of 0.001and is introduced along with the feedback signal. From Figure 11, it is observed that the proposed controller provides a smooth setpoint tracking in the noisy environment.

Process 3.
The bioreactor plays a major role in most of the biotechnological and chemical industry. It can be defined as a reactor tank to execute a number of biological reactions to create a large amount of intermediate and final products. In recent years, biosynthesis process is widely utilised to convert the living cells (biomass) into marketable chemical, pharmaceutical, food, and beverage products. In biosynthesis, the biomass consumes nutrients from the substrate (feed) to cultivate and produce more cells and important products. During this operation the bioreactor is kept under a controlled environment with constant pH, temperature, agitation rate, and dissolved oxygen tension to attain better growth of microbes.
In this work, a small scale bioreactor widely analysed by the researchers [28][29][30] is chosen for the study. Figure 12 shows the schematic diagram of the reactor. The dynamic behaviour of the reactor is complex, and a number of vital manufacturing processes belong to this group.

The basic reaction inside the bioreactor is
where "A" is the reactant, "k" is reaction rate constant, and "P" is the product.
The stoichiometry for biomass activity is very complex since it varies with environmental conditions microorganism and nutrient in the system. Due to these reasons, unstructured models are mainly considered for analysis purpose. The following mathematical equations can describe a variety of industrial bioreactors. Equations (21) and (22) describe substrate balance: where X 1 is biomass (cell) concentration, X 2 is substrate concentration, D r is the dilution rate, and X 2 f is substrate feed concentration. The steady state solutions and the mathematical model of the system are depicted in Tables 4 and 5, respectively. The reactor model has two stable states and an unstable steady state [30]. The transfer function models shown in Table 5 along with a delay time of "1" are utilized in the proposed study.
The unstable bioreactor model is a benchmark problem in the unstable system study.
For substrate inhibition model, the following parameters are considered (Table 6) where (24) represents a second order model and (25) shows a reduced first order model. The delay time for the model ( (24) and (25)) is considered as "1". In this work, the PSO-based PID tuning is attempted for second order model (24), and the optimization search is converging at the 74th iteration. The optimised PID controller parameters are K p = −0.8722, K i = −0.1613, and The closed-loop response of the unstable bioreactor system is tested with the first order model (25), and its performance is compared with the classical PID parameters presented in Table 4 [28]. Figure 13 shows that the response of PSO PID has a lesser overshoot than the MA method, and the settling time is smaller than the VC and VC1 method. The actual bioreactor model constructed using the nonlinear equation ((21)-(23)) is then tested with the PID controller value obtained by the optimization algorithms. The objective is to maintain the concentration of biomass (X 1s ) based on the setpoint, by adjusting the substrate concentration (X 2s ). Figures 14 and 15 show the variation of biomass and substrate concentration for the servo and regulatory response. In this figure a setpoint of 0.995103 is 8 ISRN Chemical Engineering     considered and a load disturbance of 0.199 (20% of setpoint) is applied at 60 min. From the result, it is observed that the PSO algorithm based PID controller provides a nonoscillatory response with minimized overshoot and settling for both the setpoint tracking and disturbance rejection applications.
The robustness of the proposed control scheme is then tested by introducing a measurement noise (noise power of 0.001; sampling time of 0.1 sec). The nonlinear model is considered for the simulation study. Figure 16 shows the variations of biomass concentration and Figure 17 depicts the variation of substrate concentration and dilution rate in the presence and the absence of measurement noise. The reference tracking response of the   bioreactor with a PSO-based PID shows that the proposed scheme works well in the noisy environment.

Conclusion
Most of the industrial process loops use conventional or modified structure PID controllers. Tuning the controller ISRN Chemical Engineering parameter for time-delayed unstable system is a challenging work if the system model is other than a first order plus dead time. In this work, design of optimization-based model independent controller tuning for unstable process models has been attempted. In this work, a PSO-based PID controller tuning and retuning is presented in detail for a class of unstable systems. The design of controller is formulated as an optimization problem using ISE as the performance index. This is a model free, online tuning method which can identify the optimal controller parameters effectively. PSO can be practically used as an alternative to obtain the controller parameters with an algorithm-based PID controller. The result obtained from the computer simulation shows that the proposed method improves the performance of the process in terms of time domain specification, setpoint tracking, disturbance rejection, error minimization, and measurement noise attenuation.