A High Speed MPPT Control Utilizing a Hybrid PSO-PID Controller under Partially Shaded Photovoltaic Battery Chargers

: Improving photovoltaic systems in terms of temporal responsiveness, lowering steady-state ripples, high efﬁciency, low complexity, and decreased tracking time under various circum-stances is becoming increasingly important. A particle-swarm optimizer (PSO) is frequently used for maximum power-point tracking (MPPT) of photovoltaic (PV) energy systems. However, during partial-shadowing circumstances (PSCs), this technique has three major drawbacks. The ﬁrst problem is that it slowly converges toward the maximum power point (MPP). The second issue is that the PSO is a time-invariant optimizer; therefore, when there is a time-variable shadow pattern (SP), it adheres to the ﬁrst global peak instead of following the dynamic global peak (GP). The third problem is the high oscillation around the steady state. Therefore, this article proposes a hybrid PSO-PID algorithm for solving the PSO’s three challenges described above and improving the PV system’s performance under uniform irradiance and PSCs. The PID is designed to work with the PSO algorithm to observe the maximum voltage that is calculated by subtracting from the output voltage of the DC-DC boost converter and sending the variation to a PID controller, which reduces the error percentage obtained by conventional PSO and increases system efﬁciency by providing the precise converter-duty cycle value. The proposed hybrid PSO-PID approach is compared with a conventional PSO and bat algorithms (BAs) to show its superiority, which has the highest tracking efﬁciency (99.97%), the lowest power ripples (5.9 W), and the fastest response time (0.002 s). The three aforementioned issues can be successfully solved using the hybrid PSO-PID technique; it also offers good performance with shorter times and faster convergence to the dynamic GP. The results show that the developed PID is useful in enhancing the conventional PSO algorithm and solar-system performance.


