# An MPC Approach for Grid-Forming Inverters: Theory and Experiment

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

_{d*}and v

_{q*}are its d and q components, respectively, while v

_{d}(v

_{q}) is the measured direct (quadrature) axis voltage; i

_{d}(i

_{q}) is the measured direct (quadrature) axis current and i

_{d*}(i

_{q*}) is the corresponding reference; finally U

_{d}(U

_{q}) is the d (q) component inverter AC side voltage.

## 2. Some Remarks about the MPC Technique

_{s}, being T

_{s}the sampling time. The MPC regulator acts to control the states of the system to a reference value

**x**

_{ref}by computing the solution of the following constrained quadratic programming (QP) problem:

**e**

_{k}is the state vector error,

**x**

_{k + 1|k}refers to the prediction of the state at time (k + 1)T

_{s}calculated at time kT

_{s}and N is the prediction horizon, i.e., the number of samples taken into account in the forecast. ${\mathit{U}=[\mathit{u}}_{k}^{T}{\dots \mathit{u}}_{k+N-1}^{T}{]}^{T}$ is the vector containing the optimal input vector

**u**

_{k}, while Q = Q

^{T}, R = R

^{T}are symmetric and positive semi-definite weighting matrices. H

_{u}, K

_{u}, H

_{x}, K

_{x}are the matrices that define the constraints for the controlled system. The MPC controller generates the control action using this strategy: at each step the control solves the optimization problem (2), predicts the evolution of the state variables based on their current values and calculates the optimal input for the system within the control horizon. Then, only the first step

**u**

_{k}is applied to the system while the rest of the solution is just discarded. The process is then repeated: a new prediction of the evolution of the states is calculated based on the measurements of their current value, and another set of optimal control action is produced (Figure 3).

_{s}a linearization procedure around

**x**

_{k}is required to obtain the system described in (1). More details can be found in [33].

## 3. MPC Controller Design for Grid-Forming Inverters

- AC side of the MG is supposed to be at steady state while DC dynamics are fully considered;
- Higher-order harmonics are neglected;
- DC inductor is neglected;
- The shunt section of the AC filter is neglected.

_{a}is the inverter modulation index, V

_{dc}is the DC link voltage and V

_{ac}is the line-to-ground voltage at the harmonic-filter output. The phase angles can be written as follows:

_{f}is the AC bus frequency measured via phase lock-loop (PLL). In the following equations, the explicit time dependence will be omitted for notation simplification. The active power flow P

_{a}

_{c}injected by the unit into the MG is given by:

_{f}is the longitudinal reactance of the harmonic-filter at rated frequency. Obviously, if the AC filter is composed of an LCL configuration, x

_{f}represents the sum of the two reactances in series according to the former hypothesis.

_{dc}is the power coming from the DC source that can be written as:

_{dc}is a given function of V

_{dc}depending on the specific nature of the source.

**u**= [m

_{a}, ω]

^{T}is the input vector, i.e., the variable to be provided by the controller,

**x**= [V

_{dc}, δ]

^{T}is the state vector and

**g**= [V

_{ac}, σ, ω

_{f}]

^{T}is a vector that collects measurements and estimated variables. In particular, V

_{ac}and ω

_{f,}can be easily measured, while σ can be estimated as follows:

^{*}linearizing System (17) around

**x**(t

^{*}). Performing the linearization procedure, System (17) becomes:

_{s}

**.**Since during the prediction the time evolution of the measurements are unknown, they are supposed to remain constant during the prediction horizon N, i.e.,

**g**

**is considered as a state with no dynamics as described by the following equation:**

_{k}_{a}as a control variable for the system, its derivative J is taken as an input. Thus, a new dynamic equation m

_{a,k + 1}= m

_{a,k}+ T

_{s *}J

_{K}is added to (25). The resulting general DG model of the kind (1) necessary for the prediction computed by the controller is written as:

_{ac}can be expressed as a combination of state and input as follows:

_{ac}formulation composed of just states, inputs and constants:

_{ac,ref}the reference for V

_{ac}, one can define e = V

_{ac}− V

