Voltage and frequency control in conventional and PV integrated power systems by a particle swarm optimized Ziegler–Nichols based PID controller

Variations of load demands, expansion of power system by interconnections among different areas and integration of renewable energy sources bring new challenges for stable, reliable and uninterrupted operations of power systems. In this paper, a control technique is proposed to control and optimize the performances of the three models having importance in the present and future energy systems. These are the output variations of an automatic voltage regulation (AVR) system, frequency variations in a load frequency control (LFC) system of a thermal power plant and frequency variations of a PV integrated thermal power plant. The proposed controller is a particle swarm optimized Ziegler–Nichols (ZN) method based proportional-integral-derivative (PID) controller. A particle swarm optimization (PSO) method suffers from the unavailability of prior knowledge of initial values of parameters. Whereas, the classical ZN method leaves the scope for performance improvements of a system. A rejuvenation to the classical ZN method is proposed by integrating PSO. The combined effect optimizes the voltage and the frequency performances, while ensuring system stability. Additionally, different objective functions inspired from energy industry requirements are considered to demonstrate performance improvements of the systems (e.g. maximum overshoot, steady-state error, settling time). The robustness of the proposed method is demonstrated by considering parametric uncertainty in the system. The proposed method is compared with performances of different controllers (e.g. PI, fuzzy PI, fuzzy PID), different iterative soft computing methods (e.g. pattern search, artificial bee colony, different variants of PSO) and classical optimization method (e.g. linear matrix inequality) considering different objective functions and different load disturbances for the aforementioned models. It is also observed that better performances are obtained using a significantly less number of iterations.


