Introduction

Renewable energy sources (RESs) are being incorporated into power systems to meet the growing energy demand. Additionally, the RESs are installed to minimize the gas emissions resulting from conventional power plants. So, the RES are becoming essential components in the transition towards a sustainable energy future. On the other hand, installing RESs in recent grids via power electronics devices causes harmful effects to these grids. The harmful effects resulted from these electronic devices, which cause high losses of system inertia, especially with the high installation of RESs in grids1,2,3,4. As a result, the losses of system inertia reduce the system stability and increase the frequency fluctuations. So, the integration of RESs requires advanced technologies and approaches to manage adaptability and ensure consistent energy supply for customers5,6,7. In this regard, huge efforts have been established to reduce the frequency fluctuations and keep the stability of the system.

Literature review

The load frequency control (LFC) is considered the most common solution to maintain the frequency at nominal standards. In this regard, different control methods have been performed in LFC to maintain a frequency stable at nominal standards8. These methods involve optimal control techniques such as sliding mode control9, artificial neural network10, model predictive control (MPC)11,12, robust control techniques13, fuzzy control techniques14, hybrid controllers that consist of more than one controller as fuzzy based fractional order control15, and freedom degree fractional order control with MPC16. These strategies effectively addressed LFC problems, however relied on the developer’s expertise and experimentation methods. Additionally, these strategies estimated long time to define their parameters.

Despite significant advances in the development of advanced controllers in the past few decades, PID controllers remain a popular engineering choice due to their easy design and cheap prices. In the presence of system imperfections and nonlinearities (i.e., RESs penetration and load perturbations), the PID controller faces challenges due to the complexity of selecting its parameters, especially with high RESs penetration17. In this regard, several researchers applied different structures of improvement to the traditional PID controller such as cascaded controller arrangement (CCA)18, a feed forward-feedback arrangement19, combination arrangement20 and increasing the degree of freedom21. Among these methods the CCA is distinguished by simple construction and easy to implement. The reason for applying to the CCA is due to its ability to enhance the outcomes through more tuning parameters. As a result, the CCA design is among the most effective control techniques for boosting system robustness, particularly when disturbances are present in control applications. In this regard several arrangements of the CCA have been applied such as PID-PID22, PD-PID23, PID-P24, fuzzy PI25, fuzzy PI-PID26, and variable structure MPC based PI27. Consequently, this is the authors suggestion for using CCA (i.e. PD-PI) in LFC to improve the traditional PID controller performance.

With the increasing concentration of RESs in the power system, LFCs that rely on diverse control techniques are unable to deal with the nonlinearities caused by high RESs. So, it is essential to install different systems to enhance the system performance and eliminate the RESs bad effects28,29,30,31. In this regard, energy storage schemes (ESSs) play a crucial role in increasing the efficiency and effectiveness of power systems during high RESs penetrations32,33. As a result, different ESSs have been employed to enhance power system execution like fuel cells34, super capacitor (SC)35, plug electric vehicles (PEVs)36, super magnetic energy storage system (SMES)29, capacitive energy systems37, redox flow batteries (RFBs)38. As the RESs penetration increases, significant efforts have been made to utilize the different advantages of these ESSs. In this regard, different studies considered hybrid ESSs (HESSs) to enhance the performance of the power grids during high RESs penetration39. The HESSs which applied to enhance the performance of the power grids are EVs and SC40, Vanadium- RFBs and SMES41, PEVs and FCs42. However, these ESSs improved the power grid during high RESs penetration, they have significant limitations. As, it requires a controller to control the power injected or absorbed by the ESSs. Building on the benefits of the HESSs, the authors aim to apply HESSs as RESs penetration increased.

Too far, several optimization techniques have been put forward for identifying the limit values of various control schemes to address system stability problems. Different optimization algorithms have been used to select the optimal parameters of the considered controller in LFC or linked with ESSs such as a novel sooty terns algorithm12, multi-verse optimizer43, marine predator optimizer algorithm44, cheetah optimizer45, and skill optimization technique46. In this regard, the authors applied electric eel foraging optimizer (EEFO) to select the optimal parameters of the proposed controller in this study47.

Research gap and motivation

In addressing frequency stability challenges, conventional controllers like the I, PI, and PID controllers encounter difficulties in parameter tuning and lack deliberation for doubt, averting system stability. Additionally, other non-cascaded controllers have enabled LFC of power systems; nevertheless, high performance with heavy penetration of RESs was not permitted by these controllers. On the other hand, few studies applied CCA to maintain frequency stability, but their arrangement uses more parameters, and the used optimization techniques cannot select the parameters with precision. Also, the developed algorithms have drawbacks like sluggish convergence during the iterative process, trapping in local optima, and adjustment of governing parameters. In addition, only an insufficient study has observed the influence of high RESs diffusion. Consistently, limited reviews consider the use of the EESs without their hold controllers in power grids with excessive RESs penetration. Nevertheless, these ESSs enhance the power grid performance, but they do not proposal superior solutions for improving the frequency fluctuations. Also, several previously used approaches use traditional ESSs without any control to enhance the performance of their considered systems. This administration highlights the need for a more inclusive analysis of the integration of advanced ESSs alongside robust control strategies to mitigate frequency variations through high RESs penetrations.

