A hybrid PSO-PID approach for trajectory tracking application of a liquid level control process

Water level control is a crucial step for steam generators (SG) which are widely used to control the temperature of nuclear power plants. The control process is therefore a challenging task to improve the performance of water level control system. The performance assessment is another consideration to underline. In this paper, in order to get better control of water level, the nonlinear process was first expressed in terms of a transfer function (TF), a proportional-integral-derivative (PID) controller was then attached to the model. The parameters of the PID controller was finally optimized using particle swarm optimization (PSO). Simulation results indicate that the proposed approach can make an effective tracking of a given level set or reference trajectory.


Introduction
There is an increasing demand for energy.Nuclear energy, which is one of the cleanest forms of energy, has increasing attraction and goverments invested funds to the develepment of nuclear energy.The nuclear power plant (NPP) generates electricity by driving the armature coupled to a steam turbine.Steam is generated by the u-tube steam generator (UTSG), whose water level should be controlled in safe limits in order to maintain plant availability and economic feasibility of a NPP [1].Therefore stabilizing the water level of a plant around a predetermined level is an important factor in order to secure sufficient cooling source and prevent any possible demage on time.Therefore, many efforts to apply various approaches, which include adaptive controllers [2,3], robust H∞ controllers [4], predictive controllers [5,6] and fuzzy logic controllers [7,8], have been developed to resolve the level control problem of the SG [9].Besides, modelling approach is another phase to observe the performance of the designed controller.Several techniques have been proposed for nonlinear system identification.
Most of them are based on parameterized nonlinear models such as Wiener-Hammerstein models, Volterra series, wavelet networks, artificial neural networks (ANN), support vector machines etc [10].Due to the uncertainty, complexity and nonlinearity of the plants, computational approaches were widely used and applied to real time systems for the modeling, prediction and optimization processes [11][12][13][14].Besides, many other recent studies underlined TFs' simple, satisfying and quick estimation of process performance for linear and nonlinear stothastic dynamic systems in the fields of engineering, environmental science and social science [15].Basically, TF demonstrates the relation between input and output signals in black boxes representing the transformation of input signal to the output signal accordingly.TFs usually are written in Laplace domain [16].
Many of the engineering systems are modeled using the combination of first, second order and also the lag functions.Supposing the TF as () and the input as () the output signal is expressed as () and formulated as () = ().().[17,18].
An industrial trainer, Gunt RT 512, providing a comprehensive experimental introduction to the fundamentals of control engineering using an example of water level control, was employed in order to observe trajectory tracking performance in our study.Thus, the process was first expressed in terms of TFs of water tank, pnomatic valve and pressure transmitter and a controller was then attached to the TF block.Since there has been an increasing demand to control the liquid level and flow, various control techniques were proposed to be applied to level control processes.Among those techniques, PID controller receive many attention due to its robust performance, simplicity and its applicability to a large class of processes having different dynamics.Almost 90%-95% of industrial control systems are using PID controllers.Despite the wide use area of PID, it is difficult design a satisfying controller for a system with nonlinear dynamics [19].Therefore many researchers focused on the development of tuning rules and methods for PID controllers.
There are various tuning methods and proposed for PID controller tuning.Among the conventional methods, Ziegler-Nichols method is supposed to be the most well known technique.For many applications of PID control processes, this tuning approach performs quite well.But, for some cases Ziegler-Nichols does not perform well enough and may cause overshoot.Thus, this method usually requires retuning process before it is applied to control processes.In order to improve the efficiency of traditional PID several artificial intelligence (AI) approaches have been suggested such as those using genetic algorithms (GA), covariance matrix adaptation evolution strategy (CMAES), PSO, differential evolution (DE), tribes algorithm (TA), ant colony optimization (ACO), and discrete binary particle swarm optimization (DBPSO), biogeography based optimization [20][21][22][23][24][25][26][27][28][29][30][31].With the advance of computational techniques, optimization algorithms are widely proposed to tune the control parameters in order to find an optimal performance.[32] All the given AI-based evolutionary computational techniques are supposed to determine the optimal set of controller parameters based on a given fitness function but the performance of of each method may significantly vary in different applications.Being one of the promising algorithms, the PSO simulatates the swarms' behavior while they are performing their tasks and the approach has several advantages compared to other methods.PSO works by maintaining a a group of agents and hence enables parallel evaluations of several solutions, therefore it does not require that the optimization problem to be differentiable and comprises simple mathematics and decrease computational complexity.Thus, the simplicity and capability of PSO to solve difficult problems have encouraged many researchers for its further development [33][34][35].The methods used for water level control processes are given in Table 1.In this paper, we first generated a transfer function of Gunt RT 512 water level control process.Following the modelling process a reference trajectory is given to be tracked by PID controller.In order to determine three optimal PID gains, Kp, Ki, and Kd, PSO algorithm was assigned.In the following section, water level control system and the process to generate its transfer function is handled.In section III, we focused on PID controller and in section IV parameter optimization process using PSO was expressed.Finally various real time and simulation experiments were performed to state the overall performance of the study in section IV.The evaluation of the study was handled in section V to contribute to future studies.

