Frequency Regulation of Interlinked Microgrid System Using Mayﬂy Algorithm-Based PID Controller

: The primary goal of this article is to design and implement a secondary controller with which to control the system frequency in a networked microgrid system. The proposed power system comprises of Renewable energy sources (RESs), energy-storing units (ESUs), and synchronous generator. RESs include photovoltaic (PV) and wind turbine generator (WTG) units. The ESU is composed of a ﬂywheel and a battery. Because renewable energy sources are not constant in nature, their values ﬂuctuate from time to time, causing an effect on system frequency and power ﬂow variation in the tie line. The nonlinear output from the RESs is balanced with the support of ESUs. In order to address this situation, a proportional integral derivative (PID) controller based on the Mayﬂy algorithm (MA) is proposed and built. Comparing the responses of controllers based on the genetic algorithm (GA), differential evolution (DE), and particle swarm optimization (PSO) technique-optimized to demonstrate the superiority of the MA-tuned controller.. The results of the validation comparisons reveal that the implemented MA-PID controller delivers and is capable of regulating system frequency under various load demand changes and renewable energy sources. A robustness analysis test was also performed in order to determine the effectiveness of the suggested optimization technique (1%, 2%, 5%, and 10%) step load perturbation (SLP) with ± 25% and ± 50% variation from the nominal governor and reheater time constant).


Introduction
The installation of renewable energy sources addresses the problems caused by conventional energy sources in the environment during electric power generation and the matching of sudden load-demand situations. Pollution (air, water, and noise) and global warming are major issues for the environment, and one source of pollution is electric power generation. The traditional techniques of generating electricity cause environmental degradation. In order to reduce pollution, RESs (solar and wind power plants) are being introduced into the power generation sector. One of the key causes for the penetration of RESs is the shortage of fossil fuels. The inclusion of RESs is a difficult undertaking because RESs are typically nonlinear power-generation sources. When incorporating RESs into the electricity grid, numerous quality challenges arise-notably, the oscillation of system frequency. In order to overcome this crisis, the load frequency control (LFC) method is used to maintain frequency standards in the power system, and a secondary controller must be implemented into the scheme in order to preserve frequency stability [1][2][3]. In particular, the secondary controller maintains the frequency stands and important parameters within in [20], the performance of a hybrid microgrid was investigated by ACO-PID controller, and its performance was compared with that of the conventional method PID controller. In the work of [21], a wind power-based hybrid power system with a moth swarm algorithmbased PID controller was examined for LFC, and this study was extended to with/without SMES performance analysis. In the work of [22], the MA-PID controller was implemented in a standalone power network as a tributary controller. The superiority of the Mayfly algorithm was justified by the result comparison of the GA and PSO techniques. The Mayfly algorithm was used in a variety of applications, including proton exchange membrane fuel cell modelling [23,24]. In the work of [25], MPC was used to forecast the microgrid. The author in [26] used the WHO approach to maintain voltage stability in the power supply. In [27], ANN was used to improve the stability of a wind-farm-integrated power grid. In [28] author used hPSO and GWO to analyse the performance of a PV panel.
The response of a multimicrogrid was evaluated by the atom search optimization (ASO)-adjusted PID controller, and the results were compared with GA and PSO-PID controllers by the author in [29]. In the work presented in [30], the Ziegler-Nichols approachtuned PID controller was used as a subordinate controller for a stand-alone microgrid system including with wind farm and an MPPT-based solar plant. The SSO-FPID controller developed in [31] was used for the LFC of a microgrid made up of solar PV, wind turbine, biogas, and biodiesel units, to regulate system frequency. Its performance was superior to that of a traditional PID controller. In the work of [32], the author constructed a PID controller tuned by the Honey Badger Algorithm (HBA) for a microgrid that included PV, wind turbine, biogas, and biodiesel units. A law-based sliding mode controller was constructed for the LFC of a microgrid (wind/hydrogen/battery DC microgrid), and a comparison study demonstrated the dominance of the proposed controller [33]. In retime the renewable energy sources are installed in many places, for example, in Nepal, 3 kW [34] and 3000 MW [35] solar power plants are being installed [36]A comparative literature survey is presented in Table 1, in an attempt to analyse the research gap in the LFC of microgrids. The process of identifying gaps in the existing research effort is known as a literature review. The review in this study reveals that the penetration of RESs in the power-generating sector has recently increased. The implementation of RESs is fraught with difficulties. Wind, PV, energy storage devices, and other components comprise the MG power system/hybrid power system. Maintaining system stability is critical when integrating RESs into the existing power grid. In this regard, numerous academics have created a variety of secondary controllers, and computational/optimization procedures have been suggested for the optimization of the controllers' parameters. Finally, in this study, an MA-adjusted PID controller was proposed and implemented.

