Introduction

Renewable Energy Sources (RES) are energy sources that are both environmentally friendly and have little negative environmental effects. They also generate minimal secondary wastes and are sustainable in satisfying present and future financial and societal requirements1. Traditional power stations are commonly characterized by their substantial size and centralized nature. RES enables localized energy generation, which offers economic benefits and is a promising move toward sustainability, unlike traditional energy production methods2. A conventional grid necessitates a transportation and distribution infrastructure for the dissemination of the produced electricity. The distribution and transmission system incurs huge loss. There is an increasing inclination towards energy distribution and generating3, involves placing transformation of energy equipment in closer proximity to electricity users and substituting large modules for lower versions. It offers myriad advantages regarding technology, finances, and the environment4 (i) decreased transmission losses, (ii) enhanced voltage distribution, (iii) heightened overall effectiveness. The technological advantages include enhanced system stability and reliability. The economic advantages encompass decreased operational and maintenance expenses, along with enhanced productivity. Power quality issues present significant technical difficulties in the running and administration for the connected-to-the-grid and islanded MG systems4.

A Microgrids (MGs) is a network of electrical systems that includes both traditional and RES it supplies power to several small, distributed loads5. The operational characteristics and nature of supply of all sources are predominantly determined by the load they are connected to, despite the fact that they are all fundamentally electrical sources. Consequently, the entire system can exhibit very nonlinear operational characteristics. Although not a significant worry when many Distributed Generators (DGs) are connected to network, transitioning the MG from being connected to the network to operating in isolated (islanded) mode, or vice versa, does create certain power quality along with dependability concerns6. The utilization of Distributed Energy Resources (DERs) is guided by the principles of economy and energy efficiency, ensuring conformance to technical and environmentally sustainable standards7. The synergistic collaboration between DERs and Information Communication Technologies (ICT) allows for the harmonization of various infrastructures, promoting smart grid progress in both theoretical and practical realms8. Benefits influence to the maintenance of high power quality and the preservation of reliability. The concept of MG is introduced as a fundamental component of future smart grids9. Power quality has become a prominent concern in the field of smart grid technology10. Power quality refers to the no stationary disturbances that significantly disrupt the functioning of electrical equipment. Improper power supply can lead to malfunction, early failure, or complete inoperability of electrical devices or loads. Consequently, power quality analysis garners significant interest from scholars across multiple disciplines in this thought-provoking topic11. The power quality events that mostly occur in a distribution system can be classed as gradual voltage fluctuations, momentary voltage drops, rapid voltage fluctuations, harmonic distortions, and switching transients12. The prevalent power quality problems encountered in Alternating Current (AC) MG systems include voltage sags/swells resulting from abrupt changes in load, interruptions caused by the transition from grid-connected to alone mode, flicker, electrical reactive power, and harmonics generated throughout the process of conversion between AC and Direct Current (DC) systems. DC systems are seen as preferable to AC systems in terms of power quality concerns because harmonics and reactive power do not impact DC MGs13. This study shows cases of the enhancement of power quality by simulating and giving some following results as power factor, loss of power, Total Harmonic Distortion (THD), voltage swings, and voltage swelling13.

The contributions of this paper as follows:

  • Providing a contribution to review the issues of energy quality and how it can be improved by using renewable energy and also reviews some of the issues of using these sources. These solutions can be applied to different places and different applications.

  • Utilization of renewable distributed energy resources.

  • his work has been applied in one of the hotels in Hurghada, Egypt, in which the electrical loads were studied accurately and its behavior was studied, and the existing energy issues in the hotel were studied, and the study ended in improving the quality of energy using renewable energy sources, and this system can be applied anywhere, provided that the place and available spaces are studied to place solar panels and wind turbines and study wind speed and solar radiation to see whether this system is suitable or not.

Finally, power quality is determined by a variety of things. The system’s behavior under different operational settings is especially important. However, the resulting level of power quality is also determined by the system’s essential component properties, such as the characteristics of generating sets, including their control and load capabilities. Nonetheless, the quantity of harmonic distortion is mostly determined by the architecture and power of nonlinear loads, as well as the RES and equipment. Voltage imbalance in systems is typically determined by load imbalance (generally due to load failure or malfunction) and the number of DERs operating in parallel. The proposed model investigates load flow analysis and harmonic load flow for the MG before and after the addition of renewable energy sources, lowering the peak-to-average power ratio, minimizing distribution losses, improving the voltage profile, and minimizing harmonic distortion.

