A Real-Time Implementation of Novel and Stable Variable Step Size MPPT

: This paper presents a complete study of a standalone photovoltaic (PV) system including a maximum power tracker (MPPT) driving a DC boost converter to feed a resistive load. Here, a new MPPT approach using a modiﬁcation on the original perturb and observe (P&O) algorithm is proposed; the improved algorithm is founded on a variable step size (VSZ). This novel algorithm is realized and e ﬃ ciently implemented in the PV system. The proposed VSZ algorithm is compared both in simulation and in real time to the P&O algorithm. The stability analysis for the VSZ algorithm is performed using Lyapunov’s stability theory. In this paper, a detailed study and explanation of the modiﬁed P&O MPPT controller is presented to ensure high PV system performance. The proposed algorithm is practically implemented using a DSP1104 for real-time testing. Signiﬁcant results are achieved, proving the validity of the proposed PV system control scheme. The obtained results show that the proposed VSZ succeeds at harvesting the maximum power point (MPP), as the amount of harvested power using VSZ is three times greater than the power extracted without the tracking algorithm. The VSZ reveals improved performance compared to the conventional P&O algorithm in term of dynamic response, signal quality and stability.


Introduction
It is currently well known that power production technology from renewable energy sources is mature, available and reliable. Photovoltaic (PV) energy is considered to be the most promising future energy source as it is pollution-free-thus, it is known as "green energy"-and abundantly available anywhere in the world.
This work investigates the control of a stand-alone PV system. The success of the application of a photovoltaic system depends strongly on weather conditions. The maximization of the energy extraction from the photovoltaic generator (PVG) is necessary. Power electronic devices such as DC converters are needed in this application to allow the extraction of the highest power rate from the power supply (PVG). Maximum power tracker (MPPT) regulator accuracy has therefore become an important process for successful and effective PV applications [1].
The success of MPPT operation is challenging due to the varying sunshine conditions, which determine the amount of sun energy flux into the PV panel; this amount may change at any time. Therefore, a PV system (PVS) is considered to be a complex system, making the design of a suitable MPPT controller difficult [2].

Modeling of the Photovoltaic Panel
The PV cell can be substituted for an electric circuit, as shown in Figure 2a. The circuit mainly comprises the following: -A current power supply (Iph) that depends of the absorbed irradiation; -A diode in which the (Id) current flows; -A load in which the (Ic) current flows. [25,26].

Modeling of the Photovoltaic Panel
The PV cell can be substituted for an electric circuit, as shown in Figure 2a. The circuit mainly comprises the following: -A current power supply (I ph ) that depends of the absorbed irradiation; -A diode in which the (I d ) current flows; -A load in which the (I c ) current flows. [25,26].
The cell current I c used for modeling is given by [8,9] I c = I ph − I rs exp q(V c + R s I c ) The PVG modeling depends on the parallel and series cell numbers of N p and N s , respectively [8,9]: The PV current I p is given by Assuming that R p >>R s, a simplification can be made. Here, the model has values of R s = 0 and R p = ∞.
The PV module ATERSA A55 was considered for modeling; the module's characteristics are shown in Figure 2b. The specifications of the PV panel are shown in Table 1 [1]. The cell current used for modeling is given by [8,9] The PVG modeling depends on the parallel and series cell numbers of Np and Ns, respectively [8,9]: The PV current is given by Assuming that Rp>>Rs, a simplification can be made. Here, the model has values of Rs = 0 and Rp = ∞.  The PVG P-V characteristics clearly present three specific operating points, as shown in Figure 2b.
-The voltage region, where the V OC can be depicted; - The current region, where the I SC can be depicted; - The maximum power region, where the MPP can be depicted.
Operation in the third region (the P max region) is required to harvest the maximum power from the PV panel.