Research Gap and Motivation
Conventional power systems and renewable energy sources are applied to generate the required electric power for all consumers with good quality. However, recently, air pollution and shortages of raw material power generation have moved the focus from conventional sources to renewable energy sources for generating electric power for consumers. Additionally, renewable-based generating power is integrated with conventional power through the design of a microgrid system to balance load demand. The possible solutions are discussed and presented in the above literature review section, as well as in Table 1. Whenever rapid load demand arises in the microgrid, fluctuations in system frequency and produced voltage impact the quality of generated electricity. In order to overcome these issues, several secondary controllers and energy storage techniques have been designed and effectively implemented. The designers of the secondary controller utilized several optimization techniques to obtain controller gain values with a suitable cost function. In order to overcome the drawbacks of conventional power systems and the requirement of a secondary controller in this proposed article, a microgrid system was designed (conventional + renewable energy source + energy storage system) with a secondary (PID) controller for frequency stabilization during emergency load situations.
The foremost objective of the studies presented in the literature review section was to reduce time domain specification parameters (settling time, steady state error, peak over, and undershoot) in power generating systems during unexpected load changing situations. Based on that, any algorithm-based controller does not provide a better-controlled response. Therefore, the design of a suitable controller with superior optimization is required for better LFC performance in power systems during sudden load demand conditions. The MA is a recently developed optimization technique, and is an easily implemented method for solving both continuous and discrete problems. Similarly, this algorithm rarely becomes stuck in local optimum points [34]. The major advantages of the proposed MA is, it has fast convergence rate, nuptial dance and random flight, which improve the balance between exploration and exploitation. Based on this potential, the MA technique is utilized for the design of a PID controller in the proposed microgrid/multigrid for performance improvement.

Innovation of the Article
The Mayfly algorithm is a well-known and efficient optimization tool for solving complex real-time optimization problems. In this work, the Mayfly algorithm is utilized to tune the controller parameters in a microgrid/multimicrogrid power system in order to provide quality power to consumers during sudden load demand situations.

•
Developing a microgrid and a multimicrogrid incorporated with RESs (PV and wind) and an energy storage system; • Developing a suitable secondary controller (PID) for the proposed power system; • Utilizing the projected Mayfly algorithm for controller gain parameter tuning in order to regulate the system's operation during sudden load demand situations; • Explaining the enhanced response of the MA-optimized controller (over the GA, PSO, and DE method-designed controllers); • Conducting robust and sensitivity analyses in order to demonstrate the supremacy of the proposed algorithm for tuning the gain values of the controller in certain situations.

Implication of the Article
• Investigating the RES-based microgrid; • Utilizing the Mayfly algorithm in order to optimize the proposed auxiliary controller; • Providing both SLP and random load pattern (RLP) load interruption to the system, and the response comparison against the GA, PSO, and DE techniques. Also, robustness test conducted to prove the reliability of the MA-PID controller.

Proposed System Modelling
In this section, the designs of the proposed isolated microgrid and an interconnected microgrid are discussed.