The structure of the paper is as follows: "Power Quality Issues In Microgrid" explains the power quality issue in MG, "Simulation results" is brief about harmonic filters, Section IV shows system design and components, "Summary" explains simulation results, conclusion at "Conclusion" limitation and future work at "Limitation and future work".

Power quality issues in microgrid

Power quality issues will become more significant in future hybrid MGs as the penetration of single-phase/unbalanced loads, non-linear loads, and single-phase/unbalanced distribution units increase. Typically, the power quality problems encountered in the DC MG consist of variations in voltage and harmonic distortions. Within the AC MG, power quality concerns mostly revolve around voltage changes, unbalances, and harmonics14. Power quality of a system is determined according to various international standards. As per the IEC 61,000 standard, power quality refers to the specific attributes of electricity at a particular location within an electrical system, which are assessed based on a predefined set of technical criteria14. A MG has the capability of working either in isolated mode or grid-tied mode. Regardless of the scenario, it meets a power quality issue that varies between the two modes. AC MGs and DC MGs have arisen as alternative options in literature15. The DC MG exhibits characteristics that effectively mitigate numerous power quality issues. Nevertheless, the DC MG encounters distinct power quality challenges15. It is crucial to tackle challenges individually, as each system presents distinct problems that necessitate specific measures to alleviate them15.

Issues in AC microgrid

An AC MG is a compressed network that connects several scattered generators and various types of loads. The rapid changes in output and demand make it difficult to ensure system stability and maintain power balance. AC MG are associated with various difficulties. The key concerns are voltage stability, system reliability, and power quality16. In terms of power quality, MGs can operate in two modes: grid-connected and islanded. Power quality is expected to suffer detrimental consequences not only when operating in separation but also during the transitions from isolated and connected activities with the grid. These transitions can lead certain DER units to shift from volt-controlled mode (when operating in isolation) to current-controlled mode (when connected to the grid), resulting in voltage stability difficulties because of the delay in detecting inadvertent islanding17,18,19.

The power quality issues in AC MGs can be classified into the following categories:

Imbalance in power

An asymmetry of power emerges when a MG shifts from being interconnected with the primary power grid to functioning autonomously. When connected to a MG, an alternate micro power station operates independently from the main power grid to supply electricity. Devices that store energy are utilized for decreasing imbalances that occur at the period of the transition phase in MG because of the sluggish dynamic response of these power plants. Preserving phase sequence and magnitude of the voltage is crucial for achieving synchronization with the grid when normal mode is restored16.

Low voltage stability

Given the lower size of distributed generation and MG power distribution, the amount of assistance is less in comparison to the bigger grid. Consequently, there is an issue about the stability of low voltage. Power converters are employed for the purpose of controlling DGs and MG. Nevertheless, these converters possess limited power transfer capabilities compared to traditional power stations. At periods of heavy use, these converters promote a decrease in demand in the power network in comparison to traditional power plants20.

Voltage sag/swell

When a MG experiences a decrease in voltage, several issues can arise while using power electronics converters for distributed generating. During a sag event, the grid-connected load requires reactive power and attempts to deliver it; a converter employing power electronics technology is used. Distributed generators experience an overabundance of electric current in one or several phases. A further problem occurs when the maximum voltage threshold is surpassed, leading to the generator shutting down and causing a subsequent power outage21.

Issues in DC microgrid

While AC MG systems are frequently discussed in articles on power quality issues, there is a lack of emphasis on studying power quality issues in DC MG. The DC MG works in a grid-connected mode, which allows it to consume and provide electricity to and from the grid. It also functions in an isolated mode. Voltage imbalance in the bipolar DC bus, voltage transients in the AC grid, inrush current, and harmonics in the DC MG are examples of common power quality issues in DC MG22,23,24. There is now a lot of research being done on DC MG to better the integration of DER devices like energy storage and nonlinear loads. This is accomplished by minimizing the need for rectification, power inversion, or conversion phases. The power quality difficulties in DC MG come from variations between the purportedly steady voltage in a DC system and the actual voltage produced by power electronic converters25.

Voltage transient

AC MGs often face voltage transients, which have a comparable effect on DC MGs. Voltage transients mostly arise from the capacitor bank switching, the activation and deactivation of distributed generation integrated into a DC MG, and variations in the load. When a capacitor bank switches, a quick voltage shift is sent from the low-voltage AC side to the DC side of a MG via a rectifier. Studies have shown that the transient voltage can outperform the operational voltage by up to 194%26. Furthermore, it has been discovered that after this transitory phase, the voltage will stabilize at a greater level than before, which is roughly 111% of the operational voltage26.

