1 Introduction

In today's digital world, electricity has become a very important commodity for all. To provide electricity in remote rural areas, the hilly area from the primary grid becomes expensive and imparts adverse ecological effects. The combination of distributed energy resources (DERs), energy storage systems (ESSs), electric loads, and the utility grid is called micro-grid (MG). A micro-grid is confined to a geographical area, disconnects from the primary grid and operates independently. The islanding capability permits a micro-grid to continue supplying power to its customers when there is an outage in the power grid due to any calamity. The micro-grid is intelligent with a high degree of sophistication [1, 2]. However, a micro-grid experiences more difficulties due to fluctuation in load and generation in islanded mode than in grid-connected mode. Although renewable energy sources (RESs) are extremely inconsistent, still they exhibit attractive choices for participation in the grid as compared to traditional power systems owing to causes like depletion of fossil fuel, increasing demand for electrical power, environmental pollution and electricity transmission costs escalation. They are also most useful for areas, with a deficit of central grid power due to geographical issues [3]. The unpredictable nature of RES affects the reliability of power production and together with the fluctuating nature of load demands; it leads to a disproportion between generation and demand. In a multi-micro-grid system, this problem turns more extreme and challenging [4, 5]. During low demands, the surplus power can be stored in an energy storage device. They can release the power to the grid according to the requirement in peak demand. The diesel generator used in MG contributes to load demand but fails to handle fast changes in demand as its time constant is high. Plugged-in electric vehicles (EVs) also offer energy storage systems (ESS) via their batteries. EVs play an important role by exchanging power bi-directionally. The charging of EVs can be considered as a consumer, and charged EVs can be employed as an ESS unit in the grid to restrict the major deviations in the system frequency [6, 7]. For the selection of DERs in an MG, environmental and economic aspects are mainly considered. The power generated in a WTG and PV depends on the condition of the weather and the sun's irradiation power. Again, the DEG has a larger time constant and hence will take a longer time for MG control during abrupt variations in load. Hence, a suitable control strategy in co-ordination with the ESS needs to be adopted quickly to compensate for the deviations. The nonlinear structure, intermittent nature, low inertia and uncertainties of DER are mainly responsible for the disparity between the generation and the demand. The frequency and voltage fluctuation may lead to a complete blackout of MG. Thus, a suitable control scheme is to be adopted to achieve the robust load frequency control of MG. Frequency deviations are common in MG which needs to be regulated with a suitable control scheme. The load frequency control (LFC) system continually monitors the grid frequency fluctuation and restores it within an acceptable range for the correct working of electric equipment [8,9,10,11,12,13]. A properly operative LFC solves this issue efficiently and thereby increases the efficacy and efficiency of the MG. It also reduces the requirement for extra protective equipment. The literature review suggests that various researchers have addressed these issues of controller design, different load characteristics, performance concerning parameter variations, unpredictable behavior of renewables like wind and solar, etc., for LFC study [14].

It is widely tested by researchers that the fuzzy logic controller (FLC) is advanced to traditional controllers for the system with complexities like nonlinearities and uncertain parameter variations [15,16,17,18,19,20]. Improved-Salp Swarm Optimized type-2 (T2) fuzzy PID structure for multi-area MG is projected in [1]. Sahoo et al. [5] have recommended fuzzy PD and PID with filter (FPIDF) structures with chaotic multiverse optimizer for the LFC of the micro-grid system. A new LFC strategy for micro-grids considering EVs using a modified harmony search algorithm technique based on general T2 fuzzy PI (GT2FPI) is recommended in [6]. Sahu et al. [7] applied a whale optimization algorithm tuned fuzzy PD-PI structure for frequency regulation of MG with uncertainties for sustaining a green environment with nominal frequency. Chaotic particle swarm optimization (PSO)-based fractional-order (FO) fuzzy PID (FOFPID) structure for frequency control of a hybrid power system (HPS) with renewable sources is suggested in [16]. A hybrid gravitational search algorithm-many optimizing liaisons (hGSA-MOL)-based fuzzy PID approach is suggested for AGC of power systems [15]. PSO-based fuzzy PI approach for micro-grid case study has been done by Bevrani et. al in [16]. In the research article [17], the LFC problem is studied with a new imperialist competitive algorithm based on fuzzy tilt integral derivative with filter and double-integral structure. An arrangement of cascade PI-PD and fuzzy PD controllers is proposed in the islanded multi-micro-grid (MMG) via an improved Jaya Algorithm [18]. A hybrid fuzzy PD-PI controller optimized by a modified moth swarm algorithm is analyzed for the LFC problem having a distributed generation system with EVs [19]. A neural network-based short-term power dispatch scheme has been projected in [21]. The literature survey shows that relatively lesser attention has been devoted to controller structure and optimization methods in the area of LFC. Not only the type of controller structure but also the selection of an appropriate heuristic optimization method for refinement of the controller values acts a decisive role in the overall outcome. Hence, offering and realizing novel heuristic algorithms display substantial influence on the system’s performance. Recently, a novel optimization method called the Harris Hawks optimization (HHO) algorithm [22] is presented. This technique has revealed excellent possibilities to solve various engineering tuning problems.

