1 Introduction

One of the biggest global obstacles recently is delivering the increasing electrical power demands for interconnected and remote societies using new industrial technologies based on Renewable Energy Sources (RESs) to eradicate environmental concerns [1]. Therefore, implementing Microgrids (MGs) with penetrations of RESs becomes a promising and attractive technology as a replacement for conventional grids owing to the advances in industrial technologies, for instance, power electronic equipment [2]. Currently, several MGs are implemented, especially in remote areas, to integrate Distributed Energy Resources (DERs) into the utility grid. In addition, clean energy, high reliability, and great capability have been achieved to treat the variations of environmental circumstances, generation disturbances of DERs, power losses in transmission and distribution systems, and less infrastructure [2, 3]. Some of the actual MGs in CERTS in the US, NEDO in Japan, etc., are investigated in [4, 5].

The MG consists of numerous DERs such as solar photovoltaic (PV) systems, micro-turbines, gas turbines, diesel generators, Fuel Cells (FCs), Wind Turbines (WTs), and Energy Storage Systems (ESSs). The variety of loads causes power quality, control, and operation issues because of the utilization of the power electronic converters [6,7,8]. To fulfill the increasing load demands, several MG configurations are investigated [9,10,11,12,13,14,15], as portrayed in Fig. 1. These configurations are in terms of voltage type (DC/AC/hybrid), distribution system (single or three phases), voltage level (Low-Voltage (LV) or Medium-Voltage (MV)), structure (radial, ring), and the operation mode (islanded mode, grid-connected). Since the existing AC MGs have a variety of loads, such as AC loads and DC loads which require an AC/DC converter to supply, it raises several power quality problems besides integrating the DERs. Moreover, utilization expansions of electric vehicles and DERs such as PV, FC, and ESS make interruptions in power system stability and voltage regulation like harmonic distortion [16]. Therefore, the DC MGs are investigated to cope with DC loads and generation units; however, multistage power conversion is required to supply AC loads, which has declined the overall power system efficiency [17, 18]. Hybrid MGs (HMGs) AC/DC are proposed to reduce energy loss during multistage power conversions with smooth operation using the hybrid generation types to handle the defects mentioned above. In addition to curtailing the interruptions due to the stochastic energy nature of PV and wind generation units, they can combine the merits of the AC and DC MGs and overcome their shortcomings [19, 20]. Hence, The HMGs include both the AC and DC generation units to supply a variety of local demand AC and DC loads. Therefore, several articles evaluate the power quality of the HMGs under various operation modes as a motivated research trend for the distributed generation system [21].

Fig. 1
figure 1

MG’s configurations

The HMGs are considered a promising research trend as improving the power flow and decreasing the power losses of transmission and distribution lines through the integration of various DERs and ESSs, such as Battery ESS (BESS), and different sorts of loads [10]. Thus, there are many review articles investigated control strategies [2, 13, 19, 22,23,24,25], infrastructure and test beds[4, 5, 11, 12, 26], optimization techniques and software tools[15, 27,28,29], and protection strategies and ancillary services [14, 30]. Regarding the HMG structure, both AC and DC MGs are involved with interfacing equipment. As previously discussed, the HMG can be operated in both islanded and grid-connected modes with different distribution systems and voltage levels [10, 11, 31]. Furthermore, the HMG can be classified into three categories, namely, AC coupled, DC coupled, and AC-DC coupled, relative to the connection of the DERs and ESSs to the main bus and the utility grid [11, 19]. Several articles specify their main features in power management schemes in [11, 12, 32, 33].

To ensure operating within acceptable limits of power quality requirements, several authors implement various control techniques associated with artificial intelligence techniques, optimization algorithms, and protection strategies with ancillary services, as deliberated in [11, 12, 15, 28,29,30, 32]. Various control strategies can be grouped into centralized, distributed, hierarchical, intelligent, and fault-tolerant control (FTC) control, as mentioned in [12, 23, 24, 34,35,36]. In [12, 37], the authors discussed the main roles and objectives of a control scheme for HMGs, such as: regulating the performance indices of the power quality such as frequency or voltage, coordination and dispatch of DERs, synchronization with the utility grid and Control of power flows, and optimization of the operation cost. To accomplish these control requirements, several ancillary services must be implemented along with the operation of the HMG such as RPC techniques. Therefore, “the reliability, controllability, observability, economy and flexibility” [3] of the HMG operation can be achieved [38].