_{ac,ref}and ${\tilde{u}}_{ref}={\left[{\omega}_{n}0\right]}^{T}$ (where the zero in the second component of ${\tilde{u}}_{ref}$ means that the control objective is to obtain a constant modulation index no matter its value).

_{ω}; R

_{J}), where R

_{ω}and R

_{J}represent the weights for the input and Q

_{V}is the weight for the voltage error.

## 4. Experimental Setup

_{1}and Load

_{2}with a resistance of 66 Ω and 160 Ω, respectively. The inverter is a Danfoss FC 302, rate current 8.2 A. The inverter is controlled via a dSPACE DS 1103 real-time controller, whose board was used to collect the measured signals and to drive the inverter. The control algorithm is developed in MATLAB/Simulink (2017b, Natick, MA USA), while some parts of code are made as C++ (Microtec PowerPC C/C++ Compiler Ver. 3.8.61, dSPACE, Paderborn, Germany) functions in order to solve the QP problem in real-time. In these experiments, the QP problem was solved using qpOASES (v 3.0, OPTEC) [36,37], an open-source library for C++, which proposes some simplified tools for this kind of interface in which more than one software is involved. In Table 2, it is possible to find the control variables used in the experimental test described in the following section.

## 5. Experimental Results

_{1}is connected. Secondly, Load

_{2}is connected in parallel with Load

_{1}at 16 s, before being disconnected at 19.5 s. Finally, at 22.3 s, Load

_{1}is also disconnected, leaving the system in a no-load condition.

_{ac,ref}± 10%. Instead, Figure 11 shows the active power supplied by the converter.

^{2}/66 = 464 W. Then, at about 16 s, power increases due to the connection of the second load up to ((1/66) + (1/165)) * 175

^{2}= 650 W before reducing progressively up to almost zero (compensating losses in the system). Looking together at Figure 10 and Figure 11, one can notice how the voltage regulation has low sensitivity to power variation, providing a very satisfactory result for the inverter operation. For the sake of completeness, Figure 12 and Figure 13 report the two MPC controller outputs i.e., the modulation index and the modulation frequency.

_{s}) equal to 1 ms.

## 6. Conclusions

## Author Contributions

## Funding

## Conflicts of Interest

## Appendix A

_{dc}; I

_{dc}) obtained with 23 different values of the resistor R

_{c}in the range (50 Ω–∞) (see dots in Figure 9). Current and voltage measuring devices appear in Figure A1. Then a fitting tool (e.g., Matlab Basic Fitting) allowed to obtain an analytical relationship I

_{dc}(V

_{dc}) between DC voltage and current that best fits experimental data. In this work, a 5th order polynomial is used, whose coefficients are listed in Table A1.

5th | 4th | 3th | 2th | 1th | 0 |
---|---|---|---|---|---|

−2.5 × 10^{−7} | 7.87 × 10^{−4} | −0.471 | 114 | −2.12 × 10^{4} | 1.27 × 10^{6} |

## References