Microgrid (MG)
A microgrid is created by combining thermal, PV, wind, and energy storage systems (BESS, FESS). The governor and turbine are part of the thermal power plant. Figure 1 depicts the general construction of an alternating current (AC) microgrid. The Appendix A contains the nominal parameters of the proposed system model [37]. The mathematical function of the proposed system model is provided in Equations (1)- (7), and the transfer function model of the investigated system is presented in Figure 2 [37]. In Figure 2, B denotes the biasing constant, R represents the regulator constant, del P is the small load disturbance, f represents the system frequency, and ∆f denotes the change in frequency.
of the proposed algorithm for tuning the gain values of the controller ations.

•
Investigating the RES-based microgrid; • Utilizing the Mayfly algorithm in order to optimize the proposed auxi • Providing both SLP and random load pattern (RLP) load interruptio and the response comparison against the GA, PSO, and DE technique ness test conducted to prove the reliability of the MA-PID controller.

Proposed System Modelling
In this section, the designs of the proposed isolated microgrid and an microgrid are discussed.

Microgrid (MG)
A microgrid is created by combining thermal, PV, wind, and energy s (BESS, FESS). The governor and turbine are part of the thermal power pla picts the general construction of an alternating current (AC) microgrid. T contains the nominal parameters of the proposed system model [37]. Th function of the proposed system model is provided in Equations (1)-(7), a function model of the investigated system is presented in Figure 2 [37] denotes the biasing constant, R represents the regulator constant, del P is disturbance, f represents the system frequency, and ∆f denotes the change

Thermal Power Plant
Mechanical power is generated in a thermal power plant using steam power, a reheater unit, and a turbine. The generator uses this spinning power to generate electricity. The governor of a steam turbine is one of the primary components that controls and regulates the turbine's speed depending on feedback response. The governor output signal regulates the flow of steam to the turbine by controlling the position of the nozzles in the turbine [13]. The Laplace function of the units in a thermal power plant is provided in Equations (1) and (2). Tg and Tt are denoted as the governor and turbine time constants, respectively [10].
Governor (Thermal power system) = Turbine (Thermal power system) = A wind farm refers to a group of windmills. Wind energy is a zero-emission energy source for generating electricity. Wind turbines transform wind energy into electricity by using the force of the rotor blades, which act similarly to the rotor blades of an aircraft. The air pressure difference between the sides of the blade causes lift and drag. The rotor is either directly connected to the generator, or connected via a series of gears, which aid in increasing the generator's speed [21]. The transfer function model of the wind turbine is shown in Equation (3). In Equation (3), 3TWTG represents the wind turbine generator time constant [38].

PV System
The transfer function model of the PV system is depicted in Equation (4). Solar power is one of the key power sources used to balance load requests in the MG power system, and it is also a readily available supply. The solar cell in the PV system converts sunlight into usable electrical power. PV does not require any fuel to generate power and produces no noise, air, or water pollution [17]. The time constant of the PV system is denoted as TPV in Equation (4).

Thermal Power Plant
Mechanical power is generated in a thermal power plant using steam power, a reheater unit, and a turbine. The generator uses this spinning power to generate electricity. The governor of a steam turbine is one of the primary components that controls and regulates the turbine's speed depending on feedback response. The governor output signal regulates the flow of steam to the turbine by controlling the position of the nozzles in the turbine [13]. The Laplace function of the units in a thermal power plant is provided in Equations (1) and (2). T g and T t are denoted as the governor and turbine time constants, respectively [10].
Turbine (Thermal power system) A wind farm refers to a group of windmills. Wind energy is a zero-emission energy source for generating electricity. Wind turbines transform wind energy into electricity by using the force of the rotor blades, which act similarly to the rotor blades of an aircraft. The air pressure difference between the sides of the blade causes lift and drag. The rotor is either directly connected to the generator, or connected via a series of gears, which aid in increasing the generator's speed [21]. The transfer function model of the wind turbine is shown in Equation (3). In Equation (3), 3T WTG represents the wind turbine generator time constant [38].

PV System
The transfer function model of the PV system is depicted in Equation (4). Solar power is one of the key power sources used to balance load requests in the MG power system, and it is also a readily available supply. The solar cell in the PV system converts sunlight into usable electrical power. PV does not require any fuel to generate power and produces no noise, air, or water pollution [17]. The time constant of the PV system is denoted as TPV in Equation (4).

