Introduction

Background and challenges

The growing need of energy utilization globally underlines the insistence of transitioning from limited, non-renewable energy resources such as fossil fuels to RESs, like wind, solar, and hydropower1. These substitutes energy sources offer a consistent and sustainable and supportable solution and impact the reduction in emission of CO2 and control the effects of climate change2. The two common renewable energy sources that is wind and solar are advantageous due to having less operational costs and can be easily use for producing energy locally thus increasing the energy security and resiliency against disturbances and interruptions3. However, RESs’ integration and participation into power grids arose challenges of managing and stabilizing intermittent energy generation. The transition of traditional power sources maintaining the grid inertia to RESs causes frequency excursion and variations4. According to the International Energy Agency’s forecast, which reveals the substantial increase in photovoltaic and wind power capacity, surpassing the traditional energy sources within next decade5. Hence, tackling of frequency variations issues are critical for fruitful integration of RESs. The energy mix of RESs and DGs in the form of microgrid provide resilient power to the system load6. According to International Renewable Energy Agency (IREA) the power generation capacity of RESs globally reached to 2537 GW with share of 1190GW, 623 GW, 586 GW, 124 GW, and 14 GW and 500 MW by hydropower, wind, PVs, bioenergy, geothermal, and marine energy resources7,8. Due to climatic factors solar irradiation and wind speed variations causes unpredictable weather conditions resulting in intermittent power generations by RESs9. Thus, the frequency oscillation occur due to unpredictable power generation of RESs and stochastic nature of loads10,11. Besides renewable energy sources, electric vehicles are an emerging trends in ecosystem-favored cars productions in automotive industry12. EVs technology contribute to gasoline consumption and greenhouse gas emissions reductions. The EVs are linked to microgrid or conventional power grid over distribution network as flexible load allowing two-way power either to or from the grid13,14,15. The EVs batteries serves as mobile energy storage banks support the RESs integration and supplies stored energy during peak load thus improving power system sustainability16. The RESs and energy storage sources and other Distributed Generations (DGs) sources are integrated in the form of islanded microgrid (IµG), grid connected mode or interconnected microgrids. The power in islanded mode is shared to the local loads. The µG integrated with various AC and DC power sources such as PVs, wind turbines, and energy storage banks, permits power sharing in networked multi-microgrids configuration17. These systems boost up the grid reliability, improve resilience and benefiting maximum power accessibility. However, islanded and multi-µGs suffer challenges with specific to frequency stability and regulation issues due to isolation of IµG from main grid, and intricacy in coordination of multi-µGs due to intermittent nature of RESs and EVs. The erratic behavior of power generation of PV and wind turbines results in mismatching the supply and demand in µGs18,19. Hence, the frequency stabilization and inertia response may be lost due to excessive penetration of RESs in µGs. In these scenarios even a minor fluctuation in µG frequency led to disruptions20. Therefore, it appears critical to implement appropriate control strategies in isolated and interconnected µGs to enhance the power system inertia and frequency stability. In order to die out the disturbances in frequency of µG, the two controlling procedures are commonly used for DGs in microgrids. One is primary level of hierarchical or primary loop local control21. The secondary loop control compensates voltage and frequency variations caused by primary loop control and damp tie line power deviations in interconnected µGs22. Therefore, a most sound frequency control strategy is needed for frequency stabilization of microgrids to ensure reliable delivery of electric power. In this research a (I-P)-PDN controller is proposed for secondary level control strategy for islanded and interconnected microgrids. The control strategy employs a novel nature inspired metaheuristic optimization technique, Black-winged Kite Algorithm (BKA) for controllers’ parameters tuning.

Literature review

In order to confront the major challenge of frequency regulation in microgrids, scientists and researchers have provided a lot of assistance and effort. For maintaining frequency within permissible limits and balanced tie line power in interconnected microgrids, load frequency controllers have been required23. In the past, frequency control techniques have utilized controllers such as proportional integrals and proportional integral derivatives due to their simplicity and simplicity to implement. For the investigation of nonlinear and uncertain power systems, the adjustment of a PID controller can be a cumbersome process, and determining the optimum gains involves a lot of computation and experimentation. Improved performance has been achieved through advanced controllers like double derivatives (DD) and integral double derivatives (IDD). Different optimization algorithms such as Bacterial Foraging-based Optimizer Algorithm (BFOA), have been used for fine tuning the parameters, leading to more efficient LFC strategies23,24. Jaya based optimized model predictive control for frequency regulation in multi-area power system under nonlinearities circumstances an TLBO-LMI based optimized PI controller for three areas reported in25,26. A robust FO-Multistage PD/(1 + PI) controller is optimally implemented using an improved Sine Cosine Algorithm for frequency regulation in an isolated AC microgrid facing renewable-induced intermittencies27.Further, control strategy employing like proportional integral-proportional derivative (PI-PD)28, PD-PI29, type-2 (fuzzy-PID)30 controllers are employed to lessen frequency deviation in microgrid. Various cascaded controller types have been used for load frequency regulation31. The Crow Search Algorithm (CSA) based optimization of Type-2 Fuzzy Cascaded PI Fractional Order (T2F-CPIF) controller improving inter areas power and frequency regulation in complicated power grids having disturbances reported in32. The Quassi-Oppositional Path Finder Algorithm (QO-PFA) based optimization of Fractional Order Type-2 Fuzzy Controller (FO-T2FC) results in enhanced frequency regulation against renewable intermittency compared to Type-1 fuzzy and classical PID controllers presented in33. The Type 2-fuzzy (T2F) controller, optimized by discrete water cycle algorithm enhances frequency stability in comparison to classical PID controllers presented in34. A Fuzzy Type-2 PSS tuned with Modified Crow Search Algorithm effectively regulating and stabilizing frequency in isolated microgrids with electric vehicles under renewable uncertainties. It outperforms classical PID and fuzzy based controllers in dynamic circumstances35.