Boost Converter
A converter is an electronic device which is used when it is necessary to efficiently modify a DC input voltage level to another level at the output according to a duty cycle command D. Using this device, the voltage can be easily stepped up or down. In this work, the converter used to feed the load is controlled to harvest the maximum power of the PV. Thus, the efficiency of the proposed photovoltaic system is boosted [26][27][28].
In this work, a boost converter is chosen to step up the voltage; its circuit consists of only a switch (a transistor), an inductor, a diode and a tow capacitor, as shown in Figure 3a. The output voltage is controlled by varying the switching frequency of the duty cycle command (D). The boost converter specifications are listed in Table 2.  The boost converter circuit dynamic model is as follows [1]: Then,  The boost converter circuit dynamic model is as follows [1]: In CCM (continuous conduction mode), the output voltage is related to the input voltage by the following [27]: Based on P in = P out, it is easy to deduce that where R pv is the PV panel load; this is also considered to be an input load (R in ) for the boost converter. Using Equation (9), based on the equation R pv = (1 − D) 2 · R out , it can be observed that if (D) decreases/increases, then R pv increases/decreases; thus, based on the I-V characteristic shown in Figure 3b, the I p will increase and V p will increase/decrease.
Equivalently, in Equation (4), it can be also seen that when the voltage (V p ) decreases/increases, the current (I p ) will increase/decrease. Therefore, if the resistance fed by the PV panel increases, then (V p ) should increase and (I p ) should decrease.
This shows that the rate of change in the duty cycle is always opposite to the rate in the voltage. This can be expressed mathematically as

Modeling of the Photovoltaic Panel
The photovoltaic generator output power is given by P = Vp × Ip. The power optimization is carried out by pushing the system to work at a defined point, as shown in Figure 4a, and by solving the following Equation (11) [28]. ∆P ∆V P = 0 (11)

P&O Algorithm
The P&O algorithm is presented in Figure 4b; it is the most popular MPPT method due to its simplicity [11,15,29]. The main task of the P&O algorithm is to provoke disturbances by acting on the pulse width modulation (PWM) duty cycle command (decreasing or increasing) and observing its impact on the generated output PV power. If the actual power P(k) is greater than the previous computed power P(k-1), then the perturbation direction is maintained; otherwise, it is reversed [28][29][30]. The value of the step size (perturbation ∆D) is very important in this algorithm.
The step size ∆D is chosen by trial and testing in simulation. If the value ∆D is very small or very large, then it is possible to lose stability. Despite the simplicity of the implementation of the P&O algorithm, it suffers from the problems [20,28] that the operation of PV systems fails to track the MPP, and the PV systems operate in an oscillating mode.
The choice of a large perturbation step (∆D) will lead to a fast convergence to the MPP from one steady state to another. Nevertheless, the power loss caused by perturbation in the steady state will also increase.
On the other hand, a smaller (∆D) can improve the power loss but will slow down the tracking speed. Therefore, the choice of the ∆D is considered to be a critical issue [28]. To solve this dilemma, a variable-step size MPPT method is proposed in the next part of this work.

P&O Algorithm
The P&O algorithm is presented in Figure 4b; it is the most popular MPPT method due to its simplicity [11,15,29]. The main task of the P&O algorithm is to provoke disturbances by acting on the pulse width modulation (PWM) duty cycle command (decreasing or increasing) and observing its impact on the generated output PV power. If the actual power P(k) is greater than the previous computed power P(k-1), then the perturbation direction is maintained; otherwise, it is reversed [28][29][30]. The value of the step size (perturbation ∆D) is very important in this algorithm.
The step size ∆D is chosen by trial and testing in simulation. If the value ∆D is very small or very large, then it is possible to lose stability. Despite the simplicity of the implementation of the P&O algorithm, it suffers from the problems [20,28] that the operation of PV systems fails to track the MPP, and the PV systems operate in an oscillating mode.
The choice of a large perturbation step (∆D) will lead to a fast convergence to the MPP from one steady state to another. Nevertheless, the power loss caused by perturbation in the steady state will also increase.

