Optimizing grid-connected PV systems with novel super-twisting sliding mode controllers for real-time power management

Over the past years, the use of renewable energy sources (RESs) has grown significantly as a means of providing clean energy to counteract the devastating effects of climate change. Reducing energy costs and pollution have been the primary causes of the rise in solar photovoltaic (PV) system integrations with the grid in recent years. A load that is locally connected to a GCPV requires both active and reactive power control. In order to control both active and reactive power, MAs and advanced controllers are essential. Researchers have used one of the recently developed MAs, known as the CAOA, which is based on mathematical arithmetic operators to tackle a few real-world optimization problems. Some disadvantages of CAOA include its natural tendency to converge to a local optimum and its limited capacity for exploration. By merging the PSO and CAOA methodologies, this article suggests the IAOA. To show how applicable IAOA is, its performance has been evaluated using four benchmark functions. The implementation of an IAOA-based ST-SMC for active and reactive power control is addressed in this article, which offers an innovative approach of research. In comparison to PSO-based ST-SMC and CAOA-based ST-SMC, the proposed IAOA-based ST-SMC appears to be superior, with settling time for active and reactive power control at a minimum of 0.01012 s and 0.5075 s. A real-time OPAL-RT 4510 simulator is used to validate the performance results of a 40 kW GCPV system after it has been investigated in the MATLAB environment.

The on-going shift of the global energy landscape highlights the importance of sources of clean energy in supporting sustainability and minimising the impact on the environment 1,2 .Among them, PV systems have the greatest promise for producing clean, plentiful energy.The photovoltaic technology is employed for the generation of electricity, which is supplied to the utility grid for consumer utilization 3,4 .The eco-friendliness and depletion of fossil fuels have increased the demand for PV systems.The intermittent nature of the sunlight has made PV technology a less reliable source of energy 5 .Electricity consumers also face a high installation cost and low power conversion efficiency in PV systems 6 .As a result, the development of power electronics technology increases system efficiency and offers possibilities for using the PV source in different applications 7,8 .Integrating PV systems into the electrical grid demands sophisticated control techniques in order to maximise their performance 9,10 .
A thorough assessment of available literature illustrates the changing landscape of control techniques used in grid-connected PV systems.Conventional control approaches, which frequently depend on PI controllers, are limited in their ability to adapt to the dynamic and nonlinear features of PV systems 11,12 .The limits of PI controllers, particularly their sensitivity to significant early undershoots, have caused a rethinking of control paradigms.As a result, sophisticated control techniques to improve the accuracy and robustness of power regulation are www.nature.com/scientificreports/The present work tackles crucial issues in the regulation of grid-connected Photovoltaic systems, where conventional PI controllers fall short because of significant early undershoots.Furthermore, chattering, an unwanted fast oscillation in control signals, is a problem with the traditional Sliding Mode Control method, despite it being robust.Surpassing PI controller constraints, reducing SMC chattering, and optimizing control parameters are the main objectives.Modern arithmetic optimization algorithms are incorporated to fine-tune control parameters in order to do this, including PSO, CAOA, and Improved Arithmetic Optimization Algorithm (IAOA).This study leads to the development of an Optimally Tuned Super-Twisting Sliding Mode Controller, which employs sophisticated optimisation algorithms to provide improved management of active and reactive power in gridconnected PV systems.This comprehensive strategy helps to the advancement of renewable energy control systems by providing innovative solutions to the complexity inherent in PV system dynamics.
They key contributions of the paper are as follows: i. Optimization-Driven Control Parameters: Introduces a novel method for optimizing the parameters of the ST-SMC by using advanced arithmetic optimization algorithms, such as PSO, CAOA, and IAOA.The accuracy and responsiveness of the control system are greatly improved by this optimization.ii.Overcoming PI Controller Limitations: Addresses the drawbacks of conventional PI controllers, particularly the issue of significant early undershoots in the control of reactive and active power.The suggested approach offers better performance as a viable substitute for traditional PI controllers.iii.Chattering Mitigation: Identifies and addresses the chattering problem via SMC approaches.The study helps to lessen chattering effects, providing smoother and more reliable control signals by utilizing the Super-Twisting algorithm and higher-order sliding mode approaches.iv.Real-Time Validation: Real-time testing on an OPAL-RT 4510 platform are used to validate the proposed optimally tuned ST-SMC.This real-world validation illustrates the proposed control strategy's practical applicability and efficacy.v. Comparative Performance Analysis: Performs a detailed comparison of the proposed ST-SMC controller tuned by several optimization methods (PSO, CAOA, IAOA) under diverse scenarios.This study gives useful insights into the strengths and shortcomings of each algorithm, assisting both researchers and developers in identifying the best optimization strategy for comparable applications.
The paper is organised in sections, beginning with an explanation of the system framework in Section "System Framework" and ending with a detailed explanation of the system design in Section "System Design".Section "Control Structure" presents the control structure's complexities, elucidating its components and functions.Section "Optimization Techniques and Benchmark Function's" focuses on the optimisation technique and the investigation of various benchmark functions.The following section, Section "Design of Controllers", meticulously outlines the controller's design aspects.Section "Results and Discussion" represents the results and discussion section of the experimental findings.Finally, in Section "Conclusion and Future Research Directions", the conclusive insights and outcomes are encapsulated, providing a comprehensive conclusion to the article.