Introduction
The day-by-day increasing load demands and continuous integration of non-renewable energy sources are expanding the complexity of modern-day power system operations. Additionally, sudden disturbances in power system networks propagate through several interconnections between areas and hinder normal operations. Thus, the challenges to maintain reliable and uninterrupted power supply to the consumers are dynamic. To achieve stable and reliable operations two control strategies are generally used, (i) active power control by automatic generation control (AGC) or load frequency control (LFC), (ii) reactive power control by automatic voltage regulator (AVR). A load frequency control system helps to maintain the frequency of a particular area under the nominal value. Fluctuation of frequency from the nominal value may lead to blackouts [1]. Furthermore, the power flow in interconnected power systems which are connected through tie-lines is predetermined on a contract basis. Disturbances in the interconnected power system lead to huge financial losses. Thus, the design of a proper control strategy is important to minimize the frequency deviations of individual areas as well as minimize the variations of power flow in the tieline. An automatic voltage regulation is a process in which the voltage level on the terminal of generators is kept constant. A suitable control technique is essential to minimize the voltage variations to ensure stable and efficient operation in the power system.
Proportional-Integral-Derivative (PID) controller is being used for a wide range of applications because of its simplicity, clarity in performance and ease of accessibility [2]. Applications of a PID controller are extended to different real-world problems such as in power generation industry for AVR [3,4], LFC [5,6], switch mode power supply (SMPS) [7]. Furthermore, applications of the PID controller can be found in temperature control in furnace [8], chemical reactors [9], automobile trajectory tracking [10], nonlinear hydraulic system [11]. The ease of applications in different real-life problems has motivated the use of the PID controller in this study. The process of selecting appropriate values of three gains (proportional, integral and derivative) of a PID controller is called tuning. One classical method of tuning a PID controller gains is the Ziegler-Nichols (ZN) method [12,13]. There are a few drawbacks of this method. It is often noted that the output of the system exhibits large overshoot [14,15] and a high decay ratio [13,14]. In power systems, the voltage or the frequency of the system should come under a desirable tolerance limit soon after any disturbance. Therefore, in different system applications, a high decay ratio can be unacceptable [13]. Thus, gain values obtained from the ZN method have to be optimized such that other system requirements are satisfied.
A particle swarm optimization (PSO) technique was first introduced by Kennedy and Eberhart in 1995 [16]. It is inspired by the social behaviour of animals such as bird flocking, fish schooling. PSO has its applications in different fields of science and engineering problems such as data clustering, power systems, neural networks, feature selection etc. [17]. Developments and further applications of PSO are available in [17]. This wide range of applications have motivated the use of PSO algorithm in this study. However, PSO comes with a few drawbacks. The selection of initial positions of the particles far from the optimal solution may result into increased number of iterations. On the other hand, a fixed number of iterations [3,15] may terminate the algorithm prematurely or force it to continue even after achieving an optimal solution.
In this paper, a ZN based PSO method is proposed for a PID controller. The collective effect overcomes the difficulties of the individual method and allows the incorporation of different system requirements. In this work, three models having applications in the current and future energy-related problems are considered to showcase the advantages. The first model is an automatic voltage regulator (AVR) which is essential for the proper functioning of the electronics equipment and stable operation of a power system in presence of disturbances [18]. The second model is a load frequency control (LFC) which helps to maintain the stability of a power system and ensures that the frequency remains in nominal value. The third model is inspired by the need for sustainable energy and its integration with existing energy sources. Thus, a load frequency control problem of a two-area PV integrated thermal power plant [19,20] is considered. Inadequacies of existing works are also featured in the comparative section. The key contributions of this work are highlighted as 1. The ZN method is one of the popular tuning techniques used in Industry to tune the PID controllers. Despite being popular it comes with a few drawbacks as stated above. Here, a Ziegler-Nichols (ZN) based PID controller is proposed. The performance of the controller is optimized through an optimization algorithm named particle swarm optimization (PSO) ensuring stable operations of the system. 2. The objective of this work is to utilize the simplicity of design of a ZN based PID controller and developing a cooperative framework between ZN and PSO to extract benefits from both. 3. In different applications, the selection of the objective function plays a key role in system performance.
In this paper, it is demonstrated that the selection of objective function for an optimization algorithm can be influenced by different performance requirements of the user. Furthermore, the ranges of the controller gains are considered as constraints in the optimization process. 4. The verification of the proposed collaborative framework is achieved through three models having importance in present and future energy systems. The first one is voltage control in presence of disturbance of an AVR model, frequency control in presence of disturbance in a single area thermal power plant and in a two-area PV integrated thermal power plant. The proposed method is implemented considering the availability of the system models. 5. Robustness of the proposed method against parametric uncertainties is also verified considering a two-area PV integrated thermal power plant. 6. The advantages of the proposed design are presented with respect to performances over a few existing works from the literature which are based on different soft computing techniques, classical techniques and different time-domain objectives.
This paper is organized in the following way: in Sect. 2, the proposed control structure is discussed. In Sect. 3, application models and results are presented. In Sect. 4, a comparative study with a few existing works is presented followed by the conclusion of this work in Sect. 5.

System modeling
PID controller is often preferred in order to improve the performance of a closed-loop system. In this section, the proposed method including a step by step guidance of implementation is presented.

Proportional-integral-derivative (PID) controller
A PID controller is a closed-loop feedback controller. The block diagram of a PID controller is shown in Fig. 1. The output y(t) of a process is compared with a reference, r(t). K P , K I and K D are a proportional, an integral and a derivative gain respectively. The transfer function of the system, error e(t) and the controller output u(t) are represented in Eqs. 1, 2 and 3 respectively. Now the objective is to find the controller gain values for a stable operation of the system.

Controller gains as a particle
A set of N number of particles is considered where the position of a particle is represented by the gains of the controller. The position of i th particle K i represents the gains of the PID controller ( K P , K I and K D ) such that,

ZN method for the proposed controller
The Eq. 3 can be deduced to Eq. 7 [21] with the help of Eqs. 5 and 6, where I and D are the integral and the derivative time constants respectively.
At first, the integral and the derivative controller gains are deactivated by setting the integral time constant ( I ) to ∞ and derivative time constant ( D ) to zero to tune a PID controller by the ZN method [12]. Therefore, Eq. 1 can be rewritten as

