A New Model Predictive Control Method for Buck-Boost Inverter-Based Photovoltaic Systems

: This study designed a system consisting of a photovoltaic system and a DC-DC boost converter with buck-boost inverter. A multi-error method, based on model predictive control (MPC), is presented for control of the buck-boost inverter. Incremental conductivity and predictive control methods have also been used to track the maximum power of the photovoltaic system. Due to the fact that inverters are in the category of systems with fast dynamics, in this method, by ﬁrst determining the system state space and its discrete time model, a switching algorithm is proposed to reduce the larger error for the converter. By using this control method, in addition to reducing the total harmonic distortion (THD), the inverter voltage reaches the set reference value at a high speed. To evaluate the performance of the proposed method, the dynamic performance of the converter at the reference voltage given to the system was investigated. The results of system performance in SIMULINK environment were simulated and analyzed by MATLAB software. According to the simulation results, we can point out the advantage of this system in following the reference signal with high speed and accuracy.


Introduction
With the increase in population and the advancement of technology, the need for electricity has become one of the essential needs of society and the available power is not enough.The construction of fossil power plants is very expensive.Moreover, these power plants are very harmful to the environment due to the production of carbon dioxide.For these reasons, the use of renewable energy is increasing day by day.Photovoltaic systems, which use solar energy to generate electricity, are one of the most popular methods of generating power.The output power of these systems is DC, so in order to transfer this power to the distribution network, we need to use a DC to AC converter (inverter).There are different types of inverters.One of the best types is the single-stage inverter [1][2][3][4][5][6][7].
Given the important task of the inverter in photovoltaic systems, a system should be used to control it with a fast dynamic response and high flexibility.One of the best methods to be used for many applications is model predictive control (MPC).Predictive control first predicts the future behavior of the system on a limited time horizon.Then, at any time, future input signals are calculated by minimizing a target function under the state constraints and input on the line [8,9].Finally, only the first calculated control member is applied to the actual system and the previous steps are repeated by measuring the new The main contributions of this paper are as follows: 1. Design of a photovoltaic system 2. Tracking the maximum power point with MPC 3. Presenting a two-error and MAC hybrid control method to regulate the output voltage of the inverter The rest of the paper is organized as follows: Section 2 discusses the designed panel.The maximum power point tracking algorithm, which is implemented on the photovoltaic system, is given in Section 3. The specifications of the proposed inverter are listed in Section 4. The MPC strategy implemented on the inverter is described in Section 5. Section 6 fully describes the system simulation results, and in Section 7, the conclusion is given.

Designed Photovoltaic Panel
The designed panel (for radiation, 1000 W/m 2 and temperature of 25 °C) has a 3.8 A short circuit current and 21 V open circuit voltage.The optimum current and voltage are 3.57A and 17.9 V, respectively.The maximum power of each simulated module using the optimal voltage and current is equal to 64 W. Additionally, for radiation of 700 W and temperature of 25 degrees Celsius, the optimum current and voltage for each module are 2.5 A and 17.5 V, respectively [28,29].
To produce 200 W of power using the designed module, we need four modules.It is necessary to close the two solar modules together in series and also in parallel with the other two modules.In this case, we form a photovoltaic system.If we series two modules, and parallel them with two other series modules, its power is obtained as follows: The maximum current and voltage of the panel, assuming 700 W of radiation and a temperature of 25 °C, is obtained as Equation (2).

Maximum Power Point Tracking (MPPT)
Getting the maximum power from photovoltaic systems is important and essential in increasing the efficiency of these systems.Due to the uncertainty of the output power of photovoltaic systems, which depends on several factors such as radiation, temperature, and load size, these systems rarely operate at the maximum power point.Therefore, tracking the maximum power point plays an important role in increasing the efficiency of these systems.In this paper, to control the maximum power point, a control method consisting of three parts is used.First, the reference current is obtained using the incremental conductivity algorithm.Then, with the help of boost converter modeling and using the The main contributions of this paper are as follows: 1.
Design of a photovoltaic system 2.
Tracking the maximum power point with MPC 3.
Presenting a two-error and MAC hybrid control method to regulate the output voltage of the inverter The rest of the paper is organized as follows: Section 2 discusses the designed panel.The maximum power point tracking algorithm, which is implemented on the photovoltaic system, is given in Section 3. The specifications of the proposed inverter are listed in Section 4. The MPC strategy implemented on the inverter is described in Section 5. Section 6 fully describes the system simulation results, and in Section 7, the conclusion is given.