In this work, a modified HHO method called mHHO is developed and afterward realized to concurrently tune the important parameters of the FOFPID controller. The mHHO algorithm overcomes the demerit of conventional HHO. A better sense of balance is established amid the exploration and exploitation phase to get an improved solution. The arbitrary movement of search agents is improved by introducing scaling factors that ultimately contribute to locating a superior global solution. The efficacy of modified HHO is tested through assessment with some popular techniques of different benchmark functions.

The novelties and contributions of the presented work are explained below:

  1. (i)

    Statistical result study of the mHHO is carried out by evaluating with the HHO and many other techniques in terms of unimodal and multimodal test functions considering different dimensions. Thus, the superiority of mHHO is established.

  2. (ii)

    Scalability result analysis of F1–F13 cases with different dimensions is carried out to verify the superiority of mHHO with others.

  3. (iii)

    The usefulness of the FOFPID controller is recognized by assessing its performance related to a conventional PID and fuzzy PID controller.

  4. (iv)

    Stability analysis of the proposed approach has been performed using a Bode plot.

  5. (v)

    The applicability and effectiveness of the FOFPID controller are authenticated in a real-time simulator by using OPAL-RT simulation.

2 Modified Harris Hawks Optimization (mHHO)

Evolution and adaptation of all living beings for survival are natural phenomena in nature. Hence, nature is the best optimizer. The Harris’s Hawk is well recognized for hunting cooperatively in packs. Harris Hawks’ social nature is characterized by their intelligence. Mostly raptors are lonely, but Harris’ Hawks hunt cooperatively in groups. Groups of Harris Hawks are likely to be more successful than lone hawks at capturing prey. Also, Harris Hawks can change the strategies for foraging and besieging according to the prey’s behavior. Such a distinctive and effectual method of hunting became the motivation for HHO. The HHO developed by Haidari et al. [22] is an attempt toward developing a population-based algorithm that can apply to any kind of real-world problem with proper formulation, inspired by the cooperative behavior of one intelligent bird called Harris Hawk. The strategy to catch prey is termed seven kills or surprise pounce. According to the 'no free lunch theory,' no universally best optimizer is there for all kinds of problems [23]. This is the motivation behind the development of new optimization techniques with developed strategies for different kinds of problems. According to the prey's behavior, the exploitation phases for different scenarios during a hunt are modeled, as explained below:

2.1 Exploration Mode

Usually, because of their powerful eyes’ hawks can see and chase down their prey quickly. But in some occasions, it becomes difficult to locate the prey. So the hawks pause and search for prey. Such behavior in HHO is called exploration mode. Positions of Hawks are selected as possible solutions. While resting, hawks search the prey in two strategies. Based on a random variable q, the hawks can rest either in a location near others (Eq. (1) for q < 0.5) or rest arbitrarily in an arbitrary position (Eq. (1) for q ≥ 0.5).