In the view of bringing loads and power converters into the service to regulate the power exchange of the MG, serious obstacles related to power quality come into the picture, for instance, the RPC and the generation of harmonics which require urgent diminishing to maintain the power quality constraints [39]. According to necessitating the reactive power daily, the RPC strategies are implemented with the performance indices of power quality in load and voltage support. Regarding the load point view, it is necessary to enhance the Power Factor (PF) and active power balance. In addition to ensuring the voltage support along with the continuous voltage fluctuations. Hence, the RPC techniques are utilized to ensure regulating the reactive power in the islanded mode of the MG to support non-dispatchable intermittent RESs [40]. Similarly, the RPC is required in a grid-connected mode owing to linear and nonlinear loads. Therefore, recent research trends are highlighted to cope with the power quality issues during the MG design and modeling using various strategies such as control techniques, algorithms, and devices, as summarized in Table 1 [39]. From the mentioned articles in Table 1, it is clear that the RPC methods are implemented to fulfill with criteria of the power quality, especially enhancing the voltage profiles and the PF and lessening active and reactive power [38]. In [41,42,43,44,45,46,47], various control techniques are applied to deal with the power quality issues while the applications of the optimization algorithms to obtain the optimal system operation are investigated in [48,49,50]. Many devices are implemented to control the voltage deviations and reactive power compensation for solving the power quality problems such as STATCOM, SSSC, UPFC, and capacitor banks, as depicted in [51,52,53,54,55].

Table 1 A brief summary of RPC methods

Most researchers used the fixed and variable capacitor banks as a method of RPC by specifying their capacity and best position to treat their role and objectives as stated in [55]. The installation of capacitor banks is due to simplicity and offers a low-cost method compared to other RPC methods. Other authors investigated other methods such as the Static Var Compensator (SVC), thyristor-controlled reactor (TCR), Thyristor-Switched Capacitor (TSC), and Static Synchronous Compensator (STATCOM), as discussed in [38, 39, 55]. Other authors studied several RPC techniques in the MG to decline harmonics amplitude within the acceptable rate by filter compensation devices such as Active Power Filter Module (APFM) for adjusting the amplitude of current and voltage [56]. In [57], the new voltage harmonic distortion compensation method is studied in terms of nonlinear loads in the islanded mode of the MG using a harmonic droop controller. Coordinated control using virtual admittances in nominated harmonic frequencies in grid-connected MG is proposed in [58] to accomplish the harmonic compensation and voltage support for inverters. By well-designed controllers besides the harmonic compensation method using optimization objectives and constraints, the Total Harmonic Distortion (THD) of MG’s voltage is reduced, and the power quality is enhanced [59]. Other harmonic compensation methods are employed in MGs to improve the power quality and other performance indices as surveyed in [56].

Moreover, several articles implemented optimization algorithms to optimize various objective functions in MGs in order to enhance power quality. Hence, they can be used to optimally select the suitable RPC method in terms of their capacity and specified location with high accuracy. In [60], the linear programming method is used to minimize the operation cost related to the BESS capacity while in [61], the Particle Swarm Optimization (PSO) algorithm is used for the same purpose. Other articles used a multi-objective honey bee mating optimization algorithm [62] and a fuzzy self-adaptive PSO algorithm [63] to improve the power quality of the MG with an uncertainty of RESs. Other authors applied the GWO in the MG to reduce the operation cost considering the capacity of ESSs and the uncertainty of RESs [64,65,66,67,68]. Moreover, it is used to boost the performance efficiency and the reliability of the MG [69, 70].

From the above discussion, the main article contributions of this article can be summarized to cover the highlighted research field gap in the applications of the HMG, as follows:

  • The detailed simulation model of the IEEE 14-bus HMG system is used as designed in [3] to investigate the power quality during the disturbance of DERs and reactive power compensation (RPC).

  • The simulation model is tested under several cases, such as interruption in solar PV and ESS systems in islanded and grid-connected modes.

  • Moreover, the normal operation also has been examined under the integration of solar PV and ESS systems in grid-connected mode.

  • To tackle the power quality issues in previous cases, a fixed capacitor bank employed as an RPC method in MV-level load buses was placed and dimensioned optimally using the multicriteria decision algorithm proposed in [55].

  • Proposing a compensation scheme using multiple capacitor banks implemented in LV-level load buses and MV-level load buses according to the power flow calculations.

