A novel RMPC strategy for three-phase inverters operating in grid-connected and standalone modes

One of the main features of microgrids is the capability of operating in both grid-connected (GC) and standalone (SA) modes. This paper presents a novel dual mode robust model predictive control (RMPC) strategy for a three-phase inverter with an LCL filter in both GC and SA operating modes under the filter’s parameter uncertainty. At first, a disturbance observer gain is obtained by solving a linear matrix inequality (LMI), which is determined to preserve the stability of the algorithm. The designed disturbance observer takes into account the polytopic uncertainty of system parameters. A performance index with two weighting matrices is then defined and solved in an infinite horizon by turning it into an optimization problem under LMI constraints. The performance of the control strategy highly depends on the weighting matrices. Hence, an optimization algorithm is formulated to ascertain the best matrices values for both GC and SA operation modes. Given the nonlinearity issue, particle swarm optimization (PSO) is employed to derive the optimal weighting matrices offline. To evaluate the proposed control strategy’s effectiveness, simulations and experiments are performed under several scenarios in both GC and SA operating modes. The results reveal the proposed control strategy’s powerfulness compared to other techniques in the presence of grid voltage and load current disturbances for both inverter operating modes.


Introduction
Inverters are among the key components of distributed generation systems that are responsible for converting the input DC voltage to AC such that it is compatible with the grid.As a prominent part of the microgrids, inverters should operate efficiently in each operating mode of GC and SA [1].In the GC mode, the inverter has to track the voltage and frequency of the main grid and inject the required power to the grid with high quality (fast convergence and zero steady-state error) at the same time.The inverter should provide the required voltage of the microgrid in SA mode to feed the local loads [2].
The robustness and stability of inverter-based distributed generation systems are highly dependent on their control strategy for both modes of operation.Many control techniques have been reported for inverters so far, which can be applied in both GC and SA operating modes [3].GC and SA control strategies could be categorized into two main types: (1) cascade linear strategies such as PID [4] and proportional resonant [5] based control methods, (2) nonlinear control strategies such as MPCbased [6], Lyapunov-based [7], knowledge-based [8], adaptive [9], and etc. Numerous studies have explored nonlinear control strategies for managing power converters.The work presented in [10] introduces a robust nonlinear optimal control technique specifically for regulating the active and reactive power in a three-phase GC inverter.This controller leverages the Hamilton-Jacobi-Bellman equation, tailored for a distinct category of disturbed nonlinear systems known as state-dependent coefficient factorized (SDCF) nonlinear systems.The objective of the controller is to minimize a quadratic cost function that considers both the tracking error and the control effort.However, this study does not address uncertainties in the parameters.The methodology is similarly applied in [11], with the addition of an integral control term to counteract unknown disturbances.The most power https://doi.org/10.1016/j.epsr.2024.110763Received 9 February 2024; Received in revised form 3 May 2024; Accepted 17 June 2024 converters in modern DGs are based on the cascade linear control strategy which allows analytical design and assure performance.The main drawbacks of such control approach could be high sensitivity, limited bandwidth, stiffness, and critical performance limitations.To overcome such disadvantages and improving the performance, robustness and flexibility of cascade linear controllers under parameter variations and disturbances, the MPC-based methods, which are among the advanced control strategies, could be a key solution [12].
MPC has found numerous applications in power electronics [13].The vast majority of MPC-based control strategies have been presented for GC and SA inverters so far.In [14], a review of MPC and its applications in power electronics is presented.Finite-set MPC (FS-MPC) is utilized in [15,16] to control the output voltage amplitude and the frequency of inverter in permitted boundary while injects the required power of local loads.FS-MPC is one of the leading advanced control methods that uses the predicted state variables of the model for every possible switching configuration.Despite many research developments, there are still some critical issues with FS-MPC methods, as highlighted below.This method typically gives variable switching frequency, which adversely affects power converter equipment and microgrid components.In [17], a new method is presented to mitigate the undesirable effects of switching frequency on power grid ingredients by filtering the cost function.The cost function weighting coefficients play an essential role in the controller performance.The optimal parameter selection problem has been solved in [18] by applying a well-trained artificial neural network to determine the weighting factors automatically.FS-MPC algorithm speed is highly dependent on the prediction horizon and the inverter configuration.To overcome this difficulty, the authors of [19] have applied the FS-MPC method to generate the training data for feeding an ANN.The FS-MPC method's main disadvantage is that it needs an accurate model of the inverter to generate rich training data for knowledge-based algorithms or determine the optimal set of control switching sequences properly.Therefore, it is vital to propose an advanced control strategy to simultaneously employ MPC's benefits and overcome all FS-MPC and cascade control strategy drawbacks.
The SA mode controller needs to be designed to have a smooth response for different situations such as step active and reactive load change and transition from GC to SA mode [20].To this end, in [21], a new MPC-based control strategy is presented for controlling a singlephase inverter in both modes of operations.The main advantage of this work is that it can automatically detect the inverter's operating mode and achieve a seamless transition when the mode changed from GD to SA and vice versa.Several weighting factors in cost function are defined to determine the modes of operation.However, this paper did not present any method to determine the optimal weighting parameters to enhance the controller performance.Besides, it needs an accurate inverter model and has a complex structure that is hard to apply in practice.In [22], a novel sliding Fourier transform-based phase-locked loop is employed, enabling adaptive and synchronized operation with seamless transition between GC and SA modes.It utilizes two distinct PI-based controllers for each mode to regulate the power generated by photovoltaic systems for linear and nonlinear loads.However, it does not account for parameter uncertainty.In [23], a droop-controlled strategy is introduced, facilitating uninterrupted load feeding during grid failures by enabling seamless transition.It incorporates a control parameter in the droop controller to determine the online controller for smooth transition but lacks a method to adjust inner loop controller parameters during transition.[24] proposes a nonlinear multimode controller for inverters, capable of operating voltage and current controllers and power compensators under various conditions.It allows the controller to switch to the desired reference value generator for seamless GC to SA transition, albeit it does not support transition from SA to GC.Table 1 compares different control frameworks, demonstrating the superiority of the proposed method over existing state-of-the-art approaches.
In this paper, a new RMPC control strategy is presented for both GC and SA operating modes of the inverter.The inverter's uncertain state-space models are determined for GC and SA operating modes in the d-q synchronous frame separately.Firstly, a disturbance observer is designed robustly to eliminate the effect of parameter uncertainty and disturbances to the inverter while guarantees the system stability.The uncertain system matrices ingredients belong to the polytypic uncertain class, consisting of the minimum and maximum pre-defined allowable boundary of inverter inductance, resistance, and capacitance.Then, the disturbance observer gain is calculated by solving an LMI to ensure system stability and robustness under parameter uncertainty.Afterward, reference signals are generated that satisfy the control purpose of voltage and current regulation in both SA and GC modes.Secondly, a performance index with two unknown weighting matrices is introduced in an infinite horizon that needs to be minimized.To this end, the MPC problem is formulated as an optimization problem subjected to some LMIs constraints.The performance of the controller highly depends on the weighting matrices selection.Therefore, an optimization method is introduced to determine optimal matrices.To this end, an auxiliary performance index is defined, which turns the problem to an NLP.Because of the problem nonlinearity, the need for the iterative solution, wide search environment, and the sensitivity to the start point, a PSO algorithm, which is among the meta-heuristic methods, is chosen to solve the NLP.Finally, two constant matrices as a disturbance observer gain to generate reference states and a feedback gain to produce control policy are obtained for each mode separately, which gives a linear control strategy with a low computational burden and easy to apply in practice.The proposed control strategy's robustness is investigated against several scenarios and parameter uncertainty for inverter in both GC and SA operating modes.The proposed RMPC algorithm uses an optimal weighting selection to ensure optimal performance for both the inverter's operating modes.The main contributions of the paper are as follows: • Two feedback gain matrices are computed as disturbance observer and feedback controller gains, resulting in a linear implementation with the benefits of minimal computing burden and ease of application in practice.• The suggested method provides two controllers for different inverter operations in GC and SA modes under parameters uncertainties.• The results are supported by mathematical proof of stability.
• By defining an auxiliary performance index, a new optimization approach for determining the optimal value of weighting matrices using PSO is presented.
The rest of the paper is organized as follows.Section 2 presents the system configuration and model for both GC and SA modes.The control strategies, disturbance observer design, MPC controller, and the optimization method are presented in Section 3. The simulation results are fulfilled in Section 4, and Section 5 presents the experimental results.Finally, the conclusion is reached in the last Section.

