Introduction

Growing demand for electric devices and nonlinear loads is the main cause of PQ degradation, which is defined as changes in voltage and current quality such as voltage sag, swell, harmonics, interruptions, flickers, etc. Reduced THD prolongs equipment life, increases power factor, and enhances efficiency1. As a result, the grid current and load voltage can be regulated simultaneously in the UPQC model due to the back-to-back arrangement of a series and shunt APF compensator2. The desire of scholars to work on UPQC has been increased by the present trend of microgrids and distributed generating3,4. Moreover, the necessity of switching to renewable energy sources rather than reducing reliance on fossil fuels which are also the cause of global warming has emerged more and more5.

To effectively minimize PQ concerns on the grid side, a fuel cell (FC) combined with UPQC was developed to provide an actual power supply during voltage disruption6. PV was coupled with UPQC7. When this happens, a BESS or other energy storage device can be interfaced with the PV-UPQC and function as an essential device for reliably providing the load with actual power8. Renewable energy systems implement BESS the most when UPQC is functioning in standalone mode. As a result, the BESS was designed in this effort and the PV supports the UPQC. A DC-DC boost converter is used to connect the PV to the DC-link, and a DC-DC buck-boost converter is used to connect the BESS to the DC-link9. The BESS steps in to increase the stability of the distribution power system by delivering power when the PV system is unable to do so. This is particularly relevant during longer-term voltage outages. Typically, the PV system provides the active power to the load. Next, researchers want to create the DC-link voltage control algorithm to maintain a DC-link capacitor voltage constant and steady10,11. However, the computational load and complexity of the UPQC controller increased.

A phase of synchronization is one of the most crucial parts of UPQC system control. To perform the precise synchronization phase operation, take into consideration that the series and shunt APF compensators, respectively, must generate reference voltage and current12. Through the injection of voltage and current in phase with the grid, the UPQC should be able to effectively complete the synchronization procedure. To manage distorted and unbalanced voltage grid instances, most UPQC controllers have been developed using a standard SRF-PLL for the synchronization phase algorithm13. In addition, the PLL’s PI controller necessitates time-consuming fine-tuning and increases control complexity14.

To overcome these issues neural network (NN) control approaches have become more and more common in recent years. There has been a reduction in the mathematical effort and algorithmic complexity as a result of recent improvements in NNs. Many applications as electrical machinery control, utilize NN-based control algorithms and backpropagation mechanisms because of their accuracy and the combined neural assembly that they employ for approximation15,16. An ANN with SWT has been applied as one of the methods for identifying, detecting, and regulating power quality issues in grid-connected micro-distribution systems17. An ANFIS-based adaptive control technique and UPQC devices were employed in a grid-connected microgrid to prevent power quality deviations18. To address the aforementioned issues, specifically regarding prolonged voltage interruptions, this study suggests a solar photovoltaic system, battery storage system, and fuel cell powered by a 12-switch UPQC controlled by a sophisticated neural network. For a microgrid with PV, fuel cell, and battery systems, an approach with UPQC was suggested to overcome PQ-related issues. The main goals of the developed PQ improvement model are discussed below,

  • Designed PV, FC, and battery integrated with three-phase load through DC link.

  • GRU-based 12 switch UPQC integrated non-linear system is designed to reduce harmonics, sag, swell, and interruptions.

  • UPQC links the grid and three-phase nonlinear load to regulate the power flow by managing the disturbances in voltage and current.

  • GRU controller is developed to enhance the performance of 12 switch UPQC by assessing the variation in PCC power and generating a command signal.

  • Three cases are used to assess the UPQC compensator’s performance in terms of sag, swell, and interruption scenarios. Additionally, an analysis is done on the harmonic of each device.

The manuscript has been arranged as follows: Sect. “Literature survey” presents a summary of some of the most recent compensator controlling strategies that are employed to enhance system PQ; Sect. “Proposed methodology” explains the internal functioning and numerical modeling of a distinctive compensator based on intelligent controllers; The performance result and an explanation of the suggested intelligent compensator model are shown in Sect. "Result and discussion"; the model’s overall conclusion is presented in Sect. “Conclusion”.

Literature survey

Improved PQ allows consumers to operate more steadily and securely. Following is a summary of some of the several techniques that evolved to reduce harmonics, sag, swell, and interruption while also improving PQ.

Contribution

Reference

• Designed a three-phase system of the SS-FC U-FISMHC technique as part of the research examination. Furthermore, the efficacy of the recommended method was assessed using three distinct test scenarios.

• The controller that has been developed provides the ability to configure a specific system with a consistent DC-link voltage development over a short period.

• This includes settling time with reduced voltage fluctuations; these systems achieve 4.64% current THD. On the other hand, this compensates for uneven power supplies.

19

• Developed a hybrid controller for the shunt active power filter, which was based on the soccer league algorithm and revealed by an artificial neural network controller (S-ANNC). Additionally, a fuzzy logic controller for the UPQC’s series active power filter which is connected to the solar photovoltaic system and battery storage system was presented in this study.

• The unit vector generation method (UVGM) and a self-tuning filter (STF) were used to produce phase synchronization, which enhances UPQC performance in unbalanced and distorted supply voltage circumstances. For each of the five test scenarios, these techniques were able to lower the THDs to 2.40%, 3.42%, 2.67%, 2.94%, and 3.43%, as well as lower the PF to a comparable level.

20

• Designed UPQC that was hybrid microgrid-based and used regulating strategies. When the system is in isolation mode, the load power supply is continually maintained. As RES is the root source of the system’s PQ issues, this solution minimizes such issues while maintaining a stable state.