The article’s structure can be summarized as follows: Sect. 2 explains the detailed modeling of the studied HMG system. The analysis of performance indices of the power quality and the proposed RPC method using the MOGWO algorithm are investigated in Sect. 3. The simulation results of the studied HMG system using MATLAB/Simulink platform under different cases and scenarios are described in Sect. 4. Section 5 highlights current challenges for improving the power quality issues and future related-research trends. Finally, the conclusion is stated in Sect. 6.

2 Studied hybrid AC/DC microgrid

Without a doubt, the implementation of the HMG suffers from several obstacles the necessary to overcome, such as “power quality and protection issues, coordination and stability obligations, energy management systems, communication infrastructure, and the market trends,” as summarized in [19]. In this article, the RPC methods are used to optimize the performance indices of the power quality, such as improving the voltage profile, which significantly influences the other performance indices and the overall operation of the HMG. The general HMG structure involves DC and AC buses, at two voltage levels, with varied sorts of loads and DERs, as shown in Fig. 2. The DC bus includes one or two RESs such as solar PV arrays, BESSs, and DC loads with the cooperation of the electric vehicles (EVs). Alternatively, the AC bus consists of DERs such as solar PV arrays or wind turbines, diesel generators, BESS, and different types of loads. Also, the power converters and transformers are utilized to regulate the power exchange. Hence, the HMG can be operated in islanded or grid-connected modes. The data acquisition systems from all systems components, RPC methods, and metering units are essential to completely control the HMG operation performance.

Fig. 2
figure 2

General HMG configuration

The benchmark in [3] that is well-established using the IEEE 14-bus distribution system is applied in this article to validate and evaluate the HMG operation performance. Hence, the benchmark is considered a robust simulation model for various research topics; for instance, power quality with several performance indices associated with DC and AC buses, at two voltage levels, with varying loads and DERs. The detailed mathematical modeling of the studied benchmark was investigated to highlight the significant parameters of the HMG components in [3]. Hence, the studied HMG can be divided into AC microgrid (1), AC microgrid (2), and DC microgrid with two voltage distribution levels (primary: 13,8-kV, and secondary: 0.22-kV), as portrayed in Fig. 3. Firstly, the HMC is integrated into a 69-kV utility grid at the PCC point, which has a Thevenin equivalent of 100 MVA with an X/R ratio of 10. Hence, the studied HMG parts can be highlighted as follows,

  • According to AC microgrid (1), it is operated to supply the electrical energy to 4 loads with the aid of a diesel generator. Moreover, it is connected with an AC microgrid (2) at the 0,22-kV level through lines 4, 5, and 6.

  • AC microgrid (2) delivers the electrical energy to 4 loads, including DERs, such as the PV Array 2 and the BESS 2.

  • The DC microgrid involves DC loads such as EVs, the BESS (1), and the PV Array (1).

  • Furthermore, various power converters are employed to connect the DERs to the two-level distribution systems. The BESS (1) system is coupled using a boost-buck bidirectional converter, and a boost converter links the PV Array (2) to the DC link.

  • The DC microgrid is also tied to the AC microgrid (2) through two-parallel bidirectional converters (named; 1.1 and 1.2), which are responsible for interchanging the electrical power through two transformers.

Fig. 3
figure 3

Studied HMG system

3 Proposed RPC methodology

In this section, the mathematical model of the multi-objective function optimization algorithm is presented for specifying the optimal size and location of RPC devices (two capacitor banks) in both the MV and LV buses to improve the power quality issues of the studies HMG system. Hence, several objective functions are considered in terms of the power quality indices for instance; voltage profile, active and reactive powers balance, angular displacement, PF, power losses of lines, implantation cost, and THD. The various applied objective functions and the constraints of the mathematical model based on the multi-objective function optimization algorithm can be illustrated as follows:

3.1 Objective function formulation

Firstly, the complete objective function can be formulated as shown in Eq. (1).

$$\mathop {\min }\limits_{\theta } \left\{ {f_{1} , \;f_{2} ,\;f_{3} ,\;f_{4} , \;f_{5} } \right\}$$
(1)

where \(\theta\) is the vector of the decision variables which involves the location and size of the selected capacitor bank. The objective functions \({f}_{1}, {f}_{2},{f}_{3},{f}_{4}\), and \({f}_{5}\) can be expressed as follows.

$$f_{1} = ADVS = \frac{{\mathop \sum \nolimits_{i = 1}^{n} \left| {Vd_{i} - V_{i} } \right|}}{n}\;\;\left( {{\text{p}}.{\text{u}}.} \right)$$
(2)