Initialization of a particle
Authors in [3,15] selected a random range to draw the initial values of the controller gains. Such selection can be ambiguous, as there is no prior information available about the range where one could find the optimal solution. Contrarily, the ZN method provides gain values for which a system exhibits reasonable performance. In Eq. 9, a uniform distribution around the ZN method values with v1 and v2 offsets are created to draw the initial gain values of the particles and v1 , v2 > 0 ∀ v = {P, I, D}.
Set initial values of velocity V i of each particle as 0 i.e.

Setting performance objective of the system
An objective function is formed for improvement of the performance of the system. One essential objective is to minimize the error e(t). In this paper, the integral of squared error (ISE) is considered as it is widely adopted as an objective function and performance index [20] and represented by Eq. 10 where "l" and "u" denote lower and upper limits of the respective controller gains.
An objective can be influenced by different system requirements; e.g. for an AVR system, the peak value of the voltage should not cross the permissible limit after any disturbance. Therefore, system overshoot (OS) from nominal value needs to be considered. The modified objective can be considered as In some engineering problems like LFC, the output of the system should come under tolerance limit as quickly as possible. Settling time ( t s ) [21] is the time taken by the system's response to reach and stay within ± % of the steady-state value where, is a positive number chosen as per the requirement. The following modified objectives are proposed.
Other objective functions may be considered according to the system requirements. The chosen objective function is used for the next phase.

Updating controller gains
Each of the N initialized particles moves from a position K i with a velocity V i (where, i = 1, 2, … , N ). The gain at which each particle gets its best objective value till the n th iteration is known as the best personal gain. The best personal objective value O p i (n) is given by: The index of the iteration at which the particle gets the best personal value is defined as Therefore, the best personal gain of each particle is K i (l i ).
Overall, the best value of objective among all particles up to the current iteration is the global best objective value O g and is given by, The index of the particle and the iteration number at which the best global objective is obtained can be given as, Thus, the best global gain can be written as K a (s) . The velocity and position of each particle are updated as follows, where, is an inertia weight factor, c 1 and c 2 are acceleration constants, and r 1 and r 2 are uniformly distributed random numbers between 0 and 1.

Stability checking and stopping condition
It is mentioned by researchers that ZN method produces high oscillations for unstable processes [22] and direct implementation of ZN method for unstable processes is tough [23]. Thus, a stability checking is implemented in the algorithm to ensure stable operation of both stable and unstable processes. The gains obtained from PSO algorithm is processed through a stability checking to ensure the stability of the models considered.
In this work, an objective function tolerance ( f ) and a steady-state error tolerance ( s ) are defined as the stopping conditions. In every iteration, the best global gains K a (s) are obtained. These are used in the system to get the values of the objective function and the steady-state error. These values are compared with the desired tolerances f and s respectively. After satisfying the terminating conditions, the values in K a (s) represent the gains of the proposed controller.