• Furthermore, UPQC-equipped hybrid microgrid performs satisfactorily under several control strategies other than voltage sag/swell. Even with numerous types of disruptions, the system functions as intended. Data centers, sensitive loads, and home users are examples of non-linear loads that are appropriate for this system. Additionally, several control techniques were used to analyze the system; however, designing is complex and time-consuming.

21

• Proposed an optimally trained ANN for U-SEBES based on the FF algorithm. The primary goals of the SES and BES controllers were to preserve the DLCV during variations in load and solar irradiation and to compensate for imbalances in the source voltage, eliminate imperfections in current waveforms to lower THD and improve the PF by making the MSE of the ANNC the primary goal.

• These goals were in addition to those of the FF-ANNC for SHAF and the PI-C for SEAF. Upon evaluating the recommended methodology on five experiment studies, the THD decreases to 2.39%, 2.32%, 2.27%, 2.45%, and 2.66%, in that sequence. However, this model needs to improve.

22

• The impacts of various PQ problems on the system are modeled for PV source-integrated UPQC. When the supply source improves the THD of the source current and introduces sag and swell conditions into the system, the voltage magnitudes stabilize. Results from simulations performed both with and without a PV-UPQC device linked to the junction are presented in a comparative study.

• PV-UPQC operates using a fuzzy-PI controller, there was a further improvement in the magnitude of the load voltage as well as higher mitigation of the THD of the source current. With the modified control structure, the voltage magnitude is stabilized at 1 pu and the source current’s THD remains at 1.16%. Despite these models being unsuitable for all conditions

23

• Devised an MPPT technique with jellyfish search optimization (JSO) to enhance microgrid (MG) performance and mitigate power-quality issues for sensitive loads. Furthermore, employed was a unified power-quality conditioner (UPQC). The MG, which was composed of a photovoltaic (PV), a wind turbine, and a fuel cell battery, was examined and modeled for both uniform and non-uniform wind speed and solar irradiation.

• The designed approach was compared with several other maximum power tracking algorithms. To further demonstrate that the added UPQC helps in enhancing power-quality issues, four case studies are done. Model attains reduced THD in 1.57%. However, the process consumes an extended period.

24

• Explains the integration of a grid-integrated photovoltaic (PV) system with a Modular Multilevel Converter (MMC)-based UPQC. When the MMC-based UPQC is combined with a DC connection operated by the Adaptive Neuro-Fuzzy Inference System (ANFIS), PQ is greatly enhanced. This method’s flexibility in controlling the shunt Harmonic Active Power Filter (HAPF) and series Active Power Filter (APF) of the UPQC contributes to a significant portion of its effectiveness. However, the system functions for an extended period.

25

• To enhance the low voltage ride a modified demagnetization control strategy is proposed for the DFIG during grid faults. With the existing coordinated approach, the control method is implemented by the addition of external resistance in the stator side of the DFIG.

• Under symmetrical and asymmetrical grid fault conditions the proposed system performance was evaluated.

26

• To address PQ issues under nonlinear and unbalanced load conditions they introduced a novel control based on the TS-fuzzy algorithm.

• Using MATLAB/Simulink software the performance is evaluated for various PQ issues such as voltage sag/swell and compared the results were with the PI controller and concluded that the proposed method reduced THD to 2.43% for nonlinear loads and 1.6% for unbalanced loads.

27

• Proposed LIP-based deloading of WTG for better frequency dynamic performances under various power system conditions such as variations in wind speed and varying load conditions.

• Validated with real-time simulator hardware in loop for the proposed deloading method

28

Hussein et al. (2025) introduce a hybrid framework combining Particle Swarm Optimization (PSO) and Goal Constraint Relaxation Algorithm (GCRA) to improve control system optimization, enhancing convergence and performance in nonlinear dynamic systems29. Dunna et al. (2024) propose a novel Maximum Power Point Tracking (MPPT) controller based on a super-twisting algorithm using a higher-order sliding mode observer (HOSMO) for PV/battery grid systems, achieving superior tracking accuracy and robustness under varying irradiance30. Premkumar et al. (2024) explore the optimal operation of hybrid power systems with stochastic solar and wind inputs and FACTS devices, using a multi-objective flow direction optimization algorithm to address economic dispatch and voltage constraints in a modified IEEE-30 bus network31. Alrashed et al. (2024) design an improved DVR compensator using an adaptive notch filter and a PD controller optimized by an improved Grey Wolf Optimizer (IGWO), which significantly reduces voltage sags/swells and Total Harmonic Distortion (THD), proving effective in highly dynamic distribution systems32. Fadheel et al. (2024) focus on frequency regulation in islanded multi-microgrids using a hybrid sparrow search-optimized fractional virtual inertia controller, integrating a fractional-order control loop that enhances frequency stability in low-inertia renewable systems33. Lastly, Izci et al. (2023) propose a control scheme for automatic voltage regulators (AVRs) based on a modified Artificial Rabbits Optimizer (ARO), which outperforms traditional methods in achieving precise voltage regulation, faster dynamic response, and improved stability margins under fluctuating load conditions34. Together, these studies underscore the growing reliance on intelligent bio-inspired optimization methods in enhancing the adaptability, efficiency, and resilience of modern power and control systems.

Proposed methodology

A steady increase in power demand has made the use of discrete, non-renewable alternative energy sources necessary for their conversion. During this alteration, the smart grid system has to be used; nevertheless, this comes with some technological challenges, one of which is PQ. With the increasing adoption of distributed generation (DG), PQ has gained considerable attention. When DG sources are integrated into the grid, PQ issues such as harmonics, flickers, voltage swells, and sags are introduced into the system. Therefore, to address the PQ problems, photovoltaic (PV), battery-storage systems (BSSs), fuel cells, and UPQC are detailed in this work35,36. It is then controlled by using a GRU controlling scheme. Figure 1 illustrates the architecture of the suggested PQ enhancement notion.