To analyze the voltage profiles, the average deviation of the voltage in the system (ADVS) is used \(({f}_{1})\), which indicates the voltage drop over the studied bus. While the maximum voltage deviation (MVD) can be represented using,

$$MVD = \mathop {\max }\limits_{1 \le i \le n} \left( {\left| {Vd_{i} - V_{i} } \right|} \right)$$
(3)

Here \(n\) is the number of the HMG buses. \(V{d}_{i}\) donates the required voltage at bus \(i\) in p.u. (1 p.u.) and \({V}_{i}\) gives the actual voltage at bus \(i\) in p.u; It is clear that the ADVS should be minimum for stating the voltage profile enhancement.

The second objective function ( \({f}_{2}\)) expresses the active power losses per line under balanced and unbalanced currents, which can be mathematically expressed as follows.

$$f_{2} = \Delta P_{a,b} = R_{l} {*}\mathop \sum \limits_{i = 1}^{Nf} \left| {I_{i,a,b} } \right|^{2} + R_{n} {*}\mathop \sum \limits_{i = 1}^{Nf} \left| {I_{i,a,b} } \right|^{2} \;\;\left( {{\text{kW}}} \right)$$
(4)

where \(\Delta {P}_{a,b}\) is the power losses per line per phase \(i\) influenced by the circulating current during the state charge a, in line b; \({I}_{i,a,b}\) is the circulating current of phase \(i\) the state charge a, in line b. while \({R}_{l}\) and \({R}_{n}\) express the phase resistors and neutral conductors, respectively; \(Nf\) depicts the number of phases in line b.

The objective function related to the power factor analysis (\({f}_{3}\)) can be determined as follows.

$$f_{3} = - Pf_{i} = \frac{{ - P_{i} }}{{\sqrt {\left( {P_{i} } \right)^{2} + \left( {Q_{i} } \right)^{2} } }}$$
(5)

In which

$$\varphi_{i} = \angle V_{i} - { }\angle I_{i}$$
(6)
$$P_{i} = V_{{\text{irms }}} I_{{{\text{irms}} }} \cos \left( {\varphi_{i} } \right)$$
(7)
$$Q_{i} = V_{irms} I_{irms} \sin \left( {\varphi_{i} } \right)$$
(8)

Hence, the Phase-Locked Loop (PLL) block is used to investigate these performance parameters. Firstly, the phase angle (\({\varphi }_{i}\) for the same phase\(i\)) is determined, then the active (\({P}_{i}\)) and reactive (\({Q}_{i}\)) powers and \(Pf\) are gained depending on both rms values of the phase voltage and current (\({{V}_{i }}_{rms}, {{I}_{i }}_{rms}\), respectively). It is clear that the \(Pf\) should be maximized for stating the power factor improvement.

The percentage of the THD per bus can be calculated as an objective function using the following equation (\({f}_{4}\));

$$f_{4} = THD{\text{\% }} = \frac{{\sqrt {\mathop \sum \nolimits_{i = 2}^{H} \left( {V_{i,h} } \right)^{2} } }}{{V_{i,1} }}{*}100$$
(9)

where: \({V}_{i,h}\mathrm{ gives}\) the voltage component according to the harmonic \(h\) at the node \(i\); \({V}_{i,1}\) is the fundamental voltage component at the node \(i\). \(H\) highlights the maximum harmonic order used for calculations.

Finally, the implementation cost objective function \({f}_{5}\) can be calculated as;

$$f_{5} = Cost = \sum\nolimits_{(i = 1)}^{n} {C|Q_{i} |} \ge 0\;(\$ )$$
(10)

where \(C\) depicts the cost of installed reactive power compensation \(\$ per kvar.\)

3.2 Constraints

To verify the power quality of the studied HMG along with the previous performance indices, the following constraints are considered [3].

$$ADVS \le {\text{C}}_{{\upalpha }}$$
(11)
$$MVD \le {\text{C}}_{{\upbeta }}$$
(12)
$${\text{V}}_{i}^{{{\text{min}}}} \le V_{i} \le {\text{V}}_{i}^{{{\text{max}}}}$$
(13)
$$\varphi_{i} { } \ge 0$$
(14)
$$P_{{{\text{loss}}}}^{{\max {\text{demand}}}} \ge P_{{{\text{loss}}}}^{{\min {\text{demand}}}} \ge 0$$
(15)
$$THD{\text{\% }} \le {\text{C}}_{{\upgamma }} {\text{\% }}$$
(16)