Implementation
In this subsection, a step by step approach is presented for the implementation of the proposed method.
1. Set the integral time constant I to ∞ and the derivative time D to 0. After deactivating integral and derivative controllers, the transfer function will be 2. Increase proportional gain K P until the system exhibits undamped oscillation. The gain at which the output of the system attains undamped oscillation is called the ultimate gain, K u and the time period of oscillation is called ultimate time period, u . The values of K u and u can be obtained using the RH criterion [21]. 3. Find K P z , K I z and K D z using values of K u and u . Consider Table 1 and Eqs. 5 and 6. 4. Choose v1 , v2 ∀ v = {P, I, D} and N appropriately.
Create a range of gain values around each K P z , K I z and K D z . Refer to Eqs. 9 and 4. 5. Set gain values of each particle from the chosen range. 6. Calculate the transfer function of the system (Eq. 1) If the real part of the roots of the characteristic equation is less than 0 then move to step 7 else move to step 5. 7. Set initial value of velocity of each particle as 0 i.e.
Set values for inertia constant, and acceleration constants c 1 , c 2 , tolerance limits f and s and iteration counter n = 0. 8. Choose an objective function according to the system requirement e.g. one of Eq. 10 through to Eq. 12.
For each particle, find the value of the chosen objective function and initialize personal best. 9. Initialize global best for all particle based on the objective value. 10. Set, iteration counter, n = n + 1 and generate two random numbers r 1 and r 2 ( r 1 , r 2 ∈ (0, 1)). 11. Update velocity and position of each particle using Eqs. 17 and 18 respectively. 12. Calculate the transfer function of the system (Eq. 1) with K i (n + 1) ∀ i = 1, … , N . If the real part of the roots of the characteristic equation is not less than 0 for the i th particle, then set K i (n + 1) = K i (n) otherwise move to step 13. 13. Using updated gain values of each particle, find the value of the objective function and determine personal best till n th iteration using Eqs. 13 and 14. 14. Find global best objective O g among all particles using Eq. 15 and global best gains K a (s) using Eq. 16. 15. Find steady-state error e sk for controller gains K a (s). Fig. 2 Block diagram of an automatic voltage regulation (AVR) system [3][4][5] 16. If, stopping conditions are satisfied i.e. O g < f and e sk < s then go to step 17, otherwise go to step 10. 17. Get global best gains K a (s). 18. Feed K a (s) to the system.

Application models and results
In this work, three models are considered. These are 1. An automatic voltage regulation system (Fig. 2 [3-5]) 2. A load frequency control system of a single area thermal power plant (Fig. 3 [5,24]) and 3. A load frequency control system of a PV integrated thermal power plant (Fig. 4 [20,25]).
In the AVR and LFC models, C(s) is the PID controller and is given by, C(S) = K P + K I s + K D s (Figs. 2-3). The performance parameters considered are the maximum percentage overshoot ( M os p ), rise time ( t r ), settling time ( t s ), the maximum peak value ( M p ) and steady-state error ( e ss ) [21]. The number of iterations that the algorithm takes to attain the desired output is also shown for each considered system. In the proposed method, N = 40 [15], = 0.728 and c 1 and c 2 are considered as 1.494 [26]. All the systems are simulated for 10 times and the best results among them are presented in the following section. The output response of the system with an extended time period is shown in the inset of the corresponding figure.

An automatic voltage regulation system
The details of each component and the complete transfer function of the AVR system shown in Fig. 2 is in [4]. The system parameters considered for the AVR system in this study are taken from [5]. The performance is shown considering V ref = 1 [3,5]. The values for s and f are considered as 0.02 and 0.15 respectively. The output responses of the system are shown in Fig. 5 for the ZN method and

A load frequency control system for a single area thermal power plant
In this section, a single area thermal power plant is considered as shown in Fig. 3 [5,24]. The system parameters considered for the LFC model in this study are taken from [5] and further details regarding the model are available in the reference. The performance of this system is shown for a load disturbance of 0.01 p.u. [27].  Table 3. Substantial improvement in e ss from the ZN method is observed in the proposed method using objective O 1 and O 4 . Improvements in M p , and in t s are also observed. It is noteworthy that, settling time of 6.449 s ( O 1 in Table 3) and 5.22 s ( O 4 in Table 3) are high for a LFC system. A fast settlement of the system response after any disturbance is highly desirable in a power system operation. Thus, such requirement is incorporated through an objective O 3 . The controller gains and performance obtained using O 3 in the proposed method is also tabulated in Table 3. Relative improvements of 77% and 99.9% in t s and e ss respectively are observed with objective   Fig. 7. The convergence curve of the proposed method for the objective function O 3 is shown in Fig. 8.