Recent literature studies36 explore a dual-controller cascade strategy with PIDD2 (Proportional Integral Derivative, Double Derivative) controller framework for frequency fluctuations mitigation in two-area tied power system37. The cascaded control strategy employing Integral-Tilted Proportional Fractional Order Derivative (I-TPFOD) controller was introduced using Satin Bowerbird Optimizer having built in novel integral-square error cost function38. Similarly, a dual-controller method with Particle Swarm Optimizer (PSO) was introduced utilizing an integrator for frequency regulation and proportional-integrator for virtual inertia control of interconnected grids39. The FOPTID + 1 control strategy for LFC employing Global Neighborhood Algorithm (GNA) for parameters optimization was introduced40. For load-frequency regulation and management of power system, numerous control approaches have been adopted using sliding mode controllers41, adaptive model predictive control (AMPC) for two area power system with one isolated microgrid in42 model predictive control reference in43, linear-matrix inequality44, resilient control methods45, data-driven controllers46, impact of simultaneous false data injection attacks (FDIAs) on microgrid’s (LFC), a strategy is implemented that integrates an unknown input observer (UIO) with a Reinforcement Learning-based Policy Gradient controller to ensure frequency security under disturbances in47, and Fuzzy Logic based Control referenced as48. The Fractional Order-Fuzzy power system stabilizer controller, fine-tuned with advanced sine-cosine algorithm significantly enhanced frequency regulation in response to EVs and intermittency of RESs in49. The grid to vehicle (G2V) and vehicle to grid (V2G) services with different conditions lessening the maximum demand, operational costs, and demand mismatches presented in50. The enhanced whale optimization algorithm based tuning of classical PID outperformed compared to simple whale optimization algorithm under several restraints and disturbances51. Cascaded load frequency control technique employing fractional order proportional integral derivative accelerated cascaded fractional order integral derivative with filter (FOPIDA-FOIDN) control was presented52 using hybrid optimizer Artificial Gorilla-Troops (AGTO) and Equilibrium Optimizer (EO) HGTOEO. Additionally, the control strategy for LFC employing hybrid controllers merging fractional order proportional integral derivative (FOPID) and Tilted Integral Derivative (TID), termed Fractional Order Tilted Integral Derivative (FOTID), parameters were refined with Manta-Ray-Foraging (MRFO) algorithm53, and PFOTID with artificial-ecosystem optimizer control strategy developed in54, and FOPID based AGC strategy optimized via imperialist competitive algorithm (ICA) in55. An intelligent- fractional order integrator (iFOI) LFC method with Grey Wolf Optimizer (GWO) and Fractional Order PID-Accelerated (FOPIDA) controllers for maritime microgrid frequency stability, was introduced in56,57.A new non-linear Proportional Integral LFC strategy with Dandelion Optimizer algorithm (DOA) was employed for single area electric grids58, PI and PID LFC strategy for multiple sourced based microgrid systems using Artificial Rabbit Optimizer algorithm (ARO) for parameters tuning59. A FOPIDN-(1 + PIDN) controller optimized with Grey wolf Optimizer for frequency regulation of power systems integrated with renewable energy sources and electric vehicles with superior performance reported in60. FOPIDN-FOPDN LFC strategy tuned with Selfish Herd Optimizer (SHO), proposing superiority of PSO technique for five area tied grids frequency stabilization by studying impact of redox-flow batteries61. Aforementioned research literature survey reveals that the selection choice of the control is equally important like that of controller parameters. The introduction and implementation of evolutionary algorithms techniques as controller’s parameters optimizers brought significance improvement to handle the frequency regulation problems in the microgrids with different distributed generation sources. Impressive modern optimization methods are implemented for controllers’ parameters tuning to accomplished the obscurity of control techniques. As an illustration, the authors implemented following optimization methods: Self-Tuned Algorithm (STA)24, Bull-Lion Optimization (BLO)62, Chaos Game Optimization (CGO)63, modified multiverse optimizer64, and Sunflower optimization algorithm (SOA) and Ant Colony Optimization (ACO)65. Meta-heuristic optimization techniques are proven as a best solution to complex nature problems having limitations, constraints and other optimization challenges in the microgrid (µG) domain. They are stimulated by natural phenomena such as genetic evolution, and diverse animal behaviors. Meta-heuristic optimization employs random, local, and global search tools to find optimum solution of problem. The present study presents a recently introduced a nature inspired metaheuristic algorithm called the black-winged kite algorithm that draws inspiration from hunting and migration behavioral patterns of small prey bird ‘Black-winged Kite’ for tuning the parameters of proposed (I-P)-PDN controller. The black-winged kite has blue gray upper body and lower white. The algorithm is developed based on the monitoring the hunting strategy, its energy foraging behavior and hovering capabilities. The black -winged kite hovers over specific areas to explore prey, with precisely locating and exploiting the prey prior to diving. The hovering initiates global search phase to explore potential solutions. The algorithm aims to reduce the computational costs by leveling the exploration and exploitation, prevent the redundant computation and dynamically reduce the step size improving the adaptability in the uncertain problems. The Black-winged Kite Algorithm (BKA) incorporates both the Cauchy mutation mechanism and a leader-based strategy to improve its global search capabilities and accelerate convergence. This innovative optimization approach demonstrates an effective balance between global exploration and local exploitation. Empirical evaluations show that BKA outperforms alternative algorithms in 66.7%, 72.4%, and 77.8% of instances when benchmarked against the standardized test of CEC-2022 and CEC-2017. Furthermore, its application to engineering design problems underscores its practical efficacy in addressing constrained real-world challenges, thereby highlighting its strong computational efficiency and competitive performance relative to contemporary optimization methodologies66. The detailed literature survey is shown in Table 1.

Table 1 Comparison of (I-P)-PDN controller with commonly used controllers.

Research contribution and motivation

The authors are motivated to propose a novel (I-P)-PDN controller for secondary loop controller for islanded and interconnected microgrids. The proposed controller has an additional signal (Po) support. Moreover, a black-winged kite algorithm is employed for optimization of proposed controller’s parameters. For improving frequency control problem under stochastic nature of RESs, EVs with battery capacity in term of saturation limits are added to the networked microgrids. The communication delay of 1µs is considered for IµG and interconnected microgrid in area-1. The research contribution is summarized as follow;

  • (I-P)-PDN controller optimizes frequency stability in RES and EV-based microgrids.

  • Comparison of proposed controllers with PID and FPDN-FPTID using performance indices.

  • BKA outperforms compared to DO, PSO, and TLBO and other optimization algorithms.

  • Evaluating proposed controller’s resilience and flexibility in worst-case scenario.

  • Introducing BKA for fine-tuning controllers in diverse microgrids configurations.

Organization of paper

The paper is organized as follows: Sect. 2 describes structure, block diagram and modeling of IµG and interconnected µGs. Section 3 details about the implementation of proposed control strategy, objective function formulation and development of proposed controller and black-winged kite algorithm. Section 4 covered the simulation results and discussion for proposed controller (I-P)-PDN. Section 5 covered the simulation results of interconnected microgrids, which is followed by sensitivity analysis at Sect. 6. The stability analysis at Sect. 7. The Sect. 8 details about conclusion and future recommendations.

Modeling of islanded and interconnected microgrids

In the proposed islanded microgrid, distributed generations (DGs) including FCs, BESSs, DEGs, PVs, WTGs and EVs are integrated. Figure 1 shows the mathematical modelling of Islanded microgrid. The microgrids parameters and their nominal values are given in appendix A.

Fig. 1
figure 1

Mathematical modelling of Islanded microgrid.

Mathematical modeling of battery energy storage source

The battery energy storage system consists of battery banks operating with the nominal operating region irrespective of the constraints. T3 is DC/AC inverter time constant, T1 is the measurement time constant and T2 is the delay time constant67. The change in power of BESS for control signal is given in Eq. (1).

$$\:{\Delta\text{P}}_{\text{B}\text{E}\text{S}\text{S}}=\frac{-\Delta\text{u}}{\left({\text{T}}_{1}\text{s}+1\right)\:\:\:\:\left({\text{T}}_{2}\text{s}+1\right)\:\:({\text{T}}_{3}\text{s}+1)}$$
(1)

Mathematical modeling of diesel generator

The diesel engine generator provide constant and rapid source for power supply to the load and a typical DEG has constraint like inertia delay (T7), governor time constant (T8) and turbine time constants (T9)67. The transfer function model of DEG is given in Eq. (2).

$$\:\frac{{\Delta\text{P}}_{\text{D}\text{E}\text{G}}}{-(\Delta\text{u}+{\Delta\text{f}.\text{R}}^{-1})}=\frac{1}{\left({\text{T}}_{7}\text{s}+1\right)\:\:\:\:\left({\text{T}}_{8}\text{s}+1\right)\:\:({\text{T}}_{9}\text{s}+1)}$$
(2)

Mathematical modeling of fuel cell

The fuel cell model has (DC/AC) inverter with time constant (T5), measurement delay (T4) and interconnection blocks (T6). The transfer function model of fuel cell for control signal (\(\:\varDelta\:u)\:\)is expressed as follows in Eq. (3)67.

$$\:\frac{\:\:{\Delta\text{P}}_{\text{F}\text{C}}}{-\Delta\text{u}}=\frac{1}{\left({\text{T}}_{4}\text{s}+1\right)\:\:\:\:\left({\text{T}}_{5}\text{s}+1\right)\:\:({\text{T}}_{6}\text{s}+1)}$$
(3)

Mathematical modeling of wind turbine generator