Hence, in this study, the values of previous constraints \(\left\{{\mathrm{C}}_{\mathrm{\alpha }},{\mathrm{C}}_{\upbeta },\mathrm{min}{V}_{i},\mathrm{max}{V}_{i},{\mathrm{C}}_{\upgamma }\mathrm{\%},C\left|{Q}_{i}\right|\right\}\) are specified respectively as \(\left\{0.04 pu,0.05\mathrm{ pu},0.95 pu,1.05\mathrm{ pu},5\mathrm{\%},\$25by kvar\right\}\).

3.3 Optimal operation management of HMG using the MOGWO algorithm

In this sub-section, the optimal operation management of the HMG using the MOGWO algorithm is discussed. The MOGWO is used to optimize the capacitor banks placement and capacity as an RPC method to enhance the power quality of the HMG in both LV and MV levels (\(ADVS, PF, {P}_{loss },THDv\mathrm{\%}\)) besides reducing the installation cost. Firstly, the MOGWO algorithm is used to optimize in capacitor bank in MV buses however, some challenges have appeared. Thus, it is proposed to implement two capacitor banks each one at a different voltage level. Thus, the MOGWO algorithm is utilized to search for the suitable location and size of the capacitor bank in both MV and LV buses which in the role will decrease the cost and improve the different performance indices. The steps of finding the optimal operation management of HMG using the MOGWO algorithm are depicted in Fig. 4. As shown, all the HMG data, performance indices limitations, MV and LV buses, electrical demands, boundaries of capacitor bank sizes, and installation cost are initially specified. Moreover, the running conditions are defined such as the demand scenarios (maximum or minimum), the number of search agents in the grey wolf population matrix, and the maximum number of iterations. Hence, at each position of a search agent, the capacitor bank size and location are specified in both scenarios (one capacitor bank in MV buses or two capacitor banks in MV and LV buses). After that, the Simulink model under the previously specified data is executed, and saving the acquisition data which are used to calculate\(ADVS,{PF, P}_{loss },THDv\mathrm{\%},\mathrm{ cost},\mathrm{ and other variables}\). Moreover, the objective function is determined and evaluated at each search agent in the specified iteration. Then, the minimum value of the objective function and the corresponding position of the search agent is calculated, before the second and third minimum values of the objective function are considered and saved in the archive. Now, the iteration number and the position of each search agent are updated in which the convergence criterion is checked until a maximum number of iterations is reached. Here, the iterative process is stopped and the objective function values with respect to search agents and iterations are stored in non-dominated optimal solutions to evaluate later and find the suggested optimal solution for the objective function.

Fig. 4
figure 4

Flow chart of optimal operation management based on the HMG using the MOGWO

4 Simulation results

To authenticate the modeling of the HMG, this section reports the HMG power quality simulation results during normal operation and the uncertainty of DERs, such as BESS and solar PV substations under islanding or grid-connected modes. Also, the power quality is assessed using reactive power compensation devices. In this article, the capacitor bank is applied. Hence, the power quality of the HMG can be evaluated using several performance indices for instance; voltage profile, active and reactive powers balance, angular displacement, PF, power losses of lines, and THD, which one index or several indices can be nominated to present at simulation results depending on the case study. Firstly, the power quality assessment is studied over two conditions, namely, islanding and grid-connected modes without BESS and PV systems over the daily demand load and the solar irradiation and temperature, as given in Fig. 5. It is obvious that the minimum demand point is approximately 30% of the maximum demand, while the maximum demand period has occurred at 11h00, which is considered the peak of both solar radiation with the maximum generation power of the solar PV panels and the industrial and residential loads. Both voltage profile and power losses in the line's indices are used. Second, the HMG's normal operation is tested under the same conditions as in the previous two cases. Thirdly, the power quality of the HMG is examined by utilizing the reactive power compensation, which uses one capacitor bank and two capacitor banks. The MOGWO algorithm is implemented to optimize both the size and location of capacitor banks over different voltage levels with high accuracy. Using the reactive power compensation devices, the simulation results highlight the HMG performance under the minimum and maximum demand loads.

Fig. 5
figure 5

Controlled variables for simulation

4.1 Case (1) Islanded mode without BESS and solar PV systems