P&O Algorithm Using a Variable Step Size
To solve the drawbacks of the P&O algorithm, the adjustment of the step size (∆D) may present a solution. A large value may make the response dynamic faster; however, it boosts the amplitude of the oscillations around the MPP and then decreases its performance.
Many improvements have been proposed, such as controlling the (∆D) value by an artificial intelligence method such as swarm optimization (PSO); for example, in the work presented in [29], which required a learning step before using this method.
This paper presents a new technique to solve the drawbacks of the P&O algorithm by auto-tuning the step size in order to make the control algorithm adaptive and more robust and to ensure increased dynamic performance. When the weather condition changes, the step size must be immediately auto-tuned pursuant to the new MPP operating point on the P-V characteristic. If the operating point is distinct from the MPP, the step size increase enables a fast-tracking ability.
The modified P&O algorithm is presented in Figure 5. Based on Figure 4a, if the operation point of the PVG is near to the maximum power point, the variable step size (∆P/∆V) will be small, and so the new duty cycle will increase or decrease in proportion to this variation; in this case, it will be a small variation, while in other cases it would be a large variation.
which required a learning step before using this method. This paper presents a new technique to solve the drawbacks of the P&O algorithm by autotuning the step size in order to make the control algorithm adaptive and more robust and to ensure increased dynamic performance.
When the weather condition changes, the step size must be immediately auto-tuned pursuant to the new MPP operating point on the P-V characteristic. If the operating point is distinct from the MPP, the step size increase enables a fast-tracking ability.
The modified P&O algorithm is presented in Figure 5. Based on Figure 4a, if the operation point of the PVG is near to the maximum power point, the variable step size (ΔP/ΔV) will be small, and so the new duty cycle will increase or decrease in proportion to this variation; in this case, it will be a small variation, while in other cases it would be a large variation.
If the operation point of the PV system is in the MPP, then the (ΔP/ΔV) will obviously be null, as shown in Figure 4a; therefore, the new duty cycle will remain the same. Thus, we avoid the oscillation of the regular P&O algorithm.
With K is a positive scaling factor, while using a boost converter, the duty cycle must change its direction inversely to the sign of the ratio (∆P/∆V), so ∆D = −K*(∆P/∆V). Thus, if the ratio (∆P/∆V) is positive, then the system operates according to the left part of the characteristic curve (P-V), as shown in Figure 4a. In this case, the voltage must increase to reach Vpmax = VMMP; thus, based on the Equation (10) the duty cycle must decrease.
Stability Proof. The Lyapunov function is a positive scalar function for the state variables of the system. If the operation point of the PV system is in the MPP, then the (∆P/∆V) will obviously be null, as shown in Figure 4a; therefore, the new duty cycle will remain the same. Thus, we avoid the oscillation of the regular P&O algorithm.
With K is a positive scaling factor, while using a boost converter, the duty cycle must change its direction inversely to the sign of the ratio (∆P/∆V), so ∆D = −K*(∆P/∆V). Thus, if the ratio (∆P/∆V) is positive, then the system operates according to the left part of the characteristic curve (P-V), as shown in Figure 4a. In this case, the voltage must increase to reach V pmax = V MMP ; thus, based on the Equation (10) the duty cycle must decrease.
Stability Proof. The Lyapunov function is a positive scalar function for the state variables of the system.
Based on the Lyapunov function, the variable structure mode control requires that Considering that where A = q nβT c 1 n s N s ; when S = 0, the PV system reach the maximum power point. Therefore, the system dynamics can be divided into two states: S < 0 and S > 0. D > 0, and by using Equation (10), Deriving S using Equation (6) gives us Thus, . S = N p I ph − I rs − I rs 1 + AV p exp AV p .
Using Equation (22) in (20) Finally, the system may reach global stability, and if S = 0, the system will operate at MPP according to Equation (17).

