Frequency Stability Enhancement of Microgrid Using Optimization Techniques-Based Adaptive Virtual Inertia Control

In recent years, a sharp increase in integration of renewable energy sources (RESs) in power system network has been observed. High penetration of RES interfaced with power electronics converters-inverters with reduced or no inherent inertia compromises modern power system’s overall stability. Due to low inertia, voltage and frequency deviations far of the allowable threshold occur. To overcome this challenge, an adaptive inertia control strategy based on optimization technique is proposed. Te improved particle swarm optimization (PSO) and genetic algorithm (GA) optimization techniques-based PID controller has been used to generate the appropriate virtual inertia coefcient for efective emulation of inertia in the presence of energy storage system. Te conventional PSO sufers local optima stagnation, resulting in premature convergence during searching process in order to achieve global and local position. To address this issue, the velocity update equation was modifed on inertia weight (w) using an additional exponential term with linear decreasing inertia weight PSO (LDIW-PSO). In this paper, exponential power is taken strategically instead of squaring it in order to reduce the number of iterations for faster convergence. Finally, a microgrid based on wind and solar energy is simulated using MATLAB/Simulink where three cases, 2% disturbance, 3% disturbance, and 4% disturbance, have been considered. Here, the evaluation of proposed system is carried out based on four main performance indices (ITAE, IAE, ISE, and ITSE). Furthermore, validation was done through hardware prototype to get experimental results in real time. Te results from MATLAB simulation and experimental setup are in sync.