The wind turbine model use wind velocity to produce electric power. The generalized power for wind turbine is defined in Eqs. (4-4c)68.

$$\:{\text{P}}_{\text{W}\text{T}\text{G}}=0.5{\uprho\:}\text{A}{\text{V}}^{3}{\text{C}}_{\text{p}}({\uplambda\:},\:{\upbeta\:})$$
(4)
$$\:{\text{C}}_{\text{p}}\left({\uplambda\:},\:{\upbeta\:}\right)={\text{C}}_{1}\text{*}\left(\frac{{\text{C}}_{2}}{{{\uplambda\:}}_{\text{i}}}-{\text{C}}_{3}{\upbeta\:}-{\text{C}}_{4}{{\upbeta\:}}^{3}-{\text{C}}_{5}\right)\text{*}{\text{e}}^{\frac{{\text{C}}_{6}}{{{\uplambda\:}}_{\text{i}}}}+{\text{C}}_{7}{{\uplambda\:}}_{\text{T}}$$
(4a)
$$\:{{\uplambda\:}}_{\text{T}}=\frac{{\upomega\:}\text{*}\text{R}}{\text{V}}$$
(4b)
$$\:\frac{1}{{{\uplambda\:}}_{\text{i}}}=\frac{1}{{{\uplambda\:}}_{\text{T}}+0.08{\upbeta\:}}-\frac{0.035}{{{\upbeta\:}}^{3}+1}$$
(4c)

Where PWTG is wind turbine’s output power, V wind’s rated speed, A is rotor’s swept area, and Cp is performance coefficient of rotor’s blades69. The wind turbine parameters are given in appendix B.

Mathematical modeling of photovoltaic

The photovoltaic generate intermittent power due to variations of solar irradiance (\(\:\varnothing\:\)). However, still it provides resiliency to the power system, supplying the load. The photovoltaics power can be presented as below in Eq. (5)70.

$$\:{\varDelta\:\text{P}}_{\text{p}\text{v}}={\upgamma\:}{\varnothing}\text{A}[1-0.005({\text{T}}_{\text{a}}-25\left)\right]$$
(5)

Where Ta is ambient temperature (°C), A is surface area (m2), \(\:\varnothing\:\) is solar irradiance (W/m2), \(\:\gamma\:\) solar panel efficiency, usually in range of 09 to 12%. The modeling parameters for 30 kW PV power71 are given in appendix C.

Mathematical modeling of electric vehicle

The present study explores the strategic deployment of electric vehicles (EVs) as dynamic, flexible loads within the broader framework of frequency regulation. Rather than isolating individual charging strategies, the focus is placed on the collective behavior of EVs, which can be effectively modeled as a distributed network of Mobile Energy Storage Units (MESUs). This abstraction enables a system-level perspective where EVs contribute meaningfully to demand-side energy management and grid stability. Through Vehicle-to-Grid (V2G) integration, EVs can discharge stored energy back into the grid, thereby providing ancillary services such as frequency stabilization. The efficacy of V2G operations depends significantly on the state of charge (SoC) of each vehicle’s battery. In this context, a standard operating SoC of 85% is maintained, allowing a ± 5% tolerance range to ensure consistent availability for grid services. Furthermore, to safeguard battery health over time, a target SoC ceiling of 90% is respected to mitigate degradation caused by frequent deep cycling72. For practical utility, particularly to accommodate imminent travel needs, the SoC is never permitted to fall below 80%, ensuring sufficient charge for mobility purposes while allowing limited discharge flexibility for V2G support. In addition to discharging capabilities, EVs are also exploited as flexible charging loads, referred to as Grid-to-Vehicle (G2V) interactions. This controlled charging mechanism enables EVs to absorb surplus grid energy during periods of low demand or high generation, effectively acting as an energy sink. The aggregate effect of coordinated EV fleets becomes a powerful tool in managing load profiles, especially in complex power systems incorporating multiple sources. To facilitate this role, an aggregated microgrid model is employed, wherein a fleet of EVs responds to centralized load frequency control (LFC) signals that regulate SoC targets in real-time. EVs support frequency regulation through bidirectional power flow. Load frequency control signal is input to the EVs and the discharging and charging power is the output represented by ∆PEVs1 and ∆PEVs2 in area-1 and 2 respectively. The detail model of PEVs is presented35,72. They function as flexible loads, enabling real-time energy adjustments. The process is governed by the energy control signal Econtrol (t). This represents the total controllable energy of the EV fleet, based on the Total Energy Model. EVs participate in frequency regulation as long as Econtrol satisfies below condition in Eq. (6)49.

$$\:{\text{E}}_{\text{m}\text{i}\text{n}}\:\text{c}\text{o}\text{n}\text{t}\text{r}\text{o}\text{l}{={\text{E}}_{\text{c}\text{o}\text{n}\text{t}\text{r}\text{o}\text{l}}=\text{E}}_{\text{m}\text{a}\text{x}}\:\text{c}\text{o}\text{n}\text{t}\text{r}\text{o}\text{l}\:$$
(6)

The Econtrol is controlled energy of PEVs. The minimum and maximum energy control can be expressed in term of battery capacity (CkWh) and Ncontrol by Eqs. (7) and (8).

$$\:{\text{E}}_{\text{m}\text{a}\text{x}}\:\text{c}\text{o}\text{n}\text{t}\text{r}\text{o}\text{l}={\text{N}}_{\text{c}\text{o}\text{n}\text{t}\text{r}\text{o}\text{l}}\times\:{\text{C}}_{\text{k}\text{W}\text{h}}\times\:9\times\:{10}^{-4}$$
(7)
$$\:{\text{E}}_{\text{m}\text{i}\text{n}}\:\text{c}\text{o}\text{n}\text{t}\text{r}\text{o}\text{l}={\text{N}}_{\text{c}\text{o}\text{n}\text{t}\text{r}\text{o}\text{l}}\times\:{\text{C}}_{\text{k}\text{W}\text{h}}\times\:8\times\:{10}^{-4}$$
(8)

Where Ncontrol indicates the quantity of EVs managed. The Ncontrol can be expressed below;

$${{\text{N}}_{{\text{control}}}}={\text{ }}{{\text{N}}_{{\text{initial}}}}+{\text{ }}{{\text{N}}_{{\text{control}}\_{\text{in}}}} - {{\text{N}}_{{\text{plug}}\_{\text{out}}}}$$
(9)

Ninitial denotes initial counting of PEVs and Ncontrol_in denotes number of EVs transit from charging condition to controllable condition, Nplug_out denotes number of EVs fully charged and in driving condition. The transfer function for EVs model is given as follows in Eq. (10).

$$\:{\text{G}}_{\text{e}\text{v}\text{s}}\left(\text{s}\right)=\frac{1}{{(\text{T}}_{\text{e}\text{v}\:}\text{s}+1){(\text{T}}_{\text{i}\text{n}\text{v}\:}\text{s}+1)}$$
(10)

Where Tev and Tinv are EVs and inverter time constants respectively. The inverter capacity is denoted by CkW.

Proposed control strategy

This section explains the proposed control strategy, proposed controller structure and its parameters optimization using BKA optimization and the advantages of dual loop controllers over single loop controllers like PI, PID etc. Conventional PID controller is one of the most flexible controllers providing the robustness and effective response34. Attaining the stability and reliability of power system to regulate the frequency, it is necessary to fine tune the controller with appropriate optimization technique. A controller should be designed such that it can handle disturbances35, show robustness to intermittent sources. Equation (11) illustrates transfer function model of classical PID controller in s-domain73. In comparison to one loop controllers, the dual loop controllers are superior in sense that inner loop not only set points, for second stage controller but it regulates the system inner process38. The two-loop process occur in sequential way.