Designed Photovoltaic Panel
The designed panel (for radiation, 1000 W/m 2 and temperature of 25 • C) has a 3.8 A short circuit current and 21 V open circuit voltage.The optimum current and voltage are 3.57A and 17.9 V, respectively.The maximum power of each simulated module using the optimal voltage and current is equal to 64 W. Additionally, for radiation of 700 W and temperature of 25 degrees Celsius, the optimum current and voltage for each module are 2.5 A and 17.5 V, respectively [28,29].
To produce 200 W of power using the designed module, we need four modules.It is necessary to close the two solar modules together in series and also in parallel with the other two modules.In this case, we form a photovoltaic system.If we series two modules, and parallel them with two other series modules, its power is obtained as follows: The maximum current and voltage of the panel, assuming 700 W of radiation and a temperature of 25 • C, is obtained as Equation (2).

Maximum Power Point Tracking (MPPT)
Getting the maximum power from photovoltaic systems is important and essential in increasing the efficiency of these systems.Due to the uncertainty of the output power of photovoltaic systems, which depends on several factors such as radiation, temperature, and load size, these systems rarely operate at the maximum power point.Therefore, tracking the maximum power point plays an important role in increasing the efficiency of these systems.In this paper, to control the maximum power point, a control method consisting of three parts is used.First, the reference current is obtained using the incremental conductivity algorithm.Then, with the help of boost converter modeling and using the predictive control, the converter condition is predicted.Finally, using a cost function by reducing the reference current error relative to the predicted panel current, switching of the boost converter, so that the system operates at its maximum power point.Figure 2 shows the incremental conductivity algorithm used.The MPPT algorithm flowchart using the MPC method is shown in Figure 3.The parameters of the boost converter used in this paper are also shown in Table 1.
Sustainability 2022, 14, x FOR PEER REVIEW 4 of 15 predictive control, the converter condition is predicted.Finally, using a cost function by reducing the reference current error relative to the predicted panel current, switching of the boost converter, so that the system operates at its maximum power point.Figure 2 shows the incremental conductivity algorithm used.The MPPT algorithm flowchart using the MPC method is shown in Figure 3.The parameters of the boost converter used in this paper are also shown in Table 1.predictive control, the converter condition is predicted.Finally, using a cost function by reducing the reference current error relative to the predicted panel current, switching of the boost converter, so that the system operates at its maximum power point.Figure 2 shows the incremental conductivity algorithm used.The MPPT algorithm flowchart using the MPC method is shown in Figure 3.The parameters of the boost converter used in this paper are also shown in Table 1.

Yes
No

Single-Stage Inverter
As shown in Figure 4, the proposed single-stage inverter structure has a battery as the voltage source, a high frequency filter, load, and various switches.