GuntRT512 water level control process
The level control unit, Gunt RT 512, is equipped with industrial grade control systems.The trainer provides a comprehensive experimental applications of level control enabling external controller applications.The spectrum of experiments also comprises the behaviour of control circuits, detection of step response, investigation of disturbances, trajectory tracking, reference level settling and optimization of control responses [36].The purpose of water level control process is to keep the water level in the tube at a desired reference level and track a given reference trajectory.The main components and the block diagram of the plant are given in Figure 1 and Figure 2 respectively.The water level control process sets the level in tank (1) for a given reference level.In order to raise or reduce the water level in the tube a pnomatic control valve allows flow into the tube from the storage tank (5).A continious flow control is achieved with a PID controller attached to the system.The control process runs as shown in Figure 1.A reference trajectory or level is first set to be tracked by the plant.PID controller gets the water level in the tube (1) as input over a pressure/current converter (2) and compares it with the currnet reference level value.Depending on the error value, PID controller generates a control signal and transfers over current / pressure converter (3) to pneumatic control valve (4).Conic valve is turned on in accordance with the control signal and water in the storage tank ( 5) is pumped (6) into the level tank.Since the exhaust pipe (7) allows continuous water flow out to the tank the flow control into the tube is used to keep the water at a desired level.In case of disturbance effect import, the exhaust pipe valve ( 7) is turned off or turned on.Throughout the whole process control, the aperture of pneumatic control valve changes flow and enables water flow into the level tank while exhaust pipe flows out to the storage tank.Thus the system is able to follow the reference trajectory or level ensuring that flow disparity.Basically, the plant consists of water level control loop and the loop controls the water level in the tube so that the water level can be maintained at desired level which is controlled by a PID controller.

Figure 2. Block diagram of water level control process
The PID controller parameters are significantly important for the real time system response, therefore the parameters of PID is optimized using PSO algorithm and the outcomes are evaluated over a fitness function which is expressed as mean square error function as given in Eq. 1.
Here, , is the fitness value , is the model output of  ℎ sample,  is the number of all samples and  represent the reference output.

Mathematical model of the process
Many engineering systems like tank modelling in process control, RC circuits are modeled by first order TF.In these systems, the TF is expressed as in Eq. ( 2) and depicted as given in Figure 3.In the proposed approach the transfer function of water level tank, pnomatic valve and pressure transmitter components were calculated respectively.
And if the level tank is assumed as linear, the differential equation is expressed as in Eq. 5.
Here   represents the water flow into the level tank in ( 3 /) and   represents the flow out from the level tank to the storage tank in ( 3 /).And substituting the Eq. 5 in Eq. 3 the equation in Eq. 6 is obtained.
If the Laplace transform of the equation is calculated, the transfer function of the tank is; In order to get the mathematical model of the water level tank, the values of both resistance  and capacitance  are necessary.As given in Eq.
3 the resistance values is defined as the ratio of water level height in level tank to the flow out of the liquid.Therefore In order to find the  value, the flow curve was plotted as given in Figure 5 and the slope of the curve gives the  value.It was also observed that for the water in tank between 200mm and 600mm the system behaviour is linear.