- Bendato, I.; Bonfiglio, A.; Brignone, M.; Delfino, F.; Pampararo, F.; Procopio, R. Definition and on-field validation of a microgrid energy management system to manage load and renewables uncertainties and system operator requirements. Electr. Power Syst. Res.
**2017**, 146, 349–361. [Google Scholar] [CrossRef] - Bendato, I.; Bonfiglio, A.; Brignone, M.; Delfino, F.; Pampararo, F.; Procopio, R.; Rossi, M. Design criteria for the optimal sizing of integrated photovoltaic-storage systems. Energy
**2018**, 149, 505–515. [Google Scholar] [CrossRef] - Bonfiglio, A.; Brignone, M.; Delfino, F.; Invernizzi, M.; Pampararo, F.; Procopio, R. A technique for the optimal control and operation of grid-connected photovoltaic production units. In Proceedings of the 2012 47th International Universities Power Engineering Conference (UPEC), Middlesex, UK, 4–7 September 2012; pp. 1–6. [Google Scholar]
- Olivares, D.E.; Mehrizi-Sani, A.; Etemadi, A.H.; Cañizares, C.A.; Iravani, R.; Kazerani, M.; Hajimiragha, A.H.; Gomis-Bellmunt, O.; Saeedifard, M.; Palma-Behnke, R.; et al. Trends in Microgrid Control. IEEE Trans. Smart Grid
**2014**, 5, 1905–1919. [Google Scholar] [CrossRef] - Shrivastwa, R.; Hably, A.; Melizi, K.; Bacha, S. Understanding Microgrids and Their Future Trends. In Proceedings of the IEEE ICIT 2019, Melbourne, Australia, 13–15 February 2019. [Google Scholar]
- Bonfiglio, A.; Barillari, L.; Bendato, I.; Bracco, S.; Brignone, M.; Delfino, F.; Pampararo, F.; Procopio, R.; Robba, M.; Rossi, M. Day ahead microgrid optimization: A comparison among different models. In Proceedings of the OPT-i 2014—1st International Conference on Engineering and Applied Sciences Optimization, Kos, Greece, 4–6 June 2014; pp. 1153–1165. [Google Scholar]
- Fornari, F.; Procopio, R.; Bollen, M.H.J. SSC compensation capability of unbalanced voltage sags. IEEE Trans. Power Deliv.
**2005**, 20, 2030–2037. [Google Scholar] [CrossRef] - Gonzalez-Longatt, F.M.; Bonfiglio, A.; Procopio, R.; Verduci, B. Evaluation of inertial response controllers for full-rated power converter wind turbine (Type 4). In Proceedings of the 2016 IEEE Power and Energy Society General Meeting (PESGM), Boston, MA, USA, 17–21 July 2016; pp. 1–5. [Google Scholar]
- Bonfiglio, A.; Invernizzi, M.; Labella, A.; Procopio, R. Design and Implementation of a Variable Synthetic Inertia Controller for Wind Turbine Generators. IEEE Trans. Power Syst.
**2019**, 34, 754–764. [Google Scholar] [CrossRef] - Rocabert, J.; Luna, A.; Blaabjerg, F.; Rodríguez, P. Control of Power Converters in AC Microgrids. IEEE Trans. Power Electron.
**2012**, 27, 4734–4749. [Google Scholar] [CrossRef] - Viinamäki, J.; Kuperman, A.; Suntio, T. Grid-Forming-Mode Operation of Boost-Power-Stage Converter in PV-Generator-Interfacing Applications. Energies
**2017**, 10, 1033. [Google Scholar] [CrossRef] [Green Version] - IEEE Life Senior Member Daley PE DGCP; IEEE Member Houser PE. Assessment of DER Interconnection Installation for Conformance with IEEE Std 1547. In Assessment of DER Interconnection Installation for Conformance with IEEE Std 1547; IEEE: Piscataway, NJ, USA, 2018; pp. 1–18. [Google Scholar]
- Hou, X.; Sun, Y.; Yuan, W.; Han, H.; Zhong, C.; Guerrero, J. Conventional P-ω/Q-V Droop Control in Highly Resistive Line of Low-Voltage Converter-Based AC Microgrid. Energies
**2016**, 9, 943. [Google Scholar] [CrossRef] [Green Version] - Italian Standard C. CEI 0-16—Technical Rules for the Connection of Active Passive Consumers to the HV MV Electrical Networks of Distribution Company; CEI: Milan, Italy, 2008. [Google Scholar]
- IEEE. IEEE. IEEE Standard for Interconnection and Interoperability of Distributed Energy Resources with Associated Electric Power Systems Interfaces. In IEEE Std 1547-2018 (Revision of IEEE Std 1547–2003); IEEE: Piscataway, NJ, USA, 2018; pp. 1–138. [Google Scholar] [CrossRef]
- Bouzid, A.M.; Guerrero, J.M.; Cheriti, A.; Bouhamida, M.; Sicard, P.; Benghanem, M.J.R.; Reviews, S.E. A survey on control of electric power distributed generation systems for microgrid applications. Renew. Sustain. Energy Rev.
**2015**, 44, 751–766. [Google Scholar] [CrossRef] [Green Version] - Serban, I.; Ion, C.P.; Systems, E. Microgrid control based on a grid-forming inverter operating as virtual synchronous generator with enhanced dynamic response capability. J. Electr. Power Energy Syst.
**2017**, 89, 94–105. [Google Scholar] [CrossRef] - Hirase, Y.; Abe, K.; Sugimoto, K.; Sakimoto, K.; Bevrani, H.; Ise, T. A novel control approach for virtual synchronous generators to suppress frequency and voltage fluctuations in microgrids. Appl. Energy
**2018**, 210, 699–710. [Google Scholar] [CrossRef] - Liu, J.; Miura, Y.; Ise, T. Comparison of Dynamic Characteristics between Virtual Synchronous Generator and Droop Control in Inverter-Based Distributed Generators. IEEE Trans. Power Electron.
**2016**, 31, 3600–3611. [Google Scholar] [CrossRef] - Arghir, C.; Jouini, T.; Dörfler, F. Grid-forming control for power converters based on matching of synchronous machines. Automatica
**2018**, 95, 273–282. [Google Scholar] [CrossRef] [Green Version] - Huseinbegovic, S.; Perunicic-Drazenovic, B. A sliding mode based direct power control of three-phase grid-connected multilevel inverter. In Proceedings of the 2012 13th International Conference on Optimization of Electrical and Electronic Equipment (OPTIM), Brasov, Romania, 24–26 May 2012; pp. 790–797. [Google Scholar]
- Li, Z.; Zang, C.; Zeng, P.; Yu, H.; Li, S.; Bian, J. Control of a Grid-Forming Inverter Based on Sliding-Mode and Mixed ${H_2}/{H_\infty }$ Control. IEEE Trans. Ind. Electron.
**2017**, 64, 3862–3872. [Google Scholar] [CrossRef] - Vazquez, S.; Rodriguez, J.; Rivera, M.; Franquelo, L.G.; Norambuena, M. Model Predictive Control for Power Converters and Drives: Advances and Trends. IEEE Trans. Ind. Electron.
**2017**, 64, 935–947. [Google Scholar] [CrossRef] [Green Version] - Hans, C.A.; Braun, P.; Raisch, J.; Grune, L.; Reincke-Collon, C. Hierarchical Distributed Model Predictive Control of Interconnected Microgrids. IEEE Trans. Sustain. Energy
**2018**, 10, 407–416. [Google Scholar] [CrossRef] [Green Version] - Zheng, Y.; Li, S.; Tan, R. Distributed Model Predictive Control for On-Connected Microgrid Power Management. IEEE Trans. Control Syst. Technol.
**2018**, 26, 1028–1039. [Google Scholar] [CrossRef] - Morstyn, T.; Hredzak, B.; Aguilera, R.P.; Agelidis, V.G. Model Predictive Control for Distributed Microgrid Battery Energy Storage Systems. IEEE Trans. Control Syst. Technol.
**2018**, 26, 1107–1114. [Google Scholar] [CrossRef] [Green Version] - Bonfiglio, A.; Oliveri, A.; Procopio, R.; Delfino, F.; Denegrí, G.B.; Invernizzi, M.; Storace, M. Improving power grids transient stability via Model Predictive Control. In Proceedings of the 2014 Power Systems Computation Conference, Wroclaw, Poland, 18–22 August 2014; pp. 1–7. [Google Scholar]
- Babqi, A.J.; Etemadi, A.H. MPC-based microgrid control with supplementary fault current limitation and smooth transition mechanisms. IET Gener. Trans. Distrib.
**2017**, 11, 2164–2172. [Google Scholar] [CrossRef] - Tavakoli, A.; Negnevitsky, M.; Muttaqi, K.M. A decentralized model predictive control for multiple distributed generators in the islanded mode of operation. In Proceedings of the 2015 IEEE Industry Applications Society Annual Meeting, Addison, TX, USA, 18–22 October 2015; pp. 1–8. [Google Scholar]
- Anderson, S.; Hidalgo-Gonzalez, P.; Dobbe, R.; Tomlin, C.J. Distributed Model Predictive Control for Autonomous Droop-Controlled Inverter-Based Microgrids. In Proceedings of the 2019 IEEE 58th Conference on Decision and Control (CDC), Nice, France, 11–13 December 2019; pp. 6242–6248. [Google Scholar]
- Dragicevic, T.; Alhasheem, M.; Lu, M.; Blaabjerg, F. Improved model predictive control for high voltage quality in microgrid applications. In Proceedings of the 2017 IEEE Energy Conversion Congress and Exposition (ECCE), Cincinnati, OH, USA, 1–5 October 2017; pp. 4475–4480. [Google Scholar]
- Alhasheem, M.; Blaabjerg, F.; Davari, P. Performance Assessment of Grid Forming Converters Using Different Finite Control Set Model Predictive Control (FCS-MPC) Algorithms. Appl. Sci.
**2019**, 9, 3513. [Google Scholar] [CrossRef] [Green Version] - Allgöwer, F.; Zheng, A. Nonlinear Model Predictive Control; Birkhäuser: Basel, Switzerland, 2012; Volume 26. [Google Scholar]
- Bonfiglio, A.; Brignone, M.; Invernizzi, M.; Labella, A.; Mestriner, D.; Procopio, R. A Simplified Microgrid Model for the Validation of Islanded Control Logics. Energies
**2017**, 10, 1141. [Google Scholar] [CrossRef] [Green Version] - Bonfiglio, A.; Delfino, F.; Labella, A.; Mestriner, D.; Pampararo, F.; Procopio, R.; Guerrero, J.M. Modeling and Experimental Validation of an Islanded No-Inertia Microgrid Site. IEEE Trans. Sustain. Energy
**2018**, 9, 1812–1821. [Google Scholar] [CrossRef] [Green Version] - Ferreau, H.J.; Kirches, C.; Potschka, A.; Bock, H.G.; Diehl, M. qpOASES: A parametric active-set algorithm for quadratic programming. Math. Programm. Comput.
**2014**, 6, 327–363. [Google Scholar] [CrossRef] - Ferreau, H.J.; Bock, H.G.; Diehl, M. An online active set strategy to overcome the limitations of explicit MPC. Int. J. Robust Nonlinear Control IFAC-Affil. J.
**2008**, 18, 816–830. [Google Scholar] [CrossRef]