Simulation Result
To prove the increased performance of the proposed algorithm, a sudden and instantaneous external and internal deviation is applied to the system. Irradiation variation is considered to be an external disturbance, and load variation is considered to be an internal disturbance. Figure 6a,b shows the load curve, R, and the irradiation curve, G, respectively. When the time is equal to 2 s, the load is increased from 15 Ω to 30 Ω; when the time is equal to 4 s, the irradiation is increased from 500 W/m 2 to 1000 W/m 2 . Figure 6c shows the MPPT controller output (the duty cycle), while Figure 6d shows the dynamic evolution of the PV current. It is clearly shown that the duty cycle command detects all disturbances and acts accordingly to maintain maximum power tracking; therefore, the current and voltage values change. Figure 7a,b shows the dynamic evolution of the PVG, voltage and power signals, respectively, for the same application of irradiation. From 0 to 4 s, the irradiation is constant; the measures mentioned above remain steady despite the load change to keep the system operating at the MPP. From 4 to 5 s, the irradiation increases, and according to the PV characteristics, the MPP is sensitive to the irradiation value. The behavior of the system proves the algorithm's robustness. It can easily be observed that the PV using both algorithms meets the MPP. Figure 7c presents the load voltage. It should be noted that, with the increasing of the load value, the oscillation increases for the regular P&O algorithm. external disturbance, and load variation is considered to be an internal disturbance. Figure 6a,b shows the load curve, R, and the irradiation curve, G, respectively. When the time is equal to 2 s, the load is increased from 15 Ω to 30 Ω; when the time is equal to 4 s, the irradiation is increased from 500 W/m ² to 1000 W/m ² . Figure 6c shows the MPPT controller output (the duty cycle), while Figure 6d shows the dynamic evolution of the PV current. It is clearly shown that the duty cycle command detects all disturbances and acts accordingly to maintain maximum power tracking; therefore, the current and voltage values change.  Figure 7a,b shows the dynamic evolution of the PVG, voltage and power signals, respectively, for the same application of irradiation. From 0 to 4 s, the irradiation is constant; the measures mentioned above remain steady despite the load change to keep the system operating at the MPP. From 4 to 5 s, the irradiation increases, and according to the PV characteristics, the MPP is sensitive to the irradiation value. The behavior of the system proves the algorithm's robustness. It can easily be observed that the PV using both algorithms meets the MPP. Figure 7c presents the load voltage. It should be noted that, with the increasing of the load value, the oscillation increases for the regular

Experimental Setup
In this section, extensive experimental work and selected results are presented. A comparison of the systems including the regular P&O algorithm and the proposed variable step size P&O controller is also presented. In this section, global PV system control is carried out as previously shown in Figure  1.    It is thus clearly demonstrated that the modified controller is much more appropriate for a rapid and accurate dynamic signal response.
In the next section, the adaptive variable step size algorithm will be implemented in real time and compared to the regular algorithm.