Single-Stage Inverter
As shown in Figure 4, the proposed single-stage inverter structure has a battery as the voltage source, a high frequency filter, load, and various switches.In the proposed inverter, two switching models may occur.In the first case, switches 1 and 4 are on, and switches 3 and 2 are off.In the second case, the opposite happens, i.e., switches 2 and 3 are on, and switches 1 and 4 are off.In the first case, the inductor current L1 is increased, but inductor current L2 and capacitors voltage C1 and C2 are decreased.Equation (3) represents the converter state space.In this equation, A1, A2, B, and C are the matrices of the system, and y is the output of the system.
( ) The state vector includes the currents of inductors L1, L2, and Lf and the voltages of capacitors C1, C2, and Cf are as follows: In the above equation, i and v represent the current and voltage of the inductors and capacitors mentioned in Figure 4.The output voltage (VO) is equal to the voltage passing through the Cf capacitor and the voltage across the load.
The following four matrices are inverter matrices which are defined as follows: U(t) can be considered as the status of switches and y(t) can be considered as the output of the system.When the switches are on, U(t) = 1, and in the case when the switches are turned off, U(t) = 0.In the proposed inverter, two switching models may occur.In the first case, switches 1 and 4 are on, and switches 3 and 2 are off.In the second case, the opposite happens, i.e., switches 2 and 3 are on, and switches 1 and 4 are off.In the first case, the inductor current L1 is increased, but inductor current L2 and capacitors voltage C1 and C2 are decreased.Equation (3) represents the converter state space.In this equation, A 1 , A 2 , B, and C are the matrices of the system, and y is the output of the system.
The state vector includes the currents of inductors L1, L2, and Lf and the voltages of capacitors C1, C2, and Cf are as follows: In the above equation, i and v represent the current and voltage of the inductors and capacitors mentioned in Figure 4.The output voltage (VO) is equal to the voltage passing through the Cf capacitor and the voltage across the load.
The following four matrices are inverter matrices which are defined as follows: U(t) can be considered as the status of switches and y(t) can be considered as the output of the system.When the switches are on, U(t) = 1, and in the case when the switches are turned off, U(t) = 0.
Figure 5 shows the inverter structure in the 0 and 1 switching modes.First, according to the MPC function, we obtain a continuous time model of the system.Then, we get an accurate predictive block.The discrete-time model of first-order systems can be obtained approximating its derivatives as follows, by using Euler's forward method: In the above equation, Ts is the sampling time and x(k) is the state of the system at time k.This method has a significant error for systems that have a higher degree.Therefore, discretization must be performed accurately.The following equation is obtained using Equations ( 3) and ( 8): The matrices E1, E2, F, and G are also defined as follows, in which the matrix I is the identity matrix; also, s is the switching mode, and y is the output of the system.First, according to the MPC function, we obtain a continuous time model of the system.Then, we get an accurate predictive block.The discrete-time model of first-order systems can be obtained approximating its derivatives as follows, by using Euler's forward method: In the above equation, T s is the sampling time and x(k) is the state of the system at time k.This method has a significant error for systems that have a higher degree.Therefore, discretization must be performed accurately.The following equation is obtained using Equations ( 3) and (8): The matrices E 1 , E 2 , F, and G are also defined as follows, in which the matrix I is the identity matrix; also, s is the switching mode, and y is the output of the system.

Proposed Model Predictive Control (MPC) Strategy
In this section, the MPC algorithm based on the two-error technique is introduced for the single-stage inverter.This algorithm regulates the output voltage by controlling the S1, S4, S2, and S3 switches, and according to the structure of the inverter, its output voltage is equal to: In this equation, V C1 is the voltage of the first capacitor, and V C2 is the voltage of the second capacitor.The right leg of the inverter acts as a buck converter, and the left leg acts as a boost converter.We can control the output voltage by controlling the voltages of capacitors C1 and C2.