Introduction
In recent times, a drastic change in energy sector has been witnessed at global level.Due to ever-increasing number of consumers and the improvements in living standards among consumers, energy demand is escalating continuously.With these situations becoming compelling day by day, the conventional methods of power generation, i.e., fossil fuels, are not sustainable.Also, these traditional methods are not environmentally friendly.Coal produces greenhouse gas (GHG), which pollutes the surroundings and causes harm to the living organism in the area.Tey also emit carbon dioxide, which is a major cause of global warming.To meet this demand over a long period of time, RESs, for instance, wind, biomass, and solar, are now becoming popular.RESs have a number of benefts as they are not destructive to environment and are relatively cheap.However, it is notable that they have low inertia and are intermittent in nature, nonlinear, and also uncertain [1].Tere is a mismatch between generation and demand which causes an imbalance.Te imbalance system makes introduced voltage and frequency deviations, which lead to a system's reduced reliability and resilience.It causes system collapse or even total blackout.In conventional power system, synchronous generators help to mitigate frequency deviation and RoCoF due to their ability to change speed when the system frequency changed.Kinetic energy is utilised (rotating mass) in traditional power system which is absent in the modern power system.Several power utility companies across the world invest millions of dollars annually to address frequency quality problem.
Te increased penetration of RES has led to system instability due to intermittent feature of converter-inverter interface [2].In addition, renewable energy sources, energy storage system, local loads, and power system applications are interconnected.Power electronics equipment lacks inherent inertia in comparison to synchronous machine in the traditional network.Due to large penetration of renewable energy sources in conventional power system network, considerable decrease in inertia is noted, causing frequency instability (frequency nadir and zenith and high rate of change of frequency).Te frequency deviation is a notable problem in modern power system comprising power electronics-based energy harvesting from RES.To address the challenges associated with low inertia and frequency deviation, several methods have been reported previously.Te use of wind turbine to generate inertia in microgrid had been proposed in [3].Although this method seems to be very promising, the intermittency of wind speed and use of power electronics interface make it inefective as an inertia source.Use of synchronous condenser has been widely used for inertia control but very expensive and not suitable for small systems like microgrid.Some of the researchers have also explored the use of ultracapacitors [4].However, the regulation of high output current of ultra capacitors having high power density but low energy density is a major challenge.Similarly, the DC-link capacitor voltage control of grid-tied converter has been efectively used for inertia control.However, this method is not suitable for the interface of constant terminal voltage sources like batteries [5].Use of DC-link capacitors; this method is efective in converters with variable voltages, however it can not be used for inertia control due to its limited energy storage capacity in microgrid [5].Certain methods based on partial loading have been proposed to utilise the spare capacity of synchronous generator for inertial response.However, running a synchronous generator under partial loading conditions is highly inefcient and increases the per unit cost of electricity generation.
Recently, the concept of virtual synchronous machines (VSMs) emulated through power converter is gaining lot of popularity [6,7].Several research papers have looked into the efect of MGs and noninertia generation on the frequency reliability, resilience, and stability of bulk power systems [8][9][10][11].Robust repetitive control (RC) is implemented in three-phase four-wire shunt active power flters (APFs) [12] for power quality in power system.In [14], a novel fractional-order controller was proposed for frequency regulation and real power fuctuation control but it did not explain how this controller is efective on ofine microgrid and their cost implication if any.Furthermore, a well-structured frequency control system based on proportional, integral, and derivative (PID) controller optimized through metaheuristic techniques for microgrid system comprising wind, hydro, solar, diesel, and thermal systems was conducted to give ultimate quick control response to system disturbances [15,16].A malfunction lenient supervision for frequency and voltage was brought forward for a diesel engine machine applied on a microgrid.Nikhil Paliwal [17] in his paper implemented this control approach in a multi-source system (hydro power, gas turbine, and thermal plant), where the balance between power generation and demand as well as losses in microgrid has been achieved [18].A similar control approach based on PID controller has been presented in [19] where the frequency control is implemented in hydro-wind hybrid system.Te efectiveness of this method depends on the droop coefcient of synchronous generator [20].Battery SOC timevarying properties are proposed in [21,22] for the inertia enhancement.
Recently, a robust approach been presented by Shahryar Maleki and his colleagues in [23] where they employed linear matrix inequality method for optimal and robust control.However, the issues associated with the response time and parameter variations increase overall control complexities.Notably, it is clear from the given literature that there are technical gaps on design and analysis of virtual inertia control that need to be address in order to solve frequency deviation problem.Te inertial response and damping coefcient are notable challenges in power electronicinterfaced microgrid.
In the proposed research work, adaptive virtual inertia control is proposed to overcome such a challenge of frequency instability using optimized PID controller-based energy storage system.In this novel concept, an improvised version of PSO and GA has been utilised to achieve optimal values for tuning of PID controller in low-inertia microgrid.Usually, a linear dynamic inertia weight updating equation is utilised for the enhanced PSO performance (LDIW-PSO) [24].However, it sufers from the challenge of getting stuck into local optima during search space.In [25], a natural exponential with squared power term has been incorporated in weight updating equation.Although this approach is able to avoid local minima problem, it inherently sufers in terms of increased number of iterations which ultimately increases the convergence time.Moreover, the reduced values of w start (0.6) and w end (0.1) imply reducing viscosity as the search process is analogous to moving fuid.In this paper, natural exponential term is taken strategically without squaring it in order to reduce the number of iterations.Also, the higher values of w start (0.9) and w end (0.2) have been taken to reduce convergence time.
Te key contribution of this paper is summarized here: (i) Adaptive virtual inertia control is proposed to enhance frequency stability in a microgrid under diferent disturbances.During designing, performance index, RoCoF, frequency zenith, and frequency nadir have been considered to improve frequency response.(ii) An improved particle swarm optimization algorithm has been implemented in this proposed control to deal with challenges of local optima and ofer a balance distribution of particles between exploration and exploitation.
2 International Transactions on Electrical Energy Systems (iii) A brief comparison of frequency stability with traditional PSO, GA, and improved PSO under various operating conditions has been provided along with their procedural algorithm to demonstrate their performance.(iv) Te optimal gains obtained through proposed algorithm have been simulated on the given system and same have been validated through OPAL-RT supported hardware in loop in real time.
Tis paper is organized as follows.General introduction is given in Section 1. System description and control are presented in Section 2. Section 3 presents a brief description of optimization techniques applied, whereas Section 4 deals with simulation results and discussion.Section 5 represents experimental setup validation.Section 6 contains conclusion.

System Description and Control
Te system under consideration is shown in Figure 1, where the model comprises both conventional sources of energy based on steam turbines for primary and secondary frequency control.Since RES is inertia-less, it needs to be regulated to avoid instability challenges.Terefore, solar and wind energy sources have also been considered for the formation of hybrid microgrid.Te system is simulated under diferent generation and loading conditions while ensuring the frequency control within permissible limits.Te mathematical modelling of all diferent power sources has been done and incorporated in the development of block diagram for the simulation purpose.Te detailed mathematical formulation for diferent sources is as follows.