Harmonics in DC microgrid

The absence of an AC-DC converter in the DC MG means that the system has no lower order harmonics. Nonetheless, greater use of a DC-DC converter would cause problems with electromagnetic interference. Despite current disagreements, the DC system is universally MG as harmonic-free. Harmonics are many frequencies that occur alongside the fundamental frequency, which is the principal frequency employed in power electronic converters. In a DC system, harmonics are the fluctuating voltage and current induced by the device’s operational frequency27. A DC MG system uses a number of Pulse Width Modulation (PWM)-based converters to supply power to various loads and producing stations. Capacitors are linked at both ends of the converter. The presence of impedance in the DC bus and numerous capacitors will cause the appearance of many resonance frequencies27.

Inrush current

In AC systems, inrush current is caused by strong inductive loads such as transformers and induction motors. However, in DC MGs, the cause of inrush current is different22. Harmonics are produced when power electronics converters connect various loads, scattered-producing stations, and varied storage devices. Therefore, appropriate filters are positioned on the side where the load is connected. Moreover, the AC side incorporates Electromagnetic-Interference (EMI) filters. When this EMI filter’s capacitor is first connected to the DC MG, it shows a noticeable current surge. The DC system’s voltage level, the capacitor’s impedance, and the converter’s capacitance all affect how much inrush current occurs23. In a DC MG, turning on a de-energized load is another way to induce inrush current. These loads demand a significant amount of inrush current due to the huge filter capacitors they contain. The inrush current’s magnitude is high enough to cause actual melting at the point of contact27.

Fault current

Three potential sources of fault current in a DC MG are the EMI filter capacitor, various distributed producing stations, and the capacitors connected to the grid through converters. The fault current is restricted by the converters’ rating because all power electronic converters are controlled in a closed-loop manner. Because of the power electronics converter, protection devices have trouble telling the difference between an overload situation and a fault state when there is a restricted fault current coming from the DC MG. As a result, designing a suitable protection system for a DC MG is very challenging28.

Power quality concerns related to demand side management

Four entities are involved in the main power quality issues that result from the use of Demand-Side Management (DSM) techniques in smart grids29. These entities are as follows: (1) When loads are connected or disconnected, the grid’s characteristics change, increasing harmonic levels and voltage variations; (2) When loads are reconnectable based on DSM, the load takes a long time to recover, increasing harmonic emission levels; (3) Sensitive equipment trips more frequently as a result of the frequent switching of DSM-enabled loads; (4) Economic pricing may encourage the simultaneous switching of several loads, resulting in transitory situations30,31.

Harmonic filters

In electrical power systems, a single-tuned passive filter is a series resistance-inductive-capacitive circuit that is tuned to resonate at a certain frequency to provide harmonic suppression and mitigate system harmonic distortion levels32. To lessen harmonic propagation throughout the system, as seen in Fig. 1, the filter absorbs the harmonic currents injected by harmonic sources at a designated tuned resonance frequency. Depending on the operating frequency, its impedance changes, resulting in a reduced impedance at the tuned resonant frequency that allows the harmonic current to be absorbed and sent to ground. Equation (1) provides the overall filter impedance at kth harmonic order (Zk)33:

$${\text{Z}}_{\text{k}}={\text{R}}_{\text{k}}+\text{j}\left(\upomega {\text{L}}_{\text{k}}-\frac{1}{\upomega {\text{C}}_{\text{k}}}\right)$$
(1)

where;

Fig. 1
figure 1

Basic principle of single-tuned filter32.

\({\text{R}}_{\text{k}}\) is the filter resistance at kth harmonic order. \(\upomega {\text{L}}_{\text{k}}\) is the filter inductive reactance at kth harmonic order. \(\frac{1}{\upomega {\text{C}}_{\text{k}}}\) is the filter capacitive reactance at kth harmonic order. At the resonance frequency, the inductive reactance and capacitive reactance equal each other. Therefore, Zk = Rk as shown in Fig. 2.

Fig. 2
figure 2

Single-tuned filter impedance characteristic33.

A single-tuned filter is designed based on three parameters32:

  1. i.

    Tuned frequency or harmonic current order that is required to be blocked.

  2. ii.

    Quality factor that is the ratio of the inductance (or capacitance) to resistance at the resonant frequency and it determines the sharpness of tuning.

  3. iii.

    Capacitance value.

  4. iv.

    System voltage level and the fundamental frequency.

