1. Introduction
The integration of microgrids into power systems represents a pivotal advancement in modern energy management, offering numerous benefits for both reliability and sustainability. Microgrids are localized energy systems that can function independently or alongside the main power network, providing a versatile and resilient solution to energy distribution. They enhance energy security by decentralizing power generation, thus reducing the reliance on large, centralized power plants and mitigating the risks associated with grid failures [
1,
2]. Additionally, microgrids can incorporate renewable energy sources such as solar and wind, promoting environmental sustainability and reducing greenhouse gas emissions [
3,
4]. Their potential to operate autonomously in island mode during outages could ensure a continuous power supply for critical infrastructures. Moreover, microgrids can optimize energy usage through advanced management systems, leading to increased efficiency and cost savings. As the demand for reliable, clean, and resilient energy solutions grows, the integration of microgrids into power systems stands as a crucial step toward achieving a sustainable and secure energy future [
5,
6,
7].
The integration of microgrids into power systems introduces several power quality issues that must be meticulously addressed to guarantee the stability and efficiency of the overall electrical network. One significant concern is the potential for voltage fluctuations and imbalance [
8]. Microgrids, particularly those that incorporate renewable energy sources such as solar and wind, are prone to generating intermittent and variable power outputs. This variability can lead to voltage sags or swells, which can affect the performance and lifespan of sensitive electronic equipment and industrial processes. To mitigate these issues, advanced voltage regulation and stabilization techniques, including the use of dynamic reactive power compensation, must be implemented. Harmonic distortion is another critical power quality issue associated with microgrid integration. The increased use of power electronic devices in microgrids, such as inverters and converters, can provide harmonics to the power network. These harmonics can distort the waveform of the electrical supply, leading to a range of adverse effects, including the overheating of equipment, the malfunction of protective devices, and the reduced efficiency of electrical machines. Effective harmonic filtering and the adoption of standards for harmonic limits are essential measures to address this problem [
9,
10].
Power quality (PQ) improvement strategies are essential for maintaining the reliability and efficiency of modern power systems, particularly as they become increasingly complex with the integration of renewable energy sources and advanced technologies [
11,
12]. One of the primary strategies is the implementation of power conditioning devices, such as dynamic voltage restorers and static synchronous compensators. These devices help to mitigate voltage sags, swells, and interruptions by providing immediate corrective action to maintain voltage stability and continuity of supply. Another crucial strategy involves the use of advanced harmonic filtering techniques. Harmonics, generated by non-linear loads and power electronic devices, can distort the electrical waveform, leading to equipment overheating, increased losses, and interference with communication systems. Active and passive filters are deployed to eliminate or reduce harmonic distortion, improving overall power quality. Active filters dynamically adjust their response to changing harmonic levels, while passive filters provide a steady reduction in specific harmonic frequencies [
10,
13].
PQ issues in electrical distribution systems can be effectively addressed using Distribution Static Synchronous Compensators (DSTATCOMs). Among the various strategies for PQ improvement, DSTATCOMs have emerged as highly effective solutions. The integration of DSTATCOMs into power systems involves multiple topologies, each designed to cater to specific system requirements and configurations. One widely used topology is the three-phase three-wire (3P3W) DSTATCOM, implemented in 3P3W distribution systems to improve PQ and compensate loads. This topology is subdivided into non-isolated and isolated voltage source inverter (VSI)-based configurations. Regarding non-isolated 3P3W VSI-based DSTATCOMs, they can be further categorized into topologies using three-leg or two-leg VSIs. The three-leg VSI topology is commonly discussed in the literature for its effectiveness, whereas the two-leg VSI topology is preferred for its reduced number of switching devices, though it faces challenges in regulating DC capacitor voltages and requiring high DC voltages [
14,
15]. However, isolated 3P3W VSI-based DSTATCOMs involve using three single-phase VSIs or configurations with a Y/Δ transformer, which offers system isolation and matches the kVA rating required for reactive power injection. Despite the higher number of switching devices in some isolated topologies, they provide benefits such as isolation and flexibility in transformer configurations to meet specific PQ improvement needs. Another crucial topology is the three-phase four-wire (3P4W) DSTATCOM, employed in 3P4W distribution systems. These topologies are designed to handle the additional neutral current and provide effective compensation for nonlinear and unbalanced loads in such systems. By implementing various configurations of 3P4W DSTATCOMs, including those with split capacitors and multiple VSIs, PQ issues like harmonics, voltage sags, and swells can be mitigated efficiently [
15].
The control strategies for DSTATCOMs can enhance the overall system performance by providing reactive power support and maintaining power quality. They aim to enhance overall system performance and encompass several advanced methodologies. The synchronous reference frame (SRF) theory is a key approach in power electronics and power systems. It uses the supply voltage to derive a rotating reference frame synchronized with the grid voltage. This synchronization is achieved by employing the grid voltage components, typically represented by sine and cosine values, in the Park transformation that converts the three-phase load current quantities into direct (d-axis) and quadrature (q-axis) components in the SRF. This transformation is crucial as it facilitates the precise regulation of reactive power, maintaining optimal PQ. The SRF theory is widely adopted in various applications, including grid-connected inverters, motor drives, and active power filters, where the precise control of PQ and system dynamics is crucial [
14,
15].
Instantaneous reactive power (IRP) theory is another important approach. In this theory, the DSTATCOM alters its current to match the desired waveform’s peak harmonic magnitude by measuring the source voltage and load currents, which are then transformed using the Clarke transformation. This conversion translates the three-phase quantities into two-phase orthogonal coordinates. This transformation is essential for accurately calculating the instantaneous active and reactive power components. This enables the DSTATCOM to effectively regulate reactive power, thus enhancing the system PQ and overall performance. In the realm of control algorithms, the Proportional–Integral (PI) control method and the Fractional-Order PI controller are widely embraced for their simplicity and effectiveness in minimizing steady-state errors. Proportional–resonant control is highly regarded for its capability to eliminate steady-state errors when tracking sinusoidal signals, making it especially advantageous in grid-connected applications. Hysteresis control, known for its fast dynamic response and straightforward implementation, is also notable, though it has the drawback of producing inconsistent switching frequencies. Moreover, control methods based on optimization algorithms utilize evolutionary strategies to fine-tune control parameters, thereby boosting system efficiency and performance. These advanced control algorithms work together to enhance the stability, responsiveness, and overall effectiveness of DSTATCOM systems in maintaining power quality and voltage regulation.
Recent advancements in DSTATCOM control strategies have introduced a range of innovative approaches to enhance system performance. A notable development is the proposal of a Type-2 Fuzzy Logic Controller (FLC) with a recursive least square filter designed to improve control precision [
16]. Additionally, a conjugate gradient backpropagation method based on the icos(ϕ) neural network has been applied, resulting in significant gains in system accuracy [
17]. The introduction of a generalized neural network (NN) algorithm, which combines Gaussian, sigmoidal, and linear transfer functions, has further broadened the versatility of DSTATCOM control [
18]. The adoption of an enhanced model predictive control (MPC)-based state-space model, along with the application of MPC to a newly developed four-level inverter-based DSTATCOM, has led to marked improvements in dynamic response and stability [
19,
20]. Furthermore, an adaptive neuro-fuzzy inference system (ANFIS) utilizing least-mean-square algorithms has proven effective in compensating for current disturbances [
21]. Other advancements include the development of an improved Widrow–Hoff algorithm-based adaptive control [
22], as well as the implementation of an adaptive reweighted zero-attracting control for a DSTATCOM-based photovoltaic source [
23]. Finally, significant research has focused on the tuning of PI controllers, employing methods such as the Differential Search Algorithm and Wind-Driven Optimization [
24], as well as the integration of particle swarm and ant colony optimization, both of which have substantially enhanced the performance of DSTATCOM systems [
25].
The PI controller, Fractional-Order PI (FOPI) controller, and cascading controllers are extensively utilized to enhance power quality and maintain voltage stability. The PI controller effectively minimizes steady-state errors by integrating past control actions, ensuring rapid correction of voltage deviations. However, system nonlinearities and dynamic changes can adversely affect its performance, leading to oscillations and extended settling times. While FOPI controllers can offer improved system performance, they are often more sensitive to disturbances and noise, which can result in instability if not carefully tuned [
26,
27,
28]. In contrast, cascading controllers, which typically involve multiple layers of control strategies, provide enhanced responsiveness and robustness against disturbances. Nevertheless, these cascading systems can become complex, making parameter tuning more challenging [
29,
30]. Both controller types may also encounter difficulties under extreme operating conditions, where saturation effects can lead to inadequate compensation and system instability. Thus, while PI, FOPI, and cascading controllers are valuable for many applications, their limitations highlight the need for meticulous design and tuning to optimize performance in real-world scenarios.
This paper elaborates on the application of cascading Proportional–Integral (PI-PI) and cascading Fractional-Order PI (FOPI-FOPI) controllers for DSTATCOMs in hybrid microgrids that incorporate photovoltaic (PV) systems and fuel cells. A novel hybrid optimization algorithm has been developed to accurately tune the proposed controller and enhance power quality.
Table 1 presents a comparative analysis of this work alongside existing studies. The principal novel contributions of this research are outlined as follows:
A new hybrid optimization algorithm (WSO-WOA) is introduced. It integrates the White Shark Optimization (WSO) and Whale Optimization Algorithm (WOA) strengths. This hybrid approach leverages the distinct advantages of both algorithms to enhance optimization performance and accuracy.
The paper provides a detailed comparative analysis of two cascading control strategies: the PI-PI controller and the FOPI-FOPI controller. This evaluation focuses on their application in a DSTATCOM integrated into a hybrid MG, highlighting their effectiveness in different operational scenarios.
A thorough performance analysis of the proposed hybrid algorithm and the cascading controllers was conducted under a range of power conditioning issues, including conditions such as voltage sags, swells, and faults. This provided a comprehensive understanding of their behavior and effectiveness in managing power quality disturbances.
The paper also includes a comparative analysis of the proposed hybrid algorithm against other well-known optimization algorithms. This comparison evaluates the relative performance of the WSO-WOA hybrid approach in terms of accuracy, convergence speed, and overall effectiveness in optimizing the control strategies.
The remainder of this paper is organized as follows:
Section 2 introduces the mathematical model of the hybrid MG, establishing a foundational understanding of its components and their interactions.
Section 3 delves into the control mechanisms used for the various elements within the MG.
Section 4 details the cascading control strategy implemented for the DSTATCOM.
Section 5 describes the operational mechanism of the proposed WSO-WOA algorithm and its role in enhancing optimization performance.
Section 6 thoroughly analyzes the results from various case studies, highlighting the practical impact of the proposed methods. Finally,
Section 7 concludes the paper, summarizing the key findings and contributions of the research.
2. Mathematical Model of the Hybrid MG System
The MG under consideration is composed of a solar photovoltaic (PV) array, a proton exchange membrane fuel cell (PEMFC), and the main grid, as shown in
Figure 1. These sources are interconnected through a centralized three-phase grid-connected inverter, which serves as the link between the MG and the main grid through a step-up transformer connected between B1 and B2. This configuration is designed to provide reliable power to both residential and industrial loads, as well as to an electric vehicle (EV) charging station. To ensure the stability and quality of power at the EV charging station bus (B4), a DSTATCOM is integrated into the system. The primary function of the DSTATCOM is to enhance the dynamic voltage profile and mitigate transient voltage issues that may arise due to fluctuating load demands or grid disturbances. This addition is crucial in maintaining consistent voltage levels, thereby ensuring the efficient operation of the charging station and the overall microgrid.
Figure 1 offers a visual representation of the microgrid’s integration with the DSTATCOM at the EV bus, highlighting the interconnectedness of the components and their role in supporting a stable and resilient power supply.
Table 2 provides detailed parameters of the electrical equipment used within the system, including specifications for the PV array, PEMFC, inverter, and DSTATCOM.
2.1. PV System
The single diode model, known as the five-parameter model of the equivalent circuit of a solar cell, is mathematically used to represent the PV array. The output current of the PV module (
) is determined as follows [
31]:
The output voltage is denoted as
.
Iph represents the light-generated current, while
refers to the diode reverse saturation current (in amperes). The diode ideality factor is denoted by
b.
Kb is Boltzmann’s constant, valued at 1.3805 × 10⁻
23 J/K, and
q represents the electron charge, equal to 1.6 × 10
–19 Coulombs.
and
represent the number of cells connected in series and parallel, respectively. The cell’s operating temperature, in Kelvin, is indicated by
T. Additionally, the photocurrent
Iph of a PV cell is influenced by temperature and solar irradiance, as described by (2):
is the temperature coefficient of the short-circuit current at Isc. The cell series resistance, measured in ohms, is represented by Rs. The shunt resistance in the system is typically very high, and it is often reasonable to neglect it when conducting the analysis. This simplifies the overall analysis process.
2.2. PEM Fuel Cell System
The FC stack output voltage comprising
NFC cells can be mathematically determined using the following equation [
32,
33]:
The power produced by the PEMFC can then be calculated using (4) [
32,
33]:
IFC refers to the fuel cell current measured (A), and
Vcell represents the output voltage of an individual cell. The expression for
Vcell is given in (5) [
32,
33]:
In (3),
Enernst represents the electric potential of the cell, commonly referred to as the Nernst equation. The operating temperature of the PEMFC, represented as
T and measured in
Kelvin, is a key parameter. The partial pressures of hydrogen and oxygen are denoted as
PH2 and
PO2, respectively.
Vact represents the voltage drop due to the reaction rates at the electrodes and is determined by (5). The fuel cell’s performance is influenced by several critical coefficients, denoted as
and
. CO
2 represents the concentration of dissolved oxygen at the catalytic interface is computed using (8).
Vohm indicates the voltage loss caused by resistance to proton flow in the electrolyte, as described by (6). The electrode resistance (
) is determined using (9), which accounts for the length of the electrolyte (
). In addition,
denotes the membrane water content.
Lastly,
Vconc accounts for the voltage loss resulting from the decrease in gas concentration and is calculated as follows:
The gas constant, denoted as R, is measured in mol/Kelvin is important in thermodynamic calculations. The Faraday constant, represented by F, is another essential parameter fundamental to electrochemical reactions. The maximum current density of the fuel cell is indicated by , with units of Amp/cm2, reflecting the highest achievable current per unit area. Additionally, A represents the cell area, measured in cm2, which directly influences the overall performance and efficiency of the fuel cell. Each of these parameters is integral to understanding and optimizing the fuel cell’s operation.
2.3. Centralized Voltage Source Inverter (CVSI)
The systematic diagram of the CVSI is presented in
Figure 2. In the analysis of this system, the microgrid frequency, denoted as ω, determines the dynamic behavior of the system. By utilizing the synchronous
d–
q reference frame, which simplifies the analysis of three-phase systems, the governing equations for both the inductor current and the output voltages of the CVSI are derived in (12) and (13). These equations are essential for understanding the interaction between the CVSI and the rest of the microgrid, particularly in how they regulate power flow and maintain voltage stability.
2.4. Utility Grid
The balanced three-phase four-wire system operating at 25 kV and 60 Hz utility grid is interfaced with the AC sub-grid at B3. It is modeled as a 3P programmable voltage source in series with an RL branch that generates a three-phase sinusoidal waveform with time-varying parameters. In grid-connected mode, the grid’s frequency, voltage, and phase angle are employed as reference signals for the CVSI, which operate synchronously with the grid to ensure overall system stability.
2.5. DSTATCOM
The DSTATCOM is composed of a DC capacitor, a VSI, and a coupling filter, as shown in
Figure 2. The coupling filter serves a critical role by enabling the DSTATCOM to connect to the power grid. It injects compensating currents at B4, thereby enhancing PQ. The system’s dynamics in the SRF can be expressed as:
Thus, according to the power balance theory,
The DSTATCOM’s active and reactive powers are calculated as follows:
4. Control Units of the DSTATCOM
The control strategy of a DSTATCOM typically involves multiple control loops to regulate voltage and improve power quality in distribution systems, as shown in
Figure 7. The outer voltage control loop is responsible for maintaining the DC link voltage (
) at a reference value (
), ensuring sufficient energy storage for reactive power compensation. This loop generates the reference current for the inner current control loop (
). The error between the measured DC link voltage and its reference is processed through controller
C1, yielding the required reference current, as shown in (22).
The second outer control loop is employed to enhance the voltage profile at the load bus, as illustrated in
Figure 7. The output of this loop serves as the reference signal for the q-axis component (
), which can be determined using (23) or (24).
The inner current control loop regulates the DSTATCOM’s output currents along the
d-axis (
) and
q-axis components (
). The control objective is to track the reference currents (
and
), which are derived from the outer loop and reactive power requirements. The
C3 and
C4 controllers in the inner loop generate the control voltages
and
as follows:
In this work, two cascading controllers, namely PI-PI and FOPI-FOPI, are employed to replace C1, C2, C3, and C4. Adopting cascading controllers offers several advantages over the traditional configuration, including improved dynamic response, enhanced stability, and greater flexibility in tuning for specific performance criteria. These benefits make cascading controllers particularly effective in complex control systems where precise regulation is essential.
The transfer function of the cascading PI-PI controller is presented in (27), illustrating its mathematical formulation and how it governs the system’s behavior. Similarly, the transfer function of the FOPI-FOPI controller is provided in (28), which highlights the distinct characteristics of Fractional-Order Controllers and their ability to offer superior control by accommodating a wider range of system dynamics. The choice between these two controllers depends on the application’s specific requirements, with each offering unique advantages in terms of performance and robustness.
Tuning the control unit’s parameters is a crucial aspect of control system design. This process is commonly treated as an optimization problem, with meta-heuristic algorithms frequently used to determine the optimal parameter settings.
The optimization may involve one or more objectives, subject to a defined set of constraints. The formulation of the objective function is pivotal, as it guides the optimization process towards achieving the desired control performance. In this study, the integral of time-weighted square error (ITSE) is employed as the objective function, denoted as ‘OF’, to evaluate system performance, as given in (29). The upper limit of the integral, represented by
Tmax, is typically set to a value greater than the system’s settling time, ensuring that the integral converges to a steady-state value. The cumulative errors within the control circuit of the DSTATCOM, as described in (30)–(33), are used to define the objective function:
The proposed fitness function (
OF) comprises four objectives (
OF1,
OF2,
OF3, and
OF4). The foremost objective (OF
1) aims to minimize the ITSE of
in the DSTATCOM (
). Simultaneously, OF
2 focuses on minimizing the ITSE of
(
), while OF
3 targets the minimization of the ITSE of
(
). The fourth objective (OF
4) seeks to reduce the ITSE of
(
). The constraints of the problem focus on the upper and lower limits of the controllers’ parameters, as well as the tolerated level of Total Harmonic Distortion (THD) in the signal fed into the grid, which is required to remain under 5%. These parameters can be delineated as follows:
The control unit of the DSTATCOM consists of four distinct loops: two outer loops for managing voltage and two inner current loops dedicated to current tracking, as shown in
Figure 7. This structure is critical for achieving precise and responsive control.
As presented in (27) and (28), the PI-PI controller consists of four decision-making variables, while the FOPI-FOPI controller incorporates six control parameters, reflecting its more intricate design due to fractional-order dynamics. The computational complexity of each controller can be determined based on the number of decision-making variables and control parameters involved. The PI-PI controller’s complexity can be approximated by O(4k), and k signifies the number of control loops. This linear relationship indicates that the computational demand scales with the decision variables.
Conversely, the FOPI-FOPI controller’s complexity is influenced by the need for fractional-order calculations, which typically require more computational resources. This complexity can be expressed by O(6k). The analysis of computational complexity underscores the importance of optimizing both controllers to ensure real-time feasibility in practical applications. While the linear nature of the complexities suggests that the systems can efficiently handle the computations, the specific demands of fractional-order calculations in the FOPI-FOPI controller necessitate careful consideration in algorithm design.
5. The Hybrid White Shark Optimizer and Whale Optimization Algorithm (WSO-WOA)
The proposed WSO-WOA algorithm integrates the updating mechanisms of the WSO and WOA to enhance the algorithm’s exploitation and exploration capabilities. As depicted in
Figure 8, the WSO-WOA primarily relies on the WSO to update the positions of new solutions. However, if the WSO fails to produce a solution that surpasses the current best solution in any iteration, the WOA is subsequently employed as an additional stage to generate new candidate solutions. This dual approach aims to ensure the generation of high-quality solutions. The operational details of the WSO, WOA, and the proposed WSO-WOA algorithm are discussed in the following sections.
5.1. White Shark Optimizer (WSO)
The WSO, created by Braik et al. [
34] in 2022 was inspired by the natural behaviors of great white sharks. The optimizer’s mathematical framework is based on the sharks’ exceptional hearing and smelling capabilities, which they use for navigation and hunting. These behaviors are integrated into the algorithm to balance exploration and exploitation, allowing search agents to efficiently investigate different areas of the search space. This approach enhances the optimization process, helping to identify the best possible solutions. The WSO operates through a systematic, iterative process aimed at solving optimization problems efficiently.
Initially, the parameters of the problem and the algorithm are set, followed by the random generation of initial positions and velocities for the population of white sharks. The positions of the sharks are evaluated to establish a baseline for the optimization process. As the algorithm progresses through iterations, the following shark behaviors are utilized to update the shark positions:
- (a)
A white shark determines the position of its prey by sensing a disruption in the water’s waves, which is caused by the movements of prey. This behavior is known as the speed of movement toward prey. Each shark’s velocity is adjusted based on the difference between its current position and the best-known positions within the swarm. It is guided by random factors to introduce variability, as illustrated in (38).
In the expression
, the variable ϵ is determined, with τ denoting the acceleration factor, which is fixed at 4.125. The notation
represents the velocity vector associated with the
ith white shark in the
tth iteration. Furthermore,
refers to the best-known position vector for the ith white shark in the swarm. The parameters c1 and c2 are random values that are uniformly distributed within the interval [0, 1].
and
are computed (39). The minimum and maximum values for P (
and
) are set at 0.5 and 1.5, respectively.
- (b)
Sharks then update their positions according to these velocities, with two possible strategies: one that applies when the randomly generated number is less than the sensory intensity factor (
), and another when it is greater. This behavior is known as the progression towards the ideal white shark. In this scenario, the behavior of white sharks as they close in on their prey is modelled using the following position-update strategy:
Here, ⊕ denotes the bitwise XOR. The variable f corresponds to the frequency of the white shark’s oscillatory motion, and “rand” denotes a randomly generated number that is uniformly distributed between 0 and 1. The parameter mv is introduced to assess the growing intensity of the white shark’s sensory perception, specifically its hearing and olfactory senses, which become increasingly refined with each iteration. Further elaboration is provided in Braik et al. [
34].
- (c)
Great white sharks are adept at sustaining their location near the most favorable solution in relation to their prey. When the randomly generated number is less than the sensory sensitivity parameter (
), each shark’s movement towards the prey is fine-tuned using additional calculations to precisely determine direction and magnitude, as detailed in (41) and (42). These equations mathematically represent the sharks’ behaviors of moving towards the most successful shark in the swarm, as well as their collective fish school dynamics
In (41), denotes the updated position of the ith the relationship between the white shark and its prey. The variables r1, r2, and “rand” are random numbers within the range [0, 1]. The parameter is introduced to reflect the effectiveness of the shark’s sensory abilities, such as smell and sight, when following other sharks near the optimal prey.
As indicated by (42), sharks adjust their positions based on the leading shark approaching the target, refining their position. Ideally, the sharks’ final positions encircle the prey within the search space. The coordinated actions of the sharks within the WSO exemplify collective behavior influenced by their alignment with the leading shark, resulting in improved search efficiency at both local and global levels.
- (d)
This process is repeated for each shark in the population, ensuring that those that move beyond the predefined boundaries are repositioned. After each iteration, the new positions are evaluated and updated, incrementing the iteration count until the termination condition is met. The algorithm ultimately returns the optimal solution discovered during the iterative process, reflecting the collective intelligence and adaptive behavior of the shark-inspired swarm.
5.2. Whale Optimization Algorithm (WOA)
The WOA was introduced by Mirjalili et al. [
35], drawing inspiration from the unique hunting behavior of humpback whales, particularly their bubble net feeding technique. This technique involves creating a series of bubbles in a circular or spiral pattern, resembling the shape of a “9”, to trap prey. This behavior is distinct from that of humpback whales and serves as the foundation for the mathematical model of WOA. Like other meta-heuristic algorithms, WOA begins with the initialization phase, then updates decision variables and constraint checks, and concludes with the evaluation process. The operational mechanism of WOA can be outlined in the following steps:
- (a)
First, initialize the population of whales Xi (where i = 1, 2…, n).
- (b)
Calculate the fitness of each search agent to identify the best search agent, denoted as .
- (c)
Begin the iterative process with the specified maximum number of iterations. For each iteration:
Update the parameters a, A, C, l, and p for every search agent. The parameter a gradually decreases from 2 to 0 throughout the iterations, affecting both the exploration and exploitation phases. Value b remains constant and determines the shape of the logarithmic spiral. The parameter l is a random value within the range of [−1, 1], while p is a random value between 0 and 1.
Search vector A enables the WOA algorithm to seamlessly shift between exploration and exploitation, as defined in (43). As A decreases, the algorithm allocates certain iterations to exploration when ∣
A∣ is greater than or equal to 1 while dedicating the remaining iterations to exploitation when ∣A∣ is less than 1. Vector
C is calculated using (44).
r is a vector randomly generated in the range 0 and 1.
The shrinking encircling mechanism and the spiral model are applied to update whales’ positions. If the probability
p is less than 0.5 and the magnitude of A is less than 1, update the position of the current search agent according to (45).
If
p is less than 0.5 but the magnitude of A is greater than or equal to 1, select a random search agent and update the position of the current search agent by:
If p is greater than or equal to 0.5, update the position of the current search agent by:
and
represent the distance between the ith whale and the prey (the best solution found so far) and are determined using (48) and (49), respectively.
is calculated using (50).
After updating the positions, check if any search agent has moved beyond the defined search space and make the necessary adjustments to bring it back within bounds.
Recalculate the fitness of each search agent and update if a better solution is found.
Increment the iteration count t and continue the process until the maximum number of iterations is reached.
Finally, return as the best solution obtained.
5.3. Proposed WSO-WOA in Tuning the Controller Parameters
The operational process of the proposed hybrid scheme is Algorithm 1. In this method, the WSO-WOA algorithm begins by randomly generating an initial population, as outlined in (51). This population comprises N individuals, each characterized by
D dimensions. The performance of each individual is evaluated using the cost functions defined in (29). The individual that produces the lowest cost value is identified as the optimal solution.
Until the termination criteria are satisfied, the algorithm continues to update the position of each individual in the population in the following steps:
Step 1: The WSO updating scheme is first applied:
The behavior of moving toward prey is implemented by adjusting each shark’s velocity, as shown in (38) and (39).
Subsequently, the movement strategy aimed at the optimal white shark is utilized to revise the individual’s position within the population, as indicated in (40).
Update the shark’s position by incorporating its behavior of moving toward the most successful shark in the swarm, along with its collective dynamics as a fish school, as described in Equations (41) and (42).
Check if the solution has moved beyond the defined search.
Step 2: Evaluation Strategy:
The OF is calculated considering the new solution obtained by the WSO.
The problem constraints are checked, and if the solution does not meet these constraints, it will be penalized with a high additional cost.
Step 3: Update if the new solution gives better fitness value the previous best fitness value (OFbest) and proceed to Step 8.
Step 4: If the new solution generated by the WSO fails to improve upon the best solution from the previous iteration, the WOA updating scheme is then applied:
Step 5: Apply the evaluation strategy explained in Step 2 considering WOA’s solution.
Step 6: Update the solution if the WOA’s solution is better than the WSO’s solution.
Step 7: Update if a better solution is found.
Step 8: Go to the next solution and continue until the last solution is reached.
Step 9: Increment the iteration count t and persist with the procedure until the maximum number of iterations is achieved.
Algorithm 1: Pseudo-code of WSO-WOA. |
- 1:
Specify the dimensions of the problem, including the number of candidate solutions (N), Tmax, as well as the upper bound (UB) and lower bound (LB) for each variable. - 2:
Set WSO and the WOA parameters.
|
- 3:
According to the procedure described in (51), the initial population is to be created through random generation. - 4:
Compute the cost function (OF) and check the problem constraints.
|
- 5:
While (t<=T) - 6:
For i = 1:N - 7:
Adjust each shark’s velocity using (38) and (39). - 8:
Update the position of the individual using (40). - 9:
Update the shark’s position using (41) and (42). - 10:
Calculate the OF (If1) of the new solution using (29). - 11:
If1 OF1 < OFbest - 12:
Update the Update . - 13:
N = N + 1, and go to line 7. - 14:
Else If1 - 15:
Update the position X using the WOA’s Equations (43)–(50). - 16:
Calculate the new OF (OF2) of the new solution using (29). - 17:
If2 OF2 < OF1 - 18:
Use the WOA’s new solution. - 19:
If3 OF2 < OFbest - 20:
Update the Update . - 21:
N = N + 1, and go to line 7. - 22:
End If3 - 23:
Else If2 - 24:
Use the WSO’s new solution. - 25:
End If2 - 26:
End If1 - 27:
End for - 28:
T = t + 1. - 29:
End While
|
7. Conclusions
This paper comprehensively evaluates two cascading controllers, the PI-PI controller and the FOPI-FOPI controller, which enhance the performance of DSTATCOMs integrated into a hybrid microgrid. A novel hybrid algorithm, WSO-WOA, was developed to optimize controller parameters across various scenarios. This hybrid microgrid features a combination of a PV system and a PEMFC, which supplies power to EV charging stations—factors that significantly impact the overall power quality of the microgrid.
The proposed WSO-WOA algorithm’s performance was rigorously compared against other optimization techniques, including WSO, WOA, GWO, and SCA. Various case studies were conducted to assess the effectiveness of these controllers under different power quality disturbances, such as three-phase balanced voltage swells, sags, and three-phase-to-ground faults.
The results obtained from this study confirmed the superiority of the WSO-WOA algorithm in achieving optimal solutions compared to other optimization algorithms. Specifically, the WSO-WOA algorithm demonstrated a notable improvement in accuracy, surpassing the other algorithms by approximately 7.29% to 14.1% in the tuning of the PI-PI controller. Furthermore, when applied to the FOPI-FOPI controller, the WSO-WOA algorithm outperformed the other methods by about 8.5% to 21.2%. This significant performance enhancement highlights the WSO-WOA algorithm’s effectiveness in fine-tuning both PI-PI and FOPI-FOPI controllers, showcasing its superior capability in optimizing controller parameters for improved system stability and performance. The results revealed a notable trade-off associated with the WSO-WOA algorithm: it required more time to converge to the optimal solution than the other algorithms. Specifically, the WSO-WOA algorithm took approximately 1.68 to 2.12 times longer to reach convergence than its counterparts. This extended convergence time is critical, particularly in scenarios where real-time or near-real-time optimization is crucial.
However, it is important to note that the tuning process in this context is offline optimization. This means that the extended computation time does not impact the system’s real-time operation, as the optimization is performed in advance and applied to the system’s configuration before deployment. Consequently, while the WSO-WOA algorithm may exhibit slower convergence, its superior accuracy and effectiveness in finding optimal solutions make it valuable for offline optimization tasks where precision outweighs the need for rapid convergence. The performance of the FOPI-FOPI and PI-PI controllers was evaluated across various case studies to assess their effectiveness under different operating conditions. The results demonstrated a significant improvement in the settling time of the regulated signal for the FOPI-FOPI controller compared to the PI-PI controller. The FOPI-FOPI controller reduced the settling time by about 30.5–56.1%. This improvement highlights the superior efficiency of the FOPI-FOPI controller in quickly stabilizing the regulated signal, which is crucial for maintaining optimal performance in dynamic environments.