In this case, it assumed that the studied HMG operates under islanded mode without any BESSs and solar PV systems, which is believed to be the worst-case study, and the diesel generator is the only power source and has the responsibility to sustain the voltage at the buses. The power quality study is carried out using two performance indices (\(ADVS\), \({P}_{loss}\)). Hence, Table 2 declares the simulation results of the average voltage deviation of all AC buses of the studied HMG over the daily demand load. It is clear that the main influences appeared at the minimum and maximum load points. Looking specifically at the minimum demand load (at 3h00), the maximum value of the \(ADVS\) is 0.0610 (6.1%) at the bus (2), which exceeds the acceptable limit. In stark contrast, the minimum value of the \(ADVS\) is 0.0001(0.01%), which occurs at the bus (13). The Maximum Voltage Deviation (\(MVD\)) in the HMG is (phase a = 0.0772, phase b = 0.0578, phase c = 0.0673). Moreover, the second major change happens in the maximum demand load (at 11h00); the maximum value of the \(ADVS\) is 0.1495 (14.95%) at the bus (2), which exceeds the acceptable limit and is considered as the greatest voltage drop. On the other hand, the minimum value of the \(ADVS\) is 0.0001(0.01%), which occurs at the bus (13) and happens at the minimum demand point. In addition, the \(MVD\) in the HMG is (phase a = 0.1649, phase b = 0.1442, phase c = 0.1567). Here, the results validate the need to improve the voltage profile at the bus (2), which suffers from the most significant variations in voltage deviations.

Table 2 Average voltage deviation of the studied HMG over daily demand load

Table 3 gives detailed data on the power losses per line in the studied system over 24 h. demand curve in watts. According to the minimum demand point, the total power losses of all lines are 13.1 kW which is about 0.9% of the total daily power losses (1.449 MW). Alternatively, at the maximum demand point, the total power losses of all lines are 115.5 kW which is about 7.97% of the total daily power losses (1.449 MW). Hence, the most affected lines are lines (7) (the connection between buses 3 and 4 as a result of the transfer of high unbalanced powers), (8), (14), and (3), respectively. Thus, the highest power loss levels per line occur in MV and LV buses near unbalanced loads.

Table 3 Average power losses of lines in the studied HMG over daily demand load

4.2 Case (2) Grid-connected mode without BESS and solar PV systems

In the second case, the studied HMG is grid-connected with the diesel generator's operation without BESSs and solar PV systems. Table 4. offers the simulation data of the average voltage deviation of all AC buses of the studied HMG over daily demand load, which demonstrates that the maximum value of the \(ADVS\) is 0.0312 (3.12%) at the bus (2), which is less than the value at the same point of the case (1). The minimum value of the \(ADVS\) is 0.0118 (1.18%) at the bus (13) that higher than the previous case (1) same point, at the minimum demand load. In addition to the \(MVD\) in the HMG is (phase a = 0.0478, phase b = 0.0227, phase c = 0.0378). Furthermore, at the maximum demand load, the maximum value of the \(ADVS\) is 0.0820 (8.2%) at the bus (2), which gets above the acceptable limit. Then again, the minimum value of the \(ADVS\) is 0.0252 (2.52%) on the bus (8). Along with the \(MVD\) in the HMG is (phase a = 0.0984, phase b = 0.0634, phase c = 0.0901).

Table 4 Average voltage deviation of the studied HMG over daily demand load

Concerning the minimum demand point, the total power losses of all lines are 8.0 kW which is about 0.9% of the total daily power losses (0.867 MW), as seen in Table 5. Otherwise, at the maximum demand point, the total power losses of all lines are 70.0 kW which is about 8.1% of the total daily power losses (0.867 MW). Again, the most affected lines are lines (7), (3), (11), and (4), respectively, as a result of the transfer of high unbalanced powers. Integration with the utility grid, the \(ADVS\) is enhanced overall AC buses, and the total daily power losses are reduced slightly. Also, both buses (2) in LV and buses (10) in MV require enhancing the voltage profile using voltage support techniques.

Table 5 Average power losses of lines in the studied HMG over daily demand load

4.3 Case (3) normal operation