This work’s motivation is to avoid the flaws in the previously published methodologies by using an effective strategy to enhance frequency fluctuations during high RESs penetration. The effective strategy depended on applying HESSs (i.e., PEVs with SMES). Furthermore, applying a PD-PI controller to control the supplied or absorbed HESSs. Additionally, utilizing the benefits of the EEFO in selecting the parameters of the proposed controller. The authors considered the output of RESs sources to confirm the superiority of the proposed strategy in enhancing the frequency and mitigating any fluctuations. Additionally, Table 1 explains the distinctions between the present research and the previously stated findings as well as the limitations of the previously mentioned findings.

Table 1 The distinctions between the present research and the previously stated findings.

The study contribution

This study proposes the use of HESSs (i.e., PEVs and SMES) to mitigate the frequency instabilities through high RESs penetration. The HESSs depend on the PD-PI controller during their operation in the considered power grid. The HESSs operates with the LFC (i.e., PD-PI controller) to enhance the system performance. Additionally, the EEFO algorithm was used to choose the optimal parameters of the proposed HESSs strategy. Furthermore, the following points summarize this work’s significant contributions:

  • A novel hybrid energy storage system (HESSs) integrating PEVs for long-term balancing and SMES for rapid transient support, providing enhanced frequency stability and operational efficiency.

  • A realistic high-renewable framework that incorporates actual wind and solar data from Egypt, ensuring practical evaluation of system dynamics under high-RES penetration.

  • A cascaded PD-PI controller applied simultaneously to both LFC and HESSs operation—representing the first dual application of this controller—which effectively mitigates frequency deviations in RES-dominated grids.

  • Optimal tuning of the PD-PI controller using the Enhanced Exploration and Exploitation Framework Optimization (EEFO), ensuring precise parameter selection and superior control performance.

  • Comprehensive robustness validation of the proposed controller against diverse operating challenges, including system parameter variations, different load patterns, and cyber-security attack conditions rarely addressed in previous studies.

The study organization

The remainder of the paper is structured as follows: Sect. 2 provides the dynamic system description. Section 3 describes the problem and the PD-PI control technique. Then, the EEFO algorithm is explained in Sect. 4, while the proposed strategy based on EEFO methodology is presented in Sect. 5. The simulation outcomes and disputation of different scenarios are presented in Sect. 6. Finally, Sect. 7 introduces the study’s conclusions and future recommendations.

Description of dynamic system

This study discusses hybrid power grid (HPG) that incorporates RESs and ESSs technology. The PD-PI is employed in LFC to achieve power grid stability. Each region of the HPG includes three traditional generation plants: a gas plant, a hydroelectric plant, and a reheat thermal plant. Each region of the HPG has an overall rated capacity of 2000 MW. The thermal power plant contributes 1087 MW, obtaining the biggest amount of electrical power; the gas turbine of 262 MW and hydropower capacity of 653 MW come in second and third, respectively. Figure 1 displays the description of the power grid in the Simulink model. The input signal for the proposed controller is the area control error (ACE), while each generation unit’s output signal serves as a secondary control action to obtain more active power for better performance. Table S1 in Supplementary clears the parameters of the two identical regions of the electrical grid under study: Eqs. (1) and (2) offer formulas for computing the ACEs in each area10.

$$\:{ACE}_{1}={\varDelta\:P}_{tie12}+B{\varDelta\:f}_{1}$$
(1)
$$\:{ACE}_{2}={\varDelta\:P}_{tie21}+B{\varDelta\:f}_{2}$$
(2)

where \(\:{\varDelta\:P}_{tie12}\) symbolizes the power flow that flows from region-1 to region-2, \(\:{\varDelta\:P}_{tie21}\)indicates the power flow that flows from region-2 to region-1, \(\:B\) represents the bias frequency factor, \(\:{\varDelta\:f}_{1}\) and \(\:{\varDelta\:f}_{2}\)indicate the frequency deviations in region-1 and region-2, respectively.

Fig. 1
figure 1

Simulink model of two interconnected system.

Wind power plant model

The following is a description of the output power obtained by real wind turbine49:

$$\:{P}_{wt}=\:\frac{1}{2}\rho\:{A}_{T}{v}_{w}^{3}{C}_{p}\left(\lambda\:,\beta\:\right)$$
(3)

where \(\:{v}_{w}\), \(\:{A}_{T}\) and \(\:\rho\:\) indicate the velocity of wind, the swept area, and the air density, respectively, \(\:\beta\:\) and \(\:\lambda\:\) represent pitch angle of the blade and ratio of tip-speed, respectively. The following formula expresses the power coefficient (\(\:{C}_{p}\)), also known as the rotor blades coefficient50,51:

$$\:{C}_{p}\left({\lambda\:}_{i},\beta\:\right)=0.5\left({\lambda\:}_{i}-0.022{\beta\:}^{2}-5.6\right){\times\:e}^{-0.17{\lambda\:}_{i}}$$
(4)
$$\:{\lambda\:}_{i}=\frac{3600\times\:R\:}{1609\times\:\lambda\:}\:,\:\:\lambda\:=\frac{\omega\:\times\:R}{{v}_{w}}\:$$
(5)

where \(\:R\) and \(\:\omega\:\) denote the blade length and angular velocity.