Introduction
Photovoltaic (PV) energy is one of the cleanest, most reliable, and most promising types of renewable energy because of its environmentally friendly nature, unlimited supply, ease of maintenance, and peaceful operation [1,2].However, the most problematic element of photovoltaic systems is that their electrical behavior is nonlinear and changes in reaction to external conditions such as the amount of sunlight and temperature.The management of PV systems requires a certain strategy to obtain the MPP of the photovoltaic system.Several MPP tracking (MPPT) technologies have been established recently to increase the efficiency of solar systems.There is a consensus that when several peaks are identified in the power-voltage (P-V) curve under partial-shading conditions (PSCs), it is important to determine the global maximum power point (GMPP) [2].
Several studies [22,[38][39][40][41] claimed that the original PSO approach could monitor the GP in general, but they ignored the fact that the SP varies with time and that therefore the GP's location and value vary as well.In addition, the original PSO has visible oscillations around the steady state and a sluggish convergence speed.As a result, PSO can monitor the GP with unwanted oscillation around the steady state and sluggish convergence speed under the same SP.Shi et al. [38] developed a PSO paired with INC to lessen the oscillations at steady state that occurs when a PSO is employed individually to address the aforementioned disadvantages of the original PSO.The PSO looks for the GP region, and INC then monitors the GP inside the same SP.In addition, the undesired steady-state oscillations are reduced; however, the track time is very long since they assumed that the SP is constant, which makes it impossible to change the GP.Lian et al. [24] presented the P&O-PSO technique to capture the dynamic GP during the temporal-variation SP.Once P&O obtains the nearest LP, the PSO is used to catch the dynamic GP.The role of the PSO, which is still present along with apparent oscillations close to steady state, is still unclear when the GP is at the beginning, where P&O may follow the initial peak whether it is LP or GP.In [18], the authors proposed a hybrid PSO with fuzzy-logic control (PSO-FLC) based on PSO particle distribution.This approach can resolve the PSO issue using a timeinvariant optimization methodology that adheres to the initial dynamic GP that appears at the start of unfavorable steady-state oscillations instead of following the dynamic GP under time-variant shading patterns.However, it has one drawback: It takes a long time to catch the GP.Table 1 compares the most important variables in the previously provided studies with those in the current effort to provide a clearer overview of the literature section.

•
A conventional PSO may be able to monitor the GP under a time-invariant shading pattern with unwanted volatility at a steady state.Although it takes longer to catch up to the GP, it is impossible to follow the dynamic GP under time-variation SPs and remains at the initial GP.

•
Previous studies have tracked the GP under PSC; however, they have slow convergence to the GP and high oscillation around the GP, and the tracking time is very long.

•
Some of these MPPT methods work successfully under uniform and PSC conditions.However, the use of the algorithm individually has some drawbacks and limitations.
To mitigate these issues, a digital-feedback PID controller with a PSO algorithm-based MPPT approach (PSO-PID) is proposed in this paper to achieve the maximum efficiency of the PV system.The major contributions of this paper can be summarized as follows:

•
A hybrid MPPT approach based on the PSO-PID method is proposed to combine the ability of the PSO to ensure GP operation with the convergence speed of the PID controller.The PV arrays' accuracy and efficacy are improved by hybrid MPPT techniques under unpredictable and changing environmental conditions.

•
The hybridization (PSO-PID) MPPT algorithm for PV systems under normal and PSC conditions provides high efficiency, quick convergence, zero oscillation around the steady state, and low complexity.

•
In order to increase the system response time and shorten the tracking process, the robust design of the PID controller with the PSO algorithm is adopted for boost converter in this article.The controller uses the reference voltage provided by the MPPT algorithm as an input to compute the matching duty cycle.When charging batteries, for example, the regulated voltage is employed.The comparator creates an error signal by comparing the output voltage to the reference voltage, and then it sends that error signal to the PID controller.The PWM generator produces the PWM signals for the power module after being sent to the PID controller, which is utilized for regulating the voltage signal.

•
The performance of the combined PSO-PID algorithm is examined and compared with conventional PSO and BA-MPPT methods for validation purposes.
This paper is organized as follows.Section 2 presents the description of the considered system, and Section 3 presents the modeling of the photovoltaic system under PSC.Section 4 contains the proposal for the PSO-PID controller, and the presentation of the simulation results is covered in Section 5. Finally, the conclusion is provided in Section 6.

Modeling and Description of PV Systems
Figure 1 shows the studied photovoltaic system, which consists of a PV generator, a boost converter, a suggested controller, and a battery bank [50].
robust design of the PID controller with the PSO algorithm is adopted for boost converter in this article.The controller uses the reference voltage provided by the MPPT algorithm as an input to compute the matching duty cycle.When charging batteries, for example, the regulated voltage is employed.The comparator creates an error signal by comparing the output voltage to the reference voltage, and then it sends that error signal to the PID controller.The PWM generator produces the PWM signals for the power module after being sent to the PID controller, which is utilized for regulating the voltage signal.

•
The performance of the combined PSO-PID algorithm is examined and compared with conventional PSO and BA-MPPT methods for validation purposes.
This paper is organized as follows.Section 2 presents the description of the considered system, and Section 3 presents the modeling of the photovoltaic system under PSC.Section 4 contains the proposal for the PSO-PID controller, and the presentation of the simulation results is covered in Section 5. Finally, the conclusion is provided in Section 6.

Modeling and Description of PV Systems
Figure 1 shows the studied photovoltaic system, which consists of a PV generator, a boost converter, a suggested controller, and a battery bank [50].

Modeling of the PV System
A model is required to regulate the system using various MPPT strategies.

The Model of PV Panel
The literature offers several electric models for modeling PV panels.The materials used in the PV cells that make up the panel determine which is the best option.In this instance, a multi-crystalline silicon PV panel was used, and a five-parameter model with a single diode was employed.The comparable electrical circuit for a PV panel made up of Ns series cells and Np parallel strings is shown in Figure 2. Equation (1) provides the PV panel's mathematical expression [51].

Modeling of the PV System
A model is required to regulate the system using various MPPT strategies.

The Model of PV Panel
The literature offers several electric models for modeling PV panels.The materials used in the PV cells that make up the panel determine which is the best option.In this instance, a multi-crystalline silicon PV panel was used, and a five-parameter model with a single diode was employed.The comparable electrical circuit for a PV panel made up of Ns series cells and Np parallel strings is shown in Figure 2. Equation (1) provides the PV panel's mathematical expression [51].
where i g = N p i Ph , i Phg = N p i Ph , v g = N s v, R sg = (N s /N P )R s and R Pg = (N s /N P )R P . 1 where  Np is the number of parallel branches within the module; ipv is the solar cell current; iph is the photon generated current; iD and iRp are the currents that pass through the diode and the shunt resistance, respectively; vpv is the solar-cell voltage; Rs is the series connected resistor; and Rsh is the shunt resistance.
Obviously, the PV equation is nonlinear.A linearized model for the photovoltaic system is necessary to make system modeling easier.

Modeling the PV Panel's Linearization
Non-linear Equation (1) describes the PV output characteristic.Through the linearization procedure, the partial derivative  / should provide the small-signal model.
The dynamic conductance can be calculated by partial differentiation and stated as Equation (2) using the analogous PV panel circuit shown in Figure 2 and the corresponding equation.RPV is the dynamic resistance and is shown in Figure 3.  Np is the number of parallel branches within the module; i pv is the solar cell current; i ph is the photon generated current; i D and i Rp are the currents that pass through the diode and the shunt resistance, respectively; v pv is the solar-cell voltage; R s is the series connected resistor; and R sh is the shunt resistance.
Obviously, the PV equation is nonlinear.A linearized model for the photovoltaic system is necessary to make system modeling easier.

Modeling the PV Panel's Linearization
Non-linear Equation (1) describes the PV output characteristic.Through the linearization procedure, the partial derivative ∂i g /∂v g should provide the small-signal model.
The dynamic conductance can be calculated by partial differentiation and stated as Equation (2) using the analogous PV panel circuit shown in Figure 2 and the corresponding equation.R PV is the dynamic resistance and is shown in Figure 3.
( ) where  Np is the number of parallel branches within the module; ipv is the solar cell current; iph is the photon generated current; iD and iRp are the currents that pass through the diode and the shunt resistance, respectively; vpv is the solar-cell voltage; Rs is the series connected resistor; and Rsh is the shunt resistance.
Obviously, the PV equation is nonlinear.A linearized model for the photovoltaic system is necessary to make system modeling easier.

Modeling the PV Panel's Linearization
Non-linear Equation (1) describes the PV output characteristic.Through the linearization procedure, the partial derivative  / should provide the small-signal model.
The dynamic conductance can be calculated by partial differentiation and stated as Equation (2) using the analogous PV panel circuit shown in Figure 2 and the corresponding equation.RPV is the dynamic resistance and is shown in Figure 3.When the output features of photovoltaics are linearized at the MPP area, it results in Equation (3): where G PV is the linearization of the PV output characteristic, q is the electron charge (1.6 × 10 −19 C), N s is the number of solar cells connected in series, N p is the number of solar cells connected in parallel, I o is the reverse-saturation current at typical test conditions, T is the degree of absolute temperature, A is the value of the diode-ideality constant, and K is the quantity of the Boltzmann constant (1.38 × 10 −23 J/K). Figure 4 shows the PV generator's equivalent circuit for the MPP area.

( , )
When the output features of photovoltaics are linearized at the MPP a in Equation ( 3): where GPV is the linearization of the PV output characteristic, q is the electro × 10 −19 C), Ns is the number of solar cells connected in series, Np is the numbe connected in parallel, Io is the reverse-saturation current at typical test cond degree of absolute temperature, A is the value of the diode-ideality constan quantity of the Boltzmann constant (1.38 × 10 −23 J/K). Figure 4 shows the P equivalent circuit for the MPP area.The PV system then takes the position of the photovoltaics panel with it alent circuit, as seen in Figure 5.The PV system then takes the position of the photovoltaics panel with its linear equivalent circuit, as seen in Figure 5.
When the output features of photovoltaics are linearized at the MPP area, it results in Equation ( 3): where GPV is the linearization of the PV output characteristic, q is the electron charge (1.6 × 10 −19 C), Ns is the number of solar cells connected in series, Np is the number of solar cells connected in parallel, Io is the reverse-saturation current at typical test conditions, T is the degree of absolute temperature, A is the value of the diode-ideality constant, and K is the quantity of the Boltzmann constant (1.38 × 10 −23 J/K). Figure 4 shows the PV generator's equivalent circuit for the MPP area.The PV system then takes the position of the photovoltaics panel with its linear equivalent circuit, as seen in Figure 5.