System configuration model
Fig. 1 depicts a three-phase inverter's topology with a local load connected to the grid through a circuit breaker.The inverter's DC source could be the regulated direct voltage of solar panels, wind turbines, or energy storage systems.The inverter consists of six power semi-conductors connected in parallel and series manner.The inverter's output is connected to an LCL filter to obtain a sinusoidal current with the minimum non-fundamental harmonics and achieving reduced switching ripple in contrast with the RL filter.The details of designing optimum value for filter parameters could be found in [33,34].  ,   and   are resistance, inductance and capacitance of inverter side filter, which may contain uncertainties.  and   are the line inductance  and resistance to the load bus.The state-space equation of inverter in grid-connected (GC) and standalone (SA) mode is: where , ,  and  are state-space matrices of the system and their values are different for each mode as follows: 1.For GC mode: 2. For SA mode: the unknown parameters are two by two matrices as follows: where  is the angular frequency and the state vectors of the system in GC and SA modes are  is the input control to the inverter in both GC and SA modes.The details of transformation from abc to d-q frame are presented in [35].The continuous-time equations of the inverter model are discretized using the Euler approximation approach as: therefore, the discrete-time state-space equations of the inverter with sampling time   is as follows: where   =  + .  ,   = . ,   =  . ,   = ,  =   and  is the identity matrix.Moreover, the dimension of each state-space matrix is determined based on the inverter operation modes, separately.Because of the uncertainty of inverter parameters, the system model's real value could be less or greater than the nominal value of the model.Assume that the parameters have the following variation range: The model with these uncertainties can be modeled as follows: where Â and B are the uncertain system's matrices.Because of the uncertainty, there are 8 possible combinations of the extreme values of minimum and maximum values of model parameters by (  ,   )( = 1, … , 8).The next section presents a robust control method to control the inverter in the presence of uncertainty and disturbance.