$$\begin{aligned} &X\left(t+1\right)\\ & \quad=\left\{\begin{array}{l}{X}_{\mathrm{rand}}\left(t\right)-{r}_{1}\left|{X}_{\mathrm{rand}}\left(t\right)-2{r}_{2}X\left(t\right)\right| \quad q\ge 0.5\\ \left({X}_{\mathrm{rabbit}}\left(t\right)-{X}_{m}\left(t\right)\right)-{r}_{3}\left(L.B.+{r}_{4}\left(UB-LB\right)\right) \quad q<0.5\end{array}\right.\end{aligned}$$
(1)

where for the present iteration, \({X}_{\mathrm{rand}}\left(t\right)\) is a hawk chosen arbitrarily, \(X\left(t\right)\) is the location vector of hawks, \({X}_{rabbit}\left(t\right)\) is the location of prey, \({X}_{m}\left(t\right)\) is the mean location of hawks for a present population, L.B. and U.B. are the bounds for the variables and \({r}_{1}, {r}_{2}, {r}_{3}\ \mathrm{and}\ {r}_{4}\) are arbitrarily chosen values in the interval (0, 1). For subsequent iterations, \(X\left(t + 1\right)\) becomes the location vector for hawks. Also, the hawk's mean position is equated in Eq. (2) as follows:

$${X}_{m}\left(t\right)=\frac{1}{N}\sum_{i=1}^{N}{X}_{i}\left(t\right)$$
(2)

where N is the number of hawks and \({X}_{i}\left(t\right)\) is the location of the hawk i for the iteration \(t\).

2.2 Departure from Exploration to Exploitation Mode

Based on the escaping energy of the prey, HHO shifts from exploration to exploitation and then different exploitation modes are implemented. The prey’s escaping energy decreases during the hunt. The escaping energy is equated in Eq. (3) as follows:

$$E=2{E}_{0}\left(1-\frac{t}{T}\right)$$
(3)

where E is the prey's escaping energy, \({E}_{0}\) is the energy state of the prey at starting, which randomly changes at each iteration in the period of (‒ 1, 1), and T and t are the maximum and a current number of iterations, respectively.

Prey’s escaping energy decreases for \({E}_{0}\) are between ‒ 1 and 0 and increases \({E }_{0}\) from 0 to 1. Also, the prey’s escaping energy decreases as the iteration increases. Depending on escaping energy of the prey, the transition takes place from exploration (\(\left|E\right|\ge 1 )\) to exploitation (\(\left|E\right|<1)\).

2.3 Exploitation Mode

In exploitation mode, hawks jump surprisingly on the besieged prey. Here, a parameter \(r\) is illustrated as the chance of the prey escaping from the hawk’s attack. If \(r < 0.5\) then the prey successfully escapes, \(r \ge 0.5\) the prey is captured. Depending upon the energy and escaping model of prey, hawks take on the besiege strategy. Ultimately, the hawks fetch the prey exhausted by repeated pounces and then make a hard besiege to fruitfully grab the prey. In HHO, parameters \(r\ \mathrm{and}\ E\) are being used for swapping among soft and hard besiege modes. Based on energy level and possibilities of escaping the prey from the hawks, besiege and hunt procedures are categorized into four categories as below.

2.3.1 Soft Besiege Mode

For \(r \ge 0.5\) and \(\left|E\right| \ge 0.5\) prey has enough energy to evade the hunt and tries to jump randomly. So, the hawks will cooperatively give surprise pounces, to make the prey exhausted. Such a move is called a soft besiege. For such a scenario, the prey's behavior is described by Eqs. (4) and (5):

$$X\left(t+1\right)=\Delta X\left(t\right)-E\left|J{X}_{\mathrm{rabbit}}\left(t\right)-X\left(t\right)\right|$$
(4)
$$\mathrm{and}\ J=2\left(1-{r}_{5}\right)$$
(5)

Here, \(\Delta X\left(t\right)\) is the change in the location vector of prey at the current location, J is the random jump effort given by the prey to mislead the hunt, \({r}_{5}\) and is a random value in the interval (0, 1) to express the nature of arbitrary jumping. \(\Delta X\left(t\right)\) is given by Eq. (6):

$$\Delta X\left(t\right)={X}_{\mathrm{rabbit}}\left(t\right)-X\left(t\right)$$
(6)

2.3.2 Hard Besiege Mode

For \(r \ge 0.5\) and \(\left|E\right|< 0.5\), prey has got exhausted and not enough energy to escape the hunt. So, the hawks will give strong surprise pounces, besiege the prey aggressively and capture the prey. Such a move is called a hard besiege. For such a scenario, the hawk's hunting behavior is described by Eq. (7):

$$X\left(t+1\right)={X}_{\mathrm{rabbit}}\left(t\right)-E\left|\Delta X\left(t\right)\right|$$
(7)

2.3.3 Soft Besiege Mode with Rapid Dives

\(\mathrm{For}\ r < 0.5\left|E\right|\ge 0.5,\) The prey has enough energy to escape from the hawks. Here the hawks follow the soft besiege for shock jump. The hawks will move in leapfrog pattern and illusive pattern of prey to escape. Leapfrog movements of hawks’ are described in a mathematical framework by Lévy flight (LF) approach. If the hawks go for a soft besiege of the prey, then the next move performed by the hawks is described in Eq. (8).

$$Y={X}_{\mathrm{rabbit}}\left(t\right)-E\left|J{X}_{\mathrm{rabbit}}\left(t\right)-X\left(t\right)\right|$$
(8)

Consequently, hawks dive as per the misleading moves of the prey. If the prey does more misleading movement, then hawks irregularly alter their plan and dive, based on LF as expressed below.

$$Z=Y+S\times LF\left(D\right)$$
(9)

where S is an arbitrary vector of size \(1 \times D\) and LF indicates the Lévy flight method, calculated in Eq. (10) as:

$$LF\left(x\right)=0.01\times \frac{u\times \sigma }{{\left|v\right|}^{\frac{1}{\beta }}}, \sigma ={\left[\frac{\Gamma \left(1+\beta \right)\times sin\left(\frac{\pi \beta }{2}\right)}{\Gamma \left(\frac{1+\beta }{2}\right)\times \beta \times {2}^{\left(\frac{\beta -1}{2}\right)}}\right]}^{\frac{1}{\beta }}$$
(10)

where \(u {\text{ and }} v\) are arbitrarily chosen parameters in the interval (0, 1) and β is the constant equal to 1.5.

Finally, the soft besiege mode followed by hawks is described in Eq. (11):

$$X\left(t+1\right)=\left\{\begin{array}{c}Y\quad if F\left(Y\right)<F\left(X\left(t\right)\right)\\ Z\quad if F\left(Z\right)<F\left(X\left(t\right)\right)\end{array}\right.$$
(11)

2.3.4 Hard Besiege Mode with Rapid Dives

For \(r < 0.5\) and \(\left|E\right|< 0.5\), escaping energy of the prey has reduced appreciably. Here, hawks reduce their mean gap from the prey and execute hard besiege. At this instant, the LF model is also used by hawks along with hard besieges to capture the prey successfully. These actions of hawks are modeled as:

$$X\left( {t + 1} \right) = \left\{ {\begin{array}{*{20}c} {Y \quad if \, F\left( Y \right) < F\left( {X\left( t \right)} \right)} \\ {Z \quad if \, F\left( Z \right) < F\left( {X\left( t \right)} \right)} \\ \end{array} } \right.$$
(12)

where Y and Z are equated in Eqs. (13) and (14) as follows:

$$Y = X_{{{\text{rabbit}}}} \left( t \right) - E\left| {JX_{{{\text{rabbit}}}} \left( t \right) - X_{m} \left( t \right)} \right|$$
(13)
$$Z = Y + S \times LF\left( D \right)$$
(14)

\(X_{m} \left( t \right)\) can be accessed from Eq. (2) for evaluation of Eq. (13). In this way, hawks adopt strategies for preying depending upon the values \(r \;{\text{and}}\; E\).

2.4 Modifications

The following two modifications were made to increase global search potential. In the original HHO, the escaping energy is equated using Eq. (3), whereas, in the proposed mHHO, the escaping energy is calculated using Eq. (15) and E0 is calculated using Eq. (16). The

$$E = 2E_{0} \left( {1 - \frac{{k^{0.5} }}{{I^{0.5} }}} \right)$$
(15)
$$E_{0} {2} \cdot {\text{ sin (rand ())}-\text{1}}$$
(16)

The cyclic sine function contour enables a solution to be repositioned. This can assure a suitable exploration of the search area known amid two solutions. So the technique will be able to look for somewhere else in the space and also in the middle of their positions. In HHO, the remaining hawks attempt to modify their locations depending on the best hawk's location. In the early stages, the best place for hawks is unknown. Modifying it with big steps firstly may cause in large variation in the optimum value. Consequently, scaling factors are engaged to limit the movement of hawks during the initial stages of the algorithm. Before each iteration, the modified position of hawks (\({H}_{m}(k)\)) is adjusted as:

$$H_{m} \left( k \right) = H\left( k \right)/SF$$
(17)

Here the scaling factor (SF) is

$$SF = 2 - \frac{k}{I}$$
(18)

The employment scaling factors permit a sluggish drive of hawks in the initial periods of the search. Consequently, the improvement of the search potential of the algorithm takes place. Afterward, as better solutions are obtained, hawks move at the usual rate.

2.5 mHHO Algorithm Workflow Steps

  1. (i)

    Define the objective function and constraints.

  2. (ii)

    Specify the bounds of variables; initialize the hawk’s locations and iteration count.

  3. (iii)

    For each hawk, evaluate the objective function values employing Eq. (7).

  4. (iv)

    Identify the best hawk as per minimum objective function value.

  5. (v)

    Update the E and J of prey by Eqs. (3) and (5).

  6. (vi)

    If E ≥ 1, allocate the location to hawk as per Eq. (9), based on probability q, or else go to step (vii).

  7. (vii)

    If E ≥ 0.5, go to step (vii) or else to step (ix).

  8. (viii)

    If r ≥ 0.5, allocate hawk location as per Eq. (4) or else by Eq. (11)

  9. (ix)

    If r ≥ 0.5, allocate hawk location as per Eq. (7) or else by Eq. (12)

  10. (x)

    Calculate the modified positions of Hawks using Eqs. (17) and (18)

  11. (xi)

    Verify if the maximum iteration count is attained, if yes then go to step (xii) or else increase the iteration counter and go to step (iii).

  12. (xii)

    Return the best values obtained.

The flowchart of mHHO is displayed in Fig. 1.

Fig. 1
figure 1

Flowchart of mHHO algorithm

3 mHHO Algorithm’s Performance Evaluation

3.1 Benchmark Test Functions

Validation of strength for any innovative optimization algorithm is performed on some standard test functions adopted from the literature [22]. The test functions are often chosen diversely and unbiased for the correct evaluation of the optimization algorithm [24]. Thus, validation of the efficiency of the proposed mHHO is carried out by selecting a set of benchmark functions [22]. Benchmark functions are mainly categorized as unimodal (F1–F7) having unique optimums and multimodal test functions (F8–F13) having multiple local optima. During the exploration phase, there may be chances of a poorly designed optimizer getting stuck at local minima with multimodal test functions. Thus, there are some difficult classes of problems where the strength of the optimizer is tested. The performance of mHHO is analyzed by these 13 well-recognized test functions.

3.2 Experimental Set-Up

The performance of mHHO is related to HHO and many other recent optimization methods like Teaching Learning-Based Optimization (TLBO), BAT, Particle Swarm Optimization (PSO), Firefly Algorithm (FA), Moth-Flame Optimization (MFO), Cuckoo Search (CS), Genetic Algorithm (GA), Differential Evolution (DE), Grey Wolf Optimization (GWO), Flower Pollination Algorithm (FPA) and Biogeography-Based Optimization (BBO) techniques. Optimization is done for 30 runs for dimensions 30, 100, 500 and 1000 with maximum iterations of 500 and the number of search agents 30. The set values of all parameters required for different algorithms are taken the same as suggested in the research work by authors in the original HHO [22]. Experiments are carried out on a computer having 64-bit, 64 GB RAM with MATLAB 7.10.

3.3 Quantitative Analysis of mHHO

In quantitative analysis, a comparison of proposed mHHO with other techniques for various dimensions (30, 100, 500 and 1000) for test functions F1-F13 is comprehensively presented. Tables 1, 2, 3, 4, 5, 6, 7 and 8 present a comparison among mHHO and other techniques published recently via handling scalable functions. Quantitative analysis is performed using average (Ave.) and standard deviation (Std.) to do a fair assessment of the suggested mHHO method with others by doing multiple runs. Small Std. represents that the algorithm gives nearly similar results for multiple runs of a given problem. Thus, the algorithm is more robust and able to reproduce results with minimum discrepancy and has less dependency on the initial population. Analysis is shown (in Tables 1, 2, 3, 4, 5, 6, 7 and 8) to verify the impact of dimensions on mHHO for F1–F13 test cases by comparing with optimization techniques like GA [25], PSO [25], BBO [25], DE [25], TLBO [26], CS [27], BAT [28], MFO [29], FA [30], GWO [31], FPA [32]. It is observed that mHHO offers the best results for F1–F7 problems in 71.4% of 30-dimensional test functions as shown in Table 1 and 85.71% of test cases for F8–F13 problems as observed in Table 2. Remarkably better performance is obtained with dimension 100, where mHHO performs better in 85.71% of F1–F7 problems (Table 3) and F8–F13 problems (Table 4). Similarly, significant variance in the performance of mHHO with all other techniques can be observed from Table 5 for F1–F7 test functions for dimension 500, where improvement for all test functions is observed. Results in Table 6 for the 500 dimension show improvement in performance for all test functions except F12 and F13. Quantitative analysis is further carried out with 1000 dimensions, and outcomes are depicted in Table 7 and Table 8. It is observed that results for 1000 dimension are similar to that for lower dimensions and HHO still performs better for most of the test functions. Thus, it can be concluded that even for higher-dimensional functions, HHO displays a reasonable and soundly fast performance in searching for the best results related to other popular optimizing techniques.

Table 1 Statistical results of benchmark functions (F1–F7) with 30 dimensions
Table 2 Statistical results of benchmark functions (F8–F13) with 30 dimensions
Table 3 Statistical results of benchmark functions (F1–F7) with 100 dimensions
Table 4 Statistical results of benchmark functions (F8–F13) with 100 dimensions
Table 5 Statistical results of benchmark functions (F1–F7) with 500 dimensions
Table 6 Statistical results of benchmark functions (F8–F13) with 500 dimensions
Table 7 Statistical results of benchmark functions (F1–F7) with 1000 dimensions
Table 8 Statistical results of multimodal benchmark functions (F8–F13) with 1000 dimensions

3.4 Scalability Analysis of HHO

The robustness of mHHO on scalability for different dimensions is shown in Fig. 2. For a reasonable judgment of advanced HHO optimization technique over its performance with different problems having different dimensionality, scalability analysis is performed by taking dimensions of 30, 100, 500 and 1000 for scalable F1-F13 test functions. This study reflects the dimension’s impact on the solution for HHO optimization technique for lower as well as higher dimension problems. From Fig. 2, it can be observed that mHHO provides better results when evaluated with some recognized nature-inspired techniques. It is observed that there is an impact of dimensions over the optimality of the results of different optimization. The performance of different dimensions considerably decreases with an increase in dimensions. However, mHHO can preserve a correct balance between exploratory and exploitative behavior on problems with several variables. The mHHO over takes other optimization for the five test functions F1–F4, and F7. Again, for F6, F8 and F10 performance is very much similar to that of HHO. Scalability results show that mHHO lags marginally from HHO in F5 and F12, F13. This discloses that the mHHO offers reliable outcomes in all dimensions without debasing the performance. As verified from quantitative results from tabulation for F9, and F11 test functions, HHO has reached the best global optimum.

Fig. 2
figure 2

Scalability results of the proposed mHHO Vs other approaches for F1–F13 cases with different dimensions

4 Engineering Design Problem

4.1 Studied System

The proposed multi-MG (MMG) comprises renewable energies such as solar energy, wind energy and ESS devices such as EV and BESS. Response of EV and BESS to the control signal is quicker as related to solar energy and wind energy. The system dynamics are preserved while considering the gains and values of time constants of different elements. As all important aspects of frequency control have been taken into consideration, the results shown in this paper present a general conclusion to implement the recommended approach in a real power system. The schematic diagram of AREA-1 of a system under study consisting of all the components is given in Fig. 3a. Transfer functions modeling and illustration of the recommended MMG with various generations and ESS are given in Fig. 3b.

Fig. 3
figure 3

a Schematic diagram of AREA-1 the proposed micro-grid. b Block diagram of the proposed power system model

4.2 Modeling of Different Generation Sources

Two areas interconnected MG under study consist of a reheat thermal power generating unit with DER in each area. Using the parameters stated in Table 9, they are modeled by transfer functions [1, 12, 19, 33].

Table 9 Power system data used in the present study

5 Controller Structure

5.1 Structure of FOFPID Controller

PID controller is popular in the industrial control field because of their simplicity of design and good performance. The FLC offers more applicability to the traditional PID structure. The overall behavior of a closed-loop system is improved by FLC forming a fixed nonlinearity amid its input and output SFs [34]. In fuzzy PID (FPID), the error and its derivative are taken as inputs. The input SFs \({K}_{1} \mathrm{and} {K}_{2}\) and output SFs as KP, KI and KD. The output of FLC is multiplied by KP, its integral with KI, and its derivative with KD, and then added to give the total controller output. But, in fractional-order fuzzy PID (FOFPID), the derivative-order rate of the error is substituted by its FO counterpart (λ1) at the input and the derivative-order rate is substituted by its FO counterpart (λ2) and the integer order is replaced by a fractional order (μ) at the output of the FLC as shown in Fig. 4. Mathematically, the FLC output is multiplied with a FOPID controller as expressed in Eq. (19):

$$C^{{{\text{FOPID}}}} \left( s \right) = K_{P} + \frac{{K_{I} }}{{s^{\mu } }} + K_{D} s^{\lambda 2}$$
(19)
Fig. 4
figure 4

FOFPID controller configuration

5.2 Implementation of FOFPID Controller

The proposed FOFPID controller follows a two-dimensional linear rule set. The inputs and output of FLC are assigned with regular triangular membership functions (MFs) and Mamdani type inference. The fuzzy linguistic variables NB, NS, Z, PS, and PB represent Negative Big, Negative Small, Zero, Positive Small, and Positive Big, respectively. The inputs and output MFs and rule base are adapted from reference [19, 20].

For controller design, eight parameters are tuned for FOFPID controller, whereas five parameters of FPID and three parameters of PID are tuned. Therefore, optimization of the FOFPID controller problem is more challenging than PID/FOPID. The values of fractional orders {λ1, λ2, μ} along with SFs \(\left\{{K}_{1}, {K}_{2}, {K}_{P}, {{K}_{I},K}_{D}\right\}\) are the optimization variables. The design of controllers focuses on minimizing an objective function to find desired system performances using the best parameters. With a proper objective function, optimal controller parameters can be obtained for different engineering problems. An integral time absolute error (ITAE) criterion is chosen as an objective function.

6 Results and Discussion

The simulation of MG under ΔPWTG, ΔPPV and ΔPL changes (as disturbances) and parameter perturbations is presented. The present work was performed to obtain the secondary controller parameters for the multi-area hybrid model, i.e., multi-micro-grid (MMG) for frequency regulation problem. For this, mHHO algorithm-based PID/FPID/FOFPID controller is used by applying the ITAE criterion. Separate controllers are used for thermal generating units and distributed generating units in each MG with different scenarios of stochastic fluctuation in load, and power fluctuations of solar and wind. Different controllers like PID, FPID, FOFPID controllers are applied to the MMG for assessment purposes. All the controller gains and scaling factors are selected in the range of 0 to 2, and the simulation time taken is 90 s. Table 10 depicts the HHO and mHHO-optimized PID/FPID/FOFPID controller parameter values and shows a fair comparison among the controllers in terms of the minimum value of ITAE. It is evident from the comparison that the performance of mHHO-based FOFPID is the best among all others. It is clear from Table 10 that with PID, the J value obtained is 127.8121 and with HHO evaluated to 116.9549 with mHHO. Further, the J value is decreased to 14.9533 with mHHO: FPID and 8.7970 with mHHO: FOFPID.

Table 10 Optimized controller parameters

6.1 Simulation Approach

For investigating the frequency response and validating the credibility of the proposed work, three different test cases are considered for the analysis of the studied MMG system shown in Fig. 3b. Three different cases are formulated to examine the behavior of different controllers and optimization techniques to address the LFC problem as variance in load, and power fluctuations of wind and solar photovoltaic. The variation of ΔPWTG, ΔPPV and ΔPL is shown in Fig. 5, respectively.

Fig. 5
figure 5

Load/power profiles: a load demand, b wind power variation and c solar power variation

Test Case–I: Results for load variation are revealed in Fig. 6a–c, to discover the effectiveness of the projected mHHO algorithm and to take a judgment between mHHO: PID, mHHO: FPID and mHHO: FOFPID. Variation in load demand takes place with a steady value of solar (0.1pu) and wind generation (0.3pu). The numerical results are gathered in Table 11. The proposed mHHO: FOFPID attains minimal undershoot (Us) of ΔF1, ΔF2, ΔPtie (− 2.0869 × 10–3, − 1.0740 × 10–3, − 0.1949 × 10–3) and overshoot (Os) (2.9336 × 10–3, 2.4476 × 10–3, 0.2301 × 10–3) values compared with mHHO: FPID, Us (− 9.6004 × 10–3, − 2.3112 × 10–3, − 0.5025 × 10–3) and OS (7.0411 × 10–3, 3.4727 × 10–3, 0.5046 × 10–3); mHHO: PID, Us (− 13.7047 × 10–3, − 13.5085 × 10–3, − 3.5102 × 10–3) and OS (42.3809 × 10–3, 35.0432 × 10–3, 3.7795 × 10–3) for the same system as given in Table 11. This can be noticed in Table 11 that the undershoot (Us) values of ΔF1, ΔF2 and ΔPtie with mHHO: FOFPID are reduced by (78.26% and 84.77%), (53.53% and 92.05%) and (61.21% and 94.45%) compared to mHHO: FPID and mHHO: PID, respectively. Similarly the overshoot (Os) values of ΔF1, ΔF2 and ΔPtie with mHHO: FOFPID are reduced by (58.34% and 93.08%), (29.52% and 93.02%) and (54.40% and 93.91%) compared to mHHO: FPID & mHHO: PID, respectively. Also, it is obvious from Fig. 6a–c that with mHHO: FPID oscillations are drastically reduced over mHHO: PID, but mHHO: FOFPID outperforms all others in terms of least oscillation, settling time, Us and Os.

Fig. 6
figure 6

Response for Case–I a ΔF1, b ΔF2 and c ΔPtie

Table 11 Comparison of transient performance for three cases

Test Case–II: Figure 7a–c shows the outcomes for the second test case, in which both load demand change and wind power variation are taken into account with a steady value of solar power. It can be noticed from Table 11 that for the identical system and optimization technique, the proposed FOFPID yields improved outcomes compared to FPID and PID. The proposed mHHO: FOFPID achieved least undershoot (Us) of ΔF1, ΔF2, ΔPtie (− 2.2117 × 10–3, − 1.4942 × 10–3, − 0.2146 × 10–3) and Os (1.8649 × 10–3, 1.7194 × 10–3, 0.0717 × 10–3) values compared with mHHO: FPID, Us (− 11.3152 × 10–3, − 2.7521 × 10–3, − 0.7466 × 10–3) and OS (6.2337 × 10–3, 3.4932 × 10–3, 0.4218 × 10–3); mHHO: PID, Us (− 19.8632 × 10–3, − 19.8189 × 10–3, − 3.2263 × 10–3) and OS (26.8225 × 10–3, 26.7690 × 10–3, 1.8973 × 10–3) for the identical system as given in Table 11. This can be observed from Table 11 that the Us values of ΔF1, ΔF2 and ΔPtie with mHHO: FOFPID are reduced by (80.45% and 88.87%), (45.82% and 92.48%) and (71.26% and 93.35%) compared to mHHO: FPID & mHHO: PID, respectively. Likewise the overshoot (Os) values of ΔF1, ΔF2 and ΔPtie with mHHO: FOFPID are reduced by (70.08% and 93.05%), (50.782% and 93.58%) and (83% and 96.22%) compared to mHHO: FPID & mHHO: PID, respectively. From the results, it is observed that the mHHO: FOFPID controller outperforms mHHO: FPID and mHHO: PID significantly as in the first case.

Fig. 7
figure 7

Response for Case–II a ΔF1, b ΔF2 and c ΔPtie

Test Case–III: In the third test case, all the three variations (ΔPWTG, ΔPPV and ΔPL) are considered as illustrated in Fig. 5. The suggested mHHO: FOFPID attains minimum undershoot (Us) of ΔF1, ΔF2, ΔPtie (− 5.3789 × 10–3, − 5.3758 × 10–3, − 0.1871 × 10–3) and overshoot (Os) (6.2840 × 10–3, 6.1037 × 10–3, 0.0781 × 10–3) values compared with mHHO: FPID, Us (− 12.8900 × 10–3, − 10.6865 × 10–3, − 0.7599 × 10–3) and OS (10.1350 × 10–3, 8.9323 × 10–3, 0.3191 × 10–3); mHHO: PID, Us (− 75.8260 × 10–3, − 76.5232 × 10–3, − 3.2263 × 10–3) and OS (83.3332 × 10–3, 81.6411 × 10–3, 1.8973 × 10–3) for the same system as given in Table 11. This can be observed from Table 11 that the Us values of ΔF1, ΔF2 and ΔPtie with mHHO: FOFPID are reduced by (58.27% and 92.91%), (49.70% and 92.97%) and (75.38% and 94.20%) compared to mHHO: FPID & mHHO: PID, respectively. Similarly the Os values of ΔF1, ΔF2 and ΔPtie with mHHO: FOFPID are reduced by (38% and 92.46%), (31.67% and 92.52%) and (75.52% and 95.88%) compared to mHHO: FPID & mHHO: PID, respectively. It validates that the FOFPID performs reasonably well under varied operating conditions from the results shown in Fig. 8a–c.

Fig. 8
figure 8

Response for Case–III a ΔF1, b ΔF2 and c ΔPtie

For better illustration, the transient performances related to the above three cases are gathered in Table 11. It is noticed from Table 11 that the numerical values of maximum overshoot/undershoot with proposed mHHO-tuned FOFPID are less compared to mHHO-tuned PID and FPID controllers for all the cases.

6.2 Stability Analysis

Further, a stability analysis of the proposed approach is performed and the outcome is provided in Fig. 9. It is noticed from Fig. 9 that the gain margin (Gm = 15.2 dB) and phase margin (Pm = 67.60) are positive. Also, the phase crossover frequency (ωpc = 648 rad/s) is higher than the gain crossover frequency (ωgc = 155 rad/s). The above results confirm the stability of the FOFPID controller as Gm and Pm are positive; additionally, ωpc is greater than ωgc.

Fig. 9
figure 9

Bode plot with proposed approach

6.3 Real-Time Simulation Approach

All simulation outcomes are examined by an OPAL-RT to confirm the opportunity for real-world application of the projected controller. The real-time simulator (RTS) does complex computations with exactness in a real-time environment in a cost-effective way. The hardware-in-the-loop (HIL) shows the accuracy of the recommended controller in actual MMG and confirms the robustness of the suggested technique in the real world. Figure 9 shows the sketches of the HIL set-up, which contains an OPAL-RT as RTS where MATLAB/Simulink-based codes are executed and a personal computer (PC) as the command station where MATLAB code is generated. Besides them, the router is used [19]. Figure 10a–c shows the RTS results compared with MATLAB results. It is observed that both results are commensurate with each other. Consequently, the proposed controller may be considered suitable for practical industrial applications (Fig. 11).

Fig. 10
figure 10

OPAL-RT experimental set-up

Fig. 11
figure 11

Assessment of recommended mHHO-based FOFPID a ΔF1 , b ΔF2 and c ΔPtie with real-time simulation and MATLAB/Simulink results

7 Conclusion

In this study, an advanced frequency control scheme has been modeled to regulate the frequency of a complicated MMG. The control method adopts a FO fuzzy PID controller for MMG frequency regulation using the mHHO algorithm. It eliminates the influence of the mismatches between the generations and loads which causes high fluctuation of frequency and power in the MMG system based on renewable energy generation. mHHO method is applied to obtain the parameters of PID, FPID and FOFPID controllers. The efficiency and superiority of the proposed mHHO technique are validated via comparisons with many other recent and popular techniques based on statistical analysis and scalability tests. From the vast comparison of statistical results for classical 13 test functions (F1–F13), it is apparent that mHHO offers better performance over various existing techniques. For three different scenarios of variation of load and power generation by renewable sources, the simulation outcomes are displayed. The projected controller FOFPID structure reduces the effects of ΔPWTG, ΔPPV and ΔPL disturbances and dynamic perturbations. Thus, the effectiveness of the proposed scheme is established for limiting the grid frequency oscillations due to the effect of renewable sources and load demand variations. Further, the dominance of the FOFPID controller as equated with PID and FPID controller is demonstrated. Time–domain simulation outcomes show that the projected FOFPID controller can keep an adequate equilibrium between the power generation and load, and effectively control the MMG frequency. Also, the close-loop stability of the proposed FOFPID controller is verified by the Bode plot. Outputs from OPAL-RT simulation validate the usefulness of the projected controller in the real-time environment as it matches with that of the MATLAB/Simulink results.