Energy Storage Units
The energy storage system aids in the improvement of microgrid stability under high-load scenarios. It mitigates the negative impact of wind, solar, and other intermittent energy sources, while improving grid capacity [27]. In this proposed work, battery energy and flywheel energy storage systems are implemented in order to store the energy during nominal/minimal load demand conditions. The transfer functions are provided in Equations (5) and (6).
In the above equation, T BESS is the time constant of the battery energy storage system, and T FESS represents the time constant of the flywheel energy system.

Multi-MG
In order to increase the system's power capacity, MGs are linked using a tie line. By consuming electricity from the isolated MGs, the tie line, also known as the grid line, balances the load demand in the grid line. A multi-MG (MMG) is conceived and created in this work by linking two isolated MGs. Figure 3 [37] depicts the mathematical function of the multi-MG.

Energy Storage Units
The energy storage system aids in the improvement of microgrid stability under high-load scenarios. It mitigates the negative impact of wind, solar, and other intermittent energy sources, while improving grid capacity [27]. In this proposed work, battery energy and flywheel energy storage systems are implemented in order to store the energy during nominal/minimal load demand conditions. The transfer functions are provided in Equations (5) and (6). Battery energy storage system = (5) Flywheel energy storage system = In the above equation, TBESS is the time constant of the battery energy storage system, and TFESS represents the time constant of the flywheel energy system.

Multi-MG
In order to increase the system's power capacity, MGs are linked using a tie line. By consuming electricity from the isolated MGs, the tie line, also known as the grid line, balances the load demand in the grid line. A multi-MG (MMG) is conceived and created in this work by linking two isolated MGs. Figure 3 [37] depicts the mathematical function of the multi-MG.

PID Controller
The secondary controller is critical for implementing the LFC scheme in the power system. Because power systems include a primary controller, known as a speed regulator,

PID Controller
The secondary controller is critical for implementing the LFC scheme in the power system. Because power systems include a primary controller, known as a speed regulator, they are not always reliable in loading circumstances. When unexpected loading occurs in the power system, it takes a long time to stabilize the system. In order to address this issue, a secondary controller is designed and installed in the power system. The PID controller is utilized as a supplementary controller. The PID controller comprises three distinct controllers, each with its own control action. The steady-state error is reduced by the proportional controller, eliminated by the integral controller, and maintained by the derivative controller. The PID controller transfer function is presented in Equation (7) [13].
where K p , K i , and K d are the proportional, integral, and derivative controller gain parameters, respectively.

Mayfly Algorithm
Mayflies are insects of the Ephemeroptera order, which is the oldest group of insects. They are mainly visible in the UK throughout May, which is where their name comes from. This algorithm was motivated mostly by the behaviour of adult mayflies (which includes crossover, mutation, swarming, nuptial dance, and random walk). Two sets of mayflies are initially generated at random to represent the male and female populations. In the second phase, the velocity of each male fly is updated, and then flies are ranked depending on their velocity. In the end, the highest-ranking flies mate with female flies. Likewise, the gain values are tweaked using this algorithm. Figure 4 depicts the MA's functional flow [23]. they are not always reliable in loading circumstances. When unexpected loading occurs in the power system, it takes a long time to stabilize the system. In order to address this issue, a secondary controller is designed and installed in the power system. The PID controller is utilized as a supplementary controller. The PID controller comprises three distinct controllers, each with its own control action. The steady-state error is reduced by the proportional controller, eliminated by the integral controller, and maintained by the derivative controller. The PID controller transfer function is presented in Equation (7) [13].
where Kp, Ki, and Kd are the proportional, integral, and derivative controller gain parameters, respectively.

Mayfly Algorithm
Mayflies are insects of the Ephemeroptera order, which is the oldest group of insects. They are mainly visible in the UK throughout May, which is where their name comes from. This algorithm was motivated mostly by the behaviour of adult mayflies (which includes crossover, mutation, swarming, nuptial dance, and random walk). Two sets of mayflies are initially generated at random to represent the male and female populations. In the second phase, the velocity of each male fly is updated, and then flies are ranked depending on their velocity. In the end, the highest-ranking flies mate with female flies. Likewise, the gain values are tweaked using this algorithm. Figure 4 depicts the MA's functional flow [23].