Fig. 1
Fig. 1
Full size image

Block diagram of the proposed system.

The system model depicted in Fig. 1 is connected to a grid system that makes use of based 12-switch UPQC to meet the load demand. The primary purpose of a grid system is to supply electricity for a three-phase non-linear load system. A grid-connected system is employed in the design of a 12-switch UPQC to mitigate PQ problems such as sag, swell, and interruption. Using shunt filters and series control techniques, the advanced 12-switch UPQC is utilized to compensate for PQ issues37,38. The PV, fuel cell, and batteries of the renewable system are linked to the DC link of a 12-switch UPQC compensator39,40. The performance of 12-switch UPQC is regulated through the utilization of GRU controlling system. The suggested method’s modeling is detailed below.

Modelling of grid

Utility grids are used in the suggested model to generate power, and nonlinear loads are taken into consideration on the load side. The discussion of mathematical modeling of sources is as follows:

Unit connected in many voltage levels through a transmission line and a complete transformer. The Thevenin equivalent circuit gathered through a series sine wave voltage (220 V, 50 Hz) with \(\:\left(Z=R+jX\right)\)Impedance is used to create the grid system.

$$\:{\:P}_{utility}=\varDelta\:V/I$$
(1)

In this case, \(\:I\) stands for current and \(\:\varDelta\:V\) indicates potential difference.

Modelling of nonlinear load

Non-linear loads are defined as any loads that, when supplied with a sinusoidal voltage, draw a non-sinusoidal current. Rectifiers, IGBTs, Diodes, MOSFETs, SCRs, and other Power Electronic Devices are included. Personal computers, television sets (TVs), compact fluorescent lamps (CFLs), printers, battery chargers, uninterruptible power supplies (UPS), fluorescent tubes with electronic ballasts, and other equipment supplied by switched-mode power supplies (SMPS) units are examples of non-linear loads41,42.

The power and load sources are connected to form a point of common connection. The voltage at that moment varies if there is a defect or other problem, which may result in undesired operations like component failure or system disconnections, among other things. A unique compensator that is based on an intelligent controller is created to prevent the system towards PQ issues like harmonics, surge, disruption, and sag. The compensators included in the suggested model are outlined below.

Modelling of twelve switches UPQC

UPQC is a customized power device that provides a comprehensive PQ solution by combining the functions of series and shunt active power filtering. Figure 3 clearly illustrates the representation of the shunt and series filters, whereas Fig. 2 shows the standard UPQC diagram. UPQC consists of two inverters coupled in series and shunt configurations back to back with a common self-supporting DC link composed of a bank of capacitors. A series injection transformer is used to connect the series inverter to the network, shunt coupling inductors are used to interface the shunt inverter to the network, and LC filters are used to lessen the high-frequency switching ripples created by inverters. As a result, Eq. (2) provides the system voltage for a comparable circuit.

$$\:{V}_{grid}\left(t\right)={V}_{grid+}\left(t\right)+{V}_{grid-}\left(t\right)+{V}_{grid0}\left(t\right)+\sum\:{V}_{sh}$$
(2)

The voltage of the shunt compensator is denoted by \(\:{V}_{sh}\), whereas the positive, negative, and zero sequence components of the system voltage are represented by \(\:{V}_{grid+}\left(t\right)\),\(\:\:{V}_{grid-}\left(t\right)\) and \(\:{V}_{grid0}\left(t\right)\). Equation (3) yields the voltage that the series compensator injects.

$$\:{V}_{s{e}_{comp}}\left(t\right)={V}_{Load}\left(t\right)-{V}_{grid}\left(t\right)$$
(3)

The system source voltage is denoted by\(\:{V}_{grid}\left(t\right)\), the load voltage by \(\:{V}_{Load}\left(t\right)\), and the series compensation voltage by \(\:{V}_{s{e}_{comp}}\left(t\right)\). The shunt compensated current, or the difference between the load current and the current accessing the grid is determined by Eq. (4).

$$\:{\:I}_{s{h}_{comp}}\left(t\right)={I}_{Load}\left(t\right)-{I}_{grid}\left(t\right)$$
(4)

\(\:{I}_{Load}\left(t\right)\)is the load current, \(\:{I}_{grid}\left(t\right)\) is the grid current, and \(\:{I}_{s{h}_{comp}}\left(t\right)\) is the compensating current. The current is introduced into the grid using the shunt compensator.

Fig. 2
Fig. 2
Full size image

Basic design of UPQC.

Fig. 3
Fig. 3
Full size image

Schematic diagram of (a) shunt filter (b) series filter.

The injected current contains limited harmonic content. The distorted load current is obtained from Eq. (5).

$$\:{\:I}_{Load}\left(t\right)={I}_{Load+}\left(t\right)+{I}_{Load-}\left(t\right)+{I}_{Load0}\left(t\right)+\sum\:{I}_{sh\_comp}\left(t\right)$$
(5)

Where the load current’s positive sequence is denoted by\(\:{I}_{Load+}\left(t\right)\), its negative sequence by\(\:{I}_{Load-}\left(t\right)\), and its zero-sequence component by \(\:{I}_{Load0}\left(t\right)\). The current passing within the shunt compensator is\(\:{I}_{sh\_comp}\left(t\right)\). High current and voltage can be fulfilled using UPQC; however, there is a voltage imbalance between the different levels. Twelve switches UPQC was utilized to overcome these issues and increase system efficiency.