Pnomatic valve
In our system, as given in Figure 6, Samson's 3241-7 type pnomatic valve was used.Pnomatic valve is fed with 5 bar pressure and operates between 4-20mA control input linearly.According to the control signal the valve opens and closes proportionaly.The water in the storage tank is then transferred to the level tank from the aperture of the valve.Here,   is the gain of pnomatic valve and is calculated as 14000 from the slope of linear line in Figure 8.If the values are substituted the mathematical model, which is similar to a first order system model, of the system is calculated as given in Eq. 10.

Reference trajectory
The reference trajectory signal to be given as a reference to the system is expressed as given in Eq. 11 and Eq.12.

𝑡 > 𝑡 𝑠
where   is the current value of trajectory,  is current tişme,  0 is delay time,  0   3 are the coefficients as given below [38].

PID controller
PID is a feedback based controller which gets the difference between the reference signal and system output and then calculates the required control output according to the error characteristics.PID controller has three components which are   ,      .Each of these terms represent proportional, integral and derivative gains respsectively [39].The proportional term (  ) provides a control action proportional to the error and reduces the rise time, the integral term (  ) reduces steady state error by performing an integral operation based on past errors and finally, the derivative term (  ) enhances the stability of the system to reduces overshoot by predicting the future [19].The weighted sum of these three actions, as given in Eq. 13, is used to adjust the controller signal which is the position of control valve in our study.
Thus the tuning process of these three parameters is a significant process.Being one of the most well known and preferred tuning methods, the Ziegler-Nichols (ZN) result in closed-loop systems with very poor damping.Despite the drawbacks of the methods, being the simpliest method compared to other approaches makes it preferable for the applications not requiring fine tuning [39,40].Because of insufficient tuning performance of ZN method, swarm intelligence methods such as ant colony optimization and particle swarm optimization are employed with their promising results [41,42].