Control design and structure
In this section, the control structure is presented.Firstly, a disturbance observer is proposed to eliminate the effect of uncertainty and disturbance to the system model while guaranteeing the system stability.Secondly, a feedback matrix is designed to follow the reference values and minimize the performance index under the input control constraint.Finally, a new optimal weight selection algorithm is suggested to determine the weighting matrices of the performance index.

Disturbance observer
Disturbances have an adverse effect on the performance of the systems.In the following, a disturbance observer is designed to eliminate the effect of parameter uncertainty and the disturbances caused by grid voltage in GC mode and load current in SA mode.A system model with uncertainty which is described in (7) can be presented with nominal matrices as follows: where Â  and B  are the nominal dynamic matrices and   is the estimated disturbance vector.There are 8 possibilities of   and   with extreme values.To estimate the unknown disturbance (()), a disturbance observer is designed as follows [36]: using ( 8) and (10) we have: where then by assuming constant input control  0 , we have: where   () = () −  0 .By subtracting (7) from (12) we have: from ( 3) and ( 4), the dynamic of disturbance observer is as follows: ] + The stability and proper disturbance rejection depend on the gain  matrix.For the stability of ( 16),  should be chosen such that  is Hurwitz.The stability condition of the closed-loop system in the sense of Lyapunov is as follows: where  ∈ [0, 1] determines the decay rate that represents the convergence rate of the system state and  is a positive definite matrix.Using Schur complement and with the assumption of  = ( 1 ,  2 ), we have: where  = 1, … , 8 and  =  1 .A feasible solution could be obtained by solving LMI of (18) under  ,  and  that guarantees the stability and robustness of the system against parameter uncertainty and grid current and voltage disturbance in SA and GC modes.
The disturbance observer determines the reference values in each step using (11).The systems states should converge to references in an infinite horizon.In steady-state conditions, the model of system with disturbance observer is as follows: where  * () is a reference vector.For the given current references in GC mode   *  and   *  , the reference values are determined as follows: For SA mode with the reference values of   *  and   *  which are generated from the outer loop of the power controller, the reference values are calculated using ( 22)- (25).The prediction model is defined using nominal system matrices and the disturbance observer as follows: by defining   ( + 1) = ( + 1) −  * () and   () = () −  * () and subtracting ( 26) from ( 19), we have: The defined system ( 27) is a linear time-invariant system with the nominal parameter value.The diagram of the disturbance observer is depicted in Fig. 1.In the next part, an MPC method is presented for the nominal system (27) in an infinite horizon to determine the feedback gain for tracking the desire references under input control constraint.