Objective Function
Equations ( 12) and ( 13) represent the objective function of the left foot and the right foot, respectively.In this regard, J1 is the left leg error, and J2 is the right leg error.
In this equation, J1 and J2 are the left and right leg error, respectively, and I ref and V ref are the reference current and voltage, respectively.Each error in this mode has four switching modes.The purpose of inverter control is to bring the output voltage to the reference value.In the proposed method, we use both inductor current and capacitor voltage errors.The relationship between the reference current and the reference voltage is as follows: where D is duty cycle, which is obtained by using the reference voltage (V ref ) and the input voltage as in Equation (15).Io is also the output current.Additionally, the reference currents according to the converter dynamics are related to the output voltage in the form of Equation (15).The reference voltage of the capacitors is also related to the input voltage.
The proposed control algorithm works as follows: First, it compares the reference voltage (V 1ref ) with the input voltage (Vb).If the reference voltage V 1ref is greater or equal to the input voltage, it applies the switching based on the improvement of the left leg error (J1).In this way, it first compares the difference in inductor current error L1 with the difference in voltage error C1.If the current error is greater, it enters the switch based on the current improvement.If the inductor current L1 has less error in any of the switching modes (0 or 1), that mode is applied to the switch, and if the voltage error is greater than the current error, the switching is applied to the system according to the improvement of the voltage error.Moreover, if the reference voltage V 1ref is less than the input voltage, the switching is applied based on the correction of the right leg error (J2).J2 is switching in the same way as J1.This process continues until the error reaches zero.The block diagram of the predictive control algorithm used in this design for the inverter is shown in Figure 6.Additionally, the inverter parameters are shown in Table 2. modes (0 or 1), that mode is applied to the switch, and if the voltage error is greater than the current error, the switching is applied to the system according to the improvement of the voltage error.Moreover, if the reference voltage V1ref is less than the input voltage, the switching is applied based on the correction of the right leg error (J2).J2 is switching in the same way as J1.This process continues until the error reaches zero.The block diagram of the predictive control algorithm used in this design for the inverter is shown in Figure 6.Additionally, the inverter parameters are shown in Table 2.

