A Lyapunov-Based Model Predictive Control Approach for Photovoltaic Microgrid Integration via Multilevel Flying Ca-pacitor Inverter

. In this study, we introduce a Model Predictive Control (MPC) approach based on a Lyapunov energy function, ensuring global asymptotic stability for a single-phase multilevel ﬂying capacitor inverter (FCI) that interfaces with photovoltaic systems and microgrids. The deﬁned cost function is derived from the Lyapunov energy function, harnessing the stored energy within the capacitor and inductor. This choice is rooted in the principle that as long as total energy is continuously dissipated, the system’s states will eventually reach the equilibrium point. Moreover, this cost function eliminates the need for tuning the weighting factors, a process that can be cumbersome and time-consuming due to the lack of clear guidelines. To assess the e ﬃ cacy of the proposed control strategy, we conducted simulations using MATLAB / Simulink under varying weather conditions. The results obtained demonstrate that the MPC strategy not only ensures overall stability but also delivers high-quality sinusoidal current with minimal total harmonic distortion (THD), practical low steady-state error in the grid current, and rapid dynamic response, even in the face of changing weather conditions.


Introduction
The power system is undergoing radical changes with global objectives such as decarbonization and digitalization [1].These objectives can be achieved by developing new distributed energy resources, including microgrids [2].The microgrid represents a prominent potential for future power system infrastructure [3].They can enable greener operations by integrating on-site renewable sources such as wind and solar, as well as energy storage devices.Among integrated microgrid renewable energy sources, photovoltaics are promising due to their low service costs, minimal maintenance requirements, dependability, and silent operation.This integration increases the security of local supply, reduces transmission losses, and decreases carbon emissions [4].
Power electronics plays a crucial role in microgrids as it is employed to convert and control the flow of energy between various sources and loads while ensuring a high quality of electrical energy [5].On the grid side, the converter must reduce harmonic distortion and optimize energy transfer efficiency according to demands from the grid, all while regulating the DC-link voltage level on the PV generator side.Various topologies of power electronic converters are used as interfaces between PV sources and the AC microgrid, including conventional two-level inverters and multilevel inverters.The latter provide specific technical benefits when compared to two-level inverters [6], such as lower losses and improved harmonic behavior, thus reducing or eliminating filtering requirements.In the literature, various topologies have been reported for high-and medium-power applications, including neutral point clamped inverter (NPCI) [7], flying capacitors inverter (FCI) [8], cascaded H-bridges inverter (CHBI) [9], and modular multilevel inverter (MMI) [10].
The FCI has garnered significant attention and interest in recent years due to its numerous advantages [11].These include the availability of switching state redundancies that can be employed to balance the voltage levels of the capacitors, resulting in lower semiconductor voltage.Additionally, can be employed to endure brief interruptions in power supply and severe drops in voltage [12].However, it's important to note that proper operation requires careful balancing of the capacitor voltages.Among the approaches and techniques used for controlling flying capacitor inverters, MPC can help achieve high-quality load waveforms and high-power levels [13].The current MPC used in flying capacitor inverters, as reported in references [14] and [15], requires the tuning of weighting factors in the cost function.However, this approach is not robust against parameter mismatches and uncertainties.
This paper presents a free-weighting factor MPC for a single-phase multilevel FCI interfacing PV and microgrids.The proposed controller is based on control Lyapunov function and does not require the use of weighting factors, offering improved robustness against parameter variations and uncertainties.To evaluate the performance of the proposed method, simulations have been conducted using the MATLAB/Simulink environment.The results demonstrate that the proposed controller injects power into the network with lower harmonic distortion, reduced switching losses, and minimized errors.
The remainder of this paper is structured as follows: In Section 2, we present the model of the multilevel FCI.Section 3 introduces the proposed Free-weighting factor MPC design.Simulation results are presented in Section 4. Finally, we conclude our paper in Section 5.

System modeling
The single-phase grid-connected photovoltaic energy conversion system (PVECS) is illustrated in Figure 1.It comprises a PV array, a mid-point DC-link, and a four-level FCI, which convert the extracted PV power to the microgrid through a grid-side R-L filter.
The FCI is built with three sets of power switches, each having a corresponding complementary switch, and incorporates two floating capacitors.These switches function complementary to safeguard against voltage source short-circuits, as demonstrated in the circuit layout depicted in Figure 1.Table 1 summarizes the potential switching states of a single-phase FCI along with their corresponding output voltages.

PV panel
Using Kirchhoff's law, we can derive the instantaneous model for the FCI as follows: where v dc represents the DC-link voltage, i g and v g denote the grid current and voltage, and v c1 and v c2 refer to the capacitor voltages.The variable u is the control signal vector for the inverter, given as u = u 1 , u 2 , u 3 .
Defining the state errors as , and i * g are the reference values for the capacitor voltages C 1 and C 2 and the grid current i g respectively.Using (1) the time derivative of state errors are given as where When the state errors reach zero (i.e., x1 = 0, x2 = 0 and x 3 = 0), the system attains its equilibrium point.In this situation, the total energy gradually diminishes to zero.Dissipation of energy is required to ensure asymptotic stability.Now, we shall establish the Lyapunov energy function derived from the energy storage element (i.e., inductor and capacitors of the inverter). (3) The time derivative of V(x) gives According to the Lyapunov direct method [16], if V(x) < 0, the system is stable and the state variables will converge to their reference values.In this context, the controller involves selecting a control value u at each sampling time to ensure that V(x) < 0.

Proposed control method
The primary characteristic of MPC is its reliance on a system model to forecast the future behavior of controlled variables across a prediction horizon N.This predictive information is then used by the MPC algorithm to compute the control action sequence for the system while optimizing a user-defined cost function.