In both regions under examination, wind power plants have a high penetration rate as one of the main RESs. wind farm with rated capacity of 85 MW has been used and linked into the power grid under investigation17. Furthermore, the whole bulk employed in this study is ten Zafarana wind farms, with a total capability of 850 MW. The transfer function used in arithmetic model of the wind induction generator has a gain of unity and time constant of 0.3 s. The actual wind speed recorded in the Jabal al-Zeit area in the Red Sea Governorate in Egypt and the actual random output power from the wind power station in a real platform are shown in Fig. 2.

Fig. 2
figure 2

The electrical power generated by real wind farm17.

The model of solar power plant

The irradiation intensity, surface area, and temperature of the surrounding environment influence the power output of PV generating unit. To determine the electrical power extracted from the PV module, the following Eq. is used52:

$$\:{P}_{PV}={\eta\:}_{sc}{\tau\:}_{g}{\alpha\:}_{sc}RA\:[1-{{\upmu\:}}_{sc}({T}_{sc}-{T}_{r}\left)\right]$$
(6)

where \(\:A\), \(\:{\eta\:}_{sc}\), \(\:{\alpha\:}_{sc}\), and \(\:{\mu\:}_{sc}\) denote the overall area of solar cell, efficiency of solar cell, absorptivity of solar cell, and thermal factor of PV cell efficiency, respectively. The terms \(\:R\) and \(\:{\tau\:}_{g}\) symbolize solar radiation and glass permeability, respectively, \(\:{T}_{r}\) and \(\:{T}_{sc}\) indicate reference temperature and cell temperature, respectively. PV plant with 50 MW capacity is considered and linked to the investigated power grid17. Solar radiation recorded in the Benban area in Aswan Governorate in Egypt and the power produced by real PV plant is illustrated in Fig. 3.

Fig. 3
figure 3

The produced power from real PV plant17.

Plug in electric vehicles model

Numerous works presented storage technology of PEVs to reduce the imbalance between production power and load demand when RESs are considered. By connecting PEVs to the electrical grid, the superior potential utilization of electrical energy between the power system and consumers is achieved. As a result, using comparable PEV with different inverter ability allows control the model behavior of PEV53,54. Figure 4 illustrates the appropriate PEV design for the LFC investigation; this model aims to simulate the performance of PEV battery. It can calculate the total power required to charge or discharge battery under control. In this model, the voltage of an open-circuited battery is represented by \(\:{V}_{oc}\). The voltage of an EV is contingent upon the state of charge (\(\:SOC\)) of its batteries. To simulate ohmic losses and battery transients, parallel RC network with series resistance is included in the model21. The Nernst voltage can be calculated as follows:

$$\:{V}_{oc\_SOC}={V}_{nom}+S\frac{RT}{F}\text{ln}\left(\frac{SOC}{{C}_{nom}-SOC}\right)$$
(7)

where \(\:{C}_{nom}\) and \(\:{V}_{nom}\) represent the nominal values of battery capacity and battery voltage, respectively, \(\:S\) and \(\:T\) stand for the parameters’ sensitivity of Nernst voltage and temperature, respectively. The terms \(\:R\) and \(\:F\) symbolize gas and Faraday constants, respectively. The size of PEV is selected based on the battery capacity, the maximum charging and discharging capacity for each vehicle connected to the grid, and the number of potential connected vehicles. Considerable adjustment of frequency and a decrease in total load variations are rendered achievable by PEV penetration55.

Fig. 4
figure 4

The PEVs model in Simulink55.

Superconducting magnetic energy storage model

The SMES units have an extreme superconducting inductance that allows them to absorb surplus real power when load decreases and injects real power as a substitute during increasing load. The SMES releases the stored energy into the grid through the power conversion system in response to an abrupt shift in the load demand. It helps in increasing the energy generated so that the system requires less time to be stabilized, the block diagram of SMES is shown in Fig. 5. Compared to other ESSs, SMES devices exhibit higher efficiency, longer working lifetimes, and faster reaction times. Fast power grid disruptions can be handled by the SMES, improving frequency response regulation56,57. The power deviation of SMES can be calculated as,

$$\:{\varDelta\:P}_{smes}=Io.{\varDelta\:E}_{d}+\varDelta\:{I}_{d}.\varDelta\:{E}_{d}$$
(8)
$$\:\varDelta\:{I}_{d}=\frac{1}{SL}\varDelta\:{E}_{d}$$
(9)
$$\:\varDelta\:{E}_{d}=\frac{1}{S{T}_{Smes}+1}\left({K}_{smes}.\varDelta\:F-{K}_{id}.\varDelta\:{I}_{d}\right)$$
(10)

where \(\:Io\) and \(\:{\varDelta\:E}_{d}\)denote the current’s nominal value and voltage deviations, respectively, \(\:\varDelta\:{I}_{d}\) refers to the current’s deviations, \(\:L\) represents the coil inductance, and \(\:{K}_{id}\)is the gain of the feedback loop for inductor deviation. The terms \(\:{T}_{Smes}\), \(\:{K}_{smes}\), and \(\:\varDelta\:F\) symbolize the time constant, gain of SMES, and frequency deviation, respectively. The SMES size is selected based on its power rating, energy capacity, charging and discharging time, and system requirements. When SMES injects power very instantly, it enhances frequency regulation and dampens fluctuations rapidly.

Fig. 5
figure 5

The SMES model in Simulink57.

The PD-PI control arrangement