Particle swarm optimization
PSO is a population based stothastic swarm intelligence search technique inspired by the special behavior of animals in swarms suchfish schools and birdflocks.PSO uses a simple mechanism imitating swarm behaviours to guide the particles to generate globally optimum solution to an optimization problem predicting the social behavior in the presence of objectives.With its simplicity of application and capability to prompt response to a solution PSO has many applications contributing to engineering and real world problems [43].In PSO algorithm, each particle starts with random initialization and is idendified by two parameters: position vector and velocity vector in order to visit new and unexplored regions.The movement is based on the particle's own experience and the shared experience from other neighboring groups of particles.The search process is repeated till the stopping criterion is attained [44].The position vector of the particle  ( = 1,2, … ) in mdimensional space is expressed as   = ( 1 ,  2 , … ,   ), the velocity vector is given as   = ( 1 ,  2 , … ,   ).Thus, the velocity of the particle in the next generation is calculated as given in Eq. 14.
( + 1) = ( 1 (),   ( + 1) Here,   () is the previous velocity and its value is in the range of [−  ,   ];   is the particle's local best position generated so far at  generation while   is the global best position generated so far by all particles. 1 and  2 are the coefficients defined as acceleration factors that are used to regulate the relative importance of the cognitive and social parameters. 1 and  2 are two independent random numbers defined in the range of (0,1); and finally  is the impact factor adjusting the weight of particles's previous velocity on its current generation.In PSO, the velocity of each particle is calculated according to Eq. 14 and the position for the next generation fitness evaluation is updated by Eq. 15.The process is repeated until a defined stopping criterion is verified or the best particle position in the entire swarm meet the current ciriterion [45].
In many studies, typical convergence criterion is defined as obtaining minimal error with respect to the optimal solution.Similar to other stigmergic collaboration algorithms, assigning proper values to the parameters is important task to enhace the performance of PSO and much work has been performed in order to determine a combination of values that work well in a wide range of problems.
In a recent study [46], some general directives to choose the good combination are propsed as: Swarm size M in [47,48], with a preference for 20 particles, cognitive parameter  1 in [0,1], with a preference for 0.7, social parameter  2 ~1.5 with a preference for 1.43.But nevertheless, different parameter values may generate better or worse outcomes depending on the problem, thus the best way to tuning is to make a sensitivity analysis in the context of the problem description.A pseudocode listing of the PSO approach is presented in algorithm 1 [49,50].After applying PSO algorithm   ,      parameters are calculated as given in Table 2 and experimental outcomes of the proposed approach follows in the next section.

Experimental results
In order to verify the efficiency of PSO-PID approach, simulation experiments were conducted.The performance of optimized controller parameters obtained using PSO was observed on various levels and trajectories to observe the performance of the algorithm.Following the tuning process, firstly a reference step input was given the system.The system was then tested with continuous step inputs with various values.The plotted performance of each step is given in Figures 11 and 12

Conclusion
Stabilizing the water level in the steam generator of a nuclear power plant is very important in order to secure sufficient cooling source for the nuclear reactor.Poor control of the steam generator water level can lead to frequent reactor shutdowns.Since considerable emergency shutdowns in nuclear power plants based on water reactor are caused by poor control of the steam generator water level, the control process is seriously to be handled.Apart from the protection of energy generation processes, water level control is vital for ecological reasons.For floodwater utilization, dynamic control of reservoir flood limited water level is a valuable and effective methodology to compromise between flood control and conservation for reservoir operation during the flood season.The dynamic control bound is fundamental element for implementing reservoir flood limited water level dynamic control operation.In this paper, Kp, Ki and Kd parameters of a PID controller were tuned using a swarm intelligence method, namel particle swarm optimization, over the mathematical model of a water level control process.Following the tuning process various reference levels were set to be tracked by the hybrid model.The results indicate that the designed PID controller using PSO algorithms performs satisfactory and the hybrid approach is applicable in various fields.The use of optimized PID controller is also a valuable approach to conribute to water level control processes and eliminates the drawbacks of human controlled operations.Besides, the optimization of the controller excludes the shortcomings of time consuming trial and error sessions.
For further studies the performance of PSO could be compared to other promising algorithms like ant colony algorithm, genetic algorithm and firefly algorithm or even the improved version of the swarm algorithms may contribute to the performance in terms of the computational complexity of proposed solution.On the other hand using a soft computing method like fuzzy controller may also diversify the applications and improve the performance.[50] Garcia, N.P., Gonzalo

Figure 1 .
Figure 1.Components of water level control process In the figure given above, the names of the numbered parts are; 1-line recorder, 2-electromagnetic flow rate sensor, 3-rotameter, 4-control valve, 5storage tank with pump, 6-ball valve with scale, 7-controller, 8-switch cabinet.

Figure 3 .
Figure 3. Transfer of input signal to the output

Figure 4 .
Figure 4. Water level tank Here, the resistance () of the flowing liquid from exhaust pipe, and the capacitance () of the level tank the resistance is calculated as given in Eq. 3 and Eq. 4 respectively. = ℎ    ()   ℎ  ( 3 /) =   (3)

Figure 5 .
Figure 5.The height-flow curve of the water level tank

Figure 7 .
Figure 7. Pnomatic control valve aperture under control signal As the figure underlines, pnomatic valve opens after 4mA and reaches to its maximum aperture at 20mA.Despite the linear characteristics of

Figure 11 .
Figure 11.Response to step input reference

Figure 12 .
Figure 12.Response to step transition input reference

Figure 13 .
Figure 13.Response to reference trajectory

Table 1 .
Methods used for water level control process

Table 2 .
Optimized PID controller parameters , E.G., Fernandez, A., Asst.Prof. Dr. Turker Tekin Erguzel received his Ph.D. degree in real time system modeling, controlling and parameter optimization from Marmara University.His research interests focus on real time systems, artificial intelligence and fuzzy control.He has been teaching at Uskudar University in the Computer Engineering Department of Faculty of Engineering and Natural Sciences since 2012.