Simulation Results
The proposed control system is simulated and analyzed using MATLAB software.The values of the parameters are considered with a sampling time of 10 µs.The purpose of the control system is to maintain the output voltage of the converter at the given reference value.The reference voltage is assumed to be equal to 155 V sinusoidal and the simulation time is also 1.5 s.There are three modes of operation, each of which is equal to half a second.The first, second, and third half second of the sun radiation are equal to 700, 1000, and zero W, respectively.Moreover, the amount of battery voltage (Vb) between the boost converter and the inverter in the first, second, and third half second is equal to 100, 120, and 90 V, respectively, and the load resistance in the first, second, and third half second is 190, 95, and 190 Ω, respectively.
Figures 7-9 show the voltage, current, and power of the photovoltaic system in three time intervals, indicating that the photovoltaic system is operate at the maximum power point.Figure 9 shows the reference current tracking by the incremental conductivity algorithm and the output current of the panel.As can be seen from the figure, the reference current is synchronized with the output current of the panel in the optimal state by the incremental conductivity algorithm with high accuracy and precision.
Figures 7-9 show the voltage, current, and power of the photovoltaic system in three time intervals, indicating that the photovoltaic system is operate at the maximum power point.Figure 9 shows the reference current tracking by the incremental conductivity algorithm and the output current of the panel.As can be seen from the figure, the reference current is synchronized with the output current of the panel in the optimal state by the incremental conductivity algorithm with high accuracy and precision.The battery is charged during the day, and the battery provides voltage at night.The battery output current in charge and discharge modes is shown in Figure 10.The battery is charged during the day, and the battery provides voltage at night.The battery output current in charge and discharge modes is shown in Figure 10.The battery is charged during the day, and the battery provides voltage at night.The battery output current in charge and discharge modes is shown in Figure 10.The battery is charged during the day, and the battery provides voltage at night.The battery output current in charge and discharge modes is shown in Figure 10.In the first and second half second, we have the sun radiation, and the battery draws current from the panel and is in charging mode.However, in the third half second, because the radiation is zero, the battery flows to the load and is in discharging mode.When in charging mode, the battery draws 1.1 A from the panel, and in discharge mode, the battery flows 0.7 A to the load.
Figure 11 shows the result of controlling the inverter output voltage by the proposed MPC.Due to the fact that the signal density is high, the simulation is also performed for a time of 0.1 s.In the first and second half second, we have the sun radiation, and the battery draws current from the panel and is in charging mode.However, in the third half second, because the radiation is zero, the battery flows to the load and is in discharging mode.When in charging mode, the battery draws 1.1 A from the panel, and in discharge mode, the battery flows 0.7 A to the load.
Figure 11 shows the result of controlling the inverter output voltage by the proposed MPC.Due to the fact that the signal density is high, the simulation is also performed for a time of 0.1 s.As you can see from Figure 11, the output voltage signal of the inverter is completely sine wave and is equal to the reference value.Now, according to the results obtained from the photovoltaic system simulation, the battery and inverter are analyzed in three simulation time intervals as follows: This period of solar radiation and ambient temperature are equal to 700 W/m 2 and 25 °C, respectively, load resistance ro = 190 Ω, and every three half seconds, the reference value of the inverter output voltage is equal to 155 sinusoidal volts.According to the calculations performed in relation (2), the voltage, current, and power of the photovoltaic system are equal to 35 V, 5 A, and 175 W, respectively.As shown in Figure 7, the voltage, current, and power of the panel have reached their optimum values with high speed and accuracy, and this shows that the photovoltaic system operates at the maximum power point, and according to Figure 8, the battery takes about 1.1 A from the panel (in charging mode).During this period, the battery voltage, battery input current, and inverter output voltage are equal to 100 V, 1.1 A, and 155 V, respectively.Now, using the results obtained from charging and discharging the battery, we obtain the power received from the panel and the power consumption of the load according to the following relations: As you can see from Figure 11, the output voltage signal of the inverter is completely sine wave and is equal to the reference value.Now, according to the results obtained from the photovoltaic system simulation, the battery and inverter are analyzed in three simulation time intervals as follows: 6.1.First Half Second (0 < t < 0.5 s) This period of solar radiation and ambient temperature are equal to 700 W/m 2 and 25 • C, respectively, load resistance ro = 190 Ω, and every three half seconds, the reference value of the inverter output voltage is equal to 155 sinusoidal volts.According to the calculations performed in relation (2), the voltage, current, and power of the photovoltaic system are equal to 35 V, 5 A, and 175 W, respectively.As shown in Figure 7, the voltage, current, and power of the panel have reached their optimum values with high speed and accuracy, and this shows that the photovoltaic system operates at the maximum power point, and according to Figure 8, the battery takes about 1.1 A from the panel (in charging mode).During this period, the battery voltage, battery input current, and inverter output voltage are equal to 100 V, 1.1 A, and 155 V, respectively.Now, using the results obtained from charging and discharging the battery, we obtain the power received from the panel and the power consumption of the load according to the following relations: The photovoltaic system gives us 175 W of power, which stores 110 W in the battery and produces 63 W and has a loss of 2 W.
6.2.Second Half Second (0.5 < t < 1 s) In a period of 0.5 to 1 s, the sun's radiation is equal to 1000 W. According to Equation (1), the optimum voltage, current, and power of the photovoltaic system are 35.8volts, 7.15 A, and 256 W, respectively.According to Figure 7, the voltage, current, and power of the panel have reached their constant value at high speed.
In the second period, according to Figure 8, the battery is receiving power from the panel.As shown in Figure 9, the output voltage of the inverter is equal to the reference value (155 V), and its signal is completely sinusoidal.
According to the current and voltage, the maximum output power of the panel is 256 W. Additionally, the battery voltage, battery input current, load resistance, and inverter output voltage are equal to 120 V, 1.1 A, 95 ohms, and 155 V, respectively.Now, using the results obtained from second half second, we obtain the power received from the panel and the power consumption of the load according to the following relations: In this case, the photovoltaic system gives us 256 W of power, so the panel can provide load power (122 W) and the excess power output to the battery (132 W).The amount of loss is 2 W.

