Virtual Inertia Control in Autonomous Microgrids via a Cascaded Controller for Battery Energy Storage Optimized by Fireﬂy Algorithm and a Comparison Study with GA, PSO, ABC, and GWO

: Modern (micro) grids host inverter-based generation units for utilizing renewable and sustainable energy resources. Due to the lack of physical inertia and, thus, the low inertia level of inverter-interfaced energy resources, the frequency dynamic is adversely affected, which critically impacts the stability of autonomous microgrids. The idea of virtual inertia control (VIC), assisted by battery energy storage systems (BESSs), has been presented to improve the frequency dynamic in islanded microgrids. This study presents the PD-FOPID cascaded controller for the BESS, a unique method for enhancing the performance of VIC in islanded microgrids. Using the ﬁreﬂy algorithm (FA), the settings of this controller are optimally tuned. This approach is robust to disruptions due to uncertainties in islanded microgrids. In several scenarios, the performance of the suggested approach is compared with those of other control techniques, such as VIC based on an MPC controller, VIC based on a robust H-inﬁnite controller, adaptive VIC, and VIC based on an optimized PI controller. The simulation results in MATLAB show that the suggested methodology in the area of VIC is better than previous methods.


Introduction
The frequency dynamics and stability are highly affected by the inertia level in electric (micro) grids [1].Power converters (so-called inverters) are used to connect renewable energy resources, like wind turbines and photovoltaic, to the microgrid.However, the inverter-interfaced energy resources lack physical inertia which reduces the inertia constant of the autonomous microgrid.Therefore, the frequency dynamic of the autonomous microgrid is at risk of instability due to a drastic rate of change of frequency and large frequency nadir raised because of the limited inertia [2,3].Battery energy storage systems (BESSs) are widely utilized and controlled to provide virtual inertia [4].
Numerous control loops have been studied for frequency control assisted by the BESS in islanded microgrids, including (1) VIC, (2) PC, and (3) SC [5][6][7], to address this low inertia and enhance the frequency stability of the system.The VIC becomes active while the other control loops are idle when there is a load change in the microgrid.The amount of stored kinetic energy in the microgrid's spinning component determines how the microgrid reacts to changes in load [8].Whether the microgrid absorbs or transmits kinetic energy depends on its inertia [8].Within 10 to 30 s following disturbances and events, the PC restores the frequency to a new stable state [9,10].On the other hand, the SC returns the frequency to the nominal condition between 30 s and 30 min after frequency deviations [11].Therefore, VIC [11] is the control that is essential to the frequency stability of an isolated microgrid.In essence, the functioning of the virtual synchronous generator's VIC is a specialized component that serves as the main factor boosting frequency stability [12,13].BESSs, if properly controlled, may be thought of as virtual inertia sources by applying VIC and producing an effective performance that is comparable to synchronous generators in the power system [14].However, the performance of VIC is in jeopardy due to large disruptions and parameter uncertainties for an islanded microgrid [15].To improve the effectiveness of virtual inertia control against disruptions and uncertainties linked to system characteristics, several control approaches have been used [16][17][18][19][20][21][22][23][24][25][26][27][28].
The performance of VIC in the islanded microgrids has been enhanced in [16] using a fuzzy controller.However, the use of a fuzzy controller is constrained by its laborintensive and complicated design.One of the main drawbacks of fuzzy controllers is their inadequate performance against disruptions in the islanded microgrids, including load disruptions and renewable energy source disruptions [17].In [17], a VIC method considering a variable droop coefficient for the islanded microgrids has been proposed.This method has improved the VIC of the microgrid to some extent and increased the flexibility of the islanded microgrids.However, its performance against disruptions in the islanded microgrid is not satisfactory.An MPC controller has been employed in [18][19][20] to raise VIC's efficiency in the islanded microgrids.By using a precise model of the microgrid, this controller may give a VIC performance that is sufficient.But the MPC controller's need for an accurate microgrid model is one of its key drawbacks.The performance of the system will be affected if an accurate model is not supplied.Furthermore, the MPC's performance under uncertain conditions is inadequate.In [21,22], an H-infinite controller has been used to improve the performance of VIC against disruptions and uncertainties in microgrid parameters.This type of controller is robust against disruptions in islanded microgrids and weakens them as much as possible.It is also resilient against uncertainties in microgrid parameters.But this controller's reliance on the system model is one of its key shortcomings.The lack of an accurate model of the microgrid compromises the efficiency of this controller.Another challenge of implementing the H-infinite controller in the islanded microgrid is its high complexity.The performance of VIC in the islanded microgrid has been enhanced in [23] by the deployment of an adaptive VIC based on the bang-bang control approach.The performance of this control system is not good when load disruptions and scattered generating sources are present, which is one of its key shortcomings.The islanded microgrid in [24] uses the coefficient diagram method.This approach calls for intricate calculations and offers insufficient resistance to load fluctuations and disruptions in renewable energy sources.In [25], a neuro-fuzzy network has been used in the structure of VIC in the islanded microgrid to control frequency and improve its stability.One of the main challenges of this method is its computational complexity for implementation in VIC.In [26], a Recurrent Probabilistic Wavelet Fuzzy Neural Network has been used in the structure of VIC in the islanded microgrid to control frequency and improve its stability.One of the main challenges of this method is its computational complexity for implementation in VIC.In [27,28], a new dynamic controller has been used to improve the performance of VIC in single-area and multi-area islanded microgrids.This method is robust against disturbances and uncertainties in microgrid parameters.It requires an accurate model of the microgrid and involves complex calculations.
According to the findings of control methods [29][30][31][32][33][34][35][36], the PID controller has the ability to improve the islanded microgrid frequency in conditions where load disruptions and renewable energy source disruptions are mild.But one of the most important problems of this controller is that it does not perform properly against severe load disruptions and severe disruptions of renewable energy sources (wind turbine, photovoltaic).Also, the PID controller does not perform optimally against the extreme uncertainty related to the islanded microgrid parameters.Compared to the FOPID controller, which has two degrees of freedom compared to the PID controller, has a number of benefits, such as (1) greater accuracy, (2) improved stability, and (3) resilient performance in systems with disruptions and parameter uncertainties [37].An islanded microgrid's frequency was managed by the FOPID controller in [38].In [39], the FOPID controller, with its parameters tuned using a neural network, was employed to improve the performance of VIC in an islanded microgrid.In [40], the FOPID controller, with its parameters optimized using the SWA, was utilized to enhance frequency stability in an islanded microgrid.In [41], the FOPID controller, with its parameters optimized using the SCA, was employed to improve frequency stability in an islanded microgrid.In [42], the FOPID controller, with its parameters optimized using the HSA, was applied to enhance frequency stability in an islanded microgrid.According to the findings of the control methods [38][39][40][41][42], the FOPID controller has improved the frequency stability of the islanded microgrid.But this type of controller also has complications.One of the complications of the FOPID controller that may directly affect the frequency stability of the islanded microgrid is the fractional parameters of this controller.Therefore, correct setting of these parameters is very important.
Cascaded controllers that consist of both PID and FOPID components have many advantages over single PID and FOPID controllers.These controllers (cascaded controllers) respond quickly to system changes and provide optimal performance.Also, this type of controller is compatible with complex systems such as islanded microgrids [43][44][45].Cascaded controllers have been used to improve frequency control in islanded microgrids and power systems [43][44][45].In [43], the FOPI-FOPD cascade controller, with its parameters optimized using the DSA, was employed to enhance frequency control in power systems.In [44], the PI-TID cascade controller, with its parameters tuned using the chaotic BOT, was used to improve frequency control in islanded microgrids.In [45], the PI-FOPID cascade controller, with its parameters optimized using the GTO, was applied to enhance frequency control in islanded microgrids.According to the findings of the control methods [43][44][45], the cascaded controller has the ability to maintain the frequency stability of the islanded microgrid.This controller is very resistant to disruptions on the islanded microgrid.It also has the ability to maintain the frequency stability of the islanded microgrid in the presence of uncertainties.
In this paper, a new method called the PD-FOPID cascaded controller is proposed to improve the performance of VIC in islanded microgrids.The parameters of the controller are optimized using the FA.The reason for using the PD-FOPID cascade controller over other cascade controllers, like PI-FOPID, in the structure of VIC is that the mentioned controller, with the inclusion of the PD element, provides a more accurate and faster response to frequency variations in islanded microgrids.This leads to the improved performance of VIC against load disturbances, renewable energy source fluctuations, and uncertainties related to the parameters of the microgrid.In the VIC structure, the FA is used to optimize the cascaded controller's settings.Compared to other metaheuristic algorithms like GA, PSO, ABC, and GWO, this method provides a number of benefits, including greater accuracy, quicker convergence, less parameter needs, and the capacity to enhance solutions.
The paper's innovations and contributions might be summed up as follows: 1.
Using PD-FOPID cascaded controllers improved virtual inertia and frequency responsiveness in islanded microgrids.