Male Mayfly Movement
Each of the male mayflies adjusts its position with respect to its own and its neighbour's positions.
is the present position of the ith mayfly in the search space at time t. The position change, calculated by adding velocity , is expressed in Equations (8) and (9) [39].

Male Mayfly Movement
Each of the male mayflies adjusts its position with respect to its own and its neighbour's positions. x t i is the present position of the ith mayfly in the search space at time t. The position change, calculated by adding velocity v t+1 i , is expressed in Equations (8) and (9) [39].
where v t+1 i = Velocity of Mayfly (ith at time t). ij = Dimension in search space.
x t i = Fly position at time t. a1, a2 = Coefficients of social effects. Pbest ij = Local best value. Gbest i = Best location of Mayfly.
The best mayflies in the group change their speed continually in order to improve their global best. Updated velocity is presented in Equation (10). The dance coefficients, represented as d and r, are random numbers between −1 and 1 [40].

Female Mayfly Movement
The female fly updates its position by increasing its speed, and y t+1 i is the ith mayfly position at time t. y t+1 The process of attraction happens randomly, with the first-ranked female attracted by the best males. The remaining flies are attracted accordingly, based on their fitness. For the minimization problem, the velocity is expressed as follows. r mf is the distance between male and female flies [40].
Most of the popular optimization methods require zero derivative points. In order to solve nonlinear problems, more variables are used for the dimension in the search space, and the search space is increased. The numerical solving methods may be stuck at the point of local optimum. Therefore, there is no guarantee of finding the best global optimum solution. In order to overcome the shortfalls of the numerical methods, more metaheuristic algorithms are used to solve complex optimization problems. The Mayfly algorithm can be easily implemented for both continuous and discrete problems. Additionally, this method rarely becomes stuck in local optimum points [40].
The major advantages of the MA [40]: • MA has a fast convergence and a fast convergence rate; • The nuptial dance and random flying contribute to the equilibrium between exploitation and exploration.
The MA is suggested in the research to optimize the secondary controller parameters, such as K p , K i , and K d . Table 2 displays the optimized controller parameters. The upper and lower value limits of controller gains (K p , K i , and K d ) are chosen as 0 and 1, respectively, during the optimization process for the minimization of the cost function (Performance Indices J).

Performance Analysis of MG with SLP and RLP
This section illustrates the performance of the suggested optimized controller for a single-area MG power system. Its performance was evaluated using the MATLAB simulation tool. In Case 1, the system's response was investigated using an SLP, and in Case 2, the system's reaction was examined using an RLP.

Case 1: MG with SLP
The projected controller (MA-PID) is suggested as a subordinate controller to test the behaviour in the LFC crisis. In order to test the suggested technique-tuned controller's ability, a one percent step load disturbance was applied. The responses of the system GA, PSO, and DE-PID controllers were compared in order to demonstrate the superiority of the projected MA-based PID controller. Figure 5 depicts the outcome comparison of the system frequency.

Performance Analysis of MG with SLP and RLP
This section illustrates the performance of the suggested optimized controller for a single-area MG power system. Its performance was evaluated using the MATLAB simulation tool. In Case 1, the system's response was investigated using an SLP, and in Case 2, the system's reaction was examined using an RLP.

Case 1: MG with SLP
The projected controller (MA-PID) is suggested as a subordinate controller to test the behaviour in the LFC crisis. In order to test the suggested technique-tuned controller's ability, a one percent step load disturbance was applied. The responses of the system GA, PSO, and DE-PID controllers were compared in order to demonstrate the superiority of the projected MA-based PID controller. Figure 5 depicts the outcome comparison of the system frequency.     Table 3 shows the numerical parameter values (time domain description) for Figure 5.