Model predictive control design
This part presents an MPC-based controller for a linear timeinvariant system (27) to track the desire signals.MPC is a step-by-step optimization method.New measurements are acquired at each step to minimize a predetermined performance index based on the predicted states of the plant.Let consider ( + |) and ( + |) as the predicted state of the plant and input control signal at time  + , respectively.We aim to achieve the following performance index: where  and  are suitable weighting positive semi-definite matrices that indicate the performance of the designed controller.Now, by the assumption of the existence of a proper feedback matrix that minimizes the performance index (28), we have: is the feedback matrix that multiplies with the states of the system to generate the control input signals.In order to obtain  , the following quadratic function is defined: If the cost function is well-defined, then  (∞, ) = 0. We consider a bound on  ∞ () using the following formulation:  (33) with the assumption of   () =    (), we have: from ( 34) and ( 31), we get: 1) and  =   (−1) , then we have the following LMI: by summing (31) from  = 0 to ∞, we have: where  is the upper bound of the cost function in  = 0, is positive and will be minimized.Using Schur Lemma, (37) can be re-written as follows: by solving the following optimization problem, the feedback gain matrix is determined such that to the performance index is minimize and ( 28) is satisfied.

Minimize:
,  Subject to: (36) and (38) (39) The performance of the controller highly depends on the  and  selection.The proposed controller diagram with state feedback control is shown in Fig. 1.Therefore, in the next part, an optimization method is proposed to determine weighting matrices.

Optimal weight selection algorithm
The parameters of  and  are the weighing matrices of performance index which determine the convergence and the smoothness of output.The idea is to solve (39) iteratively for different  and  to determine the optimal weighting matrices.Consider the following auxiliary performance index: where  and  are reference and output signals of the inverter and  = 4 if  −  < 0, otherwise  = 2.The proposed auxiliary performance index makes the inverter's output smoother.The performance index selects the fourth power of the Euclidean norm for the outputs higher than the reference signals, and consequently makes the penalty function higher.However, for the lower output values, the performance index is forced to approach to its minimum value.Therefore, the algorithm determines  and  based on the specified performance index so that the inverter has a smooth response as well as fast convergence at the same time.Such optimization problems are known as nonlinear programming (NLP).On the other hand, since meta-heuristic methods such as PSO can search the solution space faster and more optimally than deterministic methods such as successive quadratic programming due to its nature, PSO is chosen to determine the global solution.Unlike many meta-heuristic algorithms such as simulated annealing and genetic, the PSO algorithm uses three terms of inertia, self, and the best learning ratio to communicate between particles in search space to seek the optimal solution among all possible solutions.Therefore, PSO has a faster convergence trend and determines a more precise solution close to the global one.

Robustness analysis
The gain of the disturbance observer and controller were determined robustly in the previous sections while ensuring system stability.However, stability and robustness analyses must be carried out for various degrees of uncertainty.The control state feedback gain is calculated by solving the optimization problem (39).Putting the calculated gain in (15), gives the following: By subtracting the constant value of   from both sides of ( 14) and defining w () = ŵ () −   , we have: The error equations of ( 42) and ( 43) can be combined as follows: A new variable can be defined as () = [ w ()   () ]  to check the stability and robustness of the proposed method against different parameters. where To examine the stability and robustness of the proposed controller, eigenvalues of the error dynamic are demonstrated for different values of filter's parameter.The error dynamic (44) for both cases of GC and SA modes of the inverter are considered.As can be seen from Fig. 2, the eigenvalues of the system for both mods are in the unit circle for different values of filter's parameters (  = 2.2 mH,   = 4.4 mH,   = 1.1 mH,   = 2.2 mH,   = 1.1 mH,   = 10 μF,   = 20 μF,   = 40 μF) that shows the robustness of the proposed method against parameters variation.