The tuned resonance frequency fk of a specific kth filter and the quality factor are represented by Eq. (2) as follows34:

$${\text{f}}_{{\text{k}}} = \frac{1}{{2{\uppi }\sqrt {{\text{L}}_{{\text{k}}} {\text{C}}_{{\text{k}}} } }} \left( {Hz} \right)$$
(2)

where, Lk and Ck are the filter matching values for capacitive and inductance, accordingly, quality factor is represented by Eq. (3) as follows4,34:

$$Quality factor=\frac{X}{R}$$
(3)

When x is reactance and R is resistance.

The capacitance initial value (Cinitial) could be determined by the reactive energy associated to the filter (Qk) according to fundamental voltage (V1) and fundamental angular frequency (ω1) of the system by Eq. (4) as follows32:

$${\text{C}}_{\text{initial}}=\frac{{\text{Q}}_{\text{k}}}{{\upomega }_{1}{\text{V}}_{1}} \left(\text{farad}\right)$$
(4)

System design and components

Figure 3 illustrates the components of the MG organization, which include a PV array, an inverter, loads, a utility grid, and a wind energy resource.

Fig. 3
figure 3

Microgrid organization.

PV panel model

Photovoltaic (PV) arrays and modules, which are made of the primary solar cell components of the PV system, make up a PV panel. A PV module is made up of PV cells coupled in both series and parallel arrangements. A PV array is created by combining many PV modules. This study examines the utilization of a 250 KW PV array is modeled by E-Tap program35.

Wind energy model

The wind’s dynamic kinetic energy is initially converted into rotational energy by Wind Turbines (WT). This energy is then synchronized with the turbine and generator’s speed through the use of a gearbox. The generator transforms the kinetic energy produced by the turbine into electrical energy. The WT has a power rating of 250 kilowatts36.

Battery energy storage system model

BESS is a device that uses batteries to store electric power under optimal conditions and supply it during power shortages. The predominant type of BESS used to optimize the performance of PV arrays is lead-acid batteries. The battery’s charging and discharging processes are regulated based on its State of Charge (SOC), with discharging occurring at 80% SOC and charging occurring at 20% SOC37,38.

Flexible electrical loads

In modern MGs, load flexibility is beneficial in many aspects39. Generally, loads can be classified into three categories, as depicted in Fig. 4.

Fig. 4
figure 4

Classification of electrical load.

Summary

Finaly due to the increase in load and distance from the source, there was a need to increase electrical capacity to match the load and overcome power quality issues. Renewable energy sources were added to increase the electrical power generated to overcome the increase in load and to reduce dependence on the electrical grid, and renewable sources were added near the loads to overcome some power quality issues such as increased voltage drop and fading, and in this simple way, many power quality issues were overcome.

After the addition of renewable energy sources, we had another issue of harmonics, and to overcome this issue, a harmonic filter was added to the grid to overcome the harmonics resulting from the use of renewable energy components.

Simulation results

Case 1: by making a load flow study for the grid without adding any RES.

As shown in Fig. 5 after applying load flow analysis on the network before MG installation by using the Electrical Transient Analyzer Program (ETAP) program can see the following:

  • High voltage drops and under voltage.

  • Transformer is overloaded.

  • Low power quality.

  • Less efficient system.

  • Non-reliable system.

Fig. 5
figure 5

Load flow analysis for grid.

From ETAP report; Table 1 shows that, the load and consumption and power losses, the power losses of active and reactive is high at this system thus the total consumption is high because the consumption equal load plus loss.

Table 1 Load, consumption and loss for the overall system.

From ETAP report; Table 2 shows that, the voltage at bus1, its moderate and equal nominal voltage, but the voltage at other busses its decrease than nominal voltage and the voltage drop at the load buses is high.

Table 2 Voltage drop for every bus.

From ETAP report; Table 3 shows that, the flow of active power KW and reactive power KVar and also show the losses and power factor, from this table noted that the power factor is low at all busses and the losses is high for every cable and total losses at transformer is very high.

Table 3 Active and reactive power flow and losses and % PF for every bus.

From ETAP report; Table 4 shows that, the state of the bus and cable, all buses and cable have problems such as under voltage and overloaded.

Table 4 State of the important bus.

To overcome that problems, some steps must be taken, including the depreciation of loads or the use of other sources of energy to reduce loads from the traditional source and improve power quality. In order to address the aforementioned issue, the following measures were implemented.