Due to the topic issues in the power grid under study which is represented in high penetration rates of RESs in both regions and various relevant fluctuating load patterns, it is imperative to build a dependable controller to reduce oscillations and increase system stability. Thus, to address the oscillations that resulted from the earlier issues, this work considers developing PD-PI controller designed via EEFO algorithm. The controller process’s main goal is reducing the impact of the primary oscillations and improving the quality of the output. The structure of the PID and proposed PD-PI controllers are displayed in Fig. 6, the proposed controller has only four parameters that are calculated by EEFO method. Advantages of PD-PI Over Traditional PID as:

  • Improved disturbance rejection & setpoint tracking separation.

  • PID controllers combine proportional (P), integral (I), and derivative (D) actions into a single structure, which means the same gains affect both disturbance rejection and setpoint tracking.

  • PD-PI controllers decouple these two functions: PD part (Proportional-Derivative) primarily handles setpoint tracking (improve transient response). PI part (Proportional-Integral) primarily handles disturbance rejection (steady-state error elimination).

  • Result More flexible tuning for different control objectives.

  • Reduced Overshoot in Setpoint Changes.

For more clear around the derivative (D) action in the PD part helps dampen overshoot when tracking reference changes, whereas in a standard PID, the derivative term affects both tracking and regulation, sometimes causing conflicts.

Fig. 6
figure 6

The structure of PID and proposed PD-PI controllers.

The transfer functions of PID and PD-PI controllers can be expressed as,

$$\:{TF}_{PID}=\frac{C\left(s\right)}{E\left(s\right)}={K}_{p}+\frac{{K}_{i}}{S}+{K}_{d}S$$
(11)
$$\:{TF}_{PD-PI}=\frac{C\left(s\right)}{E\left(s\right)}={K}_{p1}+{K}_{d}S+{K}_{p2}+\frac{{K}_{i}}{S}$$
(12)

In Eq. (11) the \(\:{K}_{p}\), \(\:{K}_{i}\),and \(\:{K}_{d}\) are the parameters of PID controller, while the PD-PI parameters are \(\:{K}_{p1}\), \(\:{K}_{d}\), \(\:{K}_{p2}\), and \(\:{K}_{i}\) as given in Eq. (12). Where KminKKmax, Kmin represents the minimum bound which is assigned as zero, while Kmax indicates the maximum bound and assigned as 10. The integral time absolute error (\(\:ITAE\)) is used as the fitness function to be mitigated, it can be calculated via multiplying the time term by the integral of the absolute error as follows:

$$\:\text{M}\text{i}\text{n}\text{i}\text{m}\text{i}\text{z}\text{e}\:ITAE=\text{m}\text{i}\text{n}\text{i}\text{m}\text{i}\text{z}\text{e}\left(\underset{0}{\overset{{T}_{sim}}{\int\:}}\left(\:\left|{\varDelta\:f}_{1\:}\right|\:+\:\left|{\varDelta\:f}_{2\:}\right|\:+\:\left|{\varDelta\:P}_{tie\:}\right|\right).\text{t}\:\:dt\right)$$
(13)

where \(\:{T}_{sim}\) indicates the total simulation time and \(\:dt\) describes the time of simulation.

Electric eel foraging optimizer

Inspiration

The EEFO is presented by Zhao et al.47, it has considered a predator as it contains thousands of electrical cells that can store electrical energy. Adult eels can generate a voltage of 300 to 800 V to hunt their prey, and it can be powerfully discharged into freshwater fish. With their weak eyesight, eels often create about 10 V to detect and navigate towards prey. Eels efficiently monitor and identify the location of swiftly moving prey by exploiting the feedback given by these electrical impulses. When eels locate their target, they stun them by quickly emitting a stronger electric charge. The highly developed mode of defense and communication that eels master is done by using the electric charge. Furthermore, mild electric discharge is utilized for mutual communication and large electric charges are employed as a weapon of defense against an adversary.

Interacting

Eels swim and agitate with each other when they come across a group of fish. After that, the eels commence to swim in a massive, electrified circle to catch many small fish within it. Within EEFO, every electric eel represents a potential solution, with the targeted prey being the best nominee solution attained thus far in every phase. Based on the intelligence of each other’s locations, the relationship indicates that each eel collaborates with others. This conduct may be thought of as the global exploration stage. An electric eel may communicate with any other eel selected at random from the population by employing the position data of every member in the community. Comparing the distinction between a randomly selected eel and the population center is necessary to update an eel’s location. Eels churn, or move randomly in various directions, as a kind of social interaction. This churn is illustrated by the following Eqs.:

$$\:\left\{\begin{array}{c}\left\{\begin{array}{c}{v}_{i}\left(t+1\right)={x}_{j}+C\times\:\left(\stackrel{-}{x}\left(t\right)-{x}_{i}\left(t\right)\right)\:\:{p}_{1}>0.5\\\:{v}_{i}\left(t+1\right)={x}_{j}+C\times\:\left({x}_{r}\left(t\right)-{x}_{i}\left(t\right)\right)\:\:{p}_{1}\le\:0.5\end{array}\right.\:fit\left({x}_{j}\right(t\left)\right)<fit\left({x}_{i}\right(t\left)\right)\\\:\left\{\begin{array}{c}{v}_{i}\left(t+1\right)={x}_{j}+C\times\:\left(\stackrel{-}{x}\left(t\right)-{x}_{i}\left(t\right)\right)\:\:{p}_{\begin{array}{c}\:\\\:2\end{array}}>0.5\\\:{v}_{i}\left(t+1\right)={x}_{j}+C\times\:\left({x}_{r}\left(t\right)-{x}_{i}\left(t\right)\right)\:\:{p}_{2}\le\:0.5\end{array}\right.\:fit\left({x}_{j}\right(t\left)\right)\ge\:fit\left({x}_{i}\right(t\left)\right)\:\end{array}\right.$$
(14)
$$\:C=n\times\:d$$
(15)
$$\:\stackrel{-}{x}\left(t\right)=\frac{1}{2}\sum\:_{i=1}^{n}{x}_{i}\left(t\right)$$
(16)
$$\:{x}_{r}=low+r\times\:\left(up-low\right)$$
(17)

where \(\:t\) refers to the current iteration, \(\:{x}_{j}\), \(\:n\) and \(\:d\) denote randomly selected eel’s location within the existing population, population size, and dimensions problem, respectively. The terms \(\:r\), \(\:{p}_{1}\) and \(p_2\) represent the random numbers within (0,1), \(\:fit\left({x}_{i}\right(t\left)\right)\) denotes the ith electric eel’s applicant position’s fitness, \(\:low\) and \(\:up\) indicate the lower and upper limits, respectively.

Resting

A resting zone is established in the area where any one dimension of an eel’s location vector is projected onto the principal diagonal in the search space to improve the search efficiency. Consequently, before appealing in resting behavior, an eel locates its resting posture inside its resting region as,

$$\:Z\left(t\right)=Low+\left(\frac{{x}_{rand\{n}^{rand\{d}\:\{t-{Low}^{rand\{d}}{{{Up}^{rand\{d}-Low}^{rand\{d}}\right)\times\:\left(Up-Low\right)$$
(18)
$$\:{R}_{i}\left(t+1\right)=Z\left(t\right)+\left(2\times\:\left(e-{e}^{\frac{t}{{T}_{max}}}\right)\times\:\text{sin}\left(2\pi\:{r}_{1}\right)\right)\times\:\left|Z\left(t\right)-{x}_{prey}\left(t\right)\right|$$
(19)

where \(\:{T}_{max}\), \(\:{r}_{1}\), and \(\:{x}_{prey}\) represent the maximum iteration, random numerals within rang (0,1) and the location vector of the most optimal solution found thus far. While the term \(\:\left|Z\left(t\right)-{x}_{prey}\left(t\right)\right|\) indicate the resting area rang. Eels will transfer to the specified resting area after it has been identified. In this case, an eel optimizes its location towards the resting area based on its current resting location there. This behavior can be represented as follows:

$$\:{v}_{i}\left(t+1\right)={R}_{i}\left(t+1\right)+n\times\:{(R}_{i}\left(t+1\right)round\left(rand\right)\times\:{x}_{i}\left(t\right))$$
(20)

Hunting

Typically, eels swim in synchrony to form a wide circle and encircle their prey when they come to find it. By using low electric discharges for members, they cooperate and contact with their others regularly in the meantime and the electrified area is designated as hunting area. Because of this conduct, the prey starts to scamper around the hunting region, it becomes terrified and abruptly moves from its present location to various regions of the hunting region. Following the identification of the hunting region, an eel starts to hunt in the region, updating its location in response to the prey’s changed location. The hunting behavior can be expression as follows:

$$\:{H}_{prey}\left(t+1\right)={x}_{prey}\left(t\right)+\left(2\times\:\left(e-{e}^{\frac{t}{{T}_{max}}}\right)\times\:\text{s}\text{i}\text{n}\left(2\pi\:{r}_{2}\right)\right)\times\:\left|\stackrel{-}{x}\left(t\right)-{x}_{prey}\left(t\right)\right|$$
(21)
$$\:\eta\:={e}^{\frac{{r}_{3}(1-t)}{{T}_{max}}}\times\:\text{c}\text{o}\text{s}\left(2\pi\:{r}_{3}\right)$$
(22)
$$\:{v}_{i}\left(t+1\right)={H}_{prey}\left(t+1\right)+\eta\:\times\:{(H}_{prey}\left(t+1\right)-round\left(rand\right)\times\:{x}_{i}\left(t\right))$$
(23)

where \(\:{r}_{2}\) and \(\:{r}_{3}\) refer to random numerals within (0,1), \(\:{H}_{prey}\) and \(\:{x}_{prey}\) denote the prey location and the prey selected for hunting, respectively, and \(\:\eta\:\) refers to the curling parameter.

Migrating

When eels see prey, they usually transfer from their resting area to their hunting area. The eels’ migration behavior can be expressed as follows:

$$\:{v}_{i}\left(t+1\right)={-r}_{4}\times\:{R}_{i}\left(t+1\right)+{r}_{5}\times\:{{H}_{r}\left(t+1\right)-L\times\:(H}_{r}\left(t+1\right)-{x}_{i}\left(t\right))$$
(24)
$$\:{H}_{r}\left(t+1\right)={x}_{prey}\left(t\right)+\left(2\times\:\left(e-{e}^{\frac{t}{{T}_{max}}}\right)\times\:\text{s}\text{i}\text{n}\left(2\pi\:{r}_{2}\right)\right)\times\:\left|\stackrel{-}{x}\left(t\right)-{x}_{prey}\left(t\right)\right|$$
(25)

where \(\:{r}_{4}\) and \(\:{r}_{5}\)indicate random numerals within (0,1), \(\:{H}_{r}\)and \(\:L\) represent the regarded as any location inside the hunting region and levy flight function, respectively.

Moving from exploration to exploitation stage

To enhance the optimization efficiency of the algorithm, EEFO bases its search behaviors on an energy coefficient that can control the shift from exploration and exploitation. The energy coefficient can be described as,

$$\:E\left(t\right)=4\times\:sin\left(1-\frac{t}{{T}_{max}}\right)\times\:\text{ln}\frac{1}{{r}_{6}}$$
(26)

where \(\:{r}_{6}\) refers to random numeral within (0,1). As the number of iterations increases, the energy coefficient value decreases. The exploration phase is performed when E(t) > 1, the eels conduct universal search throughout the variable area by interactive activity. While the exploitation phase is performed when E(t) < 1, in this stage the eels typically engage in local search in sub-areas through resting, hunting activities or migration. The flow chart of EEFO is displayed in Fig. 7.

Fig. 7
figure 7

The EEFO flow chart.

The proposed strategy based on EEFO methodology

The EEFO is responsible for determining the optimum PD-PI controller parameters, which lead to a minimal ITAE function. The controller relies on the error signal, which represents the difference between the reference signal and the system output signal. The controller supplies the power system with the required control signal to reduce the frequency deviations and power flow in the interconnection line due to load fluctuations. The process of selecting the optimal parameters of PD-PI controller based on EEFO algorithm is presented in Fig. 8, and the steps of EEFO-based strategy provided in algorithm 1.

Fig. 8
figure 8

The process of selecting the optimal parameters of the PD-PI controller.

Algorithm 1
figure a

Steps of EEFO-based proposed strategy.

Results and discussions

In this study, the effectiveness of the proposed strategy (HESSs &LFC) based on the PD-PI controller is examined to vanish the frequency violation as well as the exchanged power deviation of a HPG during high renewable power penetration and various demand variation. The proposed strategy controller’s parameters are tunned via EEFO algorithm. Many operating conditions have been considered to validate the superiority of the proposed PD-PI controller in LFC and the proposed strategy. Figure 9 shows the considering cases of validating the proposed PD-PI controller in LFC and the proposed strategy. Furthermore, the scenarios considered in this study can be summarized as follows:

Scenario A

Assessing HPG’s performance considering low renewables penetration.

Scenario B

Assessing HPG’s performance with proposed strategy considering different load variations.

Scenario C

Assessing HPG’s performance with proposed strategy considering high renewables penetration.

Scenario D

Assessing the HPG’s performance with proposed strategy considering cyber-attacks and sensitivity analysis.

Fig. 9
figure 9

The considered cases according to scenarios for this study.

Scenario A: assessing the HPG’s performance during low renewables penetration considering SLP

In this scenario, the response of HPG has been tested considering low RESs penetration. The considered renewable power penetration combines wind and PV power penetration. Figure 10 displays the wind and PV power penetrations considering the start times penetrations of different generation sources. This scenario is divided into two cases; the first one involves confirming the superiority of the EEFO algorithm as well as the PD-PI controller-based LFC. While the second one includes confirming the superiority of the LFC&HESSs-based PD-PI over other strategies.

Fig. 10
figure 10

Renewable power considered for low penetration (a) PV power, (b) wind Power.

Case 1: confirming the superiority of the EEFO algorithm as well as the PD-PI controller in LFC

The purpose of this case is to validate the superiority of the EEFO algorithm as well as the PD-PI controller in LFC and examine the resilience of the PD-PI controller considering step load deviation (SLD) at area-1 (i.e., Δ PL = 0.01 pu at t = 0 s) of the HPG. The superiority of the EEFO algorithm is validated by comparing its performance with other algorithms such as SSO, IWD and BWO based on the PD-PI controller. The superiority of the PD-PI in LFC is confirmed by comparing its performance with the PID controller. For the simulation process, 100 iterations were performed, with the number of search agents set to 50. The optimal parameters of the considered controllers for this case are tabulated in Table 2. The ITAE and convergence curve in this case is presented in Fig. 11, where the EEFO achieved the lowest error value with the proposed controller compared to other methods. The frequency and the tie-line power responses of the HPG are displayed in Fig. 12. Likewise, Table 3 depicts the numerical values of overshoot (OS) and undershoot (US) for the strategies under study during three different sets of uncertainties. The PD-PI controller relied on the EEFO offers superior improvement in reducing oscillations in frequency deviation as well as exchanged power violation in region-1 and region-2 under step load deviation and low renewable power penetration.

Table 2 The optimum gains of the PD-PI and PID controllers in LFC during low renewable penetration.
Fig. 11
figure 11

Convergence curves and ITAE bar chart considering low renewable power penetration.

Fig. 12
figure 12

Frequency fluctuation and tie-line power oscillation for case1, scenario A.

Table 3 Numerical values of OS and US during low renewable penetration for case1, scenario A.

Also, the stability of the system with the designed controller via the suggested approach has been assessed. The proposed PD-PI controller’s stability is demonstrated using the bode diagram. Figure 13 displays the bode diagram considering the PD-PI in LFC. The Bode figure demonstrates how the PD-PI controller stability reduces the response at higher frequencies while maintaining strong disturbance rejection capabilities at lower frequencies (greater magnitudes). All things considered, the Bode diagram sheds light on the PD-PI controller’s stability and performance over a variety of frequencies, demonstrating how well it regulates the system’s response through regulated gain and phase shift.

Fig. 13
figure 13

The bode diagram considering the PD-PI based LFC.

Case 2: confirming the superiority of the (LFC& HESSs) based PD-PI over other strategies

This case clarifies the superiority of the proposed LFC&HESSs-based PD-PI controller over other strategies like LFC& EVs relied on PD-PI controller, LFC& SMES relied on PD-PI controller, and LFC-PD-PI controller & HESSs -PID controller. The operating conditions is like that used in case 1, scenario A. Furthermore, the optimal parameters of the proposed strategies and others are tabulated in Table 4. The ITAE and convergence curve for various methods with ESSs in this instance is shown in Fig. 14, where the suggested controller produced the EEFO with the lowest error value when compared to different approaches. Additionally, Fig. 15 displays the responses of frequency and the tie-line power violations for case 2, scenario A. For more details, the output power from the strategies considered is shown in Fig. 16. Likewise, Table 5 depicts the numerical values of OS and US for the strategies under study during three different sets of uncertainties. The proposed LFC & HESSs PD-PI controller relied on EEFO offers superior improvement in reducing oscillations in frequency deviation as well as exchanged power violation in region-1 and region-2 under step load deviation and low renewable power penetration.

Table 4 The optimal parameters of the approaches considered based on different controllers.
Fig. 14
figure 14

Convergence curve for various methods and ITAE bar chart with ESSs.

Fig. 15
figure 15

Frequency fluctuation and tie-line power oscillation for case 2, scenario A.

Fig. 16
figure 16

The output power from different strategies for case 2, scenario A.

Table 5 Numerical values of OS, Ts (s) and US under three different sets of uncertainties during step load violation.

Scenario B: assessing the HPG’s performance with proposed strategy considering different load variations

This scenario is used to examine the resilience of the strategy considered in comparison with other previously mentioned strategies considering different load variations in the presence of low renewable penetration. The operating condition of this scenario is like the operating condition of the previous scenario but considering different load patterns instead of SLP. These patterns of load are intended to imitate real-world variations, allowing for a more comprehensive evaluation of how effectively the approach adapts to changing demands. By examining its performance under these settings, we may find possible strengths and shortcomings in comparison to the other strategies outlined previously. As a result, this scenario is divided into two cases. The first case shows the HPG performance considering series step load variations (SSLV), while the second case considering Random load variations (RLV).

Case 1: HPG performance considering SSLV.

The SSLV is applied to the HPG across all regions. Figure 17 illustrates the SSLV configuration. Initially, the performance of the HPG is evaluated when the SSLV is applied to region (1) Subsequently, the system’s performance is assessed when the SSLV is applied to region (2) The response for this scenario is depicted in Fig. 18. According to Fig. 18, the HESS-based PD-PI controller achieved the lowest overshoot (OS) and undershoot (US) values. For ΔF1 and ΔF2, the OS values were 0.0015 pu and 0.0008 pu, respectively, while the US values were − 0.00015 pu and − 0.00017 pu, respectively, compared to the HESS-based PID controller. In contrast, the PID controller’s OS values for ΔF1 and ΔF2 were 0.0019 pu and 0.00115 pu, while its US values were − 0.0029 pu and − 0.0002 pu, respectively. These results demonstrate that, the proposed method delivers superior performance by significantly reducing both OS and US values, confirming its effectiveness in mitigating frequency fluctuations during SSLV. The numerical analysis values of OS, US and Ts during SSLV are tabulated in Table 6.

Fig. 17
figure 17

The considered SSLV.

Fig. 18
figure 18

The frequency and the tie-line power responses of HPG case 1, scenario B considering (a) SSLV at region-1, and (b) SSLV at region-2.

Table 6 Numerical values of OS, US and Ts during SSLV for HPG.

Case 2: HPG performance considering RLV.

The RLV is applied to the HPG across all regions. Figure 19 illustrates the RLV configuration. Initially, the performance of the HPG is evaluated when the RLV is applied to region-1. Subsequently, the system’s performance is assessed when the RLV is applied to region-2. The response for this scenario is depicted in Fig. 20. The figure clarifies that, the HESS-based PD-PI technique achieved the lowest values for both OS and US. For ΔF1, the OS and US values were 0.0009 pu and − 0.0011 pu, respectively, while for ΔF2, they were 0.00081 pu and − 0.00017 pu, respectively, compared to the HESS-based PID controller. Additionally, Fig. 20(b) illustrates the frequency deviations and tie-line power disturbances in region-2, further confirming that the HESS-based PD-PI technique minimized both OS and US values compared to the HESS-based PID. Table 7 displayed the numerical analysis values of OS, US and Ts during RLV. This demonstrates the effectiveness of the proposed strategy in handling load fluctuations and maintaining frequency stability at nominal levels.

Fig. 19
figure 19

The considered RLV.

Fig. 20
figure 20

The frequency and the tie-line power responses of HPG case 2, scenario B considering (a) RLV at region-1, and (b) RLV at region-2.

Table 7 Numerical values of OS, US and Ts during RLV for HPG.

Scenario C: assessing the HPG’s performance with proposed strategy considering high renewables penetration

In this scenario, the impact of the high renewables’ energy penetration has been considered. Furthermore, the output power of the RESs for this scenario are displayed in Fig. 21. A SLD on region-1 (i.e., Δ PL = 0.01 pu at t = 0 s) of the considered HPG under study. Figure 22 displays the frequency and the power in tie-line responses for this instance. Similarly, Table 8 depicts the OS and US of the three different strategies for scenario C. Then, the outpower from the strategies considered is shown in Fig. 23. According to the proposed strategy findings based on simulation outcomes as well as numerical measurements, the proposed controller offers better enhancement in mitigating fluctuations of frequency and tie-line power for the constructed grid under SLP and high renewable penetrations.

Fig. 21
figure 21

Renewable power considering for high penetration (a) PV power (b) wind power.

Fig. 22
figure 22

Deviations in frequency and tie-line power change for scenario C considering high renewable penetration.

Fig. 23
figure 23

The output power from different strategies for scenario C.

Table 8 Numerical values of OS and US under three different strategies for scenario C.

Scenario D: assessing the HPG’s performance considering cyber-attacks and sensitivity analysis

One of the main problems facing recent smart grids is cyberattacks on LFC. Attackers may interrupt the system’s frequency and transfer of power by altering data or preventing communication. Therefore, detection of intrusions, secure communication, and reliable control mechanisms are crucial for safeguarding LFC systems. In the system under study, two different signals of cyber attacks were introduced to the system as demonstrated in the Fig. 24. Figure 24 (a) represents the attacks from pattren generated, while Fig. 24 (b) denotes the attacks from pattren as random. In addition, the impact of these cyber attacks on the frequency and power deviation in the transmission line is shown in Fig. 25. This shows that random attacks have less of an impact on the system than their counterparts, despite the low frequency deviations, with the highest value of 7.8 E-3 pu and lowest value of −8E-3 pu ​​occurring in the first region.

Fig. 24
figure 24

Signals of cyber attacks.

Fig. 25
figure 25

The frequency and the tie-line power responses for scenario D under cyber-attack (a) pattern Sig. and (b) random Sig.

To confirm the superiority and validity of the suggested controller, it is examined by varying the characteristics of the interconnected system. Sensitivity assessment for scenario C is carried out by altering certain system parameters, such as Kp, Tp, Thr, Tr, and Kr, at ± 10% of their initial values within HESS. Moreover, Fig. 26 illustrates the effect of under the uncertainties of the system parameters the frequency and power deviation of the transmission lines, which shows no significant change in the deviations in this case compared to the normal case, which confirms the efficiency of the proposed technique. Figure 26 (a) displays the effect of modeling the tie-line power with a denominator (s + 1) instead of (s), which has been shown to reduce the energy deviations in the tie-line.

Fig. 26
figure 26

The frequency and the tie-line power responses for scenario C under the uncertainties of the system parameters.

The most important challenge facing the research is the large simulation time which causes an increase in the time consumed in operation. Finally, the fetched results proved the robustness and competence of the proposed strategy (LFC&HESSs) based on PD-PI controller in vanishing the violations of frequency and tie-line power in a HPG with real renewable energy plants during distinct operating conditions. It can be recommended as a reliable LFC for the interconnected system considered.

Conclusions

An advanced strategy proposed in this paper effectively addresses the challenges of frequency stability in hybrid interconnected power grids with high renewable energy penetration of real-world RESs. By integrating a hybrid energy storage system (HESSs) combining the long-term balancing capabilities of plug-in electric vehicles (PEVs) and and the rapid response superconducting magnetic energy storage (SMES) units. So, this study bridges the gap between theoretical models and practical applications, offering a realistic representation of modern power grid behavior.The HESSs is controlled using a PD-PI controller whose parameters are optimally tuned via the electric eel foraging optimizer (EEFO). This novel arrangement ensures precise, dynamic, and responsive control to mitigate the inherent fluctuations caused by the variability and intermittency of RESs. Through comprehensive simulation and comparative analyses, the proposed (LFC&HESSs)-based PD-PI controller significantly outperformed traditional methods. Specifically, the PD-PI controller achieved marked improvements over the widely used proportional-integral-derivative (PID) controller, demonstrating faster and more accurate frequency stabilization. When benchmarked against alternative strategies, such as the (LFC& SMES)-based PD-PI controller, (LFC &EVs)-based PD-PI controller, and LFC&HESS-based PID controller, the proposed method achieved performance improvements of 55%, 45%, and 40%, respectively. These results affirm the effectiveness of the proposed strategy as a promising and scalable solution for modern power systems, paving the way for more resilient, adaptable, and sustainable energy grids. In the future, the impact of the suggested strategy will be extended to larger interconnected power systems, particularly focusing on deregulated environments and nonlinear systems. Future studies will also explore integration of alternative energy storage technologies, such as hydrogen electrolyzer systems and redox flow batteries, will be explored especially in systems with high DC voltage. Further investigations will also examine the influence of fault circuits on system stability, providing a more comprehensive understanding of the control strategy’s robustness and effectiveness in diverse, real-world power grid scenarios.