Case 2: MG with RLP
The suggested system was tested in this part using a random load pattern in order to evaluate the performance of the projected MA method-based PID controller. A random load was applied to the proposed system with ±0.01 as its maximum and minimum. The frequency deviation comparison with RLP is clearly illustrated in Figure 6.

Case 2: MG with RLP
The suggested system was tested in this part using a random load pattern in order to evaluate the performance of the projected MA method-based PID controller. A random load was applied to the proposed system with ±0.01 as its maximum and minimum. The frequency deviation comparison with RLP is clearly illustrated in Figure 6. When RLP was applied to the proposed system, the first system frequency had a maximum peak value of 0.06 Hz, as shown in Figure 6. After a while, the peak values lowered to 1 × 10 −3 Hz, and the error was reduced to zero. When the load changed, the frequency deviated somewhat from its nominal values, which were controlled by the proposed auxiliary controller.

Performance Analysis of MMG with SLP and RLP
The developed multi-MG (MMG) system presented in Section 2 was investigated by applying 1% SLP and an RLP to the system in order to study the behaviour of the projected MA-PID controller. The performance was examined by considering the following two scenarios (Case 1 with SLP and Case 2 with RLP).  When RLP was applied to the proposed system, the first system frequency had a maximum peak value of 0.06 Hz, as shown in Figure 6. After a while, the peak values lowered to 1 × 10 −3 Hz, and the error was reduced to zero. When the load changed, the frequency deviated somewhat from its nominal values, which were controlled by the proposed auxiliary controller.

Performance Analysis of MMG with SLP and RLP
The developed multi-MG (MMG) system presented in Section 2 was investigated by applying 1% SLP and an RLP to the system in order to study the behaviour of the projected MA-PID controller. The performance was examined by considering the following two scenarios (Case 1 with SLP and Case 2 with RLP).  It is evident that the projected technique-tuned MA-PID controller yields superior performance over those of GA-, PSO-, and DE-tuned controllers by time domain specification variables.    It is evident that the projected technique-tuned MA-PID controller yields superior performance over those of GA-, PSO-, and DE-tuned controllers by time domain specification variables. Table 4 effectively dispatches the numerical values from Figures 7 and 8 to analyse the performance of the suggested tuning technique-oriented controller in the MMG. The behaviour comparisons in Figures 7 and 8 and Table 4 demonstrated that the projected MA-PID controller improved performance over existing (GA, PSO, and DE optimization) methods. The deviation settling times of del F 1 (22 s > 19 s > 19 s > 18 s), del F 2 (23 s > 19 s > 18.5 s > 18 s), and del P tieline (20 s > 19 s > 19 s > 18.5 s) are quicker than those of GA, PSO, and DE controllers. Additionally, peak values, such as peak overshoot (POS) and peak undershoot (PUS), were minimized in the response.

Case 2: MMG with RLP
In this section, RLP was introduced to the proposed power network in order to analyse the behaviour of the optimization technique in the MMG. The result comparisons of the system frequency and tie line power are plotted in Figures 9 and 10, respectively (del F 1 , and del P tieline ).

Case 2: MMG with RLP
In this section, RLP was introduced to the proposed power network in order to analyse the behaviour of the optimization technique in the MMG. The result comparisons of the system frequency and tie line power are plotted in Figures 9 and 10, respectively (del F1, and del Ptieline).  According to the response comparison of the tie line power and system frequency, they diverged from the nominal values at the start of the abrupt loading condition. The tie-line power and system frequency initially demonstrated some peak values, which were quickly minimized by adopting the proposed MA technique-based MA-PID controller.

Case 2: MMG with RLP
In this section, RLP was introduced to the proposed power network in order to analyse the behaviour of the optimization technique in the MMG. The result comparisons of the system frequency and tie line power are plotted in Figures 9 and 10, respectively (del F1, and del Ptieline).  According to the response comparison of the tie line power and system frequency, they diverged from the nominal values at the start of the abrupt loading condition. The tie-line power and system frequency initially demonstrated some peak values, which were quickly minimized by adopting the proposed MA technique-based MA-PID controller. According to the response comparison of the tie line power and system frequency, they diverged from the nominal values at the start of the abrupt loading condition. The tie-line power and system frequency initially demonstrated some peak values, which were quickly minimized by adopting the proposed MA technique-based MA-PID controller.