A load frequency control system for a two-area PV integrated thermal power plant
Integrations of renewable energy sources with existing conventional sources bring additional challenges to the LFC problem. In this study, one such system is considered where a PV plant in one area and a thermal power plant in another area are connected through a tie-line (Fig. 4). The complete modeling of the PV plant and the thermal power plant is available in [19].
The system parameters that are considered in this study for this model (e.g. K 1 , a 1 , K g , T g , K ps , T ps ) are taken from [20,25]. The performance of this system is shown for a load disturbance of 0.1 p.u. in area 2 [20]. Here, an objective is selected as [20]. The values of s and f are taken as 0.002, 0.003 respectively. The controller gains obtained by the proposed method are K P1 = −6.5054 , K I1 = −0.2592 , K D1 = −3.9733 , K P2 = −89.8846 , K I2 = −295.2587 and K D2 = −7.04 . The controller outputs of both the areas are obtained by these optimized gains and is shown in Fig. 9. The performance parameters for the nominal plant using these optimized controller gains are tabulated in Table 4.
It is observed that, the values of the maximum peak for both the areas and the tie-line are significantly small, e.g. the frequency in area 1 has the maximum deviation of 0.0562 Hz from the reference line which is well within the tolerance limits. The settling time of all the responses are also small i.e. the responses of the system have oscillated and settled within a very small time period. Similar improvements are also observed for the values of the steady-state error. The convergence curve of the proposed method for the considered objective O 5 is shown in Fig. 11.
The power system parameters change over time depending upon different operating conditions [28]. The controller should be robust enough to tackle these changes and maintain system stability and performances.   Thus, a sensitivity analysis of the proposed controller is performed in this study. Here, a ±25 % and ±50 % variations from the respective nominal values of power system parameters K ps and T ps are considered. The variations are considered individually as well as simultaneously. Here, the controller gains obtained by the proposed method considering the nominal system parameters are tested against the parametric uncertainties. The performance of the system for all such variations are tabulated in Table 4. The output responses of the system considering nominal parameters and ±50 % variations in K ps and T ps are shown in Fig. 10. It is clearly seen from Fig. 10 that the variations in frequency and tie-line power considering nominal and perturbed system parameters are significantly small. Thus, the proposed controller is robust enough to maintain system stability and performance in a wide range of parameter variations. In the next section, further results are elaborated through comparative studies.