In 12 switches UPQC contains twelve power semiconductor switches in total. Switches represent the shunt VSI that is connected at the PCC, whereas, the switches represent the series VSI and are connected between the PCC26. The series transformer serves as a link between the main line and the series DVR. Shunt connections are made between the DSTATCOM and the line through the coupling inductor. There is a single DC link connecting these two back-to-back inverters. However, consistent with these objectives, a non-linear load connected at the end of the three-phase source line has been taken into consideration. The point of common connection suffers a voltage malfunction as a result of an abrupt load activation or load shedding. As a result, harmonic suppression makes it challenging to maintain a voltage steady. However, this is achieved when active filter topologies combine to generate a single, integrated hybrid structure.

The detected feedback signals in the 12-switch UPQC are\(\:{I}_{la},{I}_{lb}\:and\:{I}_{lc}\), while the coupling voltages of phases \(\:a,b\:and\:c,\) and the DC bus voltage are \(\:{V}_{sa},{V}_{sb},{V}_{sc}\) and\(\:{V}_{dc}\), respectively. Park’s transformation equation permits to conversion of the load current in the three stages into the \(\:dq0\) axis. The PCC voltages are synchronized with the sine and cosine functions using a PLL. After that, low-pass channel filters are applied to \(\:{I}_{ld}\) and \(\:{I}_{lq}\) To eliminate any DC ripples. Equations (6) and (7) provide the fundamental and other harmonic components of the \(\:d\)- and \(\:q\)-axis current components.

Detected feedback signals in the 12-switch UPQC are\(\:{I}_{la},{I}_{lb}\:and\:{I}_{lc}\), while the coupling voltages of phases\(\:\:a,b,c\) and the DC bus voltage are \(\:{V}_{sa},{V}_{sb},{V}_{sc}\) and\(\:{V}_{dc}\), respectively. The three stages of the load current are converted into the \(\:dq0\) axis with the use of Park’s transformation equation. A PLL is used to synchronize the PCC voltages with the sine and cosine functions. After that, low-pass channel filters are applied to \(\:{I}_{ld}\) are \(\:{I}_{lq}\) to eliminate any DC ripples. Equations (6) and (7) yield the fundamental and other harmonic components of the d- and q-axis current components.

$$\:{I}_{ld}={I}_{dDK}+{I}_{dAK}$$
(6)
$$\:{I}_{lq}={I}_{qDK}+{I}_{qAK}$$
(7)

To mitigate the harmonics generated at the PCC and the upregulation of the load voltage under various load scenarios, a series of active filters can also be employed. In this case, maintaining a series voltage \(\:{V}_{load}={V}_{load}^{*}-{V}_{supply}\) Is necessary to maintain a constant load voltage. Park’s transformation is used to change the voltages to the rotating reference frame. A low pass filter (LPF) is used to smooth out oscillatory elements of harmonic components other than fundamental components. The voltage sections in the direct and quadrature rotational axes are calculated by Eqs. (8) and (9).

$$\:{\:V}_{d}={V}_{dDK}+{V}_{dAK}$$
(8)
$$\:{\:V}_{q}={V}_{qDK}+{V}_{qAK}$$
(9)

Thus, as demonstrated in Eq. (10), the reference D-axis voltage can be shown.

$$\:{V}_{d}^{*}={V}_{dDK}+{V}_{loss}$$
(10)

Therefore, Eq. (11) provides the reference quadrature-axis load voltage.

$$\:{V}_{q}^{*}={V}_{qDK}+{V}_{qrl}$$
(11)

With voltage sag in consideration, the series active control may assist in reducing harmonic content and enhancing the voltage profile. A UPQC’s series and shunt voltage source inverters are connected through a shared DC link, and they control reactive power in the power system as well as optimize the performance of the compensators in both the series and shunt configurations. The PV, fuel cell, and batteries of the renewable system are linked to the DC link of a 12-switch UPQC compensator.

Solar power system model

Solar energy is converted into electrical energy using a solar power system. A boost converter with MPPT and a solar PV panel make up the solar PV cells that need to absorb sun radiation to produce electricity30,43,44. The MPPT is used to maximize the PV cell’s output voltage at a given temperature and irradiation. Figure 4 depicts the PV cell’s basic model. The panel’s output power \(\:{P}_{PV}\) Can be computed using Eq. (12):

Fig. 4
Fig. 4
Full size image

Equivalent circuit of PV.

$$\:{P}_{PV}={V}_{PV}.{I}_{PV}$$
(12)

The solar PV panel’s output voltage and current are denoted as \(\:{V}_{PV}\) and\(\:{I}_{PV}\), respectively.

Battery energy storage (BES) system model

To maintain the DC bus voltage, the BS is a device made up of a battery and a bidirectional DC-DC buck-boost converter. The following Eq. (13) provides the state of charge (SOC):

$$\:SOC=100\left(1+\int\:{i}_{BS}\:dtQ\right)$$
(13)

The battery operates in two phases, depending on the amount of solar electricity generated: charging and discharging45,46. The SOC limits provided in Eq. (14) define the energy constraints that the battery has to function within.

$$\:{SOC}_{min}\le\:SOC\le\:{SOC}_{max}$$
(14)

Where\(\:\:Q\) is the battery capacity,\(\:\:{i}_{BS}\) Indicates the battery current.

Fuel cell model

Fuel cells are electrochemical devices that use the reaction of chemicals in an electrolyte to transform chemical energy into electrical energy, with the waste products being heat and water. Proton exchange membrane (PEM), gas diffusion layer (GDL), gas channel (GC), catalyst layer (CL), and current collector (CC) of the anode and cathode make up the FC. In FC booster eqn as follows:

$$\:{V}_{dc,err}\left(t\right)={V}_{dc}^{ref}-{V}_{dc}$$
(15)
$$\:{i}_{dc}^{ref}={K}_{p,1}{V}_{dc,err}\left(t\right)+{K}_{i,1}\underset{0}{\overset{t}{\int\:}}{V}_{dc,err}\left(t\right)\:dt$$
(16)

Where \(\:{V}_{dc,err}\left(t\right)\) is dc voltage error;\(\:\:{V}_{dc}^{ref}\) is dc voltage reference; \(\:K\:\)is the liquid’s permeate ratio through the porous media ratio;\(\:\:{i}_{dc}^{ref}\) DC reference.

The system is used to regulate the performance of the 12-switch UPQC. A shunt voltage source converter’s control logic aims to minimize current fluctuations and increase the solar system’s output power. The PV system’s output charges the BESS and FC cells and delivers actual electricity to the loads and grid under typical operating conditions. The battery and FC storage system can therefore provide the entire demand even in a scenario where the PV system is not producing electricity. The compensators are intended to be under the control of the GRU controller. Below is a discussion of the GRU’s working method.

Modelling of intelligent controller

An intelligent controller provides additional advantages than a regular controller because it produces accurate results. To generate a dataset from the voltage and current readings, the Simulink model was set up with various types of fault situations. Using the generated dataset as a base, a GRU is intended to control the compensators. A description of the GRU’s operation is given below.

Modelling of GRU controller

Time-series data is an excellent choice for RNNs as they can process a time-series step-by-step while preserving an internal state across time. The most effective and popular RNN is the LSTM. The long-term reliance issue of the RNN is resolved by the LSTM by preserving the differential values of previous inputs during backpropagation. As a variation on the RNN architecture, GRU provides the advantage of lowering the computation needed to update the hidden state, therefore simplifying the LSTM structure while resolving the long-term dependency issue and preserving LSTM performance. The following modifications are made to the typical LSTM cell architecture in the GRU network: Only three gates rather than four are utilized, and cell state \(\:c\) is ignored. Figure 5 shows the schematic of a single GRU.

Fig. 5
Fig. 5
Full size image

Structure of the GRU.

The voltage and current values of the PCC are considered the input parameter of the GRU in the proposed work, and the pulse signal of the switches in the UPQC is considered the output. The presented inputs and outputs from the 12-switch UPQC systems were directly coupled with the advance controller result, and the operation’s integrity was maintained around the outer limits of the device characteristics such as fluctuations.

The reset gate \(\:r\) decides what details from the prior state \(\:h\) need to be left out. The input vector and the previous state \(\:h\) are used by the update gate \(\:z\) to select which additional information to add to the current state. A probable hidden state candidate is found by the candidate state gate \(\:g\). The input gate, hidden layer, and output gate modeling for the GRU are expressed as follows in Eq. (17),

$$\:{Z}_{t}=\sigma\:\left({W}_{z}\left[{h}_{t-1},{X}_{t}\right]\right)$$
(17)
$$\:{R}_{t}=\sigma\:\left({W}_{R}\left[{h}_{t-1},{X}_{t}\right]\right)$$
(18)
$$\:\check{h}_{t}=tanh\left(W.\left[{R}_{t}\times\:{h}_{t-1},{X}_{t}\right]\right)$$
(19)
$$\:{h}_{t}=\left(1-{Z}_{t}\right)\times\:{h}_{t-1}+{Z}_{t}\times\:\check{h}_{t}$$
(20)

The weight matrix \(\:\left({W}_{z}\:and\:{W}_{R}\right)\) multiplied by the input \(\:\left({X}_{t}\right)\) and the sigmoid function \(\:\left(\sigma\:\right)\) of the previous hidden state \(\:\left({h}_{t-1}\right)\) are represented by \(\:{Z}_{t}\) and \(\:{R}_{t}\). Then, \(\check{h}_{t}\) is the tanh activation of the product of input \(\:\left({X}_{t}\right)\) multiplied by the weight matrix \(\:\left(W\right)\) and \(\:{R}_{t}\), prior hidden state \(\:\left({h}_{t-1}\right)\). The next hidden state \(\:\:{h}_{t}\), is calculated as \(\:1-{Z}_{t}\) multiplied by \(\:{Z}_{t}\times\:\check{h}_{t}\), the previous hidden state. The model’s memory can be considered as the hidden state. The next hidden state \(\:\:{h}_{t}\), is calculated as \(\:1-{Z}_{t}\) multiplied by \(\:{Z}_{t}\times\:\check{h}_{t}\), the previous hidden state. The model’s memory can be considered as the hidden state. It moves on to the following word’s processing in the model. The performance of 12-switch UPQC is regulated through the use of a GRU controlling system effectively to enhance the power flow in the proposed model.

Result and discussion

The major drawback in the power system is considered to be PQ issues. Voltage generally fluctuates at the end-user side mainly due to the lack of power generated by the sources which impacts the power on loads. PQ issues such as sag, swell, interruption, and harmonics are reduced with the proposed UPQC. A gated recurrent neural network (GRU) controlling mechanism is used to operate this device. MATLAB SIMULINK R2021b, 16.0 GB RAM, CPU @ 2.50 GHz, Intel (R) Core (TM) i5-10300 H processor, and 64-bit operating system type are used in the design and performance analysis of the suggested model. Tables 1 and 2 list the suggested model’s parameters and specifications, PV, fuel cell configuration, and UPQC element specification are listed below. Configuration of UPQC element specification is shown in Table 3.