Modelling of Frequency Control
System.In the frst case, a model without virtual inertia is given as follows: where ∆P m is power generation change by turbine, ∆P L refers to change in power load, ∆f refers to change in frequency, H is the inertia coefcient, and D is the damping constant.( 1) is transformed to Laplace as (2) is represented in Figure 2.
Figure 3 shows the frequency deviation for both high inertia as well as low inertia system when put under certain disturbances.Here, it can be observed that in the absence of any regulating mechanism, the system droops, and it takes a long time to recover.Furthermore, the black solid line has small amplitude and it settled faster than the dotted red line.Terefore, it is always desirable to have a control system which could depict such excellent characteristics.Figure 3 shows hierarchical control structure with the secondary layer showing frequency restoration and control by stabilising the mismatch in load and generation.
Te frequency change in a complete model is where where ∆P C refers to ACE action change (signal), ∆P P refers to change in power from primary control, ∆P W refers to power change in wind system, ∆P Wind refers to initial wind power change, ∆P g refers to the power produced from the turbine, ∆P Solar refers to the initial change in solar power, ∆P PV refers to power produced by the solar system, ∆P L refers to total change of load in the system, and ∆P VI refers to change in virtual inertia power.Te variable loading, load shedding, and intermittent RES supply to the system cause fuctuation trend and hence result in poor frequency profle and interrupted energy supply to customer.

Control Description.
Te control part of any hybrid power system plays vital role in frequency stability, and it must be able to respond quickly to any kind of disturbances.It is always intended to have inertia control to respond frst followed by primary and secondary control in case of a fault.Terefore, it is very necessary to emulate fast responding inertia control in the RES-based power system.Here, the damping coefcient plays vital role in minimizing the unwanted oscillations in the given system.A generalized virtual inertia control structure is shown in Figure 4 where the power disturbance may lead to frequency disturbance.Generally, a PID controller is included in a feedback closedloop control mechanism [26].PID transfer function comprises of frst-order derivative and integral.
where K P , K i , and K d are proportional, integral, and derivative gains, respectively.Further, any power disturbance can be modelled as International Transactions on Electrical Energy Systems where ∆P VI is change in virtual inertia power input, K VI is the virtual inertia coefcient, D VI is the virtual damping coefcient, and T ESS is the inverter-based energy storage system (ESS) time constant.

System Parameters.
In this paper, the parameters used for modelling and frequency regulation have been adopted from [27] and are also enumerated in Table 1.

Optimization Techniques Applied
Te control performance of the given system depends on the tuning of PID regulator.Under the normal circumstances, a generalized PID may exhibit satisfactory performance.However, its performance starts deteriorating under the dynamic load conditions/intermittent power generation from RES. Terefore, it makes it necessary to search for the optimal gains of PID regulator which may perform under all such dynamically operating conditions.An improvised form of PSO and GA has been utilised to obtain the optimized value of PID gains for virtual inertia control under the diferent operating conditions.For this purpose, the control block diagram as shown in Figure 5 has been modifed by incorporating frequency disturbance signal in the tuning of PID controller using the improvised form of PSO and GA optimization algorithms.Te whole system is simulated in MATLAB/Simulink as per the block diagram shown in Figure 6.Te simulation study is carried out for three diferent cases while considering the diferent levels of disturbances, either from the load or renewable power sources being intermittent in nature.In Case 1, a disturbance of 2% was considered at t � 0.2s.In the second case, a disturbance of 3% occurred at t � 2.2s and fnally a third disturbance of 4% is introduced at t � 4.5s.All the 3 cases were considered using both optimization techniques.

Particle Swarm Optimization (PSO).
Particle swarm optimization (PSO) was introduced in 1995 by James Kennedy and Russel C. Eberhart [28] inspired by the social behaviour of animals like fock of birds and the school of fsh.It is a simple but powerful optimization algorithm; it is an efective technique utilised in optimization challenges.Tis technique has been applied in a variety of applications.It has various advantages, for instance, efciency in mathematical computation, simple to implement, robust, and stable convergence characteristics [29], and it can also be used in online optimization due to its efciency and simplicity [30].Te conventional particle swarm optimization is a design based on the behaviour of a swarm of birds in search of food location [28].Te position location and speed of each  International Transactions on Electrical Energy Systems particle are located by the following equation; the best local position (P i ) and global best (G i ): where r 1 and r 2 are random values in the range of [0, 1], c 1 and c 2 are social and cognitive constants, w is the inertia weighting function, w is inertia weight which is very critical for the fast convergence of optimization process.A very efective approach based on linear decreasing inertia weight PSO has been presented in [24] to manipulate the inertia weight and update it dynamically as represented by equation given below: where w start is the initial value of inertia weight, w end is the fnal value of inertia, and T max refers to maximum iterations.Te linear dynamic inertia weight-PSO (LDIW-PSO) faced challenge of falling into local optimum during the searching process.Moreover, the performance of optimization engine is heavily dependent on initial and end values of inertia constant where the too small or too much higher values may increase no. of iterations as well as convergence time.To overcome this issue, natural exponential is multiplied with w end to enhance velocity-updating equation.Similarly, the authors of [25] have included a square of exponential which further increases the computational burden.Terefore, in order to reduce the computational burden without compromising in performance, an exponential term with suitable value of T max has been included in weight updating matrix such that the overall convergence time reduces with reduced no. of iterations [25,31].Te modifed equation is as given below: where w start � 0.9 and w end � 0.2. Figure 7 illustrates that MPSO converged faster than LDIW-PSO.It shows better performance.