The revised system architecture calls for using the electrical energy generated by PV and WT to supplement grid supply in order to fulfill demand and prevent the aforementioned issue. Study the load flow analysis by using ETAP program. As shown in Fig. 6, the MG after adding RES to the grid, the wind turbine is an induction generator that injects active power and absorbs reactive power, which causes a voltage drop at the MG and poor power quality; voltage and power quality can be modified to inject active power and not absorb reactive power.

Fig. 6
figure 6

Microgrid with RES.

As shown in Fig. 7, after modifying the wind turbine at the simulation program by selecting wind turbine as voltage control wind turbine to maintained voltage and absorb zero reactive power, the voltage is improved, power quality is improved, reactive power is reduced, losses and consumption are reduced, and active and reactive power is also injected into the main grid.

Fig. 7
figure 7

Microgrid with RES after modification.

From ETAP report; Table 5 shows that, the power losses are reduced, consumption is reduced and there is a generation from RES sufficient to meet the load and the active and reactive power is injected to grid.

Table 5 Load and generation, loss for overall system.

From the ETAP report, Tables 6, 7, and 8 show that the voltage drop is reduced, the voltage profile is improved, and the consumption of reactive power is reduced, and at the specific buses, reactive power is injected into the grid, and the power factor is improved, and the load and generation at all buses.

Table 6. Percentage of voltage for every bus.
Table 7. Active and reactive power flow and losses and p.f for every bus.
Table 8. Load and generation at every type.

Case 2: by making a harmonic load flow study for the MG after adding renewable energy sources.

Figure 8 shows the ship of waves from all buses and the fundamental wave. After adding RES, the cause of this distortion is harmonics.

Fig. 8
figure 8

Shape of wave form after adding RES.

By frequency scanning the percentage of the voltage spectrum at every harmonic order at every bus after adding RES, as shown in Fig. 9. The 5th, 7th and 11th, 13th harmonics have a significant effect on the system and their magnitude is high, so it is necessary to install a harmonic filter.

Fig. 9
figure 9

Frquency scan.

To avoid this problem, a harmonic filter is added to the system to remove some of the affected harmonics. Figure 10 shows the shape of the waves for all buses after adding a harmonic filter. It was found that the distortion was removed, the wave became smooth, and the 5th, 7th and 11th, 13th harmonics were removed, and THD is reduced, as shown in Fig. 11.

Fig. 10
figure 10

Shape of waveforms after adding harmonic filter.

Fig. 11
figure 11

Frequency scan after adding harmonic filter.

When the active power is raised, the amount of voltage is reduced, and thus voltage drop and under voltage occurs as shown at P–V curve at Fig. 12. The red curve represents the system before adding MG and blue curve represent the system after adding it. The system after adding RES is more stable than the system before adding it.

Fig. 12
figure 12

P–V curve.

Conclusion

This paper addresses several power quality concerns in MGs and clarifies the power quality issues in both AC and DC MGs. The proliferation in distributed Power Source has exacerbated power quality problems and is a significant challenge for both large consumers and utility companies. Also, this paper looks at power quality issues and how to improve them. The presence of harmonics has been observed to have deleterious consequences on the MG. Also, this paper presents various power quality issues that arise in a stable state, specifically voltage drop, harmonic distortion, power losses, and phase unbalance. This will be achieved by adjusting the demand level of specific electrical devices in the MG, adding other sources to the grid near the load center, such as renewable energy sources, and studying the impact of these sources on the performance and behavior of the grid. This study will examine these problems both before and after the integration of RES to MG. A real-life scenario with the aforementioned issues has been selected for analysis. The results show that the voltage profile and voltage distortion, production, and the consumption and losses, harmonics in the MG and study this result before adding RES and after adding it and comparing between result of MG and traditional grid.

Limitation and future work

One of the study’s shortcomings is its narrow focus on power quality elements, while another study aims to reduce consumption voltage drop and improve power quality through the use of renewable energy sources.

The diversity and accessibility of renewable energy sources could enhance research and expand the range of viable economic options, potentially making the suggested solution applicable in other contexts. This work’s limitations stem from the fact that it ignores crucial issues like protection and data processing.

Furthermore, it doesn’t handle hybrid cars, which can represent the source or the load depending on the situation thanks to a battery. Future articles could delve deeper into this significant topic. The following features of cooperative MG control may be included in order to enable supplemental grid services. Adaptability; dependability; security; and robustness.