Table 1 Proposed model parameter and specification.
Table 2 Configuration of proposed PV panel and fuel cell.
Table 3 Configuration of UPQC element specification.

Dataset description

Utility grid configuration is used with a traditional system connected at the PCC point. Determining the power value at the PCC point can be a useful way to track how well the simulation model is performing. Then, sag, interruption, and swell failures are exposed to each system individually to compute and store the power value at the PCC point and generate a dataset. By using an intelligent controller model, this dataset is used to drive the compensators. Twelve switches UPQC their working procedure are covered in the simulation parameter definition that follows:

Table 4 Ranges of parameters utilized in the simulation.

A set of parameters and the relevant ranges for the simulation modeling of the suggested and current methodologies are shown in Table 4. Effective individual compensators in the proposed model are separately integrated into the grid-integrated distribution system. These compensators evaluate how effectively the system performs in several scenarios, such as sag, interruption, swell, and harmonics.

A grid is a network of power lines that connects multiple power stations to loads dispersed over a wide area. The power system distributes electricity from power plants to homes and businesses around the nation. The grid power versus time graph is shown in Fig. 6. Grid power remains constant at \(\:6\times\:{10}^{4}\) W for a period of 0 to 0.5 s.

Fig. 6
Fig. 6
Full size image

Grid power analysis.

A simulation model was developed by the suggested PV, fuel cell, and battery charging control scheme for the DC-link bus of the 12-switch UPQC to validate the precision and effectiveness of the suggested control strategy. The simulation model includes a distribution network that includes a non-linear load module and the PV, fuel cell, and battery-generating module of the advanced UPQC.

Performance analysis utilizing 12 switch UPQC

The proposed twelve-switch UPQC is enhancing system security. High voltage power is effectively produced by this reactive power transmission network technology. The intelligent controller first acquires and evaluates the PCC power as an input for generating the proper 12-switch UPQC pulse signal for every scenario. Three scenarios of sag, swell, and interruption combined 3-phase fault conditions are used about PV to assess the effectiveness of the 12-switch UPQC.

Case 1: normal condition with nonlinear load

Integrated optimum controller for a nonlinear load under typical conditions, with solar irradiation of 1000\(\:w/{m}^{2}\)and temperature of \(\:{25}^{0}\). Performance analysis is done in the proposed model.

Fig. 7
Fig. 7
Full size image

Analysis of PV characteristics.

In Figure. 7 0 to 0.5 s, the PV voltage varies from 0 to 500 V. PV current eventually reaches 50 A in 0 to 0.5 s. The following graph illustrates the combined sag and swells under a phase combined fault condition. The DC link voltage is 2700 V as shown in Figure. 8 during the intervals of 0 to 0.5 s.

Fig. 8
Fig. 8
Full size image

Analysis of DC link voltage.

As temperature rises, the voltage decreases noticeably while the current increases, consequently, the power decreases. The PV power is depicted in Fig. 9 illustrates the power varies from 0 to 0.05 s until reaching \(\:3.2\times\:{10}^{4}\) in 0.5 s.

Fig. 9
Fig. 9
Full size image

Examination of PV power.

Figure 10. The battery management system has to implement the battery statement in compliance with the SOC. The SOC of the battery is calculated by dividing its voltage by its total energy consumed. The SOC decrease of 45% in Fig. 10 follows a straight line in a significant fraction of the range.

Fig. 10
Fig. 10
Full size image

Battery SOC Analysis.

A high-pressure system is used in the fuel cell unit, and a PEM stack is mostly used to drive the system. Figure 11 illustrates that the fuel cell stack responds to variations in load in a reasonably regular manner. It clearly illustrates the 0.05 s to 0.5 s fuel cell power steadily maintains 2100 W.

Fig. 11
Fig. 11
Full size image

Fuel cell power response.

Phase fault condition

When the system’s three phases are short-circuited or grounded to one another, a three-phase fault happens. Figure 12 provides a detailed illustration of the three-phase combined current and voltage fault rectification. Figure 12(a) shows under normal conditions during 0 to 0.05 s, 0.1 to 0.15 s, 0.2 to 0.25 s, 0.3 to o.35 and 0.4 to 0.45 s. Sag condition at 0.05 to 0.1 s, swell condition at 0.15 to 0.2 s and interruption at 0.25 to o.3 s occurs. According to the intelligent controller, a three-phase collapse including voltage and current may turn off the power in 0.25 to 0.3 s. Simulation studies indicate that the intelligent 12 switch UPQC maintains consistent power flow by compensating for fault current and voltage.

Fig. 12
Fig. 12
Full size image

Evaluation of (a) three-phase fault current compensation (b) Zoom waveform of current compensation (c) three-phase fault voltage compensation.

An analysis of total harmonic distortion (THD) is presented in Fig. 13. Harmonics can arise from variations in frequency within a system. The voltage and load current THDs of the proposed controller-based model are 0.04% and 10.36%, respectively.

Fig. 13
Fig. 13
Full size image

THD analysis under normal conditions for (a) current and (b) voltage.

Case 2: static condition with nonlinear load

A static shaded module generates power at a significantly slower rate than an unshaded module. Figure 14 presents the temperature \(\:{25}^{0}\)and solar irradiance 400\(\:w/{m}^{2}\)integrated in the suggested appropriate controller for a nonlinear load under static shading conditions. The suggested model’s performance analysis is explained in the section below.

Fig. 14
Fig. 14
Full size image

Analysis of PV characteristics.

