Recommended articles:
-
-
Global Energy Interconnection
Volume 8, Issue 4, Aug 2025, Pages 523-536
Optimized control of grid-connected photovoltaic systems: Robust PI controller based on sparrow search algorithm for smart microgrid application
Abstract
Abstract
0 Introduction
1) General context
The global energy landscape is undergoing a profound transformation, driven by the urgent need to reduce reliance on fossil fuels and shift toward cleaner,more sustainable energy sources.Among the various renewable energy technologies,photovoltaic systems have emerged as one of the most promising solutions.By harnessing the abundant and inexhaustible power of the sun, PV systems provide a clean, sustainable, and environmentally friendly alternative for electricity generation, as highlighted by Charadi et al.[1] and Akarne et al.[2].As the world increasingly embraces renewable energy to mitigate climate change and meet growing energy demands, the integration of PV systems into the electrical grid has become a key focus of research and development, as discussed by Akarne et al.[3] and Jrhilifa et al.[4].
However, with the increasing penetration of gridconnected PV systems, ensuring efficient energy production and stable system operation has become a significant challenge.The intermittent nature of solar energy subject to variations in irradiance and temperature necessitates advanced control strategies to optimize energy output,maintain grid stability, and ensure smooth operation of the system under fluctuating environmental conditions,as emphasized by Jrhilifa et al.[5] and Charadi et al.[6].Effective control mechanisms are critical for managing these challenges,as they enable grid-connected PV systems to respond dynamically to changes while maintaining optimal performance.
At the core of these control strategies is the PI controller, one of the most widely used tools in industrial automation and process control.PI controllers are highly regarded for their simplicity, versatility, and effectiveness in maintaining the desired system output by continuously adjusting control inputs based on the error between a setpoint and the measured output, as discussed by Junyi and Gao[7].In grid-connected PV systems,PI controllers play a crucial role in regulating voltage, current, and power output to ensure optimal energy conversion and seamless integration with the electrical grid.However, the performance of PI controllers is highly dependent on the precise tuning of their two key parameters:proportional gain and integral gain.
Traditional methods for tuning PI controllers, such as manual adjustments or heuristic techniques like the Ziegler-Nichols method, often require extensive trial and error, as noted by Jrhilifa et al.[8] and Charadi et al.[9].These methods can be time-consuming and may not yield optimal results, particularly in complex or highly dynamic systems like grid-connected PV installations, where rapid environmental changes demand real-time adaptability.Furthermore, suboptimal PI tuning can lead to issues such as slow response times, overshoot, and instability,which undermine the efficiency and reliability of the PV system.
To address these limitations,this article investigates the application of the sparrow search algorithm as an optimization technique for tuning PI controllers in gridconnected PV systems.SSA is a relatively new optimization algorithm inspired by the intelligent foraging behavior of sparrows, particularly their ability to balance exploration and exploitation in search of optimal food sources.In the context of PI tuning, SSA offers a robust and effi-cient method for exploring complex solution spaces, making it well-suited for optimizing the PI parameters in dynamic systems.
The use of SSA for PI tuning in grid-connected PV systems presents several potential advantages, including improved energy extraction efficiency, faster system response times,and enhanced stability under varying operational conditions.By automatically adjusting the PI parameters in response to real-time changes in the PV system’s operating environment, SSA can significantly enhance the overall performance of the system.
Despite the growing interest in intelligent control for grid-connected PV systems, several research gaps remain.Many existing studies focus on traditional tuning techniques or rely on algorithms like PSO or GA,which often suffer from slow convergence or local optima entrapment in highly dynamic environments.Moreover, real-time adaptability under fluctuating irradiance is still limited in many PI-based control approaches, leading to reduced MPPT accuracy and voltage instability.Most importantly,few works offer a comprehensive SSA-based tuning strategy that simultaneously improves power quality, convergence speed, and controller robustness.This paper addresses these challenges by proposing a sparrow search algorithm tuned PI controller that outperforms conventional approaches in key performance metrics, ensuring reliable and efficient integration of PV systems in smart microgrids.
This article aims to contribute to the growing field of renewable energy control by presenting a systematic approach to PI tuning using SSA.Through detailed simulations and practical case studies,we will demonstrate how SSA can optimize the performance of grid-connected PV systems, offering valuable insights for engineers and researchers working on renewable energy integration.The findings are expected to support the transition towards more sustainable and efficient energy systems,ultimately contributing to global efforts to combat climate change and promote a greener future.
2) Related work
To provide a comprehensive understanding of the current advancements in the optimization and control strategies for photovoltaic systems and related applications,this section reviews a selection of recent studies.These works explore innovative approaches to address challenges in energy efficiency, dynamic adaptability, and system stability,highlighting their relevance to the proposed methodology.Ali et al.[10] explored the optimization of gridconnected photovoltaic systems using artificial neural networks (ANN) trained with particle swarm optimization,compared to the traditional perturb and observe algorithm.The study highlights ANN-PSO’s superiority in reducing oscillations, improving tracking speed, and ensuring stable energy delivery under varying conditions.It emphasizes the robustness and reliability of advanced metaheuristic techniques, like ANN-PSO, in enhancing PV system performance, making them well-suited for dynamic operational environments and addressing effi-ciency challenges in renewable energy systems.Alaas et al.[11] discussed an advanced MPPT control approach for photovoltaic systems using fuzzy gain scheduling for PID controllers (FGS-PID) combined with adaptive scaling factors.The developed method integrates fuzzy logic with a modified fluid search optimization (MFSO) algorithm to fine-tune membership functions and achieve superior MPPT performance.The study highlights the FGSPID-MFSO controller’s ability to overcome conventional MPPT challenges, providing enhanced accuracy, faster tracking,and minimized power fluctuations under varying environmental conditions.Saleem et al.[12] presented an advanced MPPT control strategy for standalone photovoltaic systems using an Adaptive Fractional Order PID(A-FOPID) controller.By integrating fractional calculus with an online adaptation law, the controller dynamically adjusts its parameters based on system errors, enhancing flexibility and robustness.Unlike conventional methods,such as P&O and incremental conductance, or computationally intensive neural network approaches, the AFOPID offers superior tracking accuracy, reduced oscillations, and faster transient response.Simulations confirm its effectiveness over traditional PID and FOPID controllers in dynamic conditions.Rafia et al.[13] presented an adaptive ANN-based PI controller combined with an Extremum Seeking (ES) technique for maximum power point tracking in wind energy systems utilizing DFIG.The proposed controller adjusts PI parameters in realtime using an adaptive ANN for robust performance under variable wind conditions.The ES technique enhances MPPT by eliminating the need for wind speed sensors, reducing system complexity and costs.A´guila-Leo´n et al.[14]explored a hybrid meta-optimization technique that combines the Grey Wolf Optimizer(GWO)and PSO to enhance MPPT controller performance for photovoltaic systems.The proposed GWO-PSO approach addresses the challenges of environmental variability by fine-tuning the hyperparameters of PSO for precise optimization.Simulations conducted under varying conditions demonstrate significant improvements in tracking accuracy, stability, and energy efficiency compared to conventional methods like P&O and Incremental Conductance.The study highlights the robustness of meta-optimization for dynamic PV environments.Mohammad et al.[15]presented a hybrid sine-cosine and spotted hyena-based chimp optimization (Hybrid SSC) algorithm for precise PI controller tuning in microgrids with PV,wind,fuel cells,and battery storage.By combining exploration and exploitation capabilities, the algorithm optimizes eight PI controllers, enhancing dynamic response and system stability.Simulation results demonstrate significant improvements in performance compared to traditional methods,ensuring robust operation under varying conditions.This study highlights the Hybrid SSC’s potential for efficient energy management in complex microgrid systems integrated with renewable energy sources.Malarvili et al.[17] introduced a novel GA-Fuzzy Logic Self-Tuning PID Controller for automatic generation control (AGC)in multi-area hybrid renewable energy systems incorporating wind, biomass, and solar sources.The controller combines genetic algorithms(GA)and fuzzy logic for dynamic frequency regulation and load management.By minimizing the integral of time-weighted absolute error (ITAE),the method demonstrates superior performance compared to traditional optimization techniques like PSO and SA.Simulation results validate its efficiency in enhancing system stability, reducing frequency deviations, and optimizing renewable energy utilization.Zaghba et al.[18]introduced a novel hybrid MPPT technique integrating fuzzy logic and sliding mode control to enhance the performance of grid-connected photovoltaic systems under variable atmospheric conditions.Fuzzy logic manages uncertainties in input data, while sliding mode control ensures stability and responsiveness.Additionally, PSO and GA algorithms fine-tune the PI controller parameters on the grid side.The proposed approach improves tracking efficiency, stability, and response time, significantly outperforming traditional MPPT methods.Rafia et al.[19] proposed a hybrid control strategy for induction motors, combining an adaptive ANN-PID controller for speed regulation and a neural predictive current controller(NPC) optimized with Particle Swarm Optimization.The ANN-PID adapts parameters in real-time to enhance robustness, while NPC minimizes current tracking errors and torque ripples.The multi-loop design leverages ANN and PSO integration, demonstrating superior performance over conventional methods through simulations,with improved torque ripple reduction, adaptability, and robustness under varying loads and motor parameters.In addition, Babes et al.[20] proposed a fuzzy fractionalorder controller tuned with a teaching-learning-based particle swarm optimization method for a permanent magnet DC motor driven by a photovoltaic system, significantly reducing ripple and improving motor stability under fluctuating conditions.Talbi et al.[21] introduced a Sugenofuzzy tuning mechanism within model predictive control to optimize the weighting factor for PV grid-tied multilevel inverters, which enhanced inverter response and grid compliance.Furthermore, Chaouch et al.[22] implemented a real-time Arduino-based control strategy for DC motors used in wire-feeding systems powered by PV,offering a low-cost and practical approach to renewable control implementations.In addition to the aforementioned techniques,recent studies have explored alternative metaheuristic approaches applied to energy systems and control.For instance, Hamouda et al.[23] proposed an ant colony optimization-based fractional-order PI controller to enhance the robustness of PMDC motor-driven wire feeder systems.ms Grey Wolf Optimization has been applied to the design and performance enhancement of UWB antennas using DGS structures [24].An improved particle swarm optimization method incorporating a disturbance term was presented by Mezaache et al.[25] to solve Optimal Reactive Power Dispatch (ORPD) problems.Furthermore, SSO-optimized fractional-order fuzzy PID regulators have been employed to improve the control performance of DFIG-based wind turbines [26].These contributions highlight the versatility of nature-inspired optimization techniques across various power electronics and control domains Table 1 summarizes the key characteristics and contributions of the most relevant related works in the literature
3) Paper contributions
Several key contributions are presented in this paper regarding the optimization of PI control for gridconnected photovoltaic systems using the sparrow search algorithm:
Novel Application of SSA for PI Tuning: The SSA is introduced as a novel optimization technique for tuning PI controllers in grid-connected PV systems.SSA’s balance between exploration and exploitation is highlighted as being more effective in finding optimal PI parameters compared to traditional methods.
Improved Control Precision for PV Systems: Through the application of SSA, enhanced control precision is achieved by optimizing the PI parameters, resulting in more stable voltage and current levels.This is critical for ensuring smooth integration with the grid and maintaining energy quality standards.
Enhanced Dynamic Response: An improved dynamic response is exhibited by the SSA-tuned PI controller,allowing rapid adjustments to fluctuations in load and generation conditions.This adaptability is essential for managing the intermittency of solar energy in realtime grid operations.
Enhanced MPPT Performance: A novel hybrid MPPT approach is integrated into the system, combining SSA with advanced control strategies to ensure efficient energy extraction under varying atmospheric conditions.This includes improved tracking efficiency, rapid convergence to the maximum power point,and reduced power fluctuations.
Stability and Robustness in Grid Integration:The stability of the grid-connected PV system is improved by effectively tuning the PI parameters using SSA,reducing oscillations and ensuring reliable operation.Additionally, robustness against external disturbances and varying environmental conditions, such as changes in irradiance and temperature, is demonstrated.
Table 1 Summary of related works.
Reference Method Key Contributions Reduces oscillations,improves tracking speed,and ensures stable energy delivery under varying conditions.[10] ANN-PSO for MPPT[11] FGS-PID with MFSO Accurate tracking, fast response, and minimized power fluctuations under dynamic environmental conditions.Adaptive fractional order PID(AFOPID)[12][13] Adaptive ANN-PI with ES Real-time parameter adjustment for robust MPPT in wind energy systems,eliminating the need for wind speed sensors.Enhances MPPT accuracy, stability, and energy efficiency under dynamic environmental conditions.Superior tracking accuracy,reduced oscillations,and faster transient response in standalone PV systems.[14] Hybrid GWO-PSO[15] Hybrid SSC Algorithm Precise PI tuning for microgrids,improving dynamic response and system stability in renewable energy systems.Improves AGC in hybrid renewable systems, ensuring dynamic frequency regulation and load management.[16] GA-Fuzzy Logic Self-Tuning PID[18] Fuzzy Logic and Sliding Mode Control with PSO and GA[19] Adaptive ANN-PID and NPC Combines ANN and PSO for torque ripple reduction,adaptability,and robust performance in induction motor control.[20] TLBO-Fuzzy FOPID for PMDC Motor Control Enhances MPPT tracking efficiency, stability, and response time for grid-connected PV systems.Enhances ripple reduction and robustness in PV-powered wire feeder systems using fractionalorder fuzzy PID and TLBO.[21] Sugeno-Fuzzy MPC Weight Tuning Improves control of PV grid-tied PUC7 inverters with Sugeno-fuzzy MPC weight adaptation,ensuring fast and stable inverter performance.[22] Arduino-Based DC Motor Control Offers a cost-effective, real-time implementation for wirefeed systems powered by PV energy.
Systematic Methodology for Real-Time Control: A systematic methodology for real-time PI tuning using SSA is proposed, providing a scalable and adaptable solution for PV systems and other renewable energy applications.This methodology is shown to be extendable to dynamic systems requiring real-time adaptation of control parameters.
Simulation and Comparative Analysis:Extensive simulations are conducted to validate the effectiveness of SSAbased PI tuning, and its performance is compared with other optimization techniques.It is demonstrated that SSA outperforms traditional tuning methods in terms of stability, response time, and error minimization.4) Outline of the article
The article is structured as follows:The introduction presents the context and challenges of PV system integration.Related work reviews recent advancements in optimization and control strategies.The methodology Section 1 describes the proposed SSA-tuned PI controller.Results in Section 2 and discussion evaluate its performance through simulations.Finally, the conclusion in Section 3 summarizes key findings and outlines future research directions.
1 Methodology
1.1 System model
Grid-connected PV systems play a pivotal role in smart microgrids, offering sustainable energy solutions while ensuring efficient energy management and grid stability.These systems consist of a photovoltaic array, a power conditioning stage,and a control system to regulate power flow between the PV array and the grid.The proposed architecture of the system is depicted in Fig.1.
The control strategy for such systems must address the following:
Maximum power point tracking (MPPT): Ensures maximum energy extraction from the PV array under varying environmental conditions.
DC-link voltage regulation: Maintains a stable intermediate voltage for efficient power conversion.
Grid integration and power quality control: Ensures synchronization with the grid, controls active and reactive power flow, and minimizes harmonic distortion.
1) Photovoltaic array model
The PV array converts solar irradiance into electrical energy.The output current (Ipv) and voltage (Vpv) are governed by the nonlinear I-V characteristics [27]:
where
Iph: Photocurrent, proportional to solar irradiance (G)and temperature (T),
Is: Reverse saturation current,
Rs: Series resistance,
R sh: Shunt resistance,
q: Electron charge (1.602 10 19 C),
K: Boltzmann constant,
n: Ideality factor of the diode.The output power of the PV array (Ppv) is given by:
2) DC-DC boost converter
The boost converter steps up the PV voltage to the required DC-link voltage using a switching device controlled by a pulse-width modulation signal.The output voltage is given by [27,28]:
where D is the duty cycle adjusted by the MPPT algorithm.
The dynamics of the inductor current (IL) and capacitor voltage in the boost converter are described by[27,28]:

where
I dc: Current delivered to the inverter.
C: Capacitance of the DC-link capacitor,
3) DC-link capacitor
The DC-link capacitor ensures stable power delivery to the inverter.Its dynamics are given by [27,28]:
where Iinv is the current drawn by the inverter.
4) DC-AC inverter
The DC-AC inverter converts the DC-link voltage into an AC voltage for grid connection.The inverter output voltage is [27]:
Fig.1.Proposed architecture for SSA-tuned PI control in grid-connected photovoltaic systems.
where M is the modulation index.The inverter control objectives are [29,30]:
Active Power Control:

Reactive Power Control:
where Id is the direct-axis current controlling active power,and Iq is the quadrature-axis current controlling reactive power.
For a unity power factor operation, Iq is maintained at zero.
5) MPPT Control
To maximize energy extraction, a MPPT algorithm adjusts the boost converter duty cycle.The MPPT ensures that [31]:
6) Grid-side control
The grid-side control plays a critical role in ensuring seamless integration of the photovoltaic system with the utility grid.It achieves synchronization with the grid voltage, maintains a stable power flow, and regulates both active and reactive power to meet grid standards.
Control Objectives:The grid-side control focuses on the following key objectives [32]:
Active Power Tracking: The control ensures that the active power generated by the PV system is delivered.to the grid with minimal losses.The reference direct axis current
is calculated as:
where
Ppv: Power generated by the PV system,
Vgrid: RMS value of the grid voltage.
This relationship ensures that the active power transfer to the grid is directly proportional to the PV system’s output.
Reactive Power Tracking: To maintain a unity power factor, the reference quadrature-axis current
is set to:
This ensures that no reactive power is exchanged with the grid, thereby improving overall system efficiency and minimizing voltage disturbances on the grid.
1.2 Problem formulation
The control problem for grid-connected photovoltaic systems in smart microgrids is addressed through multiple objectives, each targeting a specific performance metric to enhance system functionality.
DC-Link Voltage Regulation: Minimize the tracking error of the DC-link voltage over time:

where
is the reference DC-link voltage and Vdc (t) is the measured voltage.
Maximum Power Point Tracking (MPPT): Minimize the tracking error in power output, ensuring maximum energy extraction from the PV system:
where
is the reference maximum power point and Ppv(t) is the measured power.
Power Quality and Smooth Control: Minimize the deviations in grid current tracking and the rate of change in the control input to ensure smooth operation:


Each objective (J1, J2, and J3) contributes to achieving efficient voltage regulation, maximum power extraction,high power quality, and smooth operation under dynamic conditions.
System Constraints The optimization problem is subject to a set of constraints that ensure the physical and operational feasibility of the system.These constraints address the operational limits of the photovoltaic system, control actions, power quality requirements, and dynamic system behavior.Each constraint is critical for maintaining stable and reliable performance under real-world conditions.
1) PV array operating limits
The PV array must operate within its physical limits to prevent damage and ensure optimal performance.The constraints on the PV voltage (Vpv) and current (Ipv) are expressed as:
Vpv,min and Vpv,max:Minimum and maximum allowable voltages for the PV array.
Ipv,min and Ipv,max: Minimum and maximum allowable currents for the PV array.
These bounds account for operational safety and effi-ciency, considering variable environmental conditions such as irradiance and temperature.
2) Control action limits
The control input,represented by the duty cycle(u(t))of the DC-DC converter, must be constrained to prevent instability and ensure feasible operation of the power electronics:
where
- u min: Minimum duty cycle to maintain a stable output.
- umax: Maximum duty cycle to avoid component overloading.
This constraint ensures that the DC-DC converter operates within its design limits and supports the system’s stability.
3) Grid power quality and smooth control
To ensure compliance with power quality standards and smooth system operation, the tracking errors of the grid currents and the rate of change of the control input must be minimized within specified limits:

where Errorlimit is the maximum allowable deviation to ensure power quality.
This constraint ensures that the system maintains accurate grid current tracking while avoiding excessive control input variations,improving both power quality and system stability.
Decision Variables The optimization focuses on finding the optimal values of the PI controller parameters:
where Kp,Ki represent the proportional and integral gains for the MPPT, DC-link voltage, and grid current controllers.
Here:
Objective Function Enhancements To address real-world conditions, the objective function incorporates additional terms:
PV Efficiency Maximization:

Voltage Ripple Minimization:
Reactive Power Control:
1.3 Sparrow search algorithm (SSA)
1) Overview of SSA
SSA mimics the cooperative foraging behavior of sparrows by dividing the population into two main groups:producers and scroungers.Producers lead the exploration process to discover new potential solutions, while scroungers refine their positions by learning from the producers’successes.This dynamic collaboration ensures efficient optimization and adaptability to complex problem landscapes [33].
SSA process:
The SSA optimization process can be summarized in the following structured steps:
Step 1:Parameter Initialization SSA begins with the initialization of key algorithmic parameters, including:
Total population size (N),
Maximum number of iterations (G max),
Number of producers (N P), scroungers, and scouts,
Safety threshold (ST) for adaptive exploration.
Step 2:Population Establishment The initial positions of the sparrows are generated in a defined matrix representing the search space:

where D is the dimensionality of the problem, and n is the number of sparrows.
Each sparrow’s position represents a potential solution within the problem space.Fitness values are calculated for these positions using a fitness function F(X):

Step 3: Producers and Scroungers Division Sparrows are categorized as producers and scroungers based on their fitness:
Producers: These sparrows, representing the top performing solutions, lead the search for resources.
Scroungers:These sparrows refine their positions by following producers and exploiting known resources.
Step 4: Location Adjustment The positions of sparrows are updated based on their roles:
Producers’ Position Update:

where α is a scaling factor, r is a random threshold, Q is a normally distributed random variable, and L is a unit vector.
Scroungers’ Position Update:

where xworst is the position of the least advantageous sparrow, xPbest is the best-known producer’s position, A+ is an adaptive factor, and L is a random vector.
Step 5 through Step 8: Iterative Refinement Producers and scroungers iteratively adjust their positions, evaluate fitness, and refine their roles.The process continues until the termination condition,typically the maximum number of iterations (Gmax), is met.This ensures continuous improvement in sparrow positions, striving for the global optimum.
2) Advantages of SSA
SSA offers several advantages:
Global Optimization:The algorithm efficiently explores the search space to locate the global optimum.
Dynamic Adaptation: The safety threshold (ST) and adaptive roles of producers and scroungers prevent premature convergence.
Versatility: SSA is adaptable to various optimization problems, including constrained and unconstrained tasks.
Computational Efficiency:SSA requires fewer hyperparameters and exhibits low computational overhead.
3) SSA for PI parameter optimization
The sparrow search algorithm (SSA) is employed to optimize the PI controller parameters (Kp, Ki), enhancing the performance of the control system.The optimization process involves the following steps:
Step 1: Decision Variables Define the decision vector:
Step 2: Objective Function For each candidate solution X,evaluate the fitness value J(X)based on predefined performance metrics:
where J1, J2, J3 correspond to individual objectives, such
as DC-link voltage regulation, MPPT accuracy, power quality improvement.
Step 3:Position Update Rules The SSA algorithm iteratively updates the positions of sparrows (candidate solutions) to explore and exploit the search space.The population is divided into producers and scroungers, with their positions updated as follows:
Producers’ Position Update:

Scroungers’ Position Update:

Here:
Xi,j is the position of the j-th dimension for the i-th sparrow, r is the random value controlling exploration or exploitation,ST is the safety threshold for adaptive exploration, Q, L are random variables ensuring diversity in exploration, XPbest is the best producer’s position, Xworst is the position of the worst-performing sparrow.
Step 4:Constraints Handling To ensure the feasibility of the optimized parameters, enforce bounds on the PI controller gains:
The lower and upper bounds of the PI controller parameters (Kp, Ki) were selected based on prior tuning practices and stability criteria derived from conventional Ziegler-Nichols rules, while ensuring system stability and performance across a wide range of irradiance profiles.Specifically, Kp was constrained between 0.1 and 5, and Ki between 0.01 and 1 to avoid excessive overshoot or sluggish response.For the SSA algorithm, the population size N, number of iterations Gmax, safety threshold ST, and producer ratio were selected according to empirical guidelines provided in [26] and confirmed through sensitivity analysis.
Step 5:Convergence Criteria Repeat the position update and fitness evaluation steps until one of the following criteria is met:
Maximum number of iterations is reached.
The change in the best fitness value between consecutive iterations is below a predefined threshold.
4) Implementation in control systems
The optimized PI parameters X* = [Kp*, Ki* ] are applied to the control system of the grid-connected PV system.The SSA-tuned PI controller offers the following advantages:
Enhanced Tracking Accuracy:Minimizes errors in DClink voltage and MPPT, ensuring precise regulation.
Dynamic Adaptability: Handles rapid changes in solar irradiance and load conditions.
Improved Power Quality: Reduces harmonic distortion in the grid current, ensuring compliance with IEEE standards.
Smooth Operation: Reduces abrupt changes in control signals, enhancing the system’s lifespan and reliability.
2 Results and discussion
The proposed sparrow search algorithm (SSA)-optimized PI controller was tested under dynamic conditions using MATLAB/Simulink to evaluate its robustness and efficiency in managing a grid-connected photovoltaic system.The simulation results provide valuable insights into the performance of the controller across several critical parameters, demonstrating its effectiveness in real-time operational scenarios.
Fig.2 depicts the irradiance profile applied to the PV system, with step changes introduced to simulate realworld atmospheric conditions.The profile demonstrates the effectiveness of the proposed SSA-based control strategy in handling dynamic irradiance fluctuations.These abrupt changes challenge the system’s MPPT mechanism and control stability, providing a rigorous test of the controller’s adaptability.The subsequent results for active and reactive power, DC link voltage, and grid performance validate the robustness and precision of the SSA-tuned PI controller in responding to these environmental variations.
Fig.3 shows the active power output of the grid connected PV system under the varying irradiance conditions presented in Fig.3.The active power closely tracks the changes in irradiance, with minimal delay and no significant oscillations.This indicates the SSA-optimized PI controller’s superior MPPT performance, which ensures efficient energy extraction even during rapid changes in environmental conditions.The system’s ability to quickly converge to the new power level highlights the enhanced dynamic response capabilities of the controller.Compared to conventional tuning methods, the SSA-based PI controller demonstrates a marked improvement in power tracking efficiency and stability, which is critical for maintaining reliable grid operation.This behavior confirms the system’s MPPT effectiveness, as the SSA-tuned PI controller ensures rapid power tracking with minimal delay or overshoot, even under abrupt irradiance transitions.
?
Recalculate the fitness for all sparrows using J(X)Update XPbest if a new global best solution is found.Increment t by 1.end while Output the optimal PI parameters XPbest = [Kp* ; Ki* ].
Fig.4 presents the reactive power of the PV system during the simulation period.The reactive power remains consistently at zero, aligning precisely with the reference signal, even under fluctuating irradiance conditions.This result highlights the controller’s precision in decoupling active and reactive power control, ensuring a unity power factor.Maintaining zero reactive power not only minimizes energy losses but also ensures compliance with grid regulations, making the system highly efficient and compatible with modern smart grid requirements.The nearzero reactive power throughout the simulation validates the controller’s success in enforcing unity power factor,ensuring minimal reactive energy exchange with the grid.
Fig.5 illustrates the DC link voltage performance of the system.The voltage remains tightly regulated around the reference value of 1000 V, even during the irradiance changes depicted in Fig.3.The SSA-tuned PI controller ensures rapid correction of minor deviations, preventing significant overshoot or undershoot.This stability is essential for the reliable operation of the inverter, which depends on a steady DC voltage input to maintain efficient power conversion.The superior performance of the SSAbased tuning in maintaining voltage stability under dynamic conditions highlights its robustness and adaptability, critical features for real-world PV systems.The tightly regulated voltage around the 1000 V reference demonstrates the controller’s capability to stabilize the DC-link during irradiance fluctuations, ensuring consistent inverter operation.
Fig.6 presents the voltage and current waveforms of the grid.The synchronization between the two wave forms demonstrates effective control of power flow, with a minimized phase angle indicating a unity power factor.The sinusoidal nature of the waveforms further reflects the system’s compliance with grid standards and its ability to minimize harmonic distortion.Despite fluctuations in solar irradiance, the voltage and current waveforms remain stable, underscoring the robustness of the SSAtuned PI controller.These results validate the controller’s capability to maintain power quality and ensure efficient integration of the PV system with the grid.The phase alignment and sinusoidal nature of voltage and current confirm proper synchronization with the grid and minimal harmonic content, indicating excellent power quality.
Fig.2.Irradiance profile of photovoltaic system.
Fig.3.Results of active power output.
Fig.7 illustrates the three-phase grid current behavior under varying irradiance conditions.The current waveforms remain sinusoidal and stable across all operating conditions.A transient occurs at approximately 3 s due to a sudden change in solar irradiance, but the SSAtuned PI controller quickly stabilizes the system with minimal over shoot and oscillations.This result indicates the controller’s ability to adapt dynamically to changing generation conditions while maintaining grid compliance.Furthermore, the minimal Total Harmonic Distortion(THD) observed in the current waveforms confirms the effectiveness of the controller in ensuring high power quality and adherence to IEEE 519 standards for harmonic control.Despite transient disturbances at 3 s,the SSA controller restores current waveforms swiftly with minimal overshoot, confirming its dynamic robustness.
Fig.4.Results of reactive power tracking.
Fig.5.Results of DC link voltage stability.
Fig.6.Results of grid voltage and current synchronization.
Fig.7.Results of three-phase grid current.
Fig.8.Cost function convergence of the SSA-tuned PI controller.
Fig.8 presents the evolution of the cost function during the optimization process using the SSA.The cost function converges rapidly within the first 0.1 ms, showcasing the efficiency of SSA in optimizing the PI controller parameters.This swift convergence is attributed to SSA’s superior balance between exploration and exploitation, which prevents premature convergence and ensures a globally optimal solution.Compared to traditional algorithms such as PSO and GA,SSA demonstrates a significantly reduced computational time while achieving a lower final cost.This performance highlights the feasibility of SSA for real-time optimization in smart grid applications, where rapid and accurate control parameter tuning is critical.The convergence behavior illustrated in Fig.8 demonstrates the reliability and accuracy of the SSA algorithm in identifying optimal PI controller parameters.The cost function reaches a stable minimum within the first 0.1 s, indicating rapid convergence and efficient exploration of the solution space.The absence of oscillations or divergent trends during optimization suggests that the SSA avoids premature convergence and local minima entrapment.This confirms the algorithm’s robustness in handling nonlinear, multiobjective problems typical of real-time PV control systems.The smooth and rapid convergence of the cost function supports the stability and effectiveness of SSA, showing no evidence of premature stagnation or oscillations.
Fig.9 presents the harmonic spectrum of the grid current and the THD value.The THD is measured at 2.50%, which is well below the acceptable limit defined by IEEE standards for power quality.This low THD indicates the effectiveness of the SSA-tuned PI controller in minimizing harmonic distortions introduced by the inverter and other system components.The dominance of the fundamental frequency (50 Hz) in the harmonic spectrum further validates the system’s ability to produce clean and stable current waveforms.This performance is crucial for ensuring efficient energy transmission, reducing power losses, and preventing adverse effects on connected loads.Additionally, the reduced harmonic content demonstrates the robustness of the proposed control strategy in maintaining power quality even under dynamic operating conditions, reinforcing its suitability for real-world gridconnected PV applications.The harmonic spectrum shows dominance of the fundamental frequency and a THD value of 2.50%, well below the IEEE 519 limit, validating the system’s compliance with international grid codes.
Fig.9.Results of harmonic spectrum and THD.
Table 2 highlights the superior performance of the SSAtuned PI controller across key metrics compared to PSObased and conventional P&O controllers.The SSA tuned PI achieves the shortest settling time of 0.015 s, representing a 40% improvement over the PSO controller and 70%over P&O, emphasizing its rapid stabilization capability under dynamic conditions.It delivers the highest peak active power of 104.22 kW, outperforming PSO(98.00 kW) and P&O (93.00 kW) with a 6.35% and 12.06% improvement, respectively, showcasing its efficient MPPT operation for optimal energy extraction.Additionally, the SSA achieves the lowest THD at 2.50%, significantly reducing harmonic distortion by 19.87% compared to PSO and 52.38% compared to P&O, ensuring compliance with power quality standards and minimizing grid disturbances.
Moreover, the SSA-tuned PI controller demonstrates superior current tracking performance with the lowest RMSE values for the direct-axis current and quadratureaxis current.The RMSE for Id is 0.45, reflecting a 37.50%reduction compared to PSO and 55.88%reduction compared to P&O, ensuring precise control of active power.Similarly, the RMSE for Iq is minimized to 0.93,improving by 30.60% over PSO and 48.90% over P&O,contributing to enhanced reactive power control and system stability.
The controller’s response time of 0.023 s, 39.47% faster than PSO and 70.13%faster than P&O,highlights its ability to adapt quickly to changes in operating conditions,ensuring stability and reliability for grid-connected PV systems.These results underscore the robustness and effectiveness of the SSA-tuned PI controller for highperformance energy management in smart microgrids,achieving improved transient response, power quality,and overall system efficiency.
Table 3 presents a detailed statistical analysis of the SSA-tuned PI controller’s performance metrics.The controller achieves a mean active power output of 101.7 kW,with values consistently close to the MPPT target of 104.22 kW.This narrow power variation demonstrates the high tracking efficiency and stability of the proposed method under changing irradiance conditions.The current tracking errors are also minimal, with RMSE values for Id and Iq remaining well below 1 A, indicating excellent steady-state performance.Additionally, the THD remains low, which confirms compliance with IEEE 519 standardsfor grid-connected systems.The response time is consistently fast across test cases,with a mean of 0.023 s,confirming rapid dynamic behavior.Finally,the SSA optimization phase converges in approximately 1.32 s, validating the method’s feasibility for real-time implementation.These results confirm the robustness, precision, and computational efficiency of the SSA-PI controller in handling nonlinear and time-varying PV operating conditions.
Table 2 Performance comparison of SSA-tuned PI controller with other methods.
Performance Metrics SSA-Tuned PI PSO-Based P&O Controller Improvement SSA vs PSO/% Improvement SSA vs P&O/%Settling Time (s) 0.015 0.025 0.050 40.00 70.00 MPPT Active Power (kW) 104.22 98.00 93.00 6.35 12.06 THD (%) 2.50 3.12 5.25 19.87 52.38 Response Time (s) 0.023 0.038 0.077 39.47 70.13 RMSE of Id 0.45 0.72 1.02 37.50 55.88 RMSE of Iq 0.93 1.34 1.82 30.60 48.90
Table 3 Statistical analysis of SSA-PI controller performance.
Performance Metric Mean Minimum Maximum Computation Time/s Active Power Output (kW) 101.7 98.5 104.22 1.32 RMSE of Id (A) 0.45 0.41 0.49 -RMSE of Iq (A) 0.93 0.89 0.98 -THD (%) 2.50 2.41 2.62 -Response Time (s) 0.023 0.021 0.027 -
3 Conclusion
This article presents a novel optimization framework for the control of grid-connected photovoltaic systems using a SSA-PI controller.The proposed approach addresses critical challenges in dynamic energy management,including fast stabilization,harmonic distortion suppression, and efficient energy extraction.Comprehensive performance evaluations demonstrate that the SSA-tuned PI controller outperforms conventional PSO-based and P&O methods across key metrics.
Quantitatively, the SSA-tuned controller achieves a 52.38% reduction in THD compared to the P&O method and a 19.87% reduction relative to PSO, demonstrating superior power quality.It also improves response time by 39.47% over PSO and by 70.13% compared to P&O.The MPPT performance is enhanced with a 12.06%increase in active power relative to P&O.Additionally,the RMSE of the grid current is reduced by up to 55.88%, indicating more accurate and stable current regulation under fluctuating irradiance.
The SSA-tuned PI controller exhibits superior adaptability to dynamic environmental conditions, such as irradiance fluctuations,highlighting its suitability for real-time applications in smart grids.By enabling faster response times and improved power quality, this approach contributes to the advancement of renewable energy integration into modern power systems.
Beyond its performance gains,the proposed SSA-based PI control framework represents a scalable and intelligent optimization strategy that can be generalized to other nonlinear control systems.Its potential for real-time deployment, combined with algorithmic simplicity and robustness, makes it a strong candidate for widespread use in next-generation smart grid infrastructures.
Future research could explore the experimental validation of the proposed methodology and its extension to multi-objective optimization scenarios, such as cost minimization and battery lifespan enhancement, further solidifying its applicability to large-scale, distributed renewable energy systems.
CRediT authorship contribution statement
Youssef Akarne: Writing - review & editing, Conceptualization, Formal analysis, Data curation, Writing - original draft, Validation. Ahmed Essadki: Validation,Supervision. Tamou Nasser: Validation, Supervision.Maha Annoukoubi: Supervision, Validation. Ssadik Charadi: Validation, Supervision.
Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
Acknowledgments
This research did not receive any specific grant from funding agencies in the public, commercial, or not-forprofit sectors.This study was supported by Mohammed V University through institutional facilities and resources provided to the authors.
References
-
[1]
S.Charadi,H.E.Chakir,A.Redouane,et al.,Bi-objective optimal active and reactive power flow management in grid-connected AC/DC hybrid microgrids using metaheuristic-PSO, Clean Energy 7(6) (2023). [百度学术]
-
[2]
Y.Akarne, A.Essadki, T.Nasser, et al., Electric vehicle and photovoltaic system integration in a grid-connected AC microgrid,in: International Conference on Advances in Energy, Research,Material Science and Built Environment, Springer Nature Switzerland, Cham, 2023, pp.25-31. [百度学术]
-
[3]
Y.Akarne, A.Essadki, T.Nasser, et al., Experimental analysis of efficient dual-layer energy management and power control in an AC microgrid system, IEEE Access 12 (2024) 30577-30592. [百度学术]
-
[4]
I.Jrhilifa,H.Ouadi,A.Jilbab,et al.,Vmd-gru based non-intrusive load monitoring for home energy management system, IFACPapersOnLine 58 (13) (2024) 176-181. [百度学术]
-
[5]
I.Jrhilifa, H.Ouadi, A.Jilbab, et al., Residential appliances scheduling using binary sparrow search algorithm for demand side management, IFAC-PapersOnLine 58 (13) (2024) 194-199. [百度学术]
-
[6]
S.Charadi, H.E.Chakir, A.Redouane, et al., A novel hybrid imperialist competitive algorithm-particle swarm optimization metaheuristic optimization algorithm for cost-effective energy management in multi-source residential microgrids, Energies 16(19) (2023) 6896. [百度学术]
-
[7]
J.Tang,W.Gao,A novel cascaded H-bridge photovoltaic inverter with flexible arc suppression function,Global Energy Interconnect.7 (4) (2024) 513-527. [百度学术]
-
[8]
I.Jrhilifa, H.Ouadi, A.Jilbab, et al., A VMD-deep learning approach for individual load monitoring and forecasting for residential buildings energy management, e-Prime Adv.Electr.Eng.Electron.Energy (2024) 100624. [百度学术]
-
[9]
S.Charadi, H.E.Chakir, M.Et-Taoussi, et al., Bench testing for power flow management in AC/DC hybrid microgrids using perunit system: study and design, IFAC-PapersOnLine 58 (13) (2024)552-557. [百度学术]
-
[10]
A.H.Ali, A.Najafi, Optimization and performance improvement of grid-connected PV plant based on ANN-PSO and P&O algorithms, Int.Trans.Electr.Energy Syst.2022 (1) (2022)1278492. [百度学术]
-
[11]
Z.Alaas, Z.M.S.Elbarbary, A.Rezvani, et al., Analysis and enhancement of MPPT technique to increase accuracy and speed in photovoltaic systems under different conditions, Optik 289 (2023)171208. [百度学术]
-
[12]
O.Saleem, S.Ali, J.Iqbal, Robust MPPT control of stand-alone photovoltaic systems via adaptive selfadjusting fractional order PID controller, Energies 16 (13) (2023) 5039. [百度学术]
-
[13]
H.Rafia,H.Ouadi,B.Elbhiri, Adaptive artificial neural networkbased proportional integral controllers and extremum seeking energy optimizer for wind systems, IEEE Access (2024). [百度学术]
-
[14]
J.A´guila-Leo´n, C.Vargas-Salgado, D.Dı´az-Bello, et al.,Optimizing photovoltaic systems: a meta-optimization approach with GWO-Enhanced PSO algorithm for improving MPPT controllers, Renew.Energy 230 (2024) 120892. [百度学术]
-
[15]
S.Mohammad, Jeebaseelan,S.D.Sundarsingh,Hybrid sine cosine and spotted Hyena based chimp optimization for PI controller tuning in microgrids, Sci.Rep.14 (1) (2024) 25930. [百度学术]
-
[16]
G.Ali, H.Aly,T.Little,Automatic generation control of a multiarea hybrid renewable energy system using a proposed novel GAfuzzy logic self-tuning PID controller, Energies 17 (9)(2024) 2000. [百度学术]
-
[17]
S.Malarvili,S.Mageshwari,Nonlinear PID(N-PID)controller for SSSP grid connected inverter control of photovoltaic systems,Electr.Pow.Syst.Res.211 (2022) 108175. [百度学术]
-
[18]
L.Zaghba, A.Borni, M.K.Benbitour, et al., Enhancing gridconnected photovoltaic system performance with novel hybrid MPPT technique in variable atmospheric conditions, Sci.Rep.14(1) (2024) 8205. [百度学术]
-
[19]
H.Rafia, H.Ouadi, F.Giri, et al., Advanced hybrid control for induction motor combining ANN-PID speed controller with neural predictive current regulator based on particle swarm optimization,Trans.Instit.Meas.Control 47 (7) (2025) 1387-1402. [百度学术]
-
[20]
B.Babes, A.Boutaghane, N.Hamouda, et al., New optimal control of permanent magnet dc motor for photovoltaic wire feeder systems, J.Eur.Syst.Automat.53 (6) (2020) 811-823. [百度学术]
-
[21]
B.Talbi,F.Krim,A.Laib,et al.,A sugeno-fuzzy tuning approach of weighting factor in model predictive control for PV grid-tied PUC7 multi-level inverter, in: 2022 3rd International Conference on Smart Grid and Renewable Energy (SGRE), 2022, pp.1-6. [百度学术]
-
[22]
S.Chaouch, M.Hasni, A.Boutaghane, et al., DC-motor control using arduino-uno board for wire-feed system, in: 2018 International Conference on Electrical Sciences and Technologies in Maghreb (CISTEM), IEEE, 2018, pp.1-6. [百度学术]
-
[23]
N.Hamouda, B.Babes, A.Boutaghane, et al., Optimal tuning of PI λ D μ controller for PMDC motor speed control using ant colony optimization algorithm for enhancing robustness of WFSs,in:2020 1st International Conference on Communications,Control Systems and Signal Processing (CCSSP), 2020, pp.364-369. [百度学术]
-
[24]
I.Bouchachi, A.Reddaf, M.Boudjerda, et al., Design and performances improvement of an UWB antenna with DGS structure using a grey wolf optimization algorithm, Heliyon 10(5) (2024). [百度学术]
-
[25]
M.Mezaache, O.F.Benaouda, H.Sekhane, et al., Improved PSO with disturbance term for solving ORPD problem in power systems, Adv.Electr.Electron.Eng.20 (4) (2022) 478. [百度学术]
-
[26]
R.Dembri,L.Rahmani,B.Babes,et al.,SSO optimized FOFPID regulator design for performance enhancement of doubly fed induction generator based wind turbine system, Sci.Rep.14 (1)(2024) 28305. [百度学术]
-
[27]
Y.Akarne,A.Essadki,T.Nasser,et al.,Modelling and control of a grid-connected AC microgrid with the integration of an electric vehicle, Clean Energy 7 (4) (2023) 707-720. [百度学术]
-
[28]
Y.Akarne, A.Essadki, T.Nasser, H.Laghridat, Modeling and control of a photovoltaic systems in grid-connected AC microgrid,in: J.Kacprzyk, M.Ezziyyani, V.E.Balas (Eds.), International Conference on Advanced Intelligent Systems for Sustainable Development (AI2SD 2022), Springer Nature, Switzerland,Cham, 2023, pp.130-137, https://doi.org/10.1007/978-3-031-35245-4_12. [百度学术]
-
[29]
M.Annoukoubi,A.Essadki,Y.Akarne,Model predictive control of multilevel inverter used in a wind energy conversion system application, e-Prime - Advances in Electrical Engineering,Electronics and Energy, Volume 9, 2024, 100717, ISSN 2772-6711, https://doi.org/10.1016/j.prime.2024.100717. [百度学术]
-
[30]
Y.AKARNE, A.ESSADKI, T.NASSER, et al., Modeling and control of wind turbine system based on PMSG in grid-connected AC microgrid, in: International Conference on Integrated Design and Production, Springer International Publishing, Cham, 2022,pp.595-604. [百度学术]
-
[31]
Y.Akarne, A.Essadki, T.Nasser, et al., Enhanced power optimization of photovoltaic system in a grid-connected AC microgrid under variable atmospheric conditions using PSOMPPT technique, in: 2023 4th International Conference on Clean and Green Energy Engineering (CGEE), 2023, pp.19-24. [百度学术]
-
[32]
H.Rafia,H.Ouadi,B.El Bhiri,Ann-pi controller for the grid-side converters in wind energy conversions systems under voltage dips,IFAC-PapersOnLine 58 (13) (2024) 575-580. [百度学术]
-
[33]
J.Xue,B.Shen,A novel swarm intelligence optimization approach:sparrow search algorithm, Syst.Sci.Control Eng.8 (1) (2020) 22-34. [百度学术]
Fund Information