Robustness Analysis
The robustness investigation was performed in this section in order to verify the performance and effectiveness of the planned MA-PID controller with different loading situations and system parameter variations. In this section two separate robustness analyses are discussed. In the Section 6.1, the system investigated by applying 1%, 2%, 5%, and 10% percentage step load disturbances for rigorous analysis. The test contributed to the higher performance of the MA-PID controller in the investigated system. In Section 6.2, changes in system parameters T g and T s (±50% and ±25%) for demonstrating the reliability of the controller.
6.1. 1%, 2%, 5%, and 10% Load In the robustness analysis, different levels of SLP were applied to area 1. The response comparisons of the system frequency and tie-line power flow between connected areas (del F 1 and del P tieline ) are plotted in Figures 11 and 12, respectively.

Robustness Analysis
The robustness investigation was performed in this section in order to verify the per formance and effectiveness of the planned MA-PID controller with different loading situ ations and system parameter variations. In this section two separate robustness analyse are discussed. In the Section 6.1, the system investigated by applying 1%, 2%, 5%, and 10% percentage step load disturbances for rigorous analysis. The test contributed to the highe performance of the MA-PID controller in the investigated system. In Section 6.2, change in system parameters Tg and Ts (±50% and ±25%) for demonstrating the reliability of th controller.

1%, 2%, 5%, and 10% Load
In the robustness analysis, different levels of SLP were applied to area 1. The respons comparisons of the system frequency and tie-line power flow between connected area (del F1 and del Ptieline) are plotted in Figures 11 and 12, respectively.

Robustness Analysis
The robustness investigation was performed in this section in order to verify the per formance and effectiveness of the planned MA-PID controller with different loading situ ations and system parameter variations. In this section two separate robustness analyses are discussed. In the Section 6.1, the system investigated by applying 1%, 2%, 5%, and 10% percentage step load disturbances for rigorous analysis. The test contributed to the highe performance of the MA-PID controller in the investigated system. In Section 6.2, changes in system parameters Tg and Ts (±50% and ±25%) for demonstrating the reliability of the controller.

1%, 2%, 5%, and 10% Load
In the robustness analysis, different levels of SLP were applied to area 1. The response comparisons of the system frequency and tie-line power flow between connected areas (del F1 and del Ptieline) are plotted in Figures 11 and 12, respectively.    Figures 11 and 12 clearly illustrate that the smooth operation of the proposed techniqueadopted controller (MA-PID) is superior at the time of parameter variations. The controller controlled the deviation in the system frequency under different loading conditions, from which the proposed controller is the most suitable to implement to solve the LFC crisis.

Sensitivity Analysis
A sensitivity examination was conducted with different ranges of system parameter variations of governor time constant (T g ) and turbine time constant (T s ) (±50 and ±25%) from their nominal values. The response comparison of the system frequency and tie line power flow are presented in Figures 13-16. conditions, from which the proposed controller is the most suitable to implement to solve the LFC crisis.