$$\:{\text{G}\left(\text{s}\right)}_{\text{P}\text{I}\text{D}}={\text{K}}_{\text{p}}+\frac{{\text{K}}_{\text{i}}}{\text{s}}+{\text{K}}_{\text{d}}\text{s}$$
(11)

The proposed controller consists of an (I-P) controller making an inner loop with support input signal (Po) as feedback to the PDN controller and stage two loop of final output feedback to (I-P) controller. The proportional gain is placed in feedback and integral controller in feed-forward path. The transfer function model of (I-P) controller is given by Eq. (12)74. The I-P controller has two gains, Kp1 and Ki. The second stage controller PDN has three gains Kp2, Kd and filter coefficient N. The controlled signal \(\:{\text{u}}_{1-\text{P}\left(\text{s}\right)}\) of (I-P) controller, transfer function of PDN controller and final controlled signal C(s) of two stage controller is given by Eqs. (12), (13) and (14) respectively75. Figure 2, shows the proposed controller block.

$$\:{\text{u}}_{1-\text{P}\left(\text{s}\right)}={\text{K}}_{\text{i}}\text{s}\text{E}\left(\text{s}\right)-{\text{K}}_{\text{p}}\text{Y}\left(\text{s}\right)$$
(12)
$$\:{{\text{G}\left(\text{s}\right)}_{\text{P}\text{D}\text{N}}=\text{K}}_{\text{p}2}+\frac{{\text{K}}_{\text{d}}\text{N}\text{s}}{\text{s}+\text{N}}$$
(13)
$$\:\:\:\:\:\:\:\:\:\:\text{C}\left(\text{s}\right){=[\text{u}}_{\text{I}-\text{P}\left(\text{s}\right)}-{\text{P}}_{\text{o}}]{\text{G}\left(\text{s}\right)}_{\text{P}\text{D}\text{N}}$$
(14)
Fig. 2
figure 2

Structure of (I-P)-PDN controller.

Objective function and problem formulation

The LFC controller performance dependent on the selection of the objective function (OF). Different multi-objective functions have been proposed in previous studies for reduction in frequency deviations for islanded and interconnected µGs. In this research performance indices ITAE, ISE, ITSE and IAE are used to demonstrate the efficacy of the proposed control strategy using three metaheuristic algorithms, Lyrebird Optimization Algorithm (LOA), Jellyfish Searching Optimization (JSO) and Black-winged Kite Algorithms. Population size of 30 No’s of Lyrebirds, crossover of 0.8, mutation rate and standard deviation of 0.1 is used for LOA. The population size for JSO and search agents for BKA is set to 30 No’s. The iterations are taken 500 kept same for optimization process.

The LOA and JSO can rapidly reach near the optimal solutions in the premature stages of optimization process. Thus, attaining the fast convergence. However, this premature convergence makes the algorithm getting trapped in local optima without the thorough exploration of global search space. In comparison the BKA, slowly converges, maintaining the better equilibrium between exploration and exploitation. The BKA maintains population diversity and integrates strategies to escape local optima, thus making it able to search the solution space more thoroughly. This led to final superior solutions, specifically, in complex or multimodal optimization problems. In this context, although BKA may take slightly more time than LOA and JSO to reach convergence, however, it often outperforms LOA and JSO in terms of solution quality, making it a more robust choice for finding the global optimum. The performance indices and controller’s gain maximum and minimum range are given by Eqs. (15), (16), (17), (18) and (19)76,77,78.

$$\:\text{I}\text{T}\text{A}\text{E}=\underset{0}{\overset{{\text{T}}_{\text{s}\text{i}\text{m}}}{\int\:}}\text{t}\text{e}\left(\text{t}\right)\text{d}\text{t}$$
(15)
$$\:\text{I}\text{S}\text{E}=\underset{0}{\overset{{\text{T}}_{\text{s}\text{i}\text{m}}}{\int\:}}{\text{e}\left(\text{t}\right)}^{2}\text{d}\text{t}$$
(16)
$$\:\text{I}\text{T}\text{S}\text{E}=\underset{0}{\overset{{\text{T}}_{\text{s}\text{i}\text{m}}}{\int\:}}{\text{t}\text{e}\left(\text{t}\right)}^{2}\text{d}\text{t}$$
(17)
$$\:\text{I}\text{A}\text{E}=\underset{0}{\overset{{\text{T}}_{\text{s}\text{i}\text{m}}}{\int\:}}\text{e}\left(\text{t}\right)\text{d}\text{t}$$
(18)
$$\:{\text{K}}_{\text{i}}^{\text{m}\text{i}\text{n}}={\text{K}}_{\text{i}}={\text{K}}_{\text{i}}^{\text{m}\text{a}\text{x}};{\text{K}}_{\text{p}1}^{\text{m}\text{i}\text{n}}={\text{K}}_{\text{p}1}={\text{K}}_{\text{p}1}^{\text{m}\text{a}\text{x}};{\text{K}}_{\text{p}2}^{\text{m}\text{i}\text{n}}={\text{K}}_{\text{p}2}={\text{K}}_{\text{p}2}^{\text{m}\text{a}\text{x}};\:{\text{K}}_{\text{d}}^{\text{m}\text{i}\text{n}}={\text{K}}_{\text{d}}={\text{K}}_{\text{d}}^{\text{m}\text{a}\text{x}};{\text{N}}^{\text{m}\text{i}\text{n}}=\text{N}={\text{N}}^{\text{m}\text{a}\text{x}}$$
(19)

The lower bound limit for (\(\:{\text{K}}_{\text{i}}^{\text{m}\text{i}\text{n}},\:{\text{K}}_{\text{p}1}^{\text{m}\text{i}\text{n}},{\text{K}}_{\text{p}2}^{\text{m}\text{i}\text{n}},{\:{\text{K}}_{\text{d}}^{\text{m}\text{i}\text{n}}\:,\text{N}}^{\text{m}\text{i}\text{n}})\:\)is (0, 0, 0, 0) and upper bound for (\(\:{\text{K}}_{\text{i}}^{\text{m}\text{a}\text{x}},\:{\text{K}}_{\text{p}1}^{\text{m}\text{a}\text{x}},\:\:{\text{K}}_{\text{p}2}^{\text{m}\text{a}\text{x}}\:,\:\:{\text{K}}_{\text{d}}^{\text{m}\text{a}\text{x}},\:{\text{N}}^{\text{m}\text{a}\text{x}}\)) is (11, 5, 4, 0.3, 1000).

The black-winged kite algorithm

The black-winged kite (BK) is a bird characterized with upper body blue-gray in color, lower body part is white. The predator prey relation and migration behavior are their prominent characteristics. They eat and survive on tiny mammal, birds and reptiles and strong flying potentials, and can get an unexpected success in hunting process79. The author introduced a new algorithm modeled based on inspiration from migration and hunting skills of the black-winged kites66. The Black-winged Kites algorithm consists of three phases initialization, attacking and migration.

Initialization phase

While initialization of population in BKA, the primary stage is a set of random solution. The location of each black-winged kite can be given in matrix form by Eq. (20). While Eqs. (21), (22) and (23) represents the random populations, the best solution and the initial populations respectively.