Figure 14 shows the curve of PV voltage and current. PV voltage fluctuates from 0 to 0.5 s to 500 V in 0 to 0.5 s. PV current eventually reaches 25 A during 0 to 0.5 s. The following graph illustrates the combined sag and swells three-phase combined fault condition. Figure 15 shows the DC link voltage at 6000 V at intervals of 0 to 0.5 s.

Fig. 15
Fig. 15
Full size image

DC link voltage analysis.

As the temperature rises, the voltage decreases noticeably while the current barely increases. Consequently, when the temperature rises, the power decreases. The PV power vs. time graph in Fig. 16 illustrates the power varies from 0 to 0. 5 s until reaching \(\:1.49\times\:{10}^{4}\) in 0.5 s.

Fig. 16
Fig. 16
Full size image

Examination of PV power.

Figure 17 shows a graphic representation of the battery. The battery management system has to implement the battery statement in compliance with the SOC. The SOC of the battery is calculated by dividing its voltage by its total energy consumed. The SOC decrease of 45% in Fig. 17 follows a straight line in a significant fraction of the range.

Fig. 17
Fig. 17
Full size image

Battery SOC Analysis.

The fuel cell unit utilizes a high-pressure system and a PEM stack, which are primarily used to drive the system. The fuel cell stack responds to the load change in a somewhat regular manner, as seen in Fig. 18. It clearly illustrates the 0.05 s to 0.5 s fuel cell power steadily maintaining 2100 W.

Fig. 18
Fig. 18
Full size image

Fuel cell power response.

Phase fault condition

Figure 19 provides a detailed illustration of the three-phase combined current and voltage fault rectification in static conditions. Figure 19(a) shows normal power flow at 0 to 0.05 s, 0.1 to 0.15 s, 0.2 to 0. 25 s, 0.3 to o.35 and 0.4 to 0.45 s. Sag condition at 0.25 to 0.3 s and 0.35 to 0.4 s, swell condition at 0.15 to 0.2 s and 0.45 to 0.5 s, and interruption at 0.05 to 0.1 s occurs. The power supply may be interrupted in 0.25 to 0.3 s by a three-phase fault involving voltage and current, depending on the intelligent controller. Through fault current and voltage compensation, the intelligent 12 switch UPQC sustains steady power flow, according to experimental validation.

Fig. 19
Fig. 19
Full size image

Evaluation of (a) three-phase fault current compensation (b) Zoom waveform of current compensation (c) three-phase fault voltage compensation.

A total harmonic distortion (THD) investigation is shown in Fig. 20. Variations in frequency can lead to harmonics in a system. The controller-based approach that prefers has a THD of 0.25% at current and 9.89% at load voltage.

Fig. 20
Fig. 20
Full size image

THD analysis under static settings for (a) current and (b) voltage.

Case 3: dynamic condition in nonlinear load

Figure 21 shows the integrated suggested controller for a nonlinear load under case three conditions, where solar irradiance is taken into consideration as 1000\(\:w/{m}^{2}\), 700\(\:w/{m}^{2}\), 900\(\:w/{m}^{2}\) and 900\(\:w/{m}^{2}\) at a temperature of \(\:{25}^{0}.\) The section below explains how the suggested model’s performance analysis was completed.

Fig. 21
Fig. 21
Full size image

Analysis of PV characteristics.

The PV voltage and current are depicted in Fig. 21. PV voltage varies between 0 and 0.5 s and 450 V within that time frame. PV current 0 to 0.5 s to reach 50 A in the end. The following graph illustrates the combined sag and swell 3-phase combined fault condition. Figure 22 shows the DC link voltage at 1800 V at intervals of 0 to 0.5 s.

Fig. 22
Fig. 22
Full size image

DC link voltage analysis.

As the temperature rises, the voltage decreases noticeably while the current barely increases. Consequently, when the temperature rises, the power decreases. The PV power vs. time graph in Fig. 23 illustrates the power varies from 0 to 0. 5 s until reaching \(\:1.9\times\:{10}^{4}\) in 0.5 s.

Fig. 23
Fig. 23
Full size image

Examination of PV power.

Figure 24 shows a graphic representation of the battery. The battery management system has to implement the battery statement in compliance with the SOC. The SOC of the battery is calculated by dividing its voltage by its total energy consumed. The SOC decrease of 45% in the figure follows a straight line in a significant fraction of the range.

Fig. 24
Fig. 24
Full size image

Battery SOC Analysis.

A high-pressure system is used in the fuel cell unit, and a PEM stack is mostly used to drive the system. Figure 25 illustrates that the fuel cell stack responds to variations in load in a reasonably regular manner. Figure 25 clearly illustrates the 0.05 s to 0.5-sec fuel cell power steadily maintaining 2100 W.

Fig. 25
Fig. 25
Full size image

Fuel cell power response.

Phase fault condition

The three-phase combined current and voltage fault rectification under dynamic circumstances is shown in detail in Fig. 26. Figure 26(a) shows normal power flow at 0 to 0.05 s, 0.1 to 0.15 s, 0.2 to 0. 25 s, 0.3 to 0.35 and 0.4 to 0.45 s. Sag condition at 0.25 to 0.3 s and 0.35 to 0.4 s, swell condition at 0.05 to 0.1 s and 0.15 to 0.2 s, and interruption at 0.45 to 0.5 s occurs. Depending on the intelligent controller, a voltage and current-related three-phase failure could shut off energy supply in 0.25 to 0.3 s. The intelligent 12 switch UPQC maintains constant power flow through fault current and voltage compensation, as demonstrated by experimental validation.

Fig. 26
Fig. 26
Full size image