Transfer Function for PV Systems
The switch's on/off states during a single switching cycle can be used to derive the following system equations:

Transfer Function for PV Systems
The switch's on/off states during a single switching cycle can be used to derive the following system equations: On-state dynamics of Q: The system equations, averaged over one switching cycle, are as follows: where the control variable is The state-space form of the tiny signal model is provided as follows: Using the Laplace transformation, the relationship between the control variable d and the small-signal voltage v g is given as Equation (12). where ) Equation ( 16) may be used to calculate the PV system's settling time without employing PV voltage feedback.
This value is crucial since it tells us how long we should wait before noticing the effects of a duty-cycle adjustment.
If the duty cycle is considered using the MPPT technique directly, the system settling time will be utilized to calculate the minimal-perturbation time, which is the reaction of PPV to an alteration in the duty cycle.In order for the MPPT method to accept fresh measurements of a new power, the minimum time that must elapse each time must be larger than or equal to the system settling time T MPPT ≥ T st_op .As a result, the MPPT output will be updated at a frequency of f MPPT ≤ 1/T st_op [52].

Modeling of the Photovoltaic System under PSC
The PV array may be connected in series in various applications to raise the output voltage of the system.PV-panel parallel configurations are utilized to boost the output current of the system.Furthermore, to deliver the required voltage and current, the PV array can combine series and parallel connections.Three PV panels were linked in series and exposed to partial shading, as shown in Figure 6.
The highest one is a global maximum power point (GMPP) and the others are local maximum power points (LMPPs).GMPPs cannot be identified using typical MPPT methods since they are built to follow a single peak, and they may become caught around the LMPP.To attain the greatest power production under different PSCs, solar systems must thus use global maximum power-point tracking (GMPPT) algorithms.
The modeling of the proposed photovoltaic system, which includes both the power and control circuits, is shown in Figure 6.The PV array, boost converter, and battery bank as a load represent the power circuit of the PV system.The control circuit, on the other hand, contains the PSO-PID-based MPPT.Time-variable radiations, or PSCs, are used with three dissimilar GP values and places.The time variation of the shading patterns is chosen to ensure that there are three accessible GP scenes (GP at the beginning, middle, and end), as shown in Figure 7.To examine the output response of the combined PSO-PID to track the dynamic global peak with and without spreading the particles, a time variant of the shading patterns is employed to produce a GP in dissimilar positions on the P-V features.The goal of the PSO-PID is to combine the benefits of both the PSO and the PID.When the shadow pattern changes with time, the PSO can obtain the dynamic GP, but the PID cannot.On the other hand, the PID operates on a conditional basis to soften the GP observed by the PSO, as stated in the next section.Furthermore, it prevents the oscillations that occur when the PSO is applied alone near steady state.For the MPP tracking approach, a simulation time of 0.03 s was used.Therefore, the converter's duty cycle was adjusted every 0.03 s.Partial shadowing caused by sunlight interference from nearby buildings or trees substantially impairs photovoltaic (PV) power systems.This affects the real output yield and completely undermines the lifetime of PV modules.The hotspot effect brought on by partial shading is often reduced through connection of a bypass diode in parallel to every PV module.The I-V and P-V curve of PV modules or strings, however, will exhibit many peaks rather than a single peak under partial-shading conditions, as shown in Figure 7.The highest one is a global maximum power point (GMPP) and the others are local maximum power points (LMPPs).GMPPs cannot be identified using typical MPPT methods since they are built to follow a single peak, and they may become caught around the LMPP.To attain the greatest power production under different PSCs, solar systems must thus use global maximum power-point tracking (GMPPT) algorithms.

Hybrid PSO-PID Technique
The behavior of swarms is used to represent particle-swarm optimization Each particle in the algorithm is drawn to the global best position Gbest and the p best position Pbest, but also has a tendency to wander randomly.
Let  and  represent the present position and velocity vectors for partic spectively. can be obtained as: where ε1 and ε2 are the random values, which are between zero and one [0-1], and β are the acceleration constants or learning parameters.Then, the position of the fol particles is determined as: There are several extensions to the conventional PSO method.The most nota hancement is the inclusion of an inertia constant θ in Equation ( 17); therefore,  stituted by  .Consequently, Equation ( 17) is adjusted as: This is comparable to injecting a fictitious mass to slow down the motion of t ticles, and as a result, the algorithm converges more quickly.This method may be calculate the MPP of a PV system that has many peaks in its P-V features.This is ac by using the following formula to define the particle position as the reference volt where n is the number of particles determined by the size of the array.The purpo increase the amount of energy generated by the PV array.To identify the global pe PSO algorithm is implemented as follows.
1.The particle positions are initialized at 20%, 50%, and 80% of Voc.The quant β, and θ are initialized throughout the algorithm.The best velocity vector G The modeling of the proposed photovoltaic system, which includes both the power and control circuits, is shown in Figure 6.The PV array, boost converter, and battery bank as a load represent the power circuit of the PV system.The control circuit, on the other hand, contains the PSO-PID-based MPPT.Time-variable radiations, or PSCs, are used with three dissimilar GP values and places.The time variation of the shading patterns is chosen to ensure that there are three accessible GP scenes (GP at the beginning, middle, and end), as shown in Figure 7.To examine the output response of the combined PSO-PID to track the dynamic global peak with and without spreading the particles, a time variant of the shading patterns is employed to produce a GP in dissimilar positions on the P-V features.The goal of the PSO-PID is to combine the benefits of both the PSO and the PID.When the shadow pattern changes with time, the PSO can obtain the dynamic GP, but the PID cannot.On the other hand, the PID operates on a conditional basis to soften the GP observed by the PSO, as stated in the next section.Furthermore, it prevents the oscillations that occur when the PSO is applied alone near steady state.For the MPP tracking approach, a simulation time of 0.03 s was used.Therefore, the converter's duty cycle was adjusted every 0.03 s.