In case (3), the performance study is extended to overview the power quality issues in the normal operation of the studied HMG in which the BESSs and solar PV systems are coupled with the existence of a diesel generator at the grid-connected mode. As investigated in Table 6 at the minimum demand load, the maximum value of the \(ADVS\) is 0.0425 (4.25%) at the bus (1) near the BESS (2) and unbalanced load at the bus (2). While the minimum value of the \(ADVS\) is 0.0120 (1.2%) at the bus (13) higher than the previous cases (1,2) at the same point. Added to the \(MVD\) in the HMG is (phase a = 0.0588, phase b = 0.0231, phase c = 0.0487). Regarding the maximum demand load, the maximum value of the \(ADVS\) is 0.0692 (6.92%) at the bus (3), which is higher than the acceptable limit. Still, the minimum value of the \(ADVS\) is 0.0256 (2.56%) at the bus (8) with the \(MVD\) in the HMG (phase a = 0.0860, phase b = 0.0567, phase c = 0.0769).

Table 6 Average voltage deviation of the studied HMG over daily demand load

Relative to the minimum demand point, the total power losses of all lines are 13.6 kW which is about 1.5% of the total daily power losses (0.9 MW), as noticed in Table 7. Otherwise, at the maximum demand point, the total power losses of all lines are 64.3 kW which is about 7.15% of the total daily power losses (0.9 MW). Hence, the most affected lines are lines (7), (3), (1), and (11), respectively. The normal operation mode enhances the overview of the power quality issues; however, it still needs more improvements in voltage profiles when the unbalanced loads are connected.

Table 7 Average power losses of lines in the studied HMG over daily demand load

To sum up, Table 8 extends a brief comparison among the studied three cases in terms of ADVS, \({\mathrm{MVD}}_{\left(\mathrm{a},\mathrm{b},\mathrm{c}\right)}\), Power losses, and the main influenced load buses. It is revealed that the main influenced load buses are buses (6,9,10,11,12,14) at the MV level and buses (2,3) at the LV level. Therefore, RPC methods in the above-mentioned candidate buses are required to enhance the voltage profile and other power quality performance indices as a solution for coupling single-phase and unbalanced loads.

Table 8 Brief comparison among the studied three cases

4.4 Case (4): the application of RPC methods depends on the MOGWO algorithm

In this section, the MOGWO algorithm is implemented to specify accurately the RPC allocation using the capacitor bank over the HMG. At first, the MOGWO algorithm is used to select the location and the size of one capacitor bank from candidate buses in (MV buses (6), (9), (10), (11), (12), (14)), and the results are given in Table 9. It is clear that the algorithm suggested implementing a capacitor bank with 650 kVAR at the bus 10 of the HMG which is the same results in [55] using a single objective function multicriteria decision algorithm.

Table 9 Reactive power compensation using one capacitor

Secondly, to verify the idea of implementing two capacitor banks in different voltage levels in the HMG, the MOGWO algorithm is used to optimize the location and size of capacitor banks in both MV and LV buses. The capacitor bank size limitations in LV buses are (5 to 100 kVAR) while in MV buses (5 to 750 kVAR) the perturbation in the iteration is by 5 kVAR in each step. Hence, it is observed the MOGWO algorithm has high accuracy with multi-objective function formation contrasting using single objective function multicriteria decision algorithm [55]. According to Table 10, the best selection of the capacitor banks in terms of size and location implemented by the MOGWO after iterations is using 45 kVAR in the LV bus (4) and 315 kVAR MV bus (11). The proposed selections achieved ADVS by 3.84% and 1.82% in both maximum and minimum demands, respectively. This is reflected in the total power losses which are recorded at 62.96 kW, and 13.71 kW in both demand scenarios with the highest amplitude of power factor. Hence, the highest value of THDv% does not exceed 3.06% which is the best-achieved amplitude compared to other case results. Moreover, the total implementation cost of the applied capacitor banks is 9000 ($) which is low compared to other solutions. By using the suggested idea of implementing two capacitor banks in different voltage levels in the HMG and specifying their size and location using the MOGWO algorithm, the power quality is not only enhanced but also the implementation cost is reduced.

Table 10 Reactive power compensation using two capacitors

4.5 Comparative study