Simulation results
To evaluate the RMPC-based control strategy's powerfulness, several simulations have been performed on a three-phase inverter with LCL filter and a local load connected to the grid through a circuit breaker in Matlab Simulink environment based on the system depicted in Fig. 1.Besides, for the sake of comparison, the modified voltage (nonoptimal) controller [25] and RMPC-based controller with non-optimal weighting matrices are considered to demonstrate the performance of the proposed control strategy for both GC and SA modes, respectively.Table 2 presents simulation and experimental parameters.
The voltage and current waveforms of both optimal and non-optimal models simulation is depicted in Fig. 3 which includes starting in SA mode at 0.02 s with local load of  1 = 57.5 Ω, transition to GC mode at 0.5 s, step change of injected current to the grid from 10 A to 2 A at 1 s, transition to SA mode at 1.5 s, adding a local load  2 = 115 Ω at 1.8 s and removing it at 1.9 s, transition to GC mode at 2.1 s, and step change of injected current from 2 A to 10 A at 2.3 s.
Fig. 4(a) shows the performance of the proposed optimal and nonoptimal controllers in GC mode when the injected current has a step change.the -axis of the desired current (  ) rises from 2 A to 10 A at time 2.3 s.The -axis of reference current remains to zero in the whole time of the simulation.As can be seen from Fig. 4(a), the proposed RMPC control strategy with optimal weighting matrices values has a much better transient and steady-state performance than the controller with non-optimal values for tracking injected current to the grid.In the proposed method, the output current tracks the reference smoothly and more accurately without overshoot in contrast with the non-optimal controller.The optimum values of  and  are obtained using the proposed optimal weight selection algorithm.The error term in the auxiliary performance index is chosen to be the subtraction of output current and reference value in the d-q frame for the CG mode controller.
In SA mode the proposed controller uses a disturbance observer to reject the effect of load current in control domain.To show how effectively the proposed controller could operate in contrast with the modified voltage (non-optimal) controller, several simulations have been carried out, and the results are presented in Fig. 4(b).The transient performance of the voltage amplitude of the RMPC controller is much better than the modified voltage controller.Furthermore, the current waveforms for both controllers are depicted in Fig. 4(b), which is clearly observed that the proposed controller has faster convergence.
The severe transition from GC to SA and SA to GC modes could happen due to the poor design of the controller which has adverse effects on the components of the grid and inverter.Fig. 5(a) and (b) show the transition between two modes of SA to GC and GC to SA, respectively.The results illustrate that the optimal controller has a superior performance compared to non-optimal controller.