Hybrid PSO-PID Technique
The behavior of swarms is used to represent particle-swarm optimization (PSO).Each particle in the algorithm is drawn to the global best position G best and the personal best position P best , but also has a tendency to wander randomly.Let x t i and v t i represent the present position and velocity vectors for particle i, respectively.v t+1 i can be obtained as: where ε 1 and ε 2 are the random values, which are between zero and one [0-1], and α and β are the acceleration constants or learning parameters.Then, the position of the following particles is determined as: There are several extensions to the conventional PSO method.The most notable enhancement is the inclusion of an inertia constant θ in Equation ( 17); therefore, v t i is substituted by θv t i .Consequently, Equation ( 17) is adjusted as: This is comparable to injecting a fictitious mass to slow down the motion of the particles, and as a result, the algorithm converges more quickly.This method may be used to calculate the MPP of a PV system that has many peaks in its P-V features.This is achieved by using the following formula to define the particle position as the reference voltage V. x where n is the number of particles determined by the size of the array.The purpose is to increase the amount of energy generated by the PV array.To identify the global peak, the PSO algorithm is implemented as follows. 1.
The particle positions are initialized at 20%, 50%, and 80% of V oc .The quantities, α, β, and θ are initialized throughout the algorithm.The best velocity vector G best and individual best P best values are initialized to zero.

2.
The converter's duty cycle is calculated for each particle position using Equation ( 21) and the resulting pulse is sent to the converter switch one at a time.
The panel voltage V PV and current I PV are recorded after a delay, and the power for each particle position is computed using the formula P PV = V PV × I PV .

4.
The location of the particle where the power P PV is greatest is recognized as the optimal position of the particle.

5.
The global best is calculated as the position with the highest PPV among the personal best.

6.
Then Equation ( 17) is used to determine the velocity vector, and Equation ( 18) is used to update the position of the particle.7.
The convergence condition is investigated.When all the values in the velocity vector are less than a tolerance limit or when the maximum number of iterations is reached, the algorithm is called convergence.If the convergence requirements are met, the global optimal value is generated.Otherwise, for the new position of the particles, steps 2-7 are repeated.
The algorithm's primary goal in MPPT applications is to improve the PV system's output power.Furthermore, the particle positions define the reference voltage of the photovoltaic array (V ref ).In the meantime, the velocity is described as a slight deviation from or modification of the reference voltage (V ref ).Similarly, Pbest designates the closest voltage value of each particle to the GP, whereas Gbest indicates the voltage value that generates the maximum power.As a result, particles are moved from their previous locations to the GP.The approach (Figure 8) does, however, show how many iterations are required for each particle to reach GP.Despite being the fastest ECA technique, the PSO algorithm has a lengthy convergence time.A hybrid PSO-PID MPPT technique is presented in Figure 8 to improve the system's dynamic responsiveness.
ments must be met.
where  and  represent the PV system's new and old output powers, respectively.Additionally, ∆P is the maximum allowable output-power fluctuation before taking into account the change in PSC.The PSO and PID are combined in the proposed PSO-PID approach in this article.The goal of this strategy is to combine the benefits of these two strategies while avoiding their drawbacks.The PSO is effective and has the fastest convergence speed in capturing the GP of photovoltaic panels; however, it has minimal fluctuations at the GP during steady-state circumstances and extremely strong fluctuations during PSCs, and its tracking speed is also quite sluggish.The PSO controller's inputs are the voltage and current of the PV panels, and the maximum voltage is its output, which is subtracted from the DC-DC boost converter's output voltage and supplied to the PID controller.By giving the system the precise converter-duty cycle value, this lowers the proportion of error that the PSO obtains and increases system effectiveness.In addition, the disadvantage of large oscillations is eliminated by hybrid PSO-PID operation and allows the system to operate in very low fluctuations at global peak during steady state and PSC circumstances.
The necessary parameters for a PID controller are produced with the purpose of enhancing system dynamics.The PID-controller transfer function is given by Equation (22).Trial and error is used to find the gain of the PID controller.In this case, the inner-current loop and the outer-input voltage loop for the DC-DC boost converter are both closed using 40 kHz two-pole two-zero controllers.To enable the PV arrays to operate at their maximum power point, the MPPT approaches supply the reference input voltage V PV-ref , which is compared to the actual input voltage V PV of the PV arrays.The deviated output of the comparator is sent into the voltage-control loop (G v ), an outer voltage loop that regulates the boost stage's input voltage and current, which can be controlled by an inner current loop.The output of the voltage controller, I out-ref, and the DC-DC converter's output current, I out , are contrasted in the current-control loop (G i ).The controller's output chooses the duty cycle that is supplied to the PWM to regulate the input voltage.
The voltage feedback is transferred to the inner comparators to avoid having the output voltage go beyond the boost converter's maximum voltage, which would cause the PWM to activate.The system runs on this duty cycle until MPP is reached.The steps of the feedback PID controller are depicted in Figure 8.
In order to identify changes in the PSC and reset the algorithm, the following requirements must be met.
where P t best and P t−1 best represent the PV system's new and old output powers, respectively.Additionally, ∆P is the maximum allowable output-power fluctuation before taking into account the change in PSC.
The values assigned for parameters of the proposed PSO-PID, CPSO, and BA are introduced in Table 2.