Discrete-Time Model of the FCI and the MPC Framework
To formulate the prediction model for the capacitor voltages and grid current, numerical methods are employed.Specifically, the forward Euler approximation ( 5) is utilized to derive the discrete-time model of FCI.
where T s is the sampling period.For the sake of simplifying calculations, we assume that the predicted state variables are given as follows: where v i is the inverter terminal voltage, which is defined as: Now, we define the cost function g(k) of the proposed method, which directly incorporates the derivative of the Lyapunov energy function.g(k) is expressed as: where , and i * g (k + 1) are reference values extrapolated for the (k + 1) time step.The controller employs only the eight possible switching states for prediction.Subsequently, the cost function g(x) is minimized to determine the optimal control law u opt , to be applied in the upcoming sampling period.The flowchart of the proposed MPC algorithm is depicted in figure 2.

Practical stability analysis
The notion of practical stability is a less stringent form of stability compared to asymptotic stability, making it more suitable and desirable when addressing concrete problems in the real world.The term practical highlights the fact that it ensures stability only within a certain range around the reference point.
By examining the derivative of the Lyapunov function V(x) along the trajectory x(t) in the direction provided by the control law u opt over the interval [t k , t k+1 [, we can identify two cases: • case 1: x(t) belong to the stability region where V(x) < 0 (i.e., g(k) < 0).At any time t ∈ [t k , t k+1 [, the derivative of V(x) along the trajectory of the system x(t) satisfies: Noting that the duration between two switching instants is equal to the sampling time T s = t − t k .• case 2: x(t) does not belong to any stability regions, which means V(x) > 0 (i.e., g(k) > 0), In a similar manner to case 1, we have: A preliminary result can be provided regarding the duration during which case 1 is active: The control law in case 1 applies for a duration that is either shorter or equal to 2T s within an interval of NT s in length.
Based on the above lemma, we can establish the following result: The closed-loop system (System+Controller) exhibits practical stability when the period T s is small enough and the parameter N is sufficiently large.
proof: A ball is defined using the Lyapunov function: -if the control law in case 1 applies, the following inequality holds.
-if the control law in case 2 applies, the following inequality with T s is sufficiently small and ∀k ∈ {i Then, the Lyapunov function V(x) is bounded by function φ(t) and by using lemma 3.1 the relation φ(t k+1 ) ≤ φ(t k−N+1 )) holds outside the ball Ω(0, ε) and on the interval [t k−N+1 , t k+1 [ if the horizon N is chosen sufficiently large.To sum up this proof, we employ the same reasoning used in [17].Thus, if N is sufficiently substantial and T s is adequately small, the closed-loop system (1) is practically stable.

Outer Controller and Reference Generation
The primary goal of the outer loop is to maximize power extraction from the PV generator while continuously regulating the average voltage in the DC link at its reference value v * dc , as supplied by the MPPT block, and to generate the reference grid current i * g .This ensures that a stable power balance is maintained throughout the entire inverter system.For this reason, a power-to-voltage optimizer [18], for the MPPT purpose, has been chosen for this study due to its capability to adjust to rapid changes in climate conditions.Furthermore, the DC-link voltage regulation is achieved using the following proportional-integral (PI) controller: where

Simulation results and discussion
To evaluate the performance of the overall system, a numerical simulation is executed within the MATLAB/Simulink environment.The block diagram of the proposed controller is shown in figure 3, wherein the MPPT control computes the DC-link voltage reference for the outer control loop through PI controller, which, in turn, generate the current references.Subsequently, a Phase-Locked Loop (PLL) is employed to produce the in-phase grid current for the power factor correction.The corresponding parameters for both the power plant and the controller are documented in Table 2.
The dynamic response of the system was tested by implementing sudden variations in solar irradiation.At t = 1s, there was a reduction in irradiation from 1kW/m 2 to 0.8kW/m 2 and from 0.8kW/m 2 to 0.6kW/m 2 at t = 2s, as depicted in Figure 3.The illustration in Figure 5 displays both the DC-link voltage v dc and its corresponding references v * dc .It is evident that v dc closely follows its reference generated by the MPPT block, thereby guaranteeing power equilibrium between the DC and AC sides.Figure 6 displays the waveform of the injected current into the grid.As can be observed, the grid current is sinusoidal, and its magnitude varies with solar irradiation, indicating the maximum power injection into the grid.The zoomed waveform of the grid current, as depicted in Figure 7, clearly demonstrates that the grid current perfectly follows its reference.

Conclusion
A free-weighting factor MPC strategy is proposed for the multilevel FCI used in a PVintegrated microgrid.The key advantage of our approach is its assurance of global asymptotic stability, a critical requirement for reliable power conversion systems.By formulating the cost function from the Lyapunov energy function, we the need for cumbersome and time-consuming weighting factor tuning, a process that often lacks clear guidelines.Simulations conducted in MATLAB/Simulink under varying weather conditions validate the effectiveness of our proposed MPC strategy and demonstrate that the FCI can produce high-quality sinusoidal current with minimal THD, virtually zero steady-state error, and a rapid dynamic response.

Figure 1 .
Figure 1.Schematic diagram of four-level FCI interfacing PV panel and microgrid

Figure 2 .
Figure 2. The flowchart of proposed controller algorithm

Figure 3 .
Figure 3. Block diagram of a single-phase four-level FCI interfacing PV panel and an AC micro-grid

Figure 11 Figure 10 .Figure 11 .
Figure 11  illustrates the voltage output of the terminal inverter.It is evident from the figure that the FCI generates a waveform characterized by four distinct levels.

Table 1 .
Terminal voltages and corresponding switching states for four-level FCI

Table 2 .
dc represents the DC-link error, and k p and k i are positive gains.Parameters used in simulation