System framework
The structure of a three-phase Grid-Connected Photovoltaic system is depicted in Fig. 1.The system framework basically comprises a PV array, intermediate boost converter (IBC), optimally tuned controllers and local load.The proposed control structure regulates both active and reactive power.The suggested control configuration comprises an orthogonal current component, that is additional subdivided into two components: the in-phase component and the quadrature component.The active power is managed by the in-phase component, while the reactive power is managed by the quadrature component.Table 1 tabulates the simulation parameters for the study.The converter has a 50 kVA output voltage with 1000 V DC-link voltage.The parameters P ref (active power reference) and Q ref (reactive power reference) undergo variations within the range of 12 kW to 20 kW and '0' kVAR to 14 kVAR, respectively.

System design
The proposed system has a power rating of 40 kW, a 50 kVA inverter, and a local load of 10 kW.The following equations illustrate the calculations for the line current, dc-link voltage, current ripple and inductance specifications of the proposed GCPV system.
Equation (1) shows the calculation of the line current (I S ): The rated voltage at no load is 415 V L-L .To achieve satisfactory Pulse Width Modulation (PWM) control, the DC bus voltage must exceed the peak of the line voltage.The direct current link voltage is as follows: where modulation index (m a ) is taken as 0.8.
The direct current link voltage is assumed to be 1000 V, a slightly higher rounded number.5% of I S is considered as a Current ripple (i cr ) through the inductor.