Simulation Results and Discussion
In order to show the higher performance of the proposed hybrid PSO-PID technology in monitoring dynamic GP and minimizing steady-state oscillation, the proposed hybrid PSO-PID was compared with the original PSO and BA.The simulation of an independent photovoltaic system was carried out using MATLAB/Simulink software.Figure 9 shows the entire Simulink layout of the created photovoltaic system.The proposed photovoltaic system consisted of a solar array, a boost converter, an MPPT strategy, and a battery bank.Different climate scenarios were given to test the modified PSO-PID MPPT methodology's accuracy and robustness in comparison to the conventional PSO MPPT approach.Six test investigations were undertaken in this area.The first experiment examined the influence of PSC.The second tested the changes in solar irradiance while maintaining the temperature at 25 • C. The third test examined the influence of rapid temperature fluctuations with continuous radiation of 1000 W/m 2 .The fourth and fifth test investigations were completed during sudden and slow changes in temperature and sun radiation, respectively.In addition, the tracking performance of the proposed method was compared with two recently published MPPT algorithms.The tracking efficiency of the MPPT methodology was determined by dividing the detecting power of the hybrid PSO-PID technique by the total power of the solar panel, as shown in Equation (24).
Different climate scenarios were given to test the modified PSO-PID MPPT methodology's accuracy and robustness in comparison to the conventional PSO MPPT approach.Six test investigations were undertaken in this area.The first experiment examined the influence of PSC.The second tested the changes in solar irradiance while maintaining the temperature at 25 °C.The third test examined the influence of rapid temperature fluctuations with continuous radiation of 1000 W/m 2 .The fourth and fifth test investigations were completed during sudden and slow changes in temperature and sun radiation, respectively In addition, the tracking performance of the proposed method was compared with two recently published MPPT algorithms.The tracking efficiency of the MPPT methodology was determined by dividing the detecting power of the hybrid PSO-PID technique by the total power of the solar panel, as shown in Equation ( 24).

Proposed PSO-PID under PSC
The results of the three algorithms for the three shading modes are shown in Figure 10a-d and compared in Table 3.The PV-array voltage, power and duty cycle of each algorithm and their corresponding shading patterns are included in the table and Figure 10b-d.The array received the shading pattern 1 at time intervals of t = 0 s, followed by the shading pattern 2 at time intervals of t = 0.01 s and t = 0.02 s for shading pattern 3 as shown in Figure 10a.Figure 10c shows how the CPSO algorithm tracked the MPP in around 0.008 s for shading pattern 1, 0.0128 s for pattern 2, and 0.024 s for pattern 3. Additionally, because the technique uses random constants, the convergence time and the number of iterations varied for each independent run for the same shading pattern.For BA, the algorithm yielded positive outcomes for all shading patterns.With BA, the MPP was tracked more quickly since at least one particle got there before the maximum number of iterations was achieved and other particles were close around.The advantage of this method is that it can detect quick changes in shading pattern due to its quick convergence time.
BA, the algorithm yielded positive outcomes for all shading patterns was tracked more quickly since at least one particle got there before the of iterations was achieved and other particles were close around.Th method is that it can detect quick changes in shading pattern due to its time.The outcomes of the PSO-PID-based method are displayed in Figure 10b-d.We can see that the algorithm was successful in quickly recognizing the GP whenever the P-V characteristic changed as a result of the partial-shading effect as shown in Figure 10c.A quantitative comparison of the results of the three MPPT techniques for the three various patterns is given in Table 3.The real PV voltage and power recorded for each shading pattern is presented for each MPPT algorithm.The PSO-PID algorithm stands out as one of the most potent hybrid algorithms when compared to the CPSO and BA approaches since it could operate extremely effectively in both uniform-and partial-shading patterns.The three particles that make up the swarm were chosen based on the findings from the analysis of the PV characteristics under partial shading.The starting value of each particle was chosen to be the lowest value that the GP voltage may be in any given band.The movement of the particles during the simulation is shown in Figure 11.It can be seen that convergence always occurred in less than 2.5 ms.

Proposed PSO-PID under Fast Change of Irradiation
During this entire test, the temperature was kept at 25 • C while a simulation examination was run under a rapid radiation change that shifted from 1000 W/m 2 to 200 W/m 2 , 600 W/m 2 , 1000 W/m 2 , and then 200 W/m 2 as shown in Figure 12a, to evaluate the efficacy of the PSO-PID MPPT approach with the conventional PSO and BA algorithm under the initial weather scenario.

Proposed PSO-PID under Fast Change of Irradiation
During this entire test, the temperature was kept at 25 °C while a simula nation was run under a rapid radiation change that shifted from 1000 W/m 2 to 600 W/m 2 , 1000 W/m 2 , and then 200 W/m 2 as shown in Figure 12a, to evaluate of the PSO-PID MPPT approach with the conventional PSO and BA algorithm initial weather scenario.
Figure 12b-e shows the simulation-result comparisons of the proposed h PID and traditional PSO and BA techniques for the second test.In light of the it should be highlighted that the enhanced PSO-PID MPPT methodology ou the fundamental PSO and BA approaches in terms of stability and resilience whole test procedure, as seen by the PV power output, voltage, current and d Figure 12b, c and d.In addition, compared to the conventional PSO and BA the enhanced MPPT technique converged quickly to the anticipated GP dur variation in radiation with greater accuracy and smaller fluctuations during s Additionally, Figure 12b-e compares the performance of the improved PSO-P ventional PSO and BA MPPT approaches with respect to the tracking efficiency ripples, and the response time throughout the whole test period.In this re compared to other methods, the modified PSO-PID MPPT technique had the b efficiency, the lowest power ripples, and the quickest response time.A terrible Figure 12b-e shows the simulation-result comparisons of the proposed hybrid PSO-PID and traditional PSO and BA techniques for the second test.In light of these findings, it should be highlighted that the enhanced PSO-PID MPPT methodology outperformed the fundamental PSO and BA approaches in terms of stability and resilience during the whole test procedure, as seen by the PV power output, voltage, current and duty cycle in Figure 12b-d.In addition, compared to the conventional PSO and BA algorithms, the enhanced MPPT technique converged quickly to the anticipated GP during the fast variation in radiation with greater accuracy and smaller fluctuations during steady state.Additionally, Figure 12b-e compares the performance of the improved PSO-PID and conventional PSO and BA MPPT approaches with respect to the tracking efficiency, the power ripples, and the response time throughout the whole test period.In this regard, when compared to other methods, the modified PSO-PID MPPT technique had the best tracking efficiency, the lowest power ripples, and the quickest response time.A terrible tracking of the GP with significant power losses and ripples at steady state was caused by the basic PSO MPPT algorithm, which also exhibited enormous oscillations at the GP with obvious strikes in the output characteristics (power, current, and voltage) of the solar array as shown in Figure 12b-d.Using the results obtained by analyzing the PV characteristic under a sudden irradiation variation, the swarm was selected to be composed of three particles.The initial value of each particle was selected to be the minimal value that the GP voltage could take in each band.Figure 13 shows the progress of the particles during the simulation.It can be observed that convergence was always achieved in less than 2.5 ms.
Sustainability 2023, 15, x FOR PEER REVIEW the simulation.It can be observed that convergence was always achieved ms.