Experiment results
In this part, several experimental tests are given to demonstrate the improved performance and applicability of the suggested method.The setup is closed and experimentally validated at the Smart Converter Lab, PowerLabDK, Technical University of Denmark (DTU).The overall configuration of the experimental setup is depicted in Fig. 6.The setup consists of a bi-directional power supply, an LCL filter, a Danfoss inverter, a load, an L filter, and a three-phase SPITZENBERGER SPIES AC power amplifier, which is used as a supply simulation system.Each inductor and each capacitor are considered to be 2.2 mH and 20 μF, respectively.The local resistor is switched between 79.34 Ω and 26.53 Ω during the experimental test.The measured analog currents and voltages are digitalized with a high sample rate by utilizing the highspeed analog to digital (A2D) DS2004 board.Both proposed optimal and non-optimal controllers are simulated in the Matlab/Simulink software.To do this, a core i5, 3.4 GHz, 16 Gb RAM personal computer is employed.Next, the simulated controller is implemented on the prototyping platform dSpace RTI1006.The output signal from dSpace    needs to be converted to a suitable signal for power electronic inverter.The board DS5101 is used to generate pulse width modulator (PWM) signal, which is suitable for implementing on the inverter.
Figs. 7-9 show experimental results for inverter operation in GC and SA modes, as well as switching between these two modes.Fig. 7(a) and (b) illustrate the suggested optimal and non-optimal RMPC methods in GC mode operation, respectively, in terms of injected current tracking and transient performance.Additionally, the inverter's output voltage is shown in this figure .  is varied step-by-step from 2 A to 4 A to 6 A to 4 A to 2 A in this experiment.As shown in this figure, the output current of the non-optimal controller contains a greater number of unfavorable harmonics compared to the optimal controller.It can be shown that the optimum selection of weighting factor matrices has a substantial effect on the inverter's output waveforms.An experiment is conducted   to evaluate the efficacy of both the modified voltage controller and the suggested RMPC approach in SA operating mode.The inverter is linked to a variable resistive load ranging from 79.34 Ω to 26.53 Ω to 79.34 Ω in SA mode.Fig. 8(a) illustrates the inverter's output voltage and three-phase current during a load shift.Fig. 8(b) illustrates the behavior of modified voltage (non-optimal) controller in the presence of a load change.As shown in Fig. 8, the output voltage of the proposed RMPC controller has more quality than that of the modified voltage controller.This is because the suggested controller is optimized for exceptional performance and its regulating parameters are adjusted using the proposed optimization technique.The results indicate that when the RMPC controller is used, the inverter output current has a quicker transient response.The performance of both optimal and nonoptimal controllers is examined as the next experiment for transitioning the inverter between its two GC and SA operating modes, which is unavoidable owing to grid operation uncertainty.Fig. 9 depicts the outcome of the practical test.At first, the inverter operates in SA mode, but then the circuit breaker is closed and the operating mode switches to GC.After a while, the circuit breaker opens, enabling the inverter to operate in the SA mode.As the results demonstrate, the suggested optimal controller transitions from SA to GC more smoothly and with less fluctuation than the non-optimal controller.The output current of the inverter proves that the suggested controller can readily adjust for the impact of transition while ensuring tracking.On the other side, the suggested controller can perform better in the second case, the transition from GC to SA mode.When the mode of operation is changed from GC to SA, the output voltage rises for several cycles owing to the delay in the mode transition.After activating the SA mode controller, Fig. 9. Experimental results of inverter for transition from SA to GC and GC to SA mode, (a).optimal controller, (b).non-optimal controller.Fig. 10.The first 20 harmonics of output current of inverter, (a).simulation of GC mode with THD values of 1.44% and 0.99% for nonoptimal and optimal controller, (b).practical test of GC mode with THD values of 1.44% and 0.99% for nonoptimal and optimal controller, (c).simulation of SA mode with THD values of 0.35% and 0.24% for nonoptimal and optimal controller, (d).practical test of SA mode with THD values of 3.58% and 2.12% for nonoptimal and optimal controller.the output voltage reaches a final value in the non-optimal controller with a high time constant.However, in the optimal one, the output voltage achieves its final value considerably quicker.By and large, the optimal controller outperforms the non-optimal controller in all scenarios.
The output current of the first 20 harmonics of the inverter operating in both GC and SA mode is shown in Fig. 10 for harmonic compensation analysis.The results of both practical and simulated experiments are presented.In the experiment test, the THDs in the current signal, while the inverter is in GC mode, are 15.33% and 3.68% for the optimal and nonoptimal controllers, respectively.The optimal controller, as shown in Fig. 10, has a substantially lower harmonic.
The nonoptimal controller has a significant 11th harmonic compared to optimal one.In case of standalone operation, the output current of inverter for the proposed controller has the THD value of 2.12% while it is 3.58 in the modified voltage controller.

Conclusion
One of the advantages of microgrids is their capacity to function in both GC and SA modes.An innovative RMPC control method for a three-phase inverter with an LC filter is presented in this research.The suggested controller is reliable and ensures system stability in the face of system disruptions.To effectively counteract the effects of load current and grid voltage in the GC and SA operating modes, respectively, a disturbance observer has been developed.Two weighting matrices have been used to define the performance index in quadratic form.By multiplying model states to estimate feedback gain, which is determined by solving minimization problems under LMI constraints, control policy for the system has been developed using state feedback theory.The performance of the controller is determined by the two matrices.As a result, a different approach has been suggested for generating the best matrices to minimize the auxiliary performance index using PSO.The results indicate that in both simulation and practical settings, THD is lower when operating in GC and SA modes.

Fig. 2 .
Fig. 2. Eigenvalues of the error dynamic of the proposed method for different parameters values, (a).GC operating mode, (b).SA operating mode.

Fig. 4 .
Fig. 4. Output quantities of inverter, (a).step change of   in GC mode, (b).step change of local load in SA mode.

Fig. 5 .
Fig. 5. Output quantities of inverter during transition, (a).transition from SA to GC mode, (b).transition from GC to SA mode.

Fig. 6 .
Fig. 6.Experimental setup of the inverter connected to the AC power.

H
.Mirshekali et al.

Table 1
Comparison of methods.

Table 2
Simulation and experimental parameters.