Genetic Algorithm (GA).
To improve system response of inertia-less microgrid, GA has been used to optimize PID parameters so that it efectively and efciently gives optimal values.With the repetitive loops, chromosome population is iterated; in this case, each iteration is considered as a generation.Te genetic material operators are concern with selection, crossover, and mutation to form a new cluster [32].Tere is an objective function for each generation.Charles Darwin's selection criteria are applied, and Darwin's ftness and the struggle for survival strategy are used [33].
Te probability equation is where p is probability, η refers to gene, t refers to time, M refers to population, f(η) refers to ftness value gene, and  f(H) refers to sum of ftness value of all populations.GA is applied, and the boundary values of PID controller gains K p , K i , and K d are obtained through the GA optimization process.Te algorithm shown in Figures 8 and 9 depicts step by step procedure on how improved PSO and GA optimization works.

Formulation of Four Performance Indices (PIs).
In this research paper, improved PSO and GA are applied to minimize the error in performance index.Te error, that is, the deviation in frequency should be as minimal as possible.

International Transactions on Electrical Energy Systems
Te deviation in frequency (∆f) is due to perturbation in power system due to intermittent power supply and nonlinear loads.Time range for simulation is denoted as t Sim .Minimize P.I. subject to equation (15).Here , the selected range of PID parameters gains K p , K i , and K d are considered.
where the population size, iterations, and boundary size taken are provided in Tables 2 and 3.

Simulation Results and Discussion
Te simulation of the 250 MW system with RES penetration is shown in Figure 1.It consists of DG 200 MW, solar power plant 15 MW, wind power plant 25 MW, 10 MW of BESS, residential load of 5 MW, and 10 MW industrial load [34,35] which are incorporated with the proposed controller.Te optimal gains obtained from the two techniques are tabulated in Table 4. Here, all the four performance indices were considered for each case.Series of simulations were conducted in MATLAB environment to obtain optimal parameters values for diferent algorithms.Given below are algorithms for improved PSO and GA showing parameter settings, initialization, termination, and ftness function.
Improved PSO has a population size of 100, maximum number of iterations 50, minimum ftness of 0.0001, maximum and minimum allowable velocities V max � 1; V min � −1, acceleration constants C 1 � 2; C 2 � 2, and the other parameter is inertia weight which has been modifed as discussed earlier in Section 3.1.
Similarly, the population size for GA is 100 and the number of iterations (generations) is 50.Te cross probability is 0.8, and cross mutation is 0.1.In Figures 10 and 11, optimal individual ftness-based improved PSO and GA are illustrated with the four performance indices.Optimization curves for the PID parameters are shown in Figure 12; each curve shows the optimal value of each constant.
Te optimization techniques used above are able to minimize error and their evaluation is carried out on the basis of four main performance indices, where the settling time, undershoot, overshoot, and oscillation got improved drastically.Te RoCoF and deviation in frequency are brought to steady state within few milliseconds unlike the conventional rotational mass of synchronous machines which takes up to 10seconds to settle down.Te response is very fast and comes in efect well before the primary response which sets in between 30s and30m and the secondary frequency control which sets in after the 30 th minute to shed of the loads or to operate the protective mechanism.Te simulation study is carried out under three diferent operating conditions, where Case 1 with 2% disturbance, Case 2 with 3% disturbance, and Case 3 with 4% disturbance are considered.Case 1. 2% disturbance: Initially, the system is stable with the frequency of 50Hz for the frst 0.2seconds, and then an abrupt load demand of 5MW is introduced which results in frequency disturbance.Te frequency oscillations take almost 20.734ms to damp out and system is restored again to stable operation with 50 Hz frequency while feeding a load of 245 MW.
Case 2. 3% disturbance: After 2.2seconds, a RES starts supplying the power of 7.5MW which results in power and frequency oscillations.It takes almost 23.645ms to damp out the oscillations.Finally, the frequency is again restored to its nominal value while feeding the load of 252.5 MW.
Case 3. 4% disturbance: At 4.5 seconds, another disturbance occurred with a reduced load demand of 10 MW.Tis results in the higher amplitude of frequency and power oscillations and it takes almost 24.505ms to damp out these oscillations.Again, the frequency gets settled down to its nominal value with overall system load of 242.5 MW.