Proposed PSO-PID under Fast Variation of Temperature
In order to evaluate the PSO-PID-method tracking accuracy to the conventional PSO and BA MPPT approaches, a quick change of temperature scheme is proposed.The temperature was adjusted as follows: 25 • C from 0 s to 0.007 s, 50 • C from 0.007 s to 0.018 s, 70 • C from 0.018 s to 0.023 s, and 25 • C again from 0.023 s to 0.03 s as shown in Figure 14a.It should be emphasized that during the test period, the irradiance was set at 1000 W/m 2 .The output characteristics (power, current, voltage and duty cycle) of the solar array while employing the PSO-PID and conventional PSO with BA MPPT approaches are compared in Figure 14b-e.The comparison shows that the upgraded PSO MPPT approach outperformed the conventional PSO and BA MPPT techniques throughout the simulation test in tracking the intended GP with a rapid convergence and reduced fluctuations.In this regard, Figure 14b shows that the PSO-PID MPPT technique exhibited lesser power losses in both cases compared to the power losses experienced by the conventional PSO technique in the transient and operations of steady state.Additionally, assessments of the tracking efficiency, response time, and oscillations at the GP for both the classic MPPT method and the enhanced PSO-PID MPPT strategy are shown in Figure 14b-e.These conclusions demonstrate that the proposed MPPT approach boosted tracking efficiency, shortened response times, and eliminated oscillations at steady state using the results from an analysis of the PV characteristics under a rapid change in temperature.The initial value of each particle was selected to be the minimal value the GP voltage could take at each frequency band.Figure 15 shows the progress of the particles during the simulation.It can be observed that convergence was always achieved in less than 2.5 ms.