Sensitivity Analysis
A sensitivity examination was conducted with different ranges of system paramete variations of governor time constant (Tg) and turbine time constant (Ts) (±50 and ±25% from their nominal values. The response comparison of the system frequency and tie line power flow are presented in Figures 13-16.   conditions, from which the proposed controller is the most suitable to implement to solv the LFC crisis.

Sensitivity Analysis
A sensitivity examination was conducted with different ranges of system paramete variations of governor time constant (Tg) and turbine time constant (Ts) (±50 and ±25% from their nominal values. The response comparison of the system frequency and tie lin power flow are presented in Figures 13-16.    The smooth performance of the MA-PID controller was achieved in all critical situations within system parameters, which is effectively demonstrated in Figures 13-16. From this overall performance analysis, the projected MA-PID controller is the most suitable controller for the proposed power microgrid.

Conclusions
This paper presented the design and investigation of a microgrid and multi-microgrid system for the LFC scheme by integrating an MA-PID controller as a secondary controller. Without the secondary controller in the power system, it is too difficult to control frequency oscillation. Thermal, PV, and wind energy are used to power the MG. A variety of tests were carried out in order to establish the superiority of the suggested tuning of secondary controller gain values. The examination results were as follows: • The MA-PID controller was examined an isolated MG system with 1% SLP. The performance of the projected technique-tuned controller was compared with those of GA, DE, and PSO-PID controllers. The performance of systems del F1, del F2, and del Ptieline showed that the projected MA-PID produces a better outcome with minimal settling time (8 s = MA < 10 s = DE < PSO = 10.5 s < GA = 11 s) over GA, PSO, and DE controllers.  The smooth performance of the MA-PID controller was achieved in all critical situations within system parameters, which is effectively demonstrated in Figures 13-16. From this overall performance analysis, the projected MA-PID controller is the most suitable controller for the proposed power microgrid.

Conclusions
This paper presented the design and investigation of a microgrid and multi-microgrid system for the LFC scheme by integrating an MA-PID controller as a secondary controller. Without the secondary controller in the power system, it is too difficult to control frequency oscillation. Thermal, PV, and wind energy are used to power the MG. A variety of tests were carried out in order to establish the superiority of the suggested tuning of secondary controller gain values. The examination results were as follows: • The MA-PID controller was examined an isolated MG system with 1% SLP. The performance of the projected technique-tuned controller was compared with those of GA, DE, and PSO-PID controllers. The performance of systems del F1, del F2, and del Ptieline showed that the projected MA-PID produces a better outcome with minimal settling time (8 s = MA < 10 s = DE < PSO = 10.5 s < GA = 11 s) over GA, PSO, and DE controllers. The smooth performance of the MA-PID controller was achieved in all critical situations within system parameters, which is effectively demonstrated in Figures 13-16. From this overall performance analysis, the projected MA-PID controller is the most suitable controller for the proposed power microgrid.

Conclusions
This paper presented the design and investigation of a microgrid and multi-microgrid system for the LFC scheme by integrating an MA-PID controller as a secondary controller. Without the secondary controller in the power system, it is too difficult to control frequency oscillation. Thermal, PV, and wind energy are used to power the MG. A variety of tests were carried out in order to establish the superiority of the suggested tuning of secondary controller gain values. The examination results were as follows: • The MA-PID controller was examined an isolated MG system with 1% SLP. The performance of the projected technique-tuned controller was compared with those of GA, DE, and PSO-PID controllers. The performance of systems del F 1 , del F 2 , and del P tieline showed that the projected MA-PID produces a better outcome with minimal settling time (8 s = MA < 10 s = DE < PSO = 10.5 s < GA = 11 s) over GA, PSO, and DE controllers.
• RLP was used to examine the single-area MG system, and the frequency was affected at the initialization time of loading, but it returned to normal operating conditions after 10 s. • SLP was used to analyse the performance of the projected MA-PID controller in the MMG system. In terms of oscillation control of the system frequency, the MA-PID controller performed more quickly in del F 1 ( RLP was employed in the MMG to legalize the performance of the MA-PID controller within the MMG's LFC. It was effectively evident that the MA-PID controller improved performance by reducing the steady-state error in the system frequency with minimal settling time (in del F 1 = 20 s).

•
Various load disturbance situations and system parameter variations were conducted in the robustness test, and the sensitivity analysis test clearly proved that the projected MA-PID controller functioned admirably under all crucial conditions for solving the LFC crisis.

Recommendation and Future Scope
In the proposed work, a standalone and interconnected microgrid power system with a secondary controller (PID) was examined for frequency regulation. The controller parameters were tuned by the Mayfly algorithm, and the response was compared with the responses of the GA, PSO, and DE controllers. The following recommendations and scopes are suggested for future research:

•
The system size may vary, and the performance of the secondary controller can be analysed; • Conduct an investigation by changing the optimization technique and controller.