An analysis of (a) three-phase fault current compensation (b) Zoom waveform of current compensation (c) three-phase fault voltage compensation.

Fig. 27
Fig. 27
Full size image

THD analysis under dynamic conditions for (a) current and (b) voltage.

A study on total harmonic distortion (THD) is presented in Fig. 27. Frequency variations can serve as the foundation for harmonics in a system. The recommended controller-based model has THDs of 10.36% for the load current and 0.98% for the load voltage.

THD comparison in suggested and current methods

Frequency fluctuations in a system can give rise to harmonics. In follows Fig. 28 below provides a clear comparison of THD19 and PF, DC link voltage between the suggested and current techniques for each specific controller. In comparison to current techniques, the suggested controller THD range is essentially 0.04%.

Fig. 28
Fig. 28
Full size image

THD comparison bar chart.

However, compared to all controllers the suggested technique has a lower THD, with a value of 0.04%. According to the total analysis, the suggested method reduced THD more effectively than other approaches for PQ enhancement using advanced UPQC. Tables 5 and 6 clearly show the comparison of PF and DC link voltage.

Table 5 Comparison of power factors in specific situations.
Table 6 The time lag between DC-link voltage settling at specific case studies.

In conclusion, the suggested approach can effectively preserve stability while also improving the system’s PQ.

Evaluation of GRU Intelligent controller performance

This section compares and evaluates the performance of the proposed model intelligent controller with several existing models that are currently in use, including Artificial Neural Network (ANN), Deep Neural Network (DNN), and Bootstrap LSTM (BOOT-LSTM). Specificity, sensitivity, MCC, accuracy, error, precision, false negative rate, and false positive rate are the performance parameters.

Fig. 29
Fig. 29
Full size image

Comparison of the Suggested and Current Methods’ Accuracy.

A comparison of the specificities of the proposed and existing techniques.

Figure 29 depicts accuracy values that have been calculated using the confusion matrix. Predicting a value with the least degree of error is what makes a system accurate. The accuracy rate of the suggested method is 98%, whereas the accuracy rates of BOOT-LSTM, DNN, and ANN are 97%, 83%, and 79%, respectively. In Fig. 30, the precision of the suggested and current methodologies is contrasted. What is meant by accurate measurement is the quantity of expected favorable events. The recommended method’s precision value was found to be 98%, in contrast to other current techniques such as BOOT-LSTM, DNN, and ANN, which had comparable precision values of 96%, 80%, and 61%.

Fig. 30
Fig. 30
Full size image

Precision comparison between the suggested and current methods.

Similarly, sensitivity performance is analyzed and shown in Fig. 31. This shows that the suggested intelligent controller has a 99% sensitivity, BOOT-LSTM has a 97%, DNN has a 90% sensitivity, and ANN has a 74% sensitivity. Figure 32 compares the suggested and current approaches’ levels of specificity. The specificity value of the suggested strategy was discovered to be 99.5%, in contrast to several other methods that are already in use, such as BOOT-LSTM, DNN, and ANN, which have specificity values of 99%, 94%, and 93%, respectively.

Fig. 31
Fig. 31
Full size image

Comparison of sensitivity in recommended and existing method.

Fig. 32
Fig. 32
Full size image

A comparison of the specificities of the proposed and existing techniques.

A system’s degree of inaccuracy indicates what flaws or problems it has. The error comparison between the recommended and current approaches appears in Fig. 33. The recommended method’s error rate is 4%, DNNs’ is 17%, and ANNs’ is 21%. It shows that in terms of error rates, the suggested model performs better than the conventional models. The proposed and current approaches to FNRs are contrasted in Fig. 34. The objective of FNR is to evaluate or quantify the discrepancy between expected and actual values. The recommended method’s FNR is 1.8%, DNN is 5% and ANN is 6.4%.

Fig. 33
Fig. 33
Full size image

Error comparison between the suggested and current methods.

Fig. 34
Fig. 34
Full size image

Comparing the proposed and current methods of FNR.

Figure 35 shows the false positive rate for both recommended and conventional approaches. The false positive ratio is the percentage of positive or negative outcomes that yield a positive outcome even in the absence of a phenomenon. The recommended technique has 1.7% false positive rates, 5% DNNs, and 6.4% DBNs. The proposed and current approaches to MCCs are contrasted in Fig. 36. The objective of MCC is to evaluate or quantify the discrepancy between expected and actual values. The recommended method’s MCC is 76%, DNN is 76% and ANN is 64.5%.

Fig. 35
Fig. 35
Full size image

Comparing the proposed and current methods FPR.

Fig. 36
Fig. 36
Full size image

Comparing the recommended and current methods of MCCs.

Conclusion

GRU-based UPQC is designed to reduce PQ issues under non-linear load systems in an integrated system. GRU controller is trained on 80% of the data set values. Different PQ issues such as sag, swell interruption, and THD reduction are mitigated using the GRU by analyzing the load voltage and current at every point to generate the pulsed for the UPQC. Various fault conditions are created to make a dataset which is utilised to design the GRU that analyses the load voltage and current at each second to generate a pulse for UPQC. The performance is evaluated utilizing an advanced controller under various conditions, including swell, sag, harmonics, and combined three-phase faults. The low harmonic content of voltage is 0.04%, 0.25%, and 0.98%. The suggested model’s efficacy is validated by contrasting its mitigation performance and THD with those of other current models, such as BOOT-LSTM, DNN, and ANN. The suggested method obtains evaluations of 98%, 4%, 99.5%, and 97% for accuracy, error, specificity, and precision, respectively. Additionally, the compensators UPQC has 0.04%, 0.25%, and 0.98% provide low voltage harmonics.