Proposed PSO-PID under Abrupt Changes in Radiation and Temperature
In this scenario, a test was conducted to examine how the proposed PSO nique might perform and behave under extreme atmospheric circumstances, no sent the actual instance of weather conditions.The output characteristics (powe and current) of the solar array were tested by a sudden change in temperature an of light, as shown in Figure 16a and b through the simulation results.
According to Figure 16c, the PSO-PID MPPT technique performed well i the available GP throughout the entire test circumstances, particularly in the st fluctuation.Therefore, it is important to note that the PSO-PID technique had s formance in lowering the power oscillation at the GP compared to the power provided by the traditional PSO and BA MPPT approaches.Furthermore, a rap gence rate and quick response time were ensured.The PSO-PID technique a cantly improved the output-characteristic (power, current, voltage and duty cy ity and ripple reduction of the solar array as shown in Figure 16c-f. The normal PSO and BA MPPT techniques, on the other hand, exhibited weakness during the sudden atmospheric fluctuation, particularly at the high diation and temperature, as shown in Figure 16a,b.The PV-array characteristi 16c-f (power, current, voltage and duty cycle) curves could be used to demo enormous power oscillations that occurred in this test, particularly at sudden According to Figure 16c, the PSO-PID MPPT technique performed well in catching the available GP throughout the entire test circumstances, particularly in the steady-state fluctuation.Therefore, it is important to note that the PSO-PID technique had strong performance in lowering the power oscillation at the GP compared to the power oscillation provided by the traditional PSO and BA MPPT approaches.Furthermore, a rapid convergence rate and quick response time were ensured.The PSO-PID technique also significantly improved the output-characteristic (power, current, voltage and duty cycle) stability and ripple reduction of the solar array as shown in Figure 16c-f  The normal PSO and BA MPPT techniques, on the other hand, exhibited apparent weakness during the sudden atmospheric fluctuation, particularly at the high level of radiation and temperature, as shown in Figure 16a,b.The PV-array characteristic in Figure 16c-f (power, current, voltage and duty cycle) curves could be used to demonstrate the enormous power oscillations that occurred in this test, particularly at sudden transitory changes in radiation and temperature, which cause a high power loss, a prolonged response time to the GP with a slow convergence, and instability.Figure 17 shows the progress of the particles during the simulation.It can be observed that convergence was always achieved in less than 2.5 ms.

Proposed PSO-PID Slow Changes in Radiation and Temperature
In the previously described scenario, we considered rapid changes in temperature and radiation in Figure 16a,b, to estimate the performance of the proposed hybrid PSO-PID MPPT technology.However, this test scenario was conducted to compare the tracking abilities of the hybrid PSO-PID and traditional PSO and BA techniques with a gradual shift in atmospheric circumstances.Nevertheless, during this test scenario the proposed method was tested at slow changes in temperature and radiation, as shown in Figure 18a,b.
In comparison to the conventional PSO and BA MPPT approaches, the PSO-PID methodology may significantly increase the GP tracking accuracy in terms of convergence speed and power losses.Based on the PV output-characteristic (power, current, voltage and duty cycle) shown in Figure 18c-f, it is feasible to see how well the PSO-PID technique tracked the GP at any alteration in environmental conditions and minimized fluctuation at the GP during the whole test session.The predicted MPP, however, could not be tracked by the basic PSO and BA techniques because of the enormous fluctuation surrounding it, particularly when the sun and/or temperature rose gradually as shown in Figure 18c.Additionally, the traditional PSO approach displayed considerable power losses due to excessive ripple, as shown in Figure 18c-f.Figure 19 shows the progress of the particles during the simulation.It can be observed that convergence was always achieved in less than 2.5 ms.Additionally, Figure 20 compares the performance of the proposed hybrid PSO-PID, conventional PSO, and BA MPPT approaches in term of the three most important factors: (1) average tracking efficiency, (2) power ripples, and (3) response time throughout the whole test period.In this regard, as compared to the basic PSO and BA MPPT approaches, the improved PSO-PID MPPT methodology had the highest average tracking efficiency (99.97%), the lowest power ripples (5.9 W), and the quickest response time (0.002 s).Additionally, Figure 20 compares the performance of the proposed hy conventional PSO, and BA MPPT approaches in term of the three most imp (1) average tracking efficiency, (2) power ripples, and (3) response time t whole test period.In this regard, as compared to the basic PSO and BA MPP the improved PSO-PID MPPT methodology had the highest average track (99.97%), the lowest power ripples (5.9 W), and the quickest response time Additionally, Figure 20 compares the performance of the proposed hybrid PSO-PID, conventional PSO, and BA MPPT approaches in term of the three most important factors: (1) average tracking efficiency, (2) power ripples, and (3) response time throughout the whole test period.In this regard, as compared to the basic PSO and BA MPPT approaches, the improved PSO-PID MPPT methodology had the highest average tracking efficiency (99.97%), the lowest power ripples (5.9 W), and the quickest response time (0.002 s).

Conclusions
A generalized model of a solar array under partial shading was built using MATLAB/Simulink to examine the effects of uniform, non-uniform, and partial shading.Numerous shading schemes were investigated for the model.Due to the many peaks in the characteristics, tracking the GMPP under partial shadowing was challenging.In this work, a novel modified hybrid PSO-PID algorithm that is straightforward and effective and can be implemented at a reasonable cost was proposed.For various shading patterns, the proposed PSO-PID algorithm was validated using simulations of three modules of solar panels connected in series and a boost converter.With the benefit of computational simplicity, the proposed hybrid PSO-PID algorithm was demonstrated to monitor the GMPP correctly, tracking it in a manner comparable to the basic PSO and BA approaches.The proposed PSO-PID method guaranteed quick and accurate GMPPT under the right starting particle position and step-size parameters.Consequently, the improved PSO-PID MPPT technique greatly sped up convergence to the GP and diminished power ripples.Under both uniform and non-uniform meteorological conditions, the improved PSO-PID MPPT technique could automatically adjust the duty of the converter to catch the GP and greatly reduce oscillation size at the GP.The modified PSO-PID MPPT technique outperformed the traditional PSO and BA MPPT strategies in terms of tracking performance, convergence rate, fluctuation mitigation around the MPP, and decreased power losses,

Conclusions
A generalized model of a solar array under partial shading was built using MAT-LAB/Simulink to examine the effects of uniform, non-uniform, and partial shading.Numerous shading schemes were investigated for the model.Due to the many peaks in the characteristics, tracking the GMPP under partial shadowing was challenging.In this work, a novel modified hybrid PSO-PID algorithm that is straightforward and effective and can be implemented at a reasonable cost was proposed.For various shading patterns, the proposed PSO-PID algorithm was validated using simulations of three modules of solar panels connected in series and a boost converter.With the benefit of computational simplicity, the proposed hybrid PSO-PID algorithm was demonstrated to monitor the GMPP correctly, tracking it in a manner comparable to the basic PSO and BA approaches.The proposed PSO-PID method guaranteed quick and accurate GMPPT under the right starting particle position and step-size parameters.Consequently, the improved PSO-PID MPPT technique greatly sped up convergence to the GP and diminished power ripples.Under both uniform and non-uniform meteorological conditions, the improved PSO-PID MPPT technique could automatically adjust the duty of the converter to catch the GP and greatly reduce oscillation size at the GP.The modified PSO-PID MPPT technique outperformed the

Figure 1 .
Figure 1.The photovoltaic system under study.

Figure 1 .
Figure 1.The photovoltaic system under study.

Figure 2 .
Figure 2. The PV panel equivalent circuit, where Ns is the number of series cells within the module;Np is the number of parallel branches within the module; ipv is the solar cell current; iph is the photon generated current; iD and iRp are the currents that pass through the diode and the shunt resistance, respectively; vpv is the solar-cell voltage; Rs is the series connected resistor; and Rsh is the shunt resistance.

Figure 3 .
Figure 3. I−V curve areas based on approximate linear models.

Figure 2 .
Figure 2. The PV panel equivalent circuit, where Ns is the number of series cells within the module;Np is the number of parallel branches within the module; i pv is the solar cell current; i ph is the photon generated current; i D and i Rp are the currents that pass through the diode and the shunt resistance, respectively; v pv is the solar-cell voltage; R s is the series connected resistor; and R sh is the shunt resistance.

Figure 2 .
Figure 2. The PV panel equivalent circuit, where Ns is the number of series cells within the module;Np is the number of parallel branches within the module; ipv is the solar cell current; iph is the photon generated current; iD and iRp are the currents that pass through the diode and the shunt resistance, respectively; vpv is the solar-cell voltage; Rs is the series connected resistor; and Rsh is the shunt resistance.

Figure 3 .
Figure 3. I−V curve areas based on approximate linear models.

Figure 3 .
Figure 3. I−V curve areas based on approximate linear models.

Figure 4 .
Figure 4.The equivalent linear circuit around MPP, where Veq is the equivalent linea around MPP and Req is the equivalent linear circuit voltage around MPP.

Figure 5 .
Figure 5.The equivalent PV system circuit diagram.

Figure 4 .
Figure 4.The equivalent linear circuit around MPP, where V eq is the equivalent linear circuit voltage around MPP and R eq is the equivalent linear circuit voltage around MPP.

Figure 4 .
Figure 4.The equivalent linear circuit around MPP, where Veq is the equivalent linear circuit voltage around MPP and Req is the equivalent linear circuit voltage around MPP.

Figure 5 .
Figure 5.The equivalent PV system circuit diagram.

Figure 5 .
Figure 5.The equivalent PV system circuit diagram.

Figure 6 .
Figure 6.Typical components of the proposed system.

Figure 6 .
Figure 6.Typical components of the proposed system.

Figure 7 .
Figure 7.The three distinct PV array-shading patterns under investigation.

Figure 7 .
Figure 7.The three distinct PV array-shading patterns under investigation.

Figure 9 .
Figure 9. MATLAB/Simulink model of the proposed standalone PV system with the PSO and PID MPPT algorithm.

Figure 11 .
Figure 11.Convergence of the three particles for the proposed PSO-PID comparison wi BA algorithms under PSCs.

Figure 11 .
Figure 11.Convergence of the three particles for the proposed PSO-PID comparison with CPSO and BA algorithms under PSCs.

Figure 12 .
Figure 12.Simulation-result waveforms of photovoltaic array-output characteristi change in irradiance with constant temperature for the PSO-PID, BA, and CPSO.

Figure 12 .
Figure 12.Simulation-result waveforms of photovoltaic array-output characteristics under sudden change in irradiance with constant temperature for the PSO-PID, BA, and CPSO.(a) Irradiance, (b) power, (c) current, (d) voltage, and (e) duty cycle.

Figure 12 .
Figure 12.Simulation-result waveforms of photovoltaic array-output characteris change in irradiance with constant temperature for the PSO-PID, BA, and CPSO.

Figure 13 .
Figure 13.Convergence of the three particles for the proposed PSO-PID comparison with CPSO and BA algorithms under sudden change in irradiance with constant temperature.

Sustainability 2023 ,Figure 14 .
Figure 14.Simulation-result waveforms of photovoltaic-array output characteristic change in irradiance with constant temperature for the PSO-PID, BA, and CPSO.

Figure 14 .Figure 15 .
Figure 14.Simulation-result waveforms of photovoltaic-array output characteristics under sudden change in irradiance with constant temperature for the PSO-PID, BA, and CPSO.(a) Temperature, (b) PV power, (c) current, (d) voltage, and (e) duty cycle.

Figure 15 .
Figure 15.Convergence of the three particles for the proposed PSO-PID comparison with CPSO and BA algorithms under fast change in temperature with constant radiation.5.4.Proposed PSO-PID under Abrupt Changes in Radiation and TemperatureIn this scenario, a test was conducted to examine how the proposed PSO-PID technique might perform and behave under extreme atmospheric circumstances, not to represent the actual instance of weather conditions.The output characteristics (power, voltage, and current) of the solar array were tested by a sudden change in temperature and amount of light, as shown in Figure16a,b through the simulation results.According to Figure16c, the PSO-PID MPPT technique performed well in catching the available GP throughout the entire test circumstances, particularly in the steady-state fluctuation.Therefore, it is important to note that the PSO-PID technique had strong performance in lowering the power oscillation at the GP compared to the power oscillation provided by the traditional PSO and BA MPPT approaches.Furthermore, a rapid convergence rate and quick response time were ensured.The PSO-PID technique also significantly improved the output-characteristic (power, current, voltage and duty cycle) stability and ripple reduction of the solar array as shown in Figure16c-f.

.Figure 16 .
Figure 16.Simulation-output result of PV-array characteristics under sudden vari diation and temperature for the PSO-PID, BA, and CPSO.

Figure 16 .
Figure 16.Simulation-output result of PV-array characteristics under sudden variation in solar radiation and temperature for the PSO-PID, BA, and CPSO.(a) Irradiance, (b) Temperature, (c) PV power, (d) current, (e) voltage, and (f) duty cycle.

Figure 16 .
Figure 16.Simulation-output result of PV-array characteristics under sud diation and temperature for the PSO-PID, BA, and CPSO.

Figure 17 .
Figure 17.Convergence of the three particles for the proposed PSO-PID com BA algorithms during abrupt changes in radiation and temperature.

Figure 17 .
Figure 17.Convergence of the three particles for the proposed PSO-PID comparison with CPSO and BA algorithms during abrupt changes in radiation and temperature.

Figure 18 .
Figure 18.Resulting simulation-output waveforms of PV-array characteristics during changes in radiation and temperature for the PSO-PID, BA, and CPSO.

Figure 18 .
Figure 18.Resulting simulation-output waveforms of PV-array characteristics during the slow changes in radiation and temperature for the PSO-PID, BA, and CPSO.(a) Irradiance, (b) Temperature, (c) PV power, (d) current, (e) voltage, and (f) duty cycle.

Figure 19 .
Figure 19.Convergence of the three particles for the proposed PSO-PID comparison BA algorithms under slow change in irradiation.

Figure 19 . 27 Figure 19 .
Figure 19.Convergence of the three particles for the proposed PSO-PID comparison with CPSO and BA algorithms under slow change in irradiation.

Figure 20 .
Figure 20.Resulting output of the second test scenario comparing the classic PSO MPPT technique with the modified (PSO-PID) approach in terms of (a) average tracking efficiency, (b) average power output ripples, and (c) response time.

Table 2 .
Parameters of different algorithms.

Table 3 .
Comparison of tracking time, efficiency, voltage, and power of the proposed PSO-PID with CPSO and BA algorithms.
* P Th : Theoretical power captured from the P-V characteristic; P Act : actual power captured from the MPPT algorithm.