Third Half Second (1 < t < 1.5 s)
In the third half second, the radiation is zero (night mode).As you can see from Figure 7, the amount of current and power is equal to zero, and the reason why the voltage is not zero is due to the voltage stored in the capacitor between the boost converter and the panel.Eventually, the voltage is slowly discharged and becomes zero.In the third half second, due to the fact that we do not have radiation, the load power is supplied by the battery.As shown in Figure 10, the battery is discharging and gives 0.7 A to the load.Battery voltage, battery output current, load resistance, and inverter output voltage are 90 V, 0.7 A, 190 Ω, and 155 V, respectively.According to the obtained values, the output power of the system can be obtained according to the following equation: It can be seen that the battery delivers 63 W of power to the load.The output voltage THD of the inverter is shown in Figure 12: It can be seen that the battery delivers 63 W of power to the load.The output voltage THD of the inverter is shown in Figure 12: THD is a qualitative parameter and represents how close a waveform or signal is to a sinusoidal waveform.The amount of THD is expressed as a percentage, and the lower the amount of THD, the better the quality of the sinusoidal waveform.THD less than 5% is acceptable.According to Figures 3-8, THD is less than 2%; this means that in the system that has been designed, the output signal is completely sinusoidal and of high quality.
The simulation results show that the output voltage of the inverter has become the same as the reference value with high speed and high quality.

Conclusions
In this paper, a system consisting of a photovoltaic system, a DC-DC converter, and a buck-boost inverter is designed.Considering the fact that the maximum efficiency of the solar array should be used when using photovoltaic systems, in this paper, the tracking of the maximum power point has been carried out using the method of incremental conductivity and predictive control.A new method has also been used to control the inverter.This method does not require complex equations, and by simultaneously zeroing the two errors of inductor current and capacitor voltage, with the least calculations, the output voltage reaches the given reference value.The biggest advantage of this method is its simple implementation, and this technique can also be used for DC-DC converters.The purpose of this control system is to produce an output voltage equal to the reference voltage, and according to the simulation results, the inverter output voltage becomes equal to the reference value with high speed and accuracy.Moreover, the total harmonic distortion is less than 2%.As a result, the designed system has a completely sine and high-quality output signal.Finally, it can be seen that using this method, the output voltage of the inverter reaches the specified reference value with high speed and quality.For future research, we THD is a qualitative parameter and represents how close a waveform or signal is to a sinusoidal waveform.The amount of THD is expressed as a percentage, and the lower the amount of THD, the better the quality of the sinusoidal waveform.THD less than 5% is acceptable.According to Figures 3-8, THD is less than 2%; this means that in the system that has been designed, the output signal is completely sinusoidal and of high quality.
The simulation results show that the output voltage of the inverter has become the same as the reference value with high speed and high quality.

Conclusions
In this paper, a system consisting of a photovoltaic system, a DC-DC converter, and a buck-boost inverter is designed.Considering the fact that the maximum efficiency of the solar array should be used when using photovoltaic systems, in this paper, the tracking of the maximum power point has been carried out using the method of incremental conductivity and predictive control.A new method has also been used to control the inverter.This method does not require complex equations, and by simultaneously zeroing the two errors of inductor current and capacitor voltage, with the least calculations, the output voltage reaches the given reference value.The biggest advantage of this method is its simple implementation, and this technique can also be used for DC-DC converters.The purpose of this control system is to produce an output voltage equal to the reference voltage, and according to the simulation results, the inverter output voltage becomes equal to the reference value with high speed and accuracy.Moreover, the total harmonic distortion is less than 2%.As a result, the designed system has a completely sine and high-quality output signal.Finally, it can be seen that using this method, the output voltage of the

Figure 1 .
Figure 1.General schematic of the designed system.

Figure 1 .
Figure 1.General schematic of the designed system.

Figure 3 .
Figure 3. Flowchart of maximum power point tracking algorithm using predictive control.Figure 3. Flowchart of maximum power point tracking algorithm using predictive control.

Figure 5 .
Figure 5. Inverter structure in two modes: (a) S1 and S4 switches are on, (b) S1 and S4 switches are off.

Figure 5 .
Figure 5. Inverter structure in two modes: (a) S1 and S4 switches are on, (b) S1 and S4 switches are off.

Figure 6 .
Figure 6.Flowchart of new two-error predictive control algorithm for single-stage inverter.

Figure 8 . 15 Figure 8 .
Figure 8.Comparison of MPPT reference current using incremental conductivity and panel output current.