In this section, a comparative study among various cases under study based on the HMG to reflect the overall vision of the operation performance under uncertainties of the RESs and ESS devices in either grid-connected or islanding modes in addition to the effect of RPC methods, as depicted in Fig. 6a,b for both demand scenarios and summarized in Table 11. In the first three cases under uncertainties of the RESs and ESS devices in both grid-connected or islanding modes and the normal operation, the worst operation performance on the power quality is observed. So, the RPC method using the capacitor bank is applied to cope with the power quality concerns in previous cases. Firstly, the fixed capacitor bank is employed in MV level load buses (650kVAR at the bus (10)) as placed and sized optimally using the multicriteria decision algorithm and confirmed using the MOGWO algorithm. It is clear that the performance indices of the power quality are improved in MV-level load buses, however, the LV-level load buses (particularly bus (3)) still suffer from considerable performance deteriorations caused mainly by unbalanced loads. Secondly, the proposed RPC method is verified using two capacitors’ banks. Hence, the MOGWO algorithm is utilized to optimize both the size and location of two capacitor banks over different voltage levels with high accuracy. After several iterations, it is observed that the best optimal selection of the capacitor banks implemented by the MOGWO in terms of size and location from the Pareto-optimal solutions based on non-dominated solutions is using 45 kVAR in LV bus (4) and 315 kVAR MV bus (11). The proposed selection achieved low ADVS and total power losses in both demand scenarios with the highest amplitude of the power factor. Hence, the highest value of THDv% does not exceed 3.06% which is the best-achieved amplitude compared to other case results. Moreover, the total implementation cost of the applied capacitor banks is 9000 ($) which is low compared to other solutions. To sum up, the simulation results of utilizing the proposed compensation scheme in both MV level and LV level load buses demonstrate its operation performance superiority compared to other operation cases. Hence, the power quality is not only enhanced but also the installation cost is reduced.

Fig. 6
figure 6

Comparative study among various cases under study

Table 11 A comparative study among study cases

5 Future work and research trends

Hence, the proposed HMG can be considered as a benchmark to study several future research trends as summarized in the following main points:

  • Using several DG sources such as wind turbines, solar PV systems, and fuel cells with energy storage systems will cause new obstacles, such as the coordination loss of MG protection: voltage unbalance circumstances during generation disturbances.

  • Furthermore, the possibility to insert the RPC methods, such as SVC or D-STACOM, for single-phase nonlinear loads like electric arc furnaces with the aid of optimization techniques.

  • The fault modeling and analysis and the power dispatch in unbalances between load and generation can be implemented and used for studying grid expansion plans due to future load increases. As well as dynamic analysis of the frequency stability, especially considering the loss of inertia in the HMG with islanded mode.

  • Develop new RPC strategies for a network of microgrids with high penetration levels of RESs, ESSs, and controllable loads (including EVs) to enhance the power quality issues, as highlighted in [71].

  • Hosting capacity calculation and optimization of distribution networks with high degree penetration of RESs, especially Solar PV.

  • Utilize an optimization algorithm for allocation/sizing of ESSs, control with energy management, and demand-side flexibility in microgrid-based distribution networks using Machine learning techniques.

6 Conclusion

In this article, the detailed simulation model of the IEEE 14-bus HMG system is verified to investigate the power quality during the generation interrupt of DERs and reactive power compensation (RPC) related to the presence of unbalanced loads, and nonlinear loads, in maximum and minimum demand scenarios. The HMG is examined under several cases, such as the disconnection of solar PV and ESS systems in islanded mode and grid-connected mode. The normal operation has also been studied by incorporating solar PV and ESS systems in grid-connected mode. To deal with the power quality concerns in previous cases, the authors have employed the fixed capacitor bank as RPC method in MV level load buses (650 kVAR at the bus (10)) as positioned and sized optimally using the multicriteria decision algorithm and verified using the MOGWO algorithm. Although the performance indices of the power quality improved in MV-level load buses, the LV-level load buses (particularly bus (3)) still endure considerable performance deteriorations caused by unbalanced loads. Therefore, the MOGWO algorithm is implemented to optimize both the size and location of two capacitor banks over different voltage levels with high accuracy. It is observed that the best selection of the capacitor banks in terms of size and location implemented by the MOGWO after iterations is using 45 kVAR in the LV bus (4) and 315 kVAR MV bus (11). The proposed selections achieved low ADVS and total power losses in both demand scenarios with the highest amplitude of the power factor. Hence, the highest value of THDv% does not exceed 3.06% which is the best-achieved amplitude compared to other case results. Moreover, the total implementation cost of the applied capacitor banks is 9000 ($) which is low compared to other solutions. The comprehensive assessment and discussion of the simulation results demonstrate the superiority of utilizing the proposed compensation scheme in both MV-level and LV-level load buses. By using the suggested idea of implementing two capacitor banks in different voltage levels in the HMG and specifying their size and location using the MOGWO algorithm, the power quality is not only enhanced but also the implementation cost is reduced. Also, the power quality challenges and the future research trends are debated to be utilized as an HMG model update for future studies.