$$BK = \left[ {\begin{array}{*{20}c} {BK_{{1,1}} } & {BK_{{1,2}} } & \cdots & \cdots & {BK_{{1,\dim }} } \\ {BK_{{2,1}} } & {BK_{{2,2}} } & \cdots & \cdots & {BK_{{2,\dim }} } \\ \vdots & \vdots & \vdots & \vdots & \vdots \\ \vdots & \vdots & \vdots & \vdots & \vdots \\ {BK_{{pop,1}} } & {BK_{{pop,2}} } & \cdots & \cdots & {BK_{{pop,\dim }} } \\ \end{array} } \right]$$
(20)
$$\:{\text{X}}_{\text{i}}={\text{B}\text{K}}_{\text{l}\text{b}}+\text{r}\text{a}\text{n}\text{d}({\text{B}\text{K}}_{\text{u}\text{b}}-{\text{B}\text{K}}_{\text{l}\text{b}})$$
(21)
$$\:{\text{f}}_{\text{b}\text{e}\text{s}\text{t}}=\text{m}\text{i}\text{n}\Delta\left(\text{f}\left({\text{X}}_{\text{i}}\right)\right)$$
(22)
$$\:{\text{X}}_{\text{L}}=\text{X}\left(\text{f}\text{i}\text{n}\text{d}\right({\text{f}}_{\text{b}\text{e}\text{s}\text{t}}==\text{f}\left({\text{X}}_{\text{i}}\right))$$
(23)

Where BKub and BKlb are upper and lower bounds of ith black-winged kites, the potential solutions can be represented by pop. The dim is given problem’s dimension and initial population can be represented by XL.

Attacking behavior

Black-winged kites (BKs) adjust their position in accordance to the wind speed, during fight and flying at high altitude for searching the prey, and abruptly dive and attacking on prey. The This attacking approach comprises of several attacking actions and behaviors for global exploration and search. The BKs attacking behavior can be represented by mathematical expression by Eqs. (24) and (25)66.

$$\:{\text{y}}_{\text{t}+1}^{\text{i}\text{j}}=\left\{\begin{array}{c}{\text{y}}_{\text{t}}^{\text{i}\text{j}}+n\left(1+\text{sin}\left(\text{r}\right)\right){\text{y}}_{\text{t}}^{\text{i}\text{j}}\:\:\:\:\:p<r\\\:\:\:\:\\\:{\text{y}}_{\text{t}}^{\text{i}\text{j}}+n\times\:\left(2\text{r}-1\right)\times\:{\text{y}}_{\text{t}}^{\text{i}\text{j}}\:\:\:\:\:else\:\end{array}\right.$$
(24)
$$\:\:\:\:\:\:\:\:\text{n}=0.05\times\:{\text{e}}^{-2{\times\:\left(\frac{\text{t}}{\text{T}}\right)}^{2}}$$
(25)

Among them, \(\:{\text{y}}_{\text{t}}^{\text{i}\text{j}}\) and \(\:{\text{y}}_{\text{t}+1}^{\text{i}\text{j}}\), denote the position of ith (BK), in the jth dimension in tth and iterations (t + 1) th, r can be any random value between 0 and 1, p = 0.9, T is maximum iterations, and t is current iteration number.

Migration behavior

The BKA imitates complicated migration behavior of BKs in exploitation phase. Birds migrate due to climate change and availability of food and other factors. Lead birds often play vital role in migration initiation to accomplishment. The Mathematical expression for migration action of (BKs) is given by Eqs. (26) and (27)66.

$$\:{\text{y}}_{\text{t}+1}^{\text{i}\text{j}}=\left\{\begin{array}{c}{\text{y}}_{\text{t}}^{\text{i}\text{j}}+C\left(\text{0,1}\right)\times\:{(\text{y}}_{\text{t}}^{\text{i}\text{j}}-{\text{L}}_{\text{t}}^{\text{i}}){\:\:\:\:\:\:\text{F}}_{\text{i}}<{\text{F}}_{\text{r}\text{i}}\\\:{\text{y}}_{\text{t}}^{\text{i}\text{j}}+C\left(\text{0,1}\right)\times\:\left({\text{L}}_{\text{t}}^{\text{i}}-\text{m}{\text{y}}_{\text{t}}^{\text{i}\text{j}}\right)\:\:\:\:\:\:\:else\end{array}\right.\:\:\:\:\:\:$$
(26)
$$\:\text{m}=2\times\:\text{s}\text{i}\text{n}\left(\text{r}+\raisebox{1ex}{${\uppi\:}$}\!\left/\:\!\raisebox{-1ex}{$2$}\right.\right)$$
(27)

\(\:{\text{L}}_{\text{t}}^{\text{i}}\) is BKs leading scorer in jth dimension in tth iteration, and \(\:{\text{y}}_{\text{t}}^{\text{i}\text{j}}\) and \(\:{\text{y}}_{\text{t}+1}^{\text{i}\text{j}}\:\)are the location/position of the ith BKs in jth dimension in t and (t + 1) th iteration steps, respectively. Where C(0,1) is Cauchy’s mutation80. Fi is current position by any BK in jth dimension in t iteration. Fri is fitness value of random position obtained by any BKs in t iteration in jth dimension. The mono-dimensional Cauchy distribution with probability density function is given by Eqs. (28) and (29)66.

$$\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\text{f}\left(\text{x},\:{\updelta\:},{\upmu\:}\right)=\frac{1}{{\uppi\:}}\frac{{\updelta\:}}{{{\updelta\:}}^{2}+{(\text{x}-{\upmu\:})}^{2}}\:\:-{\infty\:}<\text{x}<{\infty\:}$$
(28)
$$f\left( {x,\delta ,\mu } \right) = \frac{1}{\pi }\frac{1}{{x^{2} + 1}} - \infty < x < \infty ...\left( {\delta = 1,\mu = 0} \right)$$
(29)

The flow chart for the BKA algorithm is shown in Fig. 3.

Algorithm
figure a

Black-winged Kite Algorithm.

Fig. 3
figure 3

Flow chart for BKA.

Simulation results and discussions

In this research, a load frequency response model for a microgrid in Fig. 1 is simulated in MATLAB R2024/Simulink environment with Intel Core i5-1235U, 12th Generation RAM: 16 GB, Windows pro-11). Initially, the simulation is conducted with the controllers already proposed and presented in the literature. The performance comparison of proposed controller (I-P)-PDN in term of performances indices (IAE, ITAE, ISE and ITSE) and reliability is carried out. The ITSE is used as objective function given in Eq. (31) in optimization process via BKA. The convergence curves for objective function for Lyrebird optimization, Jellyfish search algorithm and Black-winged Kite Algorithm are given in in Fig. 4.

$$\:\text{I}\text{S}\text{E}={\int\:}_{0}^{{\text{T}}_{\text{s}\text{i}\text{m}}}{\left[\right({\Delta\text{f}}_{1})}^{2}+{\left({\Delta\text{f}}_{2}\right)}^{2}+{\left({\Delta\text{P}}_{\text{t}\text{i}\text{e}}\right)}^{2}]\:\text{d}\text{t}$$
(30)
$$\:\text{I}\text{T}\text{S}\text{E}={\int\:}_{0}^{{\text{T}}_{\text{s}\text{i}\text{m}}}{\left[\right({\Delta\text{f}}_{1})}^{2}+{\left({\Delta\text{f}}_{2}\right)}^{2}+{\left({\Delta\text{P}}_{\text{t}\text{i}\text{e}}\right)}^{2}]\text{t}\:\text{d}\text{t}$$
(31)
Fig. 4
figure 4

Convergence curve using ITSE in optimization process.

This research considers four cases and five distinct scenarios for IµG to completely assess the controller’s efficacy in diverse conditions. Finally, the robustness and stability analysis are carried out. The simulation results for different scenarios are presented in Tables 2, 3 and 4.

Case-I: step load of 4% to IµG

In this case a step load of 0.04pu is applied to the IµG. The three Lyrebird optimization (LOA), Jellyfish Searching optimization (JSO) and Black-winged Kite Algorithms (BKA) are used for optimization of proposed controller. The proposed controller with BKA optimizer outperformed with minimum ITSE and ISE values of 0.00000499pu and 0.00009638pu respectively. The LOA and JSO have ITSE values 0.004pu and 0.0003pu, and ISE values of 0.000109pu and 0.00013336pu respectively. Figures 5 and 6 show the frequency deviation in islanded microgrid when the ITSE and ISE are used as fitness functions in the optimization process. It is much clear from the Figs. 5 and 6 that there is very less OSH and USH in frequency deviation while using the BKA is an optimizer, clearly dominating the efficacy of the BKA over LOA and JSO. The BKA has reduced the ITSE up to 99.8% from 0.004pu to 0.00000499pu, and 28% reduction in ISE from 0.00013336pu to 0.00009638pu. Thus, the BKA demonstrates its superiority over LOA and JSO.

Fig. 5
figure 5

Frequency deviation for Case-I in IµG with ITSE as fitness function.

Fig. 6
figure 6

Frequency deviation for Case-I in IµG with ISE as fitness function.

Case-II: load fluctuations with lack of RESs

  • Scenario-1: Step-up load of 5%, 10%, 15%, 20%.

  • Scenario-2: Severe dynamic load (disturbance at t = 2s, t = 4s, t = 6s and t = 8s).

Scenario-1: Step-up load of 5%, 10%, 15%, 20%.

In this first scenario, the efficacy of proposed controller (I-P) cascade PDN for IµG is evaluated by applying stepping up load of 5%, 10%, 15% and 20% at time t = 2s. The results for different performance parameters are presented in the Table 2, illustrates that the proposed (I-P)-PDN controller performed better than other controllers due to quick response to perturbations with quick settling and no OSH. The lowest OSH and USH values are − 0.00\(\:{\times\:10}^{-5}\) and − 0.011pu at step load 5% and 0.00\(\:{\times\:10}^{-5}\) and − 0.018pu at 10%. The proposed controller’s response settles 0.019s, 0.01, 0.015s and 0.016s faster than other controllers at the four distinct step load. The frequency response of scenario-1 for each step load at t = 2s is given in Fig. 7, (a), (b), (c) and (d).

Fig. 7
figure 7

Frequency deviation for (Case-II, scenario-1).

Scenario-2: Severe Dynamic load at t = 2s, t = 4s, t = 6s and t = 8s

In this scenario a random load with initial stepping at time t = 2s, then 2s delay between consecutive steps of Fig. 8 is applied to islanded microgrid. The first load disturbance (0 to -5% at t = 2s), second disturbance at (-5–10% at t = 4s), third disturbance at (10% to -2.5% at t = 6s) and fourth at (-2.5 to 7.5% at t = 8s). Figure 9, shows the frequency response of each controller against the load disturbances and Table 3. results illustrate that the (I-P)-PDN attains ISE value of 317 \(\:{\times\:10}^{-6}\)pu and Ts of 0.35s for disturbance (-2.5 to 7.5% at t = 8s) and minimal Ts of 0.3s for (-5 to 10% at t = 4s) and the first disturbance (0 to -5% at t = 2s) is settled just in 0.344s.

Fig. 8
figure 8

Severe dynamic load (Case-II, scenario-2).

Fig. 9
figure 9

Frequency deviation for severe dynamic load Case-II (Scenario-2).

Table 2 Performance indices for Case-II, Scenario-I in absence of RESs.
Table 3 Performance parameters and error indices for severe dynamic load and lack of RESs (Case-II, Scenario-2).

Case-III: presence of RESs and different loading conditions

  • Scenario-1: Presence of RESs power and absence of load disturbances.

  • Scenario-2: Presence of RESs power and step-up load of 20% at t = 55s.

  • Scenario-3: Presence of RESs and additional step load of 8% at t = 65s.

Scenario-1: Presence of RESs power and absence of load disturbances

In case-III (scenario-1), the islanded microgrid is subjected to load without any change in load or addition of any disturbance. The µG response is simulated for 60 s. From the Table 4 it is reveals that the controller performs well compared to other controllers with lowest performance index ISE of 1.74\(\:{\times\:10}^{-6}\) pu and OSH of 13 \(\:{\times\:10}^{-4}\)pu. The response of the proposed controller is indicated in red color in zoomed view in Fig. 10. It is clear that the controller performed well in reduction in Ts.

Fig. 10
figure 10

Presence of RESs power without load disturbances (Case-III, scenario-1).

Scenario-2: Presence of RESs power and step load of 20% at t = 55s.

This scenario is implemented with application of step load of 20% at time t = 55s for stability analysis of the controller. The Fig. 11, reveals that the controller outperformed with no OSH and quick settling time with high reliability.

Fig. 11
figure 11

Presence of RESs power and step-up load (Case-III, Scenario-2).

Scenario-3: Presence of RESs and additional step load of 8% at t = 65s.

In this scenario, the proposed microgrid with the proposed controller is subjected to step light load of 8% at t = 65s in addition to 10% load (case-II, scenario-1) to analyze the efficacy of controller in term of under frequency. Again, as shown in the Fig. 12, the under frequency has attain the value of -0.0398pu almost same value for individual load of 0.1pu without any variation or change in frequency response.

Fig. 12
figure 12

Presence of RESs and additional step load (Case-III, Scenario-3).

Table 4 Performance parameters and error indices for Case-III Scenario-1: presence of RESs power and absence of load disturbances.
Table 5 Performance parameters for interconnected µGs in Scenario-1.
Table 6 Performance/error indices for interconnected µGs in Scenario-1.

Case-IV: Variable RESs (PV, Wind) and irregular load.

In this scenario an irregular load81 of 15% is modeled for IµG. The stability and reliability analysis of proposed controller against uncertain RESs and irregular load. It is illustrated from the Fig. 13, that over frequency has value of 1.8\(\:{\times\:10}^{-3}\)pu at t = 2.5s and 1.6\(\:{\times\:10}^{-3}\)pu at t = 5.1s and under frequency with a value of -6\(\:{\times\:10}^{-3}\)pu at t = 10s. The response after 10s is almost linear, it is straightforward that suggested controller performed better irregular nature of load. The performance error indices for interconnected µGs in scenario-1 indicates that our proposed (I-P)-PDN controller perform very well as compared to other controllers.

Fig. 13
figure 13

Frequency deviation for variable irregular load (Case-IV).

Performance analysis of the proposed control strategy for two interconnected µGs

In this section, the proposed LFC strategy is tested over 02-areas interconnected µGs network as shown in Fig. 14. The RES wind turbine is dedicated to area-1 and PV source supplies power to area-2. The interconnected microgrid parameters are defined in appendix D.

Fig. 14
figure 14

Two areas interconnected µGs.

The simulation of two area interconnected microgrid is carried out with optimized parameters of proposed controller are given in appendix E. \(\:\:\varDelta\:{\text{f}}_{1},\:\:\:\:\varDelta\:{\text{f}}_{2}\)are the frequency responses of area-1 and area-2 and \(\:\Delta{\text{P}}_{\text{t}\text{i}\text{e}}\) is the tie line power. The objective functions ITSE and ISE for the interconnected µGs are given in77. The minimum objective function values are obtained for ITSE of 49.9×\(\:{10}^{-7}\), 96.3×\(\:{10}^{-6}\) for ISE, 53.96\(\:{\times\:10}^{-5}\) for ITAE and 41.36\(\:4\) \(\:{\times\:10}^{-4}\:\)in comparison to its contemporary optimization algorithm, Dandelion Optimizer as reported in the literature.

The interconnected microgrid is tested over four scenarios.

  • Scenario-1: step load of 10% for both areas with lack of RESs and EVs.

  • Scenario-2: step load of 10% for both areas with RESs and lack of EVs.

  • Scenario-3: step load of 10% for both areas in presence of EVs and RESs.

  • Scenario-4: Irregular load of 15% for both areas with intermittent RESs and EVs.

Scenario-1: Step load of 10% for both areas with lack of RESs and EVs.

In the first scenario, a step load of 10% is applied to both areas, in the absence of RESs. As indicated from the Tables 5 and 6, the suggested controller outperformed with (I-P)-PDN controller. The area-1 has frequency response with minimum OSH of 0.0227\(\:{\times\:10}^{-4}\)pu and USH of -1.285\(\:{\times\:10}^{-3}\)pu for ∆f1 and OSH of 0.00917\(\:{\times\:10}^{-4}\)pu and USH of -1.200\(\:{\times\:10}^{-3}\)pu for ∆f2. The two responses in the area-1 and 2 settled faster than other controllers with settling period of 0.75s and 0.98s respectively. Additionally, the tie line power response settled in only 1.189s with minimum ITSE of 0.499\(\:{\times\:10}^{-5}\text{p}\text{u}\). In comparison of two stage controllers, the FPID performed well among all the remaining controllers with settling time of 2.7s and 2.4s for area-1 and area-2 respectively. Among the single stage controllers FPID responses settled faster with 3.7s and 4.3s for area-1 and 2 than other remaining single stage controllers. The frequency and tie-line power responses are given in Fig. 15.

Fig. 15
figure 15

Frequency and tie-line power responses of interconnected µGs for scenario-1.

Scenario-2: Step load of 10% for both areas with RESs and lack of EVs.

In second scenario, the intermittent RES wind power is connected to area-1 and PV power to area-2 with step load of 10% for both areas. The Fig. 16a-c, and Table 7, reveals that the suggested controller performed well in compassion to all other controllers with minimum integral weighted square error of 1.60 × 10− 5 pu. The commonly used evaluation criterion ITAE has attain minimum value of 3.88 × 10− 5 pu. The frequency responses have minimum OSH of 4.18 × 10− 4 pu and USH of -4.31 × 10− 6 pu for ∆f1 and OSH of 1.4 × 10− 3 pu, USH of -1.3 × 10− 3pu for ∆f2.

Fig. 16
figure 16

(a) Change in frequency for area-1(b) Change in frequency for area-2 (c) Change in tie line power for scenario-2.

Scenario-3: step load of 10% for both areas in presence of RESs and EVs.

The impact of electric vehicle as flexible load is investigated with proposed controller (I-P)-PDN. In this case a 10% step load at t = 0 s is applied to the area-1 and area-2 in the presence of RESs (PV, WTG). Table 7, and 8, illustrate that the performance indices are improved with the addition of electric vehicles as flexible load. The same electric vehicle model is added to both the area of interconnected microgrid. The performance comparison of the (I-P)-PDN and FPDN-FPTID controllers is carried out with same gains for network microgrid with EVs as flexible load. There is 77% reduction in tie line power OSH (-0.35\(\:{\times\:10}^{-6}\) to -0.804\(\:{\times\:10}^{-7}\)) and 52% USH (-0.85 \(\:{\times\:10}^{-4}\) to -0.4012 \(\:{\times\:10}^{-4}\)) for proposed controller with inclusion of electric vehicles in both areas respectively. The integral weighted absolute error is reduced by 64% (15.5 to 5.49) and 48% (18.5 to 10.3), ITAE by 93% (43.2 to 2.98) and 95% (448 to 20.29), ISE by 98% (1.55 \(\:{\times\:10}^{-5}\) to 3.011 \(\:{\times\:10}^{-7}\)) and 98% (2.2 \(\:{\times\:10}^{-5}\) to 3.019 \(\:{\times\:10}^{-7}\)) and ITSE by 92% (3.88 \(\:{\times\:10}^{-5}\) to 3.69 \(\:{\times\:10}^{-6}\)) and 97% (29.8 \(\:{\times\:10}^{-5}\) to 7.731 \(\:{\times\:10}^{-6}\)) for (I-P)-PDN and FPDN-FPTID controllers respectively. Moreover, the electric vehicles power OSH decreases about 1.94% and USH by 0.05 to 1%. The electric vehicles as source have significance change in power in area-2 for FPDN-FPTID controller. The EVs power ∆PEVs1 and ∆PEVs2 attained faster steady state response with proposed (I-P)-PDN controller as illustrated in Fig. 17a-b. The PV power is slightly changed at almost 10s and 18s from 0.015pu to 0.01213pu and ∆PBESS2 from 0.0425pu to 0.0422pu in area-2 due to loading behavior of EVs. The proposed controller performed well with the incorporation of EVs as flexible load as indicated from Table 8; Fig. 17 (a-b), and Fig. 18.

Table 7 Performance parameters and error indices comparison for two area interconnected µGs scenario-2.
Table 8 Performance parameters and error indices for scenario-3 of two area interconnected µGs.
Fig. 17
figure 17

(a). Change in EVs power in Area-1 (b) Change in EVs power in Area-2.

Fig. 18
figure 18

Change in power of different distributed generations in scenario-3.

Scenario-4: Irregular load of 15% for both areas with intermittent RESs and EVs

In this scenario stochastic load of 0.15pu approximately is connected to area-1 and area-2 simultaneously and WTG of 100 kW is dedicated to the area-1 and PV of 30 kW is to area-2. The intermittency of wind (speed= [0 5 10 12 15 14], time= [0 10 15 20 25 30]) to WTG and of solar irradiance (G= [300 500 300 200 350], time= [0 10 15 20 30]) to PV is applied. For inter-relation of intermittency of RESs and availability or non-availability of EVs in area-1 or 2, four conditions have been studied.

Condition-I: Availability of EVs in both areas: In this condition, EVs in both areas are present and connected. At almost 5s both the EVs in area-1 and area-2 comes into contribution of power of 9.064 × 10-6pu and 3.25 × 10-5pu, while PWTG is 0 pu, while Ppv is 0.01234pu at about 6s. The WTG supplies its power of almost 0.003488pu and PV of 0.0158pu, the EVs power at this time becomes 2.6 × 10-6pu and 7.9 × 10-6pu respectively. This power is supplied by RESs at time 10s. At internal 10.58s the EVs1 power cutoff raising PV and WTG power to 0.01707 pu and 0.00248pu respectively. At 10.815s the EVs1, EVs2 cutoff their power and PV power raised to 0.01852pu. At 12.576s, EVs1 power goes up to 6.185 × 10-7pu, and EVs2 of 0.047pu and PV power reaches to 0.02088 pu. At 12.35s again EVs1 = EVs2 = 0.04u and the Ppv of 0.02077pu. At 15.385s, the EVs2 is of 1.5 × 10-8pu and EVs1 is of 0.04pu and the PWTG is 0.0198pu and Ppv of 0.009213pu. The EVs power in both the areas become equal to zero at time nearly equal to 17.5s, at the same time WTG supplies the power of 0.01988pu and PV contribute to 0.01222pu. Similarly, at 18s the EVs in area-1 have power of 1.1 × 10-6pu, but WTG supplies 0.01988pu, thus, the power of EVs in area-1 is decreasing till become zero at 20s and EVs power in area-2 has also goes down to zero. At 22s the PWTG and Ppv is recorded 0.03432pu and 0.00789pu respectively. After this again, at 28s EVs in area-1 going to decrease that is 1.36 × 10-6pu and EVs in area-2 become zero, the PWTG at this time has highest value of 0.06pu and Ppv of 0.0067pu. The minimum power of EVs in area-1 becomes 7.9 × 10-8pu till 30s. The OSH and USH values for ∆f1 are 1.75 × 10-6pu and − 1.40 × 10-3pu, for ∆f2 are 8.5 × 10-5pu, and − 1.7 × 10-2pu, and for ∆Ptie are 1.02 × 10-6pu and − 2.93 × 10-6pu respectively.

Condition-II: Availability of electric vehicles in area-2 only: In this condition, the electric vehicles in area-2 are made available and area-1 have no connectivity of EVs. At time of 10s the WTG power shows connectivity and supplies power of 0.002488pu, as the intermittency of the WTG is taken as (time = [0 10 15 20 25 30], speed= [0 5 10 12 15 14]). Hence, at 5s the EVs in area-2 have power of 1.5e-5pu with PWTG of 0pu. Similarly, the intermittent nature of renewable sources is directly reflected and according to that change, the EVs in the specific area show connectivity or discontinuity due to the intermittency. Similarly, at 15s the solar irradiance has value of 300 W/m2 and wind velocity is 10 m/s, the EVs in area-2 supplies power of 7.2e-8pu, WTG of 0.02pu and PV of 0.008pu. The EVs in specific areas shows the appearance with the intermittency time for RESs in interconnected microgrid system. The EVs in area-2 power starting decreasing and become zero at 30s. The OSH and USH values recorded for ∆f1 are 1.70 × 10-6pu and − 1.402 × 10-3pu, for ∆f2 are 8.509 × 10-5pu and − 1.732 × 10-2pu, and for ∆Ptie are 1.028 × 10-6pu and − 2.393 × 10-6pu respectively.

Condition-III: Availability of EVs in area-1 only: In this condition, the EVs in area-1 are present only such that WTG and PV sources are connected to area-1 and area-2 respectively. Considering the intermittent behavior of WTG and PV power due to weather variability, the PWTG is 0pu because of no wind speed at time 0s, and the Ppv is 0.012pu due to availability of solar irradiance of 300 W/m2. At 10s the WTG deliver power due to wind speed of 5 m/s and at 11s, the PWTG touches 0.002pu, Ppv of 0.0193pu. At 13s the EVs power in area-2 becomes zero per unit, while WTG and PV are delivering power of 0.002pu and 0.0271pu respectively. At 28s the EVs power in area-1 decline to 7.7 × 10-6pu. The OSH and USH values for ∆f1 are 1.74 × 10-6pu and − 1.402 × 10-3pu, for ∆f2 are 8.51 × 10-5pu, and − 1.72 × 10-2pu and for ∆Ptie are 1.028 × 10-6pu and − 2.39 × 10-6pu respectively.

Condition-IV: Non-availability of Electric vehicles in area-1 and area-2: In this condition, the interconnected microgrid is operated without the connectivity of EVs in both the areas. The RESs, WTG and PV deliver power to each respective areas taking the intermittency of solar irradiance Watt/m2 and wind speed. The WTG and PV give full contribution of, 0.05457pu and 0.1475pu respectively. Figure 19a,b and c show the intermittency and uncertainty in the wind turbine power in area-1 due to variation in wind speed (mentioned in spikes at 10s, 15s, 20s and 25s) and photovoltaic power intermittency in area-2 at (0s, 10s, 15s and 20s). The OSH and USH values noted for ∆f1 are 1.73 × 10-6pu and − 1.40 × 10-3pu, for ∆f2 are 8.4 × 10-5pu and − 1.7 × 10-2pu, and for ∆Ptie are 1.02 × 10-6pu and − 2.393 × 10-6pu respectively. From the Fig. 19a-c, the flexible load behavior of EVs in aea-2 is depicted and is photovoltaic power is represented by light green color, in the absence of EVs in area-2 there is slight increase in Photovoltaic power. However, the same power is absorbed by EVs in area-2 depicted by dark blue (photovoltaic power) showing the grid to vehicle (G2V) behavior.

Fig. 19
figure 19

Change in frequency for area-1 (b) Change in frequency for area-2 (c) Change in tie line power for scenario-4.

Sensitivity analysis

The controller must demonstrate consistent performance even in the face of uncertain parameters, as the system models it employs are mathematically versatile. Additionally, the system’s configuration and parameters may evolve over time due to factors such as component degradation. Moreover, the system’s configuration and parameters are subjected to alterations over period due to the factors such as component wear and tear, and degradation. The stability of the system may be conceded if the proposed control strategy fails to accommodate system’s parameters variations. To validate the robustness of the proposed controller, parameters such as (R) and system inertia coefficient (M), have been altered by approximately ± 40% relative to their actual parameter responses. The results, which are illustrated in Figs. 20, 21 and 22, and Table 9, demonstrate the controller’s performance under conditions of parametric variation. As seen in Table 9, many parameters exhibit responses that are closely aligned with their nominal values. This data confirms that the BKA-(I-P)-PDN controller delivers consistent performance across a ± 40% of system inertia (M) and (R). Moreover, the controller’s optimal settings remain effective without the need for re-tuning when applied with real parameters at their nominal values.

Fig. 20
figure 20

Variation in parameter (R) in area-1.

Fig. 21
figure 21

Variation in parameter (M) in area-2.

Fig. 22
figure 22

Variation in parameters (R, M).

Table 9 Variations in microgrid parameters.

Stability analysis

From the Bode diagram in Fig. 23, it is illustrated that the proposed controller can endure further increase in gain of 32.1 dB prior to becoming unstable. Moreover, the gain margin has positive value indicating the robustness in stability with respect to variations in gain. The system can endure phase lag of 108 degree prior to crossing instability. Furthermore, the closed loop system is well damped and have good stability with delay margin of 0.446s. There is steady drop in gain as indicated ensuring that the system is stable. The closed loop system stability is obviously marked as “Yes”. The proposed (I-P)-PDN controller exhibits superior gain and phase margins, reflecting stronger robustness and enhanced stability under uncertainties and external disturbances. Unlike conventional methods, the (I-P)-PDN controller maintains higher resilience during large load variations and system parameter changes. These improved stability margins imply that the system can better withstand real-world fluctuations without compromising performance.

Overall, the system has potential to tolerate significant variations in both gains and delay indicate well-tuning, smooth transient responses and can handle the uncertainties in real-world applications.

Fig. 23
figure 23

Stability analysis of proposed controller (I-P)-PDN for interconnected µGs.

Conclusion and future recommendations

This study presents a novel two-stage cascaded (I-P)-PDN controller, optimized using the Black-winged Kite Algorithm (BKA), for load frequency regulation in islanded and interconnected microgrid systems. The proposed strategy effectively mitigates frequency deviations caused by the stochastic nature of renewable energy sources (RESs) and dynamic load variations, significantly outperforming conventional controllers. Simulation results demonstrate that the (I-P)-PDN controller achieves a 77% reduction in overshoot (OSH) and a 52% decrease in undershoot (USH) in tie-line power variations compared to existing controllers. Additionally, the Integral Absolute Error (IAE) is reduced by 42.3%, Integral Time Absolute Error (ITAE) by 85%, and Integral Square Error (ISE) by 98%, highlighting the controller’s superior stability and robustness. The impact of Electric Vehicles (EVs) as flexible loads further enhances system performance, leading to a 93% reduction in ITAE and a 95% reduction in ITSE for interconnected microgrids. The stability analysis via Bode plots confirms that the proposed control strategy maintains stability with a gain margin of 32.1 dB and a phase margin of 108 degrees, ensuring resilience against uncertainties. Generally, the (I-P)-PDN controller with BKA tuning provides a reliable solution for microgrid frequency regulation with the limitation of moderate computational demand during the offline tuning stage when scaling to high dimension search space. However, this demand remains manageable with standard computing resources and does not hinder practical applicability. Future work can explore real-time hardware implementation and cybersecurity aspects of microgrid communication delays to further enhance the practicality of the proposed control strategy. Furthermore, addressing cybersecurity concerns, as microgrids are increasingly reliant on communication networks for monitoring and control, making them vulnerable to cyber-attacks such as data spoofing, denial of service, and false data injection.