Control structure
The regulating structure shown in Fig. 2 manages the active and reactive power.Equation (5) shows the peak voltage as 47 : (3)  www.nature.com/scientificreports/ The in-phase components are given in Eq. ( 6).
The quadrature components (w A , w B , w C ) are determined in the following way: The STSMC controller obtains and handles active and reactive power measurement errors.
where, where 'P*' is the grid's reference active power, 'Q tref ' is the grid's reference reactive power, 'Q t ' is the reactive power, and 'P' is the grid's active power.
( In-phase and quadrature current components are I up and I wp, respectively.After multiplying with their respective amplitudes, the quadrature current and in-phase components are as follows: In Eq. ( 14), the three-phase reference currents are determined.
The actual currents are subtracted from their respective reference current values to get the control signals 'e x ' , 'e y ' , 'e z ' .

Optimization techniques and benchmark function's Particle swarm optimization (PSO)
Kennedy and Eberhard introduced particle swarm optimization in 1995 21 , which was influenced by natural occurrences.The following are the PSO stages: i. Initialization: A starting population and velocity of size [NP × D] are generated within the specified search range.At this point, "NP" denotes the population number, and "D" represents the problem dimension 48 .
ii. Updating the velocity: The velocity is updated according to Eq. ( 16) where "C 1 " and "C 2 " are acceleration constants that are commonly taken to be 2 and.05, "g best " is the global best, "p best " is the local best, "rand 1 " and "rand 2 " are random values between [0, 1], and "w" is the inertia weight, which decreases linearly from 0.9 to 0.4.
iii.Updating the position: The initial population experiences an update by uniting it with the newly generated velocity 49,50 .

Forensic-based investigation (FBI) algorithm
The FBI was developed by Chou and Nguyen 51 and is based on three basic concepts: location, suspected investigation, and stalking.There are five steps in an extensive forensic investigation process: opening the case, analysing findings, and looking at directions, actions, and trials.The police squad gathers information on the crime initially, and this information assists them in starting the investigation 52,53 .The investigative team looks at the scene of the crime, prospective suspects, the victim, and the evidence of the crime.By examining the data and contrasting it with the perceptions gathered throughout the investigation, the team determines who are the most likely the culprits.The flowchart of the FBI is depicted in Fig. 3.
Suspected locations are searched by the investigating officers to trace out the possible locations of hiding.A search team is organized to identify the location of the suspect with highest possibility.In order to arrest the criminal, the police team move towards the traced location.The information regarding the traced location is informed to the police headquarters.The pursuit team and the investigation team coordinate each other about the findings, investigation and next approach about the case 54,55 .The pursuit team direct reports to the investigating team about the matter so that the suspect can be detected easily.The five stages are as follows.
(i) Case Opening: The crime scene is investigated by the police officers and collects the information.The preliminary idea is gained by the members of the team who initially investigated the scene by considering various standard operating procedures.The team questions witnesses and locates the witnesses.(ii) Findings from Interpretation: The overall information is gained by the members of the team through team meetings.The possible suspects of the concerned case are evaluated by assessing the information in the team briefings.(iii) Inquiry direction: Based on the analysis of findings from various theories are developed i.e. crime motives, inquiry lines and scenarios by the members of the team.The new theories are again evaluated through investigations and are compared with the old theories for better interpretation of the case.www.nature.com/scientificreports/(iv) Course of action: The members of the team set the priorities and inquiry lines for taking actions.New analysis comes out from the actions taken.The actions and inquiry directions are again refined through new outcomes of the case.(v) Trial: The final process where fair and dominating outcome of the case comes out.A severe suspect is identified and the prosecution takes place.Depending upon the complexity, severity and difficulty of the case the investigating police officers are decided.Depending upon the characteristics of the case, the total numbers of investigating officers may be tens, hundreds or thousands.
Steps involved in FBI Algorithm: Step A 1 : The 'investigation findings' are represented in this step.
Step A 2 : The 'inquiry directions' are presented in this step.www.nature.com/scientificreports/

(18) X
Step B 1 : The 'actions' taken in the investigation are represented in this step.
Step B 2 : The 'process of actions' is illustrated in this step. where, p Ai = possibility that the suspect is at location X Ai α = effectiveness coefficient i.e. [−

Conventional arithmetic optimization algorithm (CAOA)
Abualigah et al. 33 proposed the CAOA as a new meta-heuristic methodology in 2021.To achieve a globally optimized solution, the position updating equations embody four conventional arithmetic operators: addition (A), subtraction (S), multiplication (M), and division (D).For the exploratory search, multiplication (M) and division (D) are utilized, providing a large step in the search space in accordance with the various impacts of these four arithmetic operators.In order to carry out the exploitation search, which can yield small step sizes in the search space, addition (A) and subtraction (S) are performed.Figure 4 depicts the CAOA optimisation technique.

i. Phase of initialization
To choose between exploitation and exploration, the Math Optimizer Accelerated (MOA) function is calculated.The following is the function: where 'iter' and 'iter max ' are the number of iterations and the maximum number of iterations, respectively.'min a ' and 'max a ' are the accelerated function's minimum and maximum values, which are 0.2 and 0.9, respectively.
ii. Exploration stage To randomly explore the area, the operators Multiplication ("X") and Division (" ÷ ") are employed.By generating the three random numbers r 1 , r 2 , and r 3 , the solution is updated.
where g best denotes the global optimum solution, ε is a small integer value that prevents division from occurring when the denominator is zero, U l and L l represents the upper and lower limits of every dimension, µ is equal to 0.5, and α is a sensitive parameter taken as 5.

iii. Exploitation Stage
The exploitation is carried out by the mathematical operators such as subtraction ("-") and addition (" + ").The steps associated with the exploitation phase are as follows: if r 3 < 0.5
Inspiration for improving the CAOA According to the optimum global solution, the population is updated in CAOA.As soon as the population reaches the optimum region, it will begin to stagnate.Premature coverage occasionally occurs.Additionally, the individual data of the population is not fully utilized by this method.Therefore, this paper presents an IAOA to make the most of the exploitation of individual data and address the boundaries acknowledged in CAOA.

ii. Mechanism for the proposed algorithm
A hybrid optimization technique is presented, coalescing the strong point of PSO and CAOA.
The flowchart of IAOA procedure is shown in Fig. 5.The parameters 'α' and 'μ' are taken as 5 and 0.5, respectively.The procedural code sequence for IAOA is defined as follows: www.nature.com/scientificreports/i. Determine the initial population of the design constants and design variables 'α' and 'μ' employed in the CAOA methodology.ii.By assessing the objective function, find the solution that performs the best (g best ).
iii.Update the solution using Eqs.(26-31) of the CAOA technique.iv.The values of 'α' and 'μ' are updated using the Eqs.(16-17) of the PSO technique.v. Until the terminating condition is reached, the previous two steps must be continued.
In order to prove the supremacy of IAOA over CAOA, this article analyses four benchmark functions, including Goldstein-Price, Cross-In-Tray, Hartmann 3-Dimensional, and Styblinski-Tang 56 .The presentation, size, and scope of each distinct function are displayed in Table 2.Both IAOA and CAOA were implemented and performed using MATLAB with a population and iteration limit of 100.Table 3 presents performance metrics that demonstrate the higher performance of IAOA, including mean, maximum, minimum, and standard deviation.The IAOA method takes less iteration to attain the global optimal value, however, the IAOA algorithm's computation time is a little bit longer due to the additional updating step.Figure 6 displays the convergence plots for various benchmark functions.

Design of controllers
Any control system must have controllers to minimize the difference between measured and actual values.To regulate active and reactive power, the controllers ensure that the actual currents align with the specified references.Numerous controllers are employed for controlling electrical power, such as PI, SMC and ST-SMC.

Proportional integral (PI) controller
A PI controller blends both integral and proportional control actions 57 .By comparing the system output to the set point, a feedback control loop can determine the error signal 58 .The PI controller's mathematical expression is provided in (32).
Table 2. Description of the benchmark functions employed in the study.

Sliding mode controller (SMC)
The SMC is a variable structure based control technique in which the system states are driven towards the sliding surface with a switching logic S(x) alternating between two limit values 59 .The process essentially consists of two steps: sliding in the direction of the surface and subsequent convergence towards the surface 60 .The sliding mode controller design is carried out in three stages: i. Decision of the sliding surface.ii.Establishment of the existence condition of sliding mode.iii.Design of the control law.i. Decision of the sliding surface: A non-linear system is taken into account as shown in Eq. ( 34): As proposed by Slotine and Li 61 , we take the following general equation for sliding surface: where 'n' stands for the sliding mode controller's order, 'x' stands for the state that needs to be controlled, 'λ' stands for a positive constant that determines the system's bandwidth and 'x*' for the desired state, 'f 'and 'g' are uncertain supposed bounded and continuous.
(34) ii.Establishment of the existence condition of sliding mode: The Lyapunov function is taken into consideration for determining the attractiveness condition: The sliding variable S(x, t) tends to be zero when the derivative of V(S) is negative, which defines the attractiveness condition.
A more restrictive condition known to be η-attractively is used instead of the condition in Eq. (38), which ensures asymptotic convergence in the direction of the sliding surface for convergence in finite time.
iii.Design of the control law: The controlled variable S = 0 is kept on the sliding surface when the equivalent command is a continuous function.S = 0 and Ṡ = 0 are the conditions of invariance 62 .On the other hand, this order does not compel the system's trajectories to converge in the direction of the sliding surface.The sum of the discontinuous component (u d ) and the equivalent command (u eq ) provides the command u.
In this case, the constant "K" is positive.The chattering effect is produced by Eq. (41).Oscillations caused by chattering in electro-mechanical systems may result in warmth.The discontinuous component in Eqs. ( 42) and ( 43) can be expressed as functions to reduce chattering.
where, where 'ϕ' stands for the width of the boundary layer.The chattering is reduced when 'sign(S)' is changed to Sat S φ .

High-order sliding mode
The alternative approach to the chattering problems from the conventional sliding mode control technique is resolved by adopting the theory of higher-order sliding modes 63 .This method reduces chattering by removing the discontinuous term directly from the synthesised command and putting it instead into one of its higher derivatives 64,65 .Beyond improving asymptotic accuracy, high-order sliding modes have been developed to address chattering difficulties while retaining the convergence characteristics and durability typical of ordinary sliding mode controllers.These methods frequently rely on the concept of homogeneity and a set of coefficients or weights.

Super-twisting sliding mode controller
i. Twisting algorithm Aligned with the quadrant in which the system's state is positioned, not only is the sign of the control switched, but the amplitude also alternates between two values.In the phase plane, the trajectory of the system spirals towards the origin while navigating around it 66 .Equation (45) presents the system of relative degree 2. The robustness and stability of the control system are largely dependent on Eqs.(45) and (46).In order to minimize the effects of uncertainties and disturbances, the algorithm is designed to produce control signals that move the system towards the target trajectory.In particular, following the reference trajectory and rejecting disturbances are made easier when the twisting algorithm is applied throughout the entire algorithm.The twisting algorithm does this by continuously modifying the control input in response to the difference between the system's actual state and the intended trajectory.Fast convergence and robustness depend on the information regarding the control signal's rate of change.Moreover, chattering is avoided and smooth control action is ensured by the twisting method, which also guarantees that the control signal stays restricted.To do this, a non-linear term that smoothes transitions between various control actions by acting as a smoothing factor is added to the control rule.Overall, by ensuring stability, fast convergence, and robustness towards the intended trajectory, the twisting algorithm in the super-twisting www.nature.com/scientificreports/sliding mode controller greatly enhances the overall performance of the control system.Figure 7 presents the convergence of the twisting algorithm in the plane(S, Ṡ).
The control law is homogeneous as it does not depend on the sign of S or Ṡ when when multiplied by K > 0.
ii. Algorithm of super-twisting In the realm of second-order sliding mode control, the super-twisting algorithm stands out as an exception.Originally designed for systems possessing a relative degree of 1 concerning a sliding surface, this algorithm offers unique capabilities 67 .Super twisting algorithm is advantageous because it does not utilize this information.It is composed of two parts: a continuous part u1 and a discontinuous part 67 .
With ρ , λ, α checking for the following inequalities: where K M , K m , and C 0 are positive coefficients.We can make the process simpler if S 0 = ∞ where the sliding mode parameter, super twisting variable and control input are represented by λ, u1 and u, respectively.In this article, Sat S φ in (44) is used in instead of the switching function 'sign(S)' in (51).To regulate both active and reactive power, Fig. 2 incorporates two control loops.The initial loop oversees the active power, while the second loop manages the reactive power 68 .

Results and discussion
The efficacy of a grid-connected PV system experiences enhancement through the utilization of an optimally tuned ST-SMC proposed in this article.This section entails a comparison and presentation of system performances for each of the three different algorithms incorporating ST-SMC.Additionally, the bidirectional converter enables a two-way flow of power, allowing the 40 kW PV system to supply electricity to the grid while simultaneously meeting the needs of a local load.The grid can get active as well as reactive power support from the bidirectional converter, which is managed by a P-Q control framework.Both active and reactive power can be independently controlled using the PQ control framework.The active power reference changes stepwise from 12 to 20 kW while maintaining a unity power factor.Similarly, the reactive power varies stepwise from '0' kVAR to 14 kVAR.The reference's negative sign indicates that the power is sent to the grid.The load is regarded to be constant throughout the whole process.The ST-SMC controller is tuned using three different algorithms such as PSO, CAOA and IAOA techniques, for the performance comparison.Table 4 lists the gains of various algorithms based ST-SMC technique.Figure 8 depicts the real-time experimental set-up implemented in OPAL-RT 4510.
The dynamic performance of the optimally tuned ST-SMC technique is presented in Table 5.Table 6 summarises the real-time parameters used in the experiments, providing insights into the important requirements governing system dynamics and performance during real-time simulations.Figure 9 demonstrates the system's three-phase grid current responses while using the three algorithms-based STSMC technique.A distinct decrease in current is visible in the responses with PSO-based STSMC.Similar to this, the grid current may experience a significant undershoot.The figure makes it abundantly evident that the reactive power variation has a greater impact on the PSO-based STSMC performance than the active power variation.Once more, the PSO-based STSMC exhibits a slow settling time.The CAOA-based STSMC exhibits a quicker settling time as compared to the PSO-based STSMC.As can be observed from the figure, both variations in active and reactive power have an equal impact on the CAOA-STSMC performance.The current responses with IAOA-STSMC are shown in Fig. 9.It is abundantly evident that IAOA-STSMC has the minimum settling time.
Figure 10 represents the grid-side active and reactive power responses using three algorithms based on the ST-SMC technique.Figure 10a shows that among all optimally tuned techniques, the PSO-based ST-SMC technique performs the worst with a settling time of 0.01174 s.In contrast, CAOA-based ST-SMC has a settling time of 0.01162 s, and IAOA-based ST-SMC performs best with a settling time of 0.01012 s for active power control.Figure 10b depicts the results of the three algorithms based on the ST-SMC technique for reactive power control.The IAOA-ST-SMC's supremacy is also evident in this domain.For reactive power control, the IAOA-based ST-SMC has the lowest settling time of 0.5075 s, followed by CAOA-based ST-SMC at 0.5156 s and PSO-based ST-SMC at 0.5352 s.
The PV side current response for all three algorithm-based STSMC is shown in Fig. 11.The DC side of the PSO-based PI controller exhibits the most significant effects of variations in active and reactive power references.The overshoots and undershoots for all algorithms during active power change are remarkably identical.However,  www.nature.com/scientificreports/

Figure 2 .
Figure 2. Active and reactive power control structures.

Figure 6 .
Figure 6.Convergence plots of benchmark functions.(a) Convergence characteristics of Goldstein-Price function.(b) Convergence characteristics of Cross-In-Tray function.(c) Convergence characteristics of Hartmann 3-Dimensional function.(d) Convergence characteristics of Styblinski-Tang function.

Figure 10 .
Figure 10.The grid side active and reactive power responses with the three algorithms based ST-SMC. )

Table 1 .
Specifications for simulation.

Start Initialize D dimensions , NP locations & Number of Iterations Evaluate Initial Solution Determine target location Update worse probability locations Update highest probability locations
Vol:.(1234567890) Scientific Reports | (2024) 14:4646 | https://doi.org/10.1038/s41598-024-55380-3 1,1]p min = highest possibility position corresponding to the best objec- tive value d, k, h, and i are four suspected locations, {d,k, h, i} ϵ {1, 2, …, NP},d, k and h are chosen randomly ; NP is the number of suspected locations p max = lowest possibility value corresponding to the worst objective value j = 1, 2, …, D; D is the number of dimensions X min = highest possibility position corresponding to the best solution a 1 &a 2 are number of individuals that affect the movement of X Aij assumed to be 2 & 3

Table 4 .
Gains of various algorithms based on ST-SMC technique.