2.
Employing an FA, which has not before been used in the context of VIC in islanded microgrid architectures, to optimize the suggested controller settings (PD-FOPID).Performance testing of the FA-PD-FOPID suggested controller to enhance VIC performance against disturbances and uncertainties in islanded microgrid parameters.
The continuation of the paper is categorized into several sections: Section 2 discusses the studied islanded microgrid.Section 3 focuses on the design of the proposed controller for achieving desirable virtual inertia control in the islanded microgrid structure.Section 4 presents simulation results and discussions.Finally, Section 5 provides the conclusion 2.

Studied Islanded Microgrid
In this section, the components of the studied islanded microgrid, the dynamic model of the islanded microgrid, and VIC on the islanded microgrid are discussed.

Components of the Studied Islanded Microgrid
The researched islanded microgrid's structure is depicted in Figure 1 [17].A thermal power plant with a capacity of 12 MW, a wind turbine with a capacity of 7 MW, a photovoltaic system with a capacity of 9 MW, residential loads with a capacity of 15 MW, and an energy storage system (ESS) with a capacity of 4 MW are some of the parts that make up the islanded microgrid.The islanded microgrid has a base power of 12 MW [17].In the load-frequency control system of the islanded microgrid, VIC is implemented on ESS, and it is anticipated to function as a compensator for balancing generation and consumption [17].
2. Employing an FA, which has not before been used in the context of VIC in isla microgrid architectures, to optimize the suggested controller settings (PD-FOP 3. Performance evaluation of the suggested approach in relation to GA, PSO, ABC GWO algorithms for PD-FOPID controller parameter optimization, taking account IAE and ITAE objective functions.4. Performance testing of the FA-PD-FOPID suggested controller to enhance performance against disturbances and uncertainties in islanded micr parameters.
The continuation of the paper is categorized into several sections: Section 2 disc the studied islanded microgrid.Section 3 focuses on the design of the proposed con for achieving desirable virtual inertia control in the islanded microgrid structure.S 4 presents simulation results and discussions.Finally, Section 5 provides the conclus

Studied Islanded Microgrid
In this section, the components of the studied islanded microgrid, the dynamic m of the islanded microgrid, and VIC on the islanded microgrid are discussed.

Components of the Studied Islanded Microgrid
The researched islanded microgrid's structure is depicted in Figure 1 [17].A th power plant with a capacity of 12 MW, a wind turbine with a capacity of 7 M photovoltaic system with a capacity of 9 MW, residential loads with a capacity of 15 and an energy storage system (ESS) with a capacity of 4 MW are some of the part make up the islanded microgrid.The islanded microgrid has a base power of 12 MW In the load-frequency control system of the islanded microgrid, VIC is implement ESS, and it is anticipated to function as a compensator for balancing generatio consumption [17].for frequency regulation in the dynamic model of the microgrid: three control loops: VIC loop, SC loop, and PC loop.A droop coefficient of 1/R is included in the main control loop [18][19][20].The SC loop consists of a control error system with a control gain K I and an integral controller [21].A first-order transferring function with damping constant D and inertia H, which is frequently employed in electrical systems for frequency regulation, is utilized to balance the system in the islanded microgrid.Wind turbines and photovoltaic systems are two examples of renewable energy sources that are modeled as first-order transfer functions with random inputs [21].According to Figure 2a, the proposed controller (FA-PD-FOPID) is used in the VIC structure to improve the inertia of the islanded microgrid and enhance frequency stability.The parameters related to the islanded microgrid are shown in Table 1 [17].

The Dynamic Model for Studying the Frequency Response (FR) of the Islanded Microgrid
Figure 2a depicts the dynamic model for analyzing the FR of the islanded microgrid's [18][19][20].The thermal power plant has a limiter-equipped turbine and a dead-band governor.The steam valve's lowest and maximum opening and closing speeds are represented by VL and Vu, respectively [18][19][20].A hierarchical control structure is utilized for frequency regulation in the dynamic model of the microgrid: three control loops: VIC loop, SC loop, and PC loop.A droop coefficient of 1/R is included in the main control loop [18][19][20].The SC loop consists of a control error system with a control gain KI and an integral controller [21].A first-order transferring function with damping constant D and inertia H, which is frequently employed in electrical systems for frequency regulation, is utilized to balance the system in the islanded microgrid.Wind turbines and photovoltaic systems are two examples of renewable energy sources that are modeled as first-order transfer functions with random inputs [21].According to Figure 2a, the proposed controller (FA-PD-FOPID) is used in the VIC structure to improve the inertia of the islanded microgrid and enhance frequency stability.The parameters related to the islanded microgrid are shown in Table 1

VIC on the Islanded Microgrid
The objective of designing a VIC system is to provide the appropriate virtual inertia in microgrids that possess vast distributed generation resources.Since this microgrid does not possess adequate inertia in comparison to power systems, this control section operates as a separate control section to maintain microgrid frequency stability in the transient [17][18][19][20].In Figure 2b, the dynamic model (microgrid) of VIC is shown.VIC is a derivative control in which the frequency variation rate is added as the additional active power to the reference microgrid during disturbances and incidents acting on the microgrid.The derivative control, which is highly sensitive to the frequency measurement noises, uses a low-pass filter to solve this problem.The low-pass filter simulates the behavior of an ESS [17][18][19][20].Therefore, VIC prevents microgrid frequency instability and improves microgrid inertia and damping.The maximum capacity of the ESS, P inertia,max , (charging power) is 0/25 pu and the minimum capacity of the ESS, P inertia,min , (discharging power) is −0/25 pu [17][18][19][20].

Design of the Proposed Controller for Desired Performance of VIC in the Islanded Microgrid Structure
In this section, the structure of the proposed controller, the analysis of the FA, and the design of the proposed controller using the FA are discussed.

Proposed Controller
The cascaded PD-FOPID controller is intended to decrease frequency deviations caused by disruptions and uncertainties in system parameters in the VIC structure, as well as to increase the inertia of the islanded microgrid.The output of the PD controller controls the set-point of the FOPID controller, which is one of two controllers that make up the proposed controller.The PD controller is regarded as the primary or external controller in the proposed controller, while the FOPID controller is regarded as the secondary or internal controller.The suggested PD-FOPID controller for VIC in the islanded microgrid is shown in Figure 3 as having the following structure.The inner loop's transfer function is shown in Figure 3, to be represented by Equation (1).
Energies 2023, 16, x FOR PEER REVIEW 7 of 24 In Figure B (s), B (s), A (s) and A (s) are, respectively, shown by Equations ( 3)-( 6) In Figure 3, B 1 (s), B 2 (s), A 1 (s) and A 2 (s) are, respectively, shown by Equations ( 3)-( 6) The suggested controller's whole internal structure is seen in Figure 4.The proposed controller parameters were obtained by minimizing two objective functions, IAE and ITAE, using FA.The objective functions IAE and ITAE are shown using Equations ( 7) and ( 8), respectively.The constraints of objective functions are demonstrated using Equation (9).7) and ( 8), respectively.The constraints of objective functions are demonstrated using Equation (9).

Firefly Algorithm (FA)
A Firefly Calculation is an optimization calculation propelled by the characteristic behavior of fireflies [46].This algorithm is widely used for solving optimization problems and conducting extensive searches in search spaces.The main advantage of the Firefly Algorithm over other algorithms such as GA, PSO, ABC, and GWO is its faster and more powerful performance [46,47].Due to its use of simple and effective methods, the FA is capable of quickly approaching near-optimal solutions [48].Additionally, this algorithm has the ability to converge to the optimal solution and generally provides the best results in less time [48].This algorithm has the ability to adapt to complex problems and can effectively work on multi-objective optimization problems and problems with complex search spaces [46][47][48].Overall, the FA is recognized as a powerful method for solving optimization problems, combining speed, convergence, and adaptability [49].The abovedescribed FA employs fireflies as nature-based interacting agents [49].The following guidelines form the foundation of the algorithm [46][47][48][49]: A. Because the fireflies are unisex, they are drawn to one another.B. The brightness of the firefly affects how beautiful they are.As a result, fireflies are drawn to higher levels of brightness and travel accordingly.The relationship between distance and brightness is inverse.
C: The value of the objective function is represented by the brightness level.Equation (10) expresses the firefly's attraction β as a function of distance (r) [46][47][48][49]: where γ is the constant light absorption coefficient and β 0 is the attraction at r = 0.The Euclidean distance is used to calculate the distance between any two fireflies (Equation ( 11)) [46][47][48][49].

Designing the Proposed Controller Using the Firefly Algorithm
Optimizing the control parameters of the PD-FOPID controller in the VIC structure of an islanded microgrid using the FA involves several stages: 1.
Initialize β 0 , γ, α, and scale: These are parameters used in the algorithm.β 0 represents the initial attractiveness, γ represents the absorption coefficient, α represents the randomization parameter, and scale is used to scale the controller parameters.

2.
Generate an initial population of fireflies x i : This step creates an initial set of fireflies with their respective PD-FOPID controller parameters.The number of fireflies is determined by the variable "no_of_fireflies".

3.
Evaluate the objective function of fireflies f(x): The objective function is evaluated for each firefly based on the Integral of Absolute Error (IAE) or Integral of Timeweighted Absolute Error (ITAE).This function measures the performance of the firefly's controller parameters.4.
Determine the light intensity I i at x i : The light intensity of each firefly is determined based on the evaluation of the objective function.The higher the light intensity, the better the performance of the firefly.

5.
Rank the fireflies based on their light intensity: the fireflies are ranked based on their light intensity, with the best solution (firefly) and its corresponding light intensity being stored.6.
While loop: this loop continues until the maximum number of iterations (maximum Iteration) is reached.7.
For loop (i): this loop iterates over each firefly in the population.8.
For loop (j): this nested loop iterates over each firefly in the population again.9.
Calculate the distance r ij : The distance between firefly i and firefly j is calculated.This distance is used to determine the attractiveness between fireflies.10.Move firefly i towards j: If the light intensity of firefly j is greater than the light intensity of firefly i, firefly i is moved towards firefly j.This movement is based on the attractiveness β(r) and the movement of fireflies.11.Evaluate new solutions and their light intensity: After the movement of fireflies, the objective function is evaluated again for the new solutions.The light intensity of each firefly is updated accordingly.12. End of nested loop (j).13.End of loop (i).14.Rank the fireflies and update the best solution: After the nested loops, the fireflies are ranked again based on their updated light intensity.The best solution (firefly) and its corresponding light intensity are updated if a better solution is found.15.End of while loop.
In Figure 5, the process of optimizing the parameters of the PD-FOPID controller in the VIC structure of the islanded microgrid using the FA is illustrated.

Simulation Results and Discussion
In this section, the islanded microgrid has been simulated under four different scenarios.Scenario (1) consists of two parts: the first part evaluates the performance and convergence of the FA in optimizing the PD-FOPID controller parameters and compares it with GA, PSO, ABC, and GWO algorithms.In the second part, the proposed FA-PD-FOPID controller is compared with several methods, including VIC based on MPC controller, VIC based on H-infinite controller, adaptive VIC controller, VIC based on optimized PI controller, VIC, and No VIC in the islanded microgrid under load disruptions.In scenario (2), the proposed method is compared with other methods (VIC based on MPC controller, VIC based on H-infinite controller, adaptive VIC controller, VIC based on optimized PI controller, VIC, and No VIC in the islanded microgrid) in terms of performance against load disruptions and uncertainties in the parameters of the islanded microgrid.In scenario (3), the proposed method is compared with the mentioned methods in terms of performance against load disruptions, renewable energy source disruptions (photovoltaic, wind turbine), and slight uncertainties in the parameters of the islanded microgrid.In scenario (4), the proposed method is compared with the mentioned methods in terms of performance against load disruptions, renewable energy source disruptions (photovoltaic, wind turbine), and severe uncertainties in the parameters of the islanded microgrid [50].

Scenario (1)
In this scenario, a disruption with a size of ΔPL = 0.1 pu is connected to the islanded microgrid at t = 1 s, as shown in Figure 6.The initial parameters for the FA and the Cascaded PD-FOPID controller are presented in Table 2. Figure 7 illustrates the convergence of the FA, ABC, GWO, GA, and PSO algorithms in optimizing the PD-FOPID controller parameters, considering the IAE as the objective function.According to Figure 7, the FA algorithm exhibits faster convergence, and the IAE values for FA, GWO, GA, ABC, and PSO algorithms are 0.0021, 0.0027, 0.0028, 0.0033, and 0.0036, respectively.Table 3 presents the optimized parameters for the PD-FOPID controller using the FA, GWO, GA, ABC, and PSO algorithms, considering the IAE and ITAE as the objective functions.

Simulation Results and Discussion
In this section, the islanded microgrid has been simulated under four different scenarios.Scenario (1) consists of two parts: the first part evaluates the performance and convergence of the FA in optimizing the PD-FOPID controller parameters and compares it with GA, PSO, ABC, and GWO algorithms.In the second part, the proposed FA-PD-FOPID controller is compared with several methods, including VIC based on MPC controller, VIC based on H-infinite controller, adaptive VIC controller, VIC based on optimized PI controller, VIC, and No VIC in the islanded microgrid under load disruptions.In scenario (2), the proposed method is compared with other methods (VIC based on MPC controller, VIC based on H-infinite controller, adaptive VIC controller, VIC based on optimized PI controller, VIC, and No VIC in the islanded microgrid) in terms of performance against load disruptions and uncertainties in the parameters of the islanded microgrid.In scenario (3), the proposed method is compared with the mentioned methods in terms of performance against load disruptions, renewable energy source disruptions (photovoltaic, wind turbine), and slight uncertainties in the parameters of the islanded microgrid.In scenario (4), the proposed method is compared with the mentioned methods in terms of performance against load disruptions, renewable energy source disruptions (photovoltaic, wind turbine), and severe uncertainties in the parameters of the islanded microgrid [50].

Scenario (1)
In this scenario, a disruption with a size of ∆P L = 0.1 pu is connected to the islanded microgrid at t = 1 s, as shown in Figure 6.The initial parameters for the FA and the Cascaded PD-FOPID controller are presented in Table 2. Figure 7 illustrates the convergence of the FA, ABC, GWO, GA, and PSO algorithms in optimizing the PD-FOPID controller parameters, considering the IAE as the objective function.According to Figure 7, the FA algorithm exhibits faster convergence, and the IAE values for FA, GWO, GA, ABC, and PSO algorithms are 0.0021, 0.0027, 0.0028, 0.0033, and 0.0036, respectively.Table 3 presents the optimized parameters for the PD-FOPID controller using the FA, GWO, GA, ABC, and PSO algorithms, considering the IAE and ITAE as the objective functions.Therefore, based on Figure 7 and Table 3, the FA will be utilized for optimizing the PD-FOPID controller parameters.As mentioned in this scenario, a disruption with the waveform shown in Figure 6 is applied to the islanded microgrid.In Figure 8, the applied signal by the proposed controller to the islanded microgrid is illustrated.Figure 9a,b depicts the FR of the islanded microgrid using diverse control strategies.The results of the various control methods for Scenario (1) are presented in Table 4.According to Table 4, the maximum frequency deviation and settling time associated with frequency deviation using the proposed method (VIC based on FA-PD-FOPID controller) are 0.0058 Hz and 0.15 s, respectively.The maximum frequency deviation and settling time using VIC based on a H-infinite controller are 0.039 Hz and 0.54 s, respectively.The maximum frequency deviation and settling time using VIC based on an MPC controller are 0.076 Hz and 14.62 s, respectively.The maximum frequency deviation and settling time using the Adaptive VIC controller are 0.12 Hz and 24.66 s, respectively.The maximum frequency deviation and settling time using VIC based on an optimized PI controller are 0.18 Hz and 17.79 s, respectively.The maximum frequency deviation and settling time using the VIC method are 0.25 Hz and 26.41 s, respectively.The maximum frequency deviation and settling time without using any VIC method are 0.34 Hz and 21.55 s, respectively.According to the results of Scenario (1), the proposed method has demonstrated satisfactory performance compared to other employed methods in mitigating the effects of load disturbances, significantly reducing frequency deviations caused by load disruption.Additionally, the settling time associated with frequency deviations caused by load disruption has been accelerated using the proposed method.Therefore, based on Figure 7 and Table 3, the FA will be utilized for optimizing the PD-FOPID controller parameters.As mentioned in this scenario, a disruption with the waveform shown in Figure 6 is applied to the islanded microgrid.In Figure 8, the applied signal by the proposed controller to the islanded microgrid is illustrated.Figure 9a,b depicts the FR of the islanded microgrid using diverse control strategies.The results of the various control methods for Scenario (1) are presented in Table 4.According to Table 4, the maximum frequency deviation and settling time associated with frequency deviation using the proposed method (VIC based on FA-PD-FOPID controller) are 0.0058 Hz and 0.15 s, respectively.The maximum frequency deviation and settling time using VIC based on a H-infinite controller are 0.039 Hz and 0.54 s, respectively.The maximum frequency deviation and settling time using VIC based on an MPC controller are 0.076 Hz and 14.62 s, respectively.The maximum frequency deviation and settling time using the Adaptive VIC controller are 0.12 Hz and 24.66 s, respectively.The maximum frequency deviation and settling time using VIC based on an optimized PI controller are 0.18 Hz and 17.79 s, respectively.The maximum frequency deviation and settling time using the VIC method are 0.25 Hz and 26.41 s, respectively.The maximum frequency deviation and settling time without using any VIC method are 0.34 Hz and 21.55 s, respectively.
According to the results of Scenario ( 1), the proposed method has demonstrated satisfactory performance compared to other employed methods in mitigating the effects of load disturbances, significantly reducing frequency deviations caused by load disruption.Additionally, the settling time associated with frequency deviations caused by load disruption has been accelerated using the proposed method.

Scenario (2)
In this scenario, a load disruption has been introduced to the islanded microgrid, taking into account the uncertainty associated with the microgrid parameters (H = −50%).In Figure 10, the applied signal by the proposed controller to the islanded microgrid is illustrated.Figure 11a,b depicts the FR of the islanded microgrid using diverse control strategies.The results of the diverse control strategies for scenario (2) are shown in Table 5.According to Table 5, the maximum frequency deviation and settling time using the proposed method (VIC based on FA-PD-FOPID controller) are 0.007 Hz and 0.17 s, respectively.The maximum frequency deviation and settling time using VIC based on a H-infinite controller are 0.054 Hz and 0.78 s, respectively.The maximum frequency deviation and settling time using VIC based on an MPC controller are 0.11 Hz and 24.02 s, respectively.The maximum frequency deviation and settling time using the Adaptive VIC controller are 0.148 Hz and 25.78 s, respectively.The maximum frequency deviation and settling time using VIC based on optimized PI controller are 0.20 Hz and 21.47 s, respectively.The maximum frequency deviation and settling time using VIC are 0.37 Hz and 29.82 s, respectively.The maximum frequency deviation and settling time using the No VIC method are 0.44 Hz and 22.94 s, respectively.According to the results of scenario (2), the proposed method has shown desirable performance compared to other employed methods in the face of disruptions and uncertainties related to system parameters, significantly reducing frequency deviations caused by load disruptions.Additionally, the settling time associated with frequency deviations caused by load disruptions and uncertainties in system parameters has been accelerated using the proposed method.
deviation and settling time using VIC based on an MPC controller are 0.11 Hz and 24.02 s, respectively.The maximum frequency deviation and settling time using the Adaptive VIC controller are 0.148 Hz and 25.78 s, respectively.The maximum frequency deviation and settling time using VIC based on optimized PI controller are 0.20 Hz and 21.47 s, respectively.The maximum frequency deviation and settling time using VIC are 0.37 Hz and 29.82 s, respectively.The maximum frequency deviation and settling time using the No VIC method are 0.44 Hz and 22.94 s, respectively.According to the results of scenario (2), the proposed method has shown desirable performance compared to other employed methods in the face of disruptions and uncertainties related to system parameters, significantly reducing frequency deviations caused by load disruptions.Additionally, the settling time associated with frequency deviations caused by load disruptions and uncertainties in system parameters has been accelerated using the proposed method.In this scenario, the load disruptions and renewable energy sources disruptions are applied to the microgrid as shown in Figure 12.In this scenario, a slight uncertainty (H = −5%) is also considered for the microgrid parameters.In Figure 13, the applied signal by the proposed controller to the islanded microgrid is illustrated.In Figure 14a-c, the FR of the microgrid using diverse control strategies is shown.The results of the diverse control strategies for scenario (3) are presented in Table 6.According to Table 6, the maximum frequency deviation using the proposed method (VIC based on FA-PD-FOPID controller) is 0.0007 Hz.The maximum frequency deviation using VIC based on a H-infinite controller is 0.051 Hz.The maximum frequency deviation using VIC based on an MPC controller is 0.263 Hz.The maximum frequency deviation using the Adaptive VIC controller is 0.328 Hz.The maximum frequency deviation using VIC based on an optimized PI controller is 0.394 Hz.The maximum frequency deviation using VIC is 0.715 Hz.The maximum frequency deviation without VIC is 0.804 Hz.According to the results of scenario (3), the proposed method has performed well compared to other methods in mitigating the frequency deviations caused by load disruptions, renewable energy source disruptions, and slight uncertainty in system parameters.

2023, 16, x FOR PEER REVIEW 17 of 24
In this scenario, the load disruptions and renewable energy sources disruptions are applied to the microgrid as shown in Figure 12.In this scenario, a slight uncertainty (H = −5%) is also considered for the microgrid parameters.In Figure 13, the applied signal by the proposed controller to the islanded microgrid is illustrated.In Figure 14a-c, the FR of the microgrid using diverse control strategies is shown.The results of the diverse control strategies for scenario (3) are presented in Table 6.According to Table 6, the maximum frequency deviation using the proposed method (VIC based on FA-PD-FOPID controller) is 0.0007 Hz.The maximum frequency deviation using VIC based on a H-infinite controller is 0.051 Hz.The maximum frequency deviation using VIC based on an MPC controller is 0.263 Hz.The maximum frequency deviation using the Adaptive VIC controller is 0.328 Hz.The maximum frequency deviation using VIC based on an optimized PI controller is 0.394 Hz.The maximum frequency deviation using VIC is 0.715 Hz.The maximum frequency deviation without VIC is 0.804 Hz.According to the results of scenario (3), the proposed method has performed well compared to other methods in mitigating the frequency deviations caused by load disruptions, renewable energy source disruptions, and slight uncertainty in system parameters.The FR of the islanded microgrid using diverse control strategies, Scenario (3).(c).The FR of the islanded microgrid using the proposed method, Scenario (3).In this scenario, the load disruptions and renewable energy source disruptions are applied to the microgrid as shown in Figure 12.In this scenario, significant uncertainty in the microgrid parameters ((Tg = +50%, H = −85%, Tt = +90%) is also considered.In Figure 15, the applied signal by the proposed controller to the islanded microgrid is illustrated.In Figure 16a-c, the FR of the microgrid using diverse control strategies is depicted.The results of diverse control strategies for scenario (4) are shown in Table 7.According to Table 7, the maximum frequency deviation using the proposed method (VIC based on FA-PD-FOPID controller) is 0.0008 Hz.The maximum frequency deviation using VIC based on a H-infinite controller is 0.062 Hz.The maximum frequency deviation using VIC based on an MPC controller is 0.44 Hz.The maximum frequency deviation using the Adaptive VIC controller is 0.49 Hz.The maximum frequency deviation using VIC based on an optimized PI controller is 0.71 Hz.The maximum frequency deviation using VIC is 2.2 Hz.The maximum frequency deviation without VIC is 2.6 Hz.According to the results of scenario (4), the proposed method has shown a desirable performance compared to other employed methods against load disruptions, renewable energy sources disruptions, and significant uncertainty in system parameters, significantly reducing frequency deviations caused by load disruptions.It worth noting that the different dynamic and impedance characterizes of the inverter-based resources such as BESSs demand new protection schemes [50], which have not been elaborated in this work.In this scenario, the load disruptions and renewable energy source disruptions are applied to the microgrid as shown in Figure 12.In this scenario, significant uncertainty in the microgrid parameters ((Tg = +50%, H = −85%, Tt = +90%) is also considered.In Figure 15, the applied signal by the proposed controller to the islanded microgrid is illustrated.In Figure 16a-c, the FR of the microgrid using diverse control strategies is depicted.The results of diverse control strategies for scenario (4) are shown in Table 7.According to Table 7, the maximum frequency deviation using the proposed method (VIC based on FA-PD-FOPID controller) is 0.0008 Hz.The maximum frequency deviation using VIC based on a H-infinite controller is 0.062 Hz.The maximum frequency deviation using VIC based on an MPC controller is 0.44 Hz.The maximum frequency deviation using the Adaptive VIC controller is 0.49 Hz.The maximum frequency deviation using VIC based on an optimized PI controller is 0.71 Hz.The maximum frequency deviation using VIC is 2.2 Hz.The maximum frequency deviation without VIC is 2.6 Hz.According to the results of scenario (4), the proposed method has shown a desirable performance compared to other employed methods against load disruptions, renewable energy sources disruptions, and significant uncertainty in system parameters, significantly reducing frequency deviations caused by load disruptions.It worth noting that the different dynamic and impedance characterizes of the inverter-based resources such as BESSs demand new protection schemes [50], which have not been elaborated in this work.The FR of the islanded microgrid using diverse control strategies, Scenario (4).(c).The FR of the islanded microgrid using the proposed method, Scenario (4).

Conclusions
In this paper, a new and robust method was designed for the BESS to improve the performance of VIC against disruptions and uncertainties related to system parameters.The proposed controller is called the PD-FOPID cascade controller, and its parameters have been optimized using the FA.First, the performance of the FA has been compared with GA, PSO, ABC, and GWO algorithms in optimizing the parameters of the PD-FOPID cascaded controller.Then, the proposed control method (FA-PD-FOPID) was compared with VIC based on a H-infinite controller, VIC based on an MPC controller, the Adaptive VIC controller, VIC based on an optimized PI controller, VIC, and No VIC methods, and it has the following advantages over other control methods: improvement of islanded microgrid inertia in the presence of wind turbines and photovoltaics, reduction in the maximum frequency deviation of the islanded microgrid in the presence of load disruptions by 80% compared to other control methods, reduction in the settling time related to the frequency deviation of the islanded microgrid in the presence of load disruptions by 73% compared to other control methods, reduction in the maximum frequency deviation of the islanded microgrid in the presence of load disruptions and uncertainties in system parameters by 87% compared to other control methods, reduction in the settling time related to the frequency deviation of the islanded microgrid in the presence of load disruptions and uncertainties in system parameters by 79% compared to The FR of the islanded microgrid using diverse control strategies, Scenario (4).(c).The FR of the islanded microgrid using the proposed method, Scenario (4).

Conclusions
In this paper, a new and robust method was designed for the BESS to improve the performance of VIC against disruptions and uncertainties related to system parameters.The proposed controller is called the PD-FOPID cascade controller, and its parameters have been optimized using the FA.First, the performance of the FA has been compared with GA, PSO, ABC, and GWO algorithms in optimizing the parameters of the PD-FOPID cascaded controller.Then, the proposed control method (FA-PD-FOPID) was compared with VIC based on a H-infinite controller, VIC based on an MPC controller, the Adaptive VIC controller, VIC based on an optimized PI controller, VIC, and No VIC methods, and it has the following advantages over other control methods: improvement of islanded microgrid inertia in the presence of wind turbines and photovoltaics, reduction in the maximum frequency deviation of the islanded microgrid in the presence of load disruptions by 80% compared to other control methods, reduction in the settling time related to the frequency deviation of the islanded microgrid in the presence of load disruptions by 73% compared to other control methods, reduction in the maximum frequency deviation of the islanded microgrid in the presence of load disruptions and uncertainties in system parameters by 87% compared to other control methods, reduction in the settling time related to the frequency deviation of the islanded microgrid in the presence of load disruptions and uncertainties in system parameters by 79% compared to other control methods, reduction in the maximum frequency deviation of the islanded microgrid in the presence of load

2. 2 .
Figure2adepicts the dynamic model for analyzing the FR of the islanded microgrid's[18][19][20].The thermal power plant has a limiter-equipped turbine and a dead-band governor.The steam valve's lowest and maximum opening and closing speeds are represented by V L and V u , respectively[18][19][20].A hierarchical control structure is utilized
Figure2adepicts the dynamic model for analyzing the FR of the islanded microgrid's[18][19][20].The thermal power plant has a limiter-equipped turbine and a dead-band governor.The steam valve's lowest and maximum opening and closing speeds are represented by VL and Vu, respectively[18][19][20].A hierarchical control structure is utilized for frequency regulation in the dynamic model of the microgrid: three control loops: VIC loop, SC loop, and PC loop.A droop coefficient of 1/R is included in the main control loop[18][19][20].The SC loop consists of a control error system with a control gain KI and an integral controller[21].A first-order transferring function with damping constant D and inertia H, which is frequently employed in electrical systems for frequency regulation, is utilized to balance the system in the islanded microgrid.Wind turbines and photovoltaic systems are two examples of renewable energy sources that are modeled as first-order transfer functions with random inputs[21].According to Figure2a, the proposed controller (FA-PD-FOPID) is used in the VIC structure to improve the inertia of the islanded microgrid and enhance frequency stability.The parameters related to the islanded microgrid are shown in Table1[17].

Figure 3 .
Figure 3.The suggested PD-FOPID controller for VIC in the islanded microgrid.

2 2 2 Y
(s)=A (s)U (s) (1) A2(s) denotes the internal process' transfer function in Equation (1), and U2(s) is the process' input signal.Equation (2) depicts the outer loop's transfer function.A1(s) in Equation (2) stands for the inner loop's output, and U1(s) for the reference signal.According to Figure 3, the PD controller is represented by B1(s) in the outer layer and the FOPID controller by B2(s) in the inner layer.

Figure 3 .
Figure 3.The suggested PD-FOPID controller for VIC in the islanded microgrid.A 2 (s) denotes the internal process' transfer function in Equation (1), and U 2 (s) is the process' input signal.Equation (2) depicts the outer loop's transfer function.A 1 (s) in Equation (2) stands for the inner loop's output, and U 1 (s) for the reference signal.According to Figure 3, the PD controller is represented by B 1 (s) in the outer layer and the FOPID controller by B 2 (s) in the inner layer.

Figure 4 .
Figure 4.The suggested controller's whole internal structure.

Figure 4 .
Figure 4.The suggested controller's whole internal structure.The proposed controller parameters were obtained by minimizing two objective functions, IAE and ITAE, using FA.The objective functions IAE and ITAE are shown using

Figure 5 .
Figure 5.The process of optimizing the parameters of the PD-FOPID controller.

Figure 5 .
Figure 5.The process of optimizing the parameters of the PD-FOPID controller.

Figure 6 .
Figure 6.The disruption is applied to the islanded microgrid.Figure 6.The disruption is applied to the islanded microgrid.

Figure 6 .
Figure 6.The disruption is applied to the islanded microgrid.Figure 6.The disruption is applied to the islanded microgrid.

Figure 7 .Table 2 .
Figure 7.The convergence of the FA, GA, ABC, GWO, and PSO algorithms in optimizing the PD-FOPID controller parameters, considering IAE as the objective function.

Figure 7 .
Figure 7.The convergence of the FA, GA, ABC, GWO, and PSO algorithms in optimizing the PD-FOPID controller parameters, considering IAE as the objective function.

Figure 7 .
Figure 7.The convergence of the FA, GA, ABC, GWO, and PSO algorithms in optimizing the PD-FOPID controller parameters, considering IAE as the objective function.

Figure 8 .
Figure 8.The applied signal by the proposed controller to the islanded microgrid, Scenario (1).

Figure 10 .
Figure 10.The applied signal by the proposed controller to the islanded microgrid, Scenario (2).

Figure 10 .
Figure 10.The applied signal by the proposed controller to the islanded microgrid, Scenario (2).

Figure 12 .
Figure 12.The load disruptions and renewable energy source disruptions are applied to the microgrid.

Figure 12 . 22 Figure 12 .
Figure 12.The load disruptions and renewable energy source disruptions are applied to the microgrid.

Figure 13 .
Figure 13.The applied signal by the proposed controller to the islanded microgrid, Scenario (3).

Figure 13 .
Figure 13.The applied signal by the proposed controller to the islanded microgrid, Scenario (3).

Figure 15 .
Figure 15.The applied signal by the proposed controller to the islanded microgrid, Scenario (4).

Figure 15 .
Figure 15.The applied signal by the proposed controller to the islanded microgrid, Scenario (4).

Table 1 .
The parameters related to the islanded microgrid.

Table 2 .
The initial parameters for the FA and the Cascaded PD-FOPID controller.

Table 3 .
The optimized parameters for the PD-FOPID controller using the FA, GWO, GA, ABC, and PSO algorithms.

Table 3 .
The optimized parameters for the PD-FOPID controller using the FA, GWO, GA, ABC, and PSO algorithms.

Table 2 .
The initial parameters for the FA and the Cascaded PD-FOPID controller.

Table 4 .
The maximum frequency deviation and settling time associated with frequency deviation utilizing the diverse control strategies, Scenario (1).

Table 4 .
The maximum frequency deviation and settling time associated with frequency deviation utilizing the diverse control strategies, Scenario (1).

Table 5 .
The maximum frequency deviation and settling time associated with frequency deviation using diverse control strategies, Scenario (1).

Table 5 .
The maximum frequency deviation and settling time associated with frequency deviation using diverse control strategies, Scenario (1).

Table 6 .
The maximum frequency deviation using diverse control strategies, Scenario (3).

Table 6 .
The maximum frequency deviation using diverse control strategies, Scenario (3).

Table 7 .
The maximum frequency deviation using the different control methods, Scenario (4).

Table 7 .
The maximum frequency deviation using the different control methods, Scenario (4).