**Figure 1.**Elementary scheme for (

**a**) grid forming; (

**b**) grid feeding; (

**c**) grid supporting acting as voltage source; (

**d**) grid supporting acting as current source (adapted from [6]).

**Figure 2.**Grid-forming base control scheme (adapted from [16]).

**Figure 8.**Experimental setup details at Niš University: 1—PC with dSpace DS1103; 2—LCL filter; 3—Variable load; 4—DC source; 5—grid inverter; 6—Current sensors; 7—Voltage sensors.

C | 1.1 mF | R_{Lg} | 11 mΩ |
---|---|---|---|

L | 2.35 mH | C_{f} | 3.3 μF |

L_{i} | 28 mH | L_{g} | 1.3 mH |

R_{Li} | 0.17 Ω |

Q_{V} | 3 | f_{min} | 49.5 Hz |
---|---|---|---|

R_{ω} | 10 | f_{max} | 50.5 Hz |

R_{J} | 5 | m_{a,min} | 0.18 |

N | 3 | m_{a,max} | 1.156 |

ω_{n} | 314.159 rad/s | A_{max} | 4 kVA |

© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Labella, A.; Filipovic, F.; Petronijevic, M.; Bonfiglio, A.; Procopio, R.
An MPC Approach for Grid-Forming Inverters: Theory and Experiment. *Energies* **2020**, *13*, 2270.
https://doi.org/10.3390/en13092270

**AMA Style**

Labella A, Filipovic F, Petronijevic M, Bonfiglio A, Procopio R.
An MPC Approach for Grid-Forming Inverters: Theory and Experiment. *Energies*. 2020; 13(9):2270.
https://doi.org/10.3390/en13092270

**Chicago/Turabian Style**

Labella, Alessandro, Filip Filipovic, Milutin Petronijevic, Andrea Bonfiglio, and Renato Procopio.
2020. "An MPC Approach for Grid-Forming Inverters: Theory and Experiment" *Energies* 13, no. 9: 2270.
https://doi.org/10.3390/en13092270