Experimental Setup
In this section, extensive experimental work and selected results are presented. A comparison of the systems including the regular P&O algorithm and the proposed variable step size P&O controller is also presented. In this section, global PV system control is carried out as previously shown in Figure 1.
For the real-time experiment, a dSPACE controller board was chosen as the control platform. The output-input (O/I) interface of the dSPACE DS1104 help to enable the linkage between the MATLAB/SIMULINK and the real hardware system. [31][32][33]. The output-input (O/I) blocks are analog-to-digital converters (ADCs) and digital-to-analog converters (DACs). Using the MATLAB/SIMULINK real-time workshop (RTW) Toolbox, the SIMULINK model was converted to C-code; later, the codes were treated by a compiler and connected to the real-time dSPACE processor board. The PWM signal was 20 kHz, which was directly produced to control the switching MOSFET of the boost converter.
Using the dSPACE graphical user interface (GUI) software, the supervision of the PV panel performance and behavior in real time was carried out. The user is able to control, stop the system and record the signals in real time.
The implementation of the MPPT was carried out with a dSPACE DS1104 real-time control layout card. The sensors were mounted in the boost converter to help to acquire measurements. Figure 8a shows the diagram of the hardware setup, and Figure 8b shows the used hardware. For the real-time experiment, a dSPACE controller board was chosen as the control platform. The output-input (O/I) interface of the dSPACE DS1104 help to enable the linkage between the MATLAB/SIMULINK and the real hardware system. [31][32][33]. The output-input (O/I) blocks are analog-to-digital converters (ADCs) and digital-to-analog converters (DACs). Using the MATLAB/SIMULINK real-time workshop (RTW) Toolbox, the SIMULINK model was converted to C-code; later, the codes were treated by a compiler and connected to the real-time dSPACE processor board. The PWM signal was 20 kHz, which was directly produced to control the switching MOSFET of the boost converter.
Using the dSPACE graphical user interface (GUI) software, the supervision of the PV panel performance and behavior in real time was carried out. The user is able to control, stop the system and record the signals in real time.
The implementation of the MPPT was carried out with a dSPACE DS1104 real-time control layout card. The sensors were mounted in the boost converter to help to acquire measurements. Figure 8a shows the diagram of the hardware setup, and Figure 8b shows the used hardware. The experiment setup consisted of four ATERSA A55 modules linked in parallel, which were placed on the roof of the school; the control step was done in the lab. All the used components are shown in Figure 8b. Figure 9 shows the maximum power point tracker control scheme, which was constructed in SIMULINK (MATLAB). All the signals that originated from the DSP analog/digital (A/D) converter needed to be be normalized. This normalization was done by multiplying the signal by a scaling gain; The experiment setup consisted of four ATERSA A55 modules linked in parallel, which were placed on the roof of the school; the control step was done in the lab. All the used components are shown in Figure 8b. Figure 9 shows the maximum power point tracker control scheme, which was constructed in SIMULINK (MATLAB). All the signals that originated from the DSP analog/digital (A/D) converter needed to be be normalized. This normalization was done by multiplying the signal by a scaling gain; for the DSP, this gain was equal to 10. To prove the performance of the VSZ algorithm, the controllers were experimentally tested using the dSPACE data acquisition system.
To begin a new test, the block presented in Figure 9 needed to be run to create the C code. However, before beginning the MPP tracking operation, we wanted to find the operation point of the system without control. Therefore, a constant command equal to zero was sent to the DS1104SL DSP PWM, and the load value was changed from 0.1 Ω to 47.5 Ω to obtain the real I-V characteristic of the ATERSA.
The obtained ATERSA I-V and P-V characteristics are shown below in Figure 10a,b, respectively. Figure 10 shows the ATERSA I-V and P-V characteristics and the resistive load operating point with R ≈ 15.113 ohm. This load was coupled to the PV panel when the command (D) was equal to zero (null); i.e., without any controller. From the figures below, it can be clearly seen that the operating point of the load was far away from the MPP; this PV panel was characterized by an irradiation value of 370 W/m² with a maximum power equal to 54 W, which was the MPP. To prove the performance of the VSZ algorithm, the controllers were experimentally tested using the dSPACE data acquisition system.
To begin a new test, the block presented in Figure 9 needed to be run to create the C code. However, before beginning the MPP tracking operation, we wanted to find the operation point of the system without control. Therefore, a constant command equal to zero was sent to the DS1104SL DSP PWM, and the load value was changed from 0.1 Ω to 47.5 Ω to obtain the real I-V characteristic of the ATERSA.
The obtained ATERSA I-V and P-V characteristics are shown below in Figure 10a,b, respectively. Figure 10 shows the ATERSA I-V and P-V characteristics and the resistive load operating point with R ≈ 15.113 ohm. This load was coupled to the PV panel when the command (D) was equal to zero (null); i.e., without any controller. From the figures below, it can be clearly seen that the operating point of the load was far away from the MPP; this PV panel was characterized by an irradiation value of 370 W/m 2 with a maximum power equal to 54 W, which was the MPP.
In the next part, the acquisition of all data was done in September at 13 am in Vitoria-Gasteiz, Spain, resulting in an irradiation of around 380 W/m 2 and temperature values equal to 33.2 • C. After obtaining the real characteristics, the P&O algorithm and variable step size VSZ were used to increase the system's efficiency and ensure its good performance.
To start real-time tracking, the SIMULINK MPPT control block was downloaded again to generate the new C for the dSPACE board. It should be noted that this procedure requires some time; therefore, some differences between the obtained results could appear. In the next figures, the black curve shows the conventional P&O results, and the red curve shows the result obtained using the VSZ. Figure 11 shows the irradiation change while recording the tracking operation for both the VSZ controller (in red) and regular P&O algorithm (in black); the figure also shows the power (P) and the duty cycle (D). In the next part, the acquisition of all data was done in September at 13 am in Vitoria-Gasteiz, Spain, resulting in an irradiation of around 380 W/m² and temperature values equal to 33.2 °C. After obtaining the real characteristics, the P&O algorithm and variable step size VSZ were used to increase the system's efficiency and ensure its good performance. therefore, some differences between the obtained results could appear. In the next figures, the black curve shows the conventional P&O results, and the red curve shows the result obtained using the VSZ. Figure 11 shows the irradiation change while recording the tracking operation for both the VSZ controller (in red) and regular P&O algorithm (in black); the figure also shows the power (P) and the duty cycle (D).  Figure 12 shows the current and voltage for the PVG and for the load. To prove the robustness of the VSZ controller and its ability to maintain the harvesting of the maximum of power, after 11 s, the resistive load value was manually changed. The approximate resistance values used in this experiment were 14.48 Ω and 47.5 Ω.   The voltage, current and power measurements remained constant in the face of the load variation. This disturbance was done in order to keep the system operating at the required point; i.e., the MPP. The performance proved the regulator's robustness.
The acquired results proved that both systems using different controllers' present robustness and good maximum power tracking; however, the VSZ controllers showed the best performance, with less oscillation and much more accurate tracking.
It should be noted that the proposed variable step size controller successfully tracked the maximum power, and this was accurate for the operating points shown by P-V and the I-V characteristics. To prove the robustness of the VSZ controller and its ability to maintain the harvesting of the maximum of power, after 11 s, the resistive load value was manually changed. The approximate resistance values used in this experiment were 14.48 Ω and 47.5 Ω. The voltage, current and power measurements remained constant in the face of the load variation. This disturbance was done in order to keep the system operating at the required point; i.e., the MPP. The performance proved the regulator's robustness.
The acquired results proved that both systems using different controllers' present robustness and good maximum power tracking; however, the VSZ controllers showed the best performance, with less oscillation and much more accurate tracking.
It should be noted that the proposed variable step size controller successfully tracked the maximum power, and this was accurate for the operating points shown by P-V and the I-V characteristics.

Conclusions
In this work, a full study of a photovoltaic system incorporating an MPPT controller was presented. The proposed PV system consisted of a PV generator, a DC-DC boost converter and a resistive load. In order to increase the system efficiency, a full design of a variable step size P&O controller was presented, along with the study of its stability. This method improves on the performance of the regular P&O, reducing the complexity and ensuring system efficiency. The proposed PV system was investigated and practically implemented using the control system card dSPACE 1104. This controller guarantees high dynamic system performance. Simulation and experimental results are presented to highlight the obtained performance.
The VSZ showed better results as it successfully and correctly tracked the MPP with significantly better performance than the P&O tracking controller. This novel algorithm can be easily used in industries; consequently, the economic profits gained by using the VSZ algorithm could be huge.
Om future work, this new proposed approach could be applied to the incremental conductance (INC) algorithm; moreover, the system's robustness could also be tested in terms of other aspects that disturb the PV systems' power generation efficiency, such as humidity, dust and fog.