International Transactions on Electrical Energy Systems
Te simulation results for all the performance indices are shown separately in Figures 13-16.Figure 13 shows the simulation for performance index ITAE, Figure 14 presents the results for IAE, Figure 15 shows the simulation results for ISE, and in Figure 16, the simulation results for ITSE are presented.Here, each of the diagram consists of the traces of change in frequency (∆F), frequency (F), power (P), and change of power (∆P) for the PID optimized through PSO and GA.Here, it can be easily visualised that the GA performs better in terms of lower peak overshoot while the PSO outperforms GA in terms of settling time.Here, it is worthwhile to mention that in both the cases, the system works satisfactorily and stabilises rapidly when subject to any kind of disturbance.
Table 5 shows the statistical analysis of the changes in frequency captured in Figures 13-16.
In Table 6, power change analysis is done; it gives indepth understanding of how this controller is very efective.
As observed in Table 5, improvised PSO PID controller has the highest overshoot as it is with all the four performance indices but restricted to the threshold of 3%.However, in all cases, it took the shortest time to settle down.On the other hand, GA PID controller has small overshoot but long settling time.

Experimental Results and Discussion
Simulation was done on MATLAB/Simulink environment as discussed and results were shown.Furthermore, a realtime hardware prototype was designed based on OPAL-RT (OP-4510) as shown in Figure 17.Tis further illustrates the efcacy of the research concept in this paper.
It is seen that the proposed dynamic controller has quick dynamic response as it takes less than two seconds to arrest any deviation despite the intensity of the change.From the experiment, 2%, 3%, and 4% disturbances were used and the response time in all the 3 cases was found to be fast.
MATLAB simulation results and experimental results from real-time OPAL-RT are in agreement giving a clear indication that the tuned optimal values of PID controller can be used in the ofine system.Te outcome of both the approaches is more or less similar.In Figure 18, frequency nadir is 1.967 Hz, and in MATLAB simulations as seen in Table 5, the average for all the four performance indices is 1.985 Hz.Tis is to validate the proposed control approach where the simulation results are almost emulated using hardware in loop.
Finally, comparisons were made between this proposed technique and some existing techniques as shown in Table 7 to ensure its efectiveness.International Transactions on Electrical Energy Systems

. Conclusion
Te designed test system based on two optimization techniques has been successfully implemented in MATLAB/ Simulink.Te gains obtained through these optimization methods have been further utilised for the tuning of PID regulator which further exhibits the emulation of virtual inertia control.Te three diferent uncertainty levels caused by either intermittent RES or fuctuating load have been demonstrated to show the efectiveness of the proposed control approach.Te problems of high RoCoF, high overshoot, high undershoot, and long rise time have been signifcantly eliminated.
Te proposed techniques are suitable for regulating both RoCoF and frequency control.Te above analysis confrmed that the inclusion of optimization techniques in the microgrid would act as a game changer to elusive inertia and damping.With the continuous penetration of RES/DG into our power system network, this technique will enable system control engineers to achieve steady-state operation of the overall system.
As already discussed in results section, the proposed controller's performance is tested and validated through the MATLAB simulation and hardware prototype, and the controller responds fast to the given changes.From the experimental validation, the proposed controller with excellent outcome can be used in microgrid with nonlinear loads and power supply.Tis adaptive virtual inertia method using optimization techniques improves frequency response and thus confrms the efectiveness of this controller.

Figure 12 :
Figure 12: Optimization curve for K P , K i , and K d .

Figure 13 :
Figure 13: Response curves for change in frequency, frequency, change in power, and power optimized by improved PSO and GA-based P.I-ITAE.

Figure 14 :
Figure 14: Response curves for change in frequency, frequency, change in power, and power optimized by improved PSO and GA-based P.I-IAE.

Figure 15 :
Figure 15: Response curves for change in frequency, frequency, change in power, and power optimized by improved PSO and GA-based P.I-ISE.

Figure 16 :
Figure 16: Response curves for change in frequency, frequency, change in power, and power optimized by improved PSO and GA-based P.I-ITSE.

Figure 18 :
Figure 18: Experimental results for frequency deviation, frequency, power, and power change in mixed signal oscilloscope (MSO).

Table 1 :
System parameter values.

Table 2 :
PSO and GA elements.

Table 3 :
PSO and GA boundary condition.

Table 4 :
PSO and GA-optimized PID gains with performance indices.

Table 6 :
Statistical analysis of power change (∆P).

Table 7 :
Additional comparison between the existing control techniques from the pool of literature and the proposed control technique.