Comparative study
In this section, comparative studies with a few existing works are presented to highlight the improvement using the proposed method. For comparisons, the same system parameters of the respective work are considered. The choices of references for this study also include other objective function, soft computing techniques as well as classical control technique. The zoomed-in view of the output response is shown in the inset of the corresponding figure.
At first, an AVR system is considered. The Integral time square error (ITSE) is taken as the objective function which is defined as ∫ t 0 t e(t) 2 dt . The upper and lower ranges of the controller gains are taken from [4]. In [4], the authors used an improved kidney-inspired algorithm (IKA) to tune a PID controller. In [29], the authors used a PID controller with a second-order derivative term. The proposed controller was tuned through PSO. In [30], the authors used artificial bee colony (ABC) optimization with PID controller for the AVR system and a comparative performance with differential evolution (DE) and PSO was also shown. In [31], the authors used local unimodal sampling (LUS) optimization algorithm for obtaining gain values of a PID controller for the AVR problem. A pattern search (PS) optimization based PID controller was proposed in [32]. In [33], authors proposed biogeography-based optimization (BBO) for PID controller parameter tuning for an AVR system. Grasshopper optimization algorithm (GOA) was used with the PID controller in [34]. The coyote optimization algorithm (COA) as proposed in [35] was used with the PID controller to optimize the performance of the AVR system. The parameter values of the COA algorithm is taken from [35]. The controller gains and the performance parameters obtained by Fig. 9 The outputs of the controller in the area 1 and the area 2 of the two-area PV integrated thermal power plant considering a load disturbance of 0.1 p.u. in the area 2 [20]. The outputs are obtained by the optimized gains from the proposed method. The zoomed-in response is featured in the inset  Table 5 considering V ref = 1 [4] along with the above-mentioned references. It can be clearly seen from the results in Table 5 that the proposed method has the best objective value among all the cited references. It is also observed that the rise time and settling time have improved from all the cited references. Thus, it can be concluded that the proposed cooperative framework between the classical ZN method and the PSO has not only improved the performances of the system but also resulted into significantly less iterations than some of the works in the existing literature e.g. in [29] a PID-PSO framework was proposed which resulted into 50 iterations, however, in the proposed method as the initial values are drawn using the ZN gains, better performances are obtained within 3 iterations. Furthermore, the comparative responses of the AVR system are shown in Fig. 12 considering controller gains from Table 5. Now a LFC system as presented in [6,27,36,37] is considered for a load disturbance of P L = 0.01 p.u. In [6], the authors used direct synthesis approach, in [27], the author used internal model control, in [36], the authors used Laurent series and relay feedback identification and in [37], the authors used linear matrix inequality (LMI) constrains to tune the PID controller. The responses obtained from the proposed method (corresponding to O 1 ) and the comparative results using the same parameters as provided in the above references are presented through Fig. 13 and Table 6. It is observed that the peak value, settling time of the frequency response and the error index ISE value are significantly improved. Therefore, the proposed controller with the PSO algorithm has superior performance over the cited works from the existing literature.
The comparative results for the load frequency control system for a two-area PV integrated thermal power plant are tabulated in Table 7 while keeping the same parameter values as in the references. In [19], the authors used firefly algorithm (FA) to tune the PI controller for load frequency control of the PV integrated Fig. 11 The convergence curve of the proposed method for the objective function O 5 considering the LFC system for a two-area PV integrated thermal power plant  12 Comparative responses of the AVR system with controller gains from Table 5 thermal power plant. The performance is compared with the genetic algorithm (GA). In [20], the author used a fuzzy PID controller and a PI controller with imperialist competitive algorithm (ICA) to tune controller parameters for the LFC problem. In [25], the authors used population extreme optimization (PEO) to tune PI controller for the system in study. The author in [38] used scale-free fuzzy PI controller and in [39], he used a fuzzy PID with filter plus double integral controller for the LFC problem. It is observed from Table 7 that the best objective value (ISE) is obtained by the proposed method among all the cited works. Improvements in the peak values of frequency variations in area 1, area 2 and power deviation in the tie-line are observed. The proposed method shows significant improvement in settling time of frequency deviations in area 1 and area 2. Furthermore, all these improvements in performances are also observed within significantly lesser number of iterations. Thus, it can be concluded that the proposed method has outperformed some of the popular control techniques and optimization algorithms from the existing literature.

Conclusion
In this paper, an optimized ZN based tuning of a PID controller is proposed. It is validated through three system models namely an AVR system, a LFC system for a single area thermal plant and a LFC system for a multi-area PV integrated thermal plant. Results show the suitability of the proposed method for all the system models. A comparative study is presented considering system parameters for the models as available in the respective reference works. The proposed method is compared with different iterative soft computing methods (e.g. IKA, DE, ABC, PS, different variations of PSO) and classical optimization method (e.g. LMI) considering different time-domain objective function (e.g. ISE, ITSE, ITAE). The effectiveness of the controller is also tested with different load disturbances. It is observed that significant improvement in the performance is achieved in less number of iterations. In future, the proposed method will be extended to LFC problems for multi-area power systems considering hydro, wind power plants. The proposed method is dependent on available system model. In future, the authors would like to explore the possibilities of extending this work to systems without available model.

Compliance with ethical standards
Conflict of interest On behalf of all authors, the corresponding author states that there is no conflict of interest.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creat iveco mmons .org/licen ses/by/4.0/.