State-Space Modeling Techniques of Emerging Grid-Connected Converters

In modern power electronics-based power systems, accurate modeling is necessary in order to analyze stability and the interaction between the different elements, which are connected to it. State space modeling seems a valid approach to study the modes of a certain system and their correlation with its states. Unfortunately, this approach may require complicated calculations and it is difficult to model advanced or emerging control techniques for grid-tied converters, such as cascaded controllers (e.g., voltage and current) and virtual synchronous generators (VSGs). Moreover, this approach does not allow an easy reconfiguration of the modeled system by adding, removing of modifying certain elements. To solve such problems, this paper presents a step-by-step approach to the converter modeling based on the Component Connection Method (CCM). The CCM is explained in detail and a practical example is given, by modeling one exemplary VSG model available in the literature. The obtained model is finally validated experimentally to demonstrate the practical accuracy of such approach.


Introduction
The transition to power systems involving more power electronics-based converters represents a challenge today. An increase in the penetration of inverter-interfaced renewable energy sources (such as wind and sun) may lead to instabilities within the power system [1,2]. For this reason, accurate converter models, taking into consideration both the converter hardware parameters and its control algorithm, will be necessary. Moreover, some grid codes are now requiring dynamic models on different degree of details for simulation and analysis at the power system level [3,4].
Several techniques are presently available for this purpose. The most popular are frequency domain analysis using impedance models and the eigenvalue analysis using state-space models [5]. Regarding the impedance models, various approaches are available in the literature [6][7][8][9][10][11], as well as experimental procedures [12] to obtain the black-box frequency response of a converter without knowing its internal parameters. Regarding the system-level analysis, the Generalized Nyquist Criterion can be used [13] if the individual equivalent impedance models are available. However, impedance models fail to provide an immediate comprehension of the poles in the system and how they are influenced by the system parameters. Moreover, by observing the Bode plot of the equivalent impedance of a converter, the effect of some poles can be canceled by corresponding zeros of the system.

State-Space Modeling Literature
With the spread of distributed generation and microgrids based on power electronics converters, accurate and efficient modeling techniques have become necessary. Such methods must guarantee flexibility (i.e., being easily applicable to different systems), scalability (i.e., can model more than one converter and can merge multiple grid sub-portions) and various detail level, depending on the specific analysis needed.
For this purpose, various levels of complexity and detail have been proposed during the years. At first, the focus was on low frequency subsynchronous oscillations, neglecting the faster behavior of current/voltage controllers [24]. In such cases, the inverter was considered as an ideal voltage source, controlled in amplitude and frequency by active and reactive droop controllers. However, such level of simplification is not always accurate in predicting instabilities or poorly damped resonances occurring at higher frequencies (innermost current or voltage control bandwidth and grid-side filters resonance frequency). Therefore, more accurate models have been proposed [25,26].
Given these requirements and summarizing the benefits of state-space modeling briefly mentioned in Section 1: • The modes of the system under study are evident in their frequency and damping. Therefore, poorly damped oscillations can be easily identified; • The interaction among the modes and the states can be analyzed by means of participation factors. The states associated with the most critical modes are then identified; • A reduced order model of the system can be obtained, by neglecting the dynamic behavior of some of its parts. This allows faster simulations without a decrease in the quality of the results.
CCM is a valid modeling approach. In fact, the main advantage of CCM is the possibility of decomposing an articulated system into its fundamental blocks, which can then be individually modeled, and the possibility of reconfiguring the system by simply adding new blocks or just modifying the interconnection matrices. Such advantage is especially beneficial when modeling a single converter unit. This allows an easy an quick derivation of the state-space model of the converter, even when a single or more control layers (e.g., current controller) or hardware component (e.g., grid side filter) are modified in a later stage of the design. CCM has been traditionally used at power system level to analyze multi-node networks with several conventional generating units or loads starting from [27]. Later, it has been specifically used to model the early grid applications of power electronics: static var compensators and HVDC transmission systems [28,29]. This method has gained renewed interest in the last decade, when it was applied to modern power electronics-based power systems. First, in 2014 CCM was applied to the specific modeling of wind farms and their connection to the main grid [8,30,31]. The same research evolved then in CCM modeling applied to multi converter power system, being able to include highly detailed inverter models (i.e., including accurate control loops and digital delays models) in wider inverter-based power systems.
CCM is currently used to analyze the stability and the interaction among conventional (i.e., phase locked loop (PLL)-based) and new controllers (i.e., Synchronverters) for renewable generation [32][33][34]. In these works, the CCM is the first stage of a more advanced state-space µ-analysis [34] to consider the uncertainties of the modeled plants.
CCM is still also currently adopted in power system studies, to include inverter-based grid nodes into larger scale studies (e.g., Subsynchronous torsional interactions [35]). In such cases, its flexibility is exploited in order to simplify the modeling procedure neglecting aspects at frequency out of the range of interest (e.g., digital control delay). The history of CCM is schematically summarized in Figure 2. Power Systems Multi-inverter systems [24] 2020 [31,32] [8, 33,34] [35] [25][26][27] Converter Interactions

Generalized CCM Modeling Approach
This section considers a step-by-step procedure to model a grid-connected three-phase two level inverter, interfaced to the grid by means of an LCL filter and is depicted in Figure 3. The DC supply of the inverter is considered to be an ideal voltage source. Thanks to the modular approach guaranteed by the CCM, a more accurate model of the DC source, or even the model of a more complex DC side, e.g., a DC microgrid [36,37], can be easily included. The grid is modeled as a Thévenin equivalent circuit.
Energies 2020, xx, 1 4 of 26 modifying the interconnection matrices. Such advantage is especially beneficial when modeling a single converter unit. This allows an easy an quick derivation of the state-space model of the converter, even when a single or more control layers (e.g., current controller) or hardware component (e.g., grid side filter) are modified in a later stage of the design. CCM has been traditionally used at power system level to analyze multi-node networks with several conventional generating units or loads starting from [27]. Later, it has been specifically used to model the early grid applications of power electronics: static var compensators and HVDC transmission systems [28,29]. This method has gained renewed interest in the last decade, when it was applied to modern power electronics-based power systems. First, in 2014 CCM was applied to the specific modeling of wind farms and their connection to the main grid [8,30,31]. The same research evolved then in CCM modeling applied to multi converter power system, being able to include highly detailed inverter models (i.e., including accurate control loops and digital delays models) in wider inverter-based power systems.
CCM is currently used to analyze the stability and the interaction among conventional (i.e., Phase Locked Loop, PLL, based) and new controllers (i.e., Synchronverters) for renewable generation [32][33][34]. In these works, the CCM is the first stage of a more advanced state-space μ-analysis [34] to consider the uncertainties of the modeled plants.
CCM is still also currently adopted in power system studies, to include inverter-based grid nodes into larger scale studies (e.g., Subsynchronous torsional interactions [35]). In such cases, its flexibility is exploited in order to simplify the modeling procedure neglecting aspects at frequency out of the range of interest (e.g., digital control delay).

Generalized CCM Modeling Approach
This section considers a step-by-step procedure to model a grid-connected three-phase two level inverter, interfaced to the grid by means of an LCL filter and is depicted in Figure 3. The DC supply of the inverter is considered to be an ideal voltage source. Thanks to the modular approach guaranteed by the CCM, a more accurate model of the DC source, or even the model of a more complex DC side, e.g., a DC microgrid [36,37], can be easily included. The grid is modeled as a Thévenin equivalent circuit.   between the components are defined by means of sparse interlinking matrices. Finally, the state-space model of the overall system is obtained by linear algebra calculation. This process is performed by the following general step-by-step procedure described below: 1. Define the system inputs U s and outputs Y s . Examples of inputs are external disturbances such as references variations (e.g., active and reactive power) and grid faults (i.e., frequency, voltage amplitude or phase variations). The outputs of the system can be chosen arbitrarily, depending on the aspect under study. Examples are the power (or current) injected by the inverter and the measured grid frequency using PLLs or VSGs. 2. Identify the single components. Two kinds of components can be used: dynamic (with state variables) and algebraic (without state variables). In general, n dynamic components and m algebraic components are identified and linearized. 3. Each k-th linearized dynamic component can be written in the following state-space form: where X k represents the state variables vector of the block, U k the inputs of the component and Y k its outputs. The matrices A k , B k , C k and D k are the component state-space matrices. Examples of the dynamic components are LCL filters and integral regulators. 4. Algebraic components are defined to simplify the modeling procedure. In a traditional state-space representation, only dynamic components are defined. However, this distinction can be very useful when it comes to the modeling of a controller. Many algebraic calculations, such as divisions, lead to complicated linearized expressions and it can be convenient to simplify the process by defining such algebraic components. They do not have state variables, but only inputs U k and outputs Y k related as: Droop controllers, sums and divisions to calculate the current reference from the active and reactive power references are examples of algebraic blocks. 5. The vector of the state variables of the global system X s is the aggregate of the X k state variable vectors of the single components. The list of the components inputs U and the list of the components outputs Y can be defined in an equivalent way as follows: 6. An aggregated model is defined by composing the individual system matrices as follows: Energies 2020, 13, 4824 6 of 25 where: In (5), it must be noted that the B a and C a matrices must be extended by adding null elements to compensate for the algebraic blocks. In particular, a number of null columns equal to the total number of inputs of all the algebraic blocks must be attached to the B a matrix. Also several null rows equal to the sum of the algebraic block outputs must be attached to the C a matrix. 7. Define the connection matrices, to connect the single components.
These matrices T are sparse and connect the inputs and outputs of the system as follows: 8. The global linearized system state-space model can be obtained as: where: Energies 2020, 13, 4824 7 of 25 when the system structure is modified, U and Y must be modified according to the new blocks, as well as the connection matrices. As mentioned in the introduction, the CCM is useful when performing a multi time scale analysis of a system. The reason behind this kind of analysis is that the most recent controllers, enabling power electronic converters provide ancillary services to the grid (e.g., VSGs) typically work on different time scales. The inner control loops (voltage, current) are operating at the time scale of the switching frequency. On the other hand, the outer level controllers, managing for example the virtual inertia, operate with time constants in the order of magnitude of seconds. To perform a simplified analysis with a traditional state-space modeling approach, the system has to be completely remodeled, meaning time loss and possibility of introducing errors. The CCM solves this problem: the user can easily exclude some levels of the system by substituting them with purely algebraic blocks. This way the computational burden for simulations is reduced, while preserving the correctness of the analysis at the time scale of interest. This simplification affects only the state variables of the k-th excluded block, but does not affect its inputs and outputs. Therefore, a dynamic block can be transformed into an algebraic block and the global system is easily derived again, without any need to change the connection matrices. The poles relative to the neglected blocks will not be present in the global system anymore. The pole map of the system and a participation factors analysis, which will be described in Section 5, are a good starting point to decide which blocks can be neglected to perform which study, since they give a clear and straightforward view of the time constant of each pole and which blocks are related to them.
Moreover, the CCM is flexible and solves also the issues related to the comparison or improvements of the inverter control and hardware. In fact, CCM decompose an articulated system into its fundamental blocks, which can then be individually modeled, and allows the reconfiguration of the system by simply adding new blocks or just modifying the interconnection matrices. Such advantage is especially beneficial when modeling a single converter unit. The benefits are especially evident in comparison to the traditional monolithic modeling approach, which has to be repeated again when any part of the system is modified. This flexibility of CCM allows an easy and quick derivation of the new state-space model of the converter, even when a single or more control layers (e.g., current controller) or hardware component (e.g., grid side filter) are modified in a later stage of the design.
A practical example of the CCM superiority can be done by comparing it with the traditional state-space modeling. The literature [18] gives examples of VSG modeling with traditional techniques. In this example the complete state-space model of a grid-connected converter controlled with a cascaded VSG is described. However, the equivalent model is obtained directly, with a monolithic approach. The result is a 19 × 19 state variable matrix, with no easy identification of which part of this matrix corresponds to which block of the converter. With the CCM, as demonstrated by the approach of (5), this is not the case. Each functional block of the system under study corresponds to a well defined matrix, which can be modified in a later stage. For example, in case a different current control strategy is implemented in a later stage of the design, its inputs and outputs will not probably change, but only its internal structure. Several controllers can be therefore compared, as well as different approximations of the delay of the digital controller.

Modeling of the S-VSC
In this section, an example of the application of the CCM is given. The system under study is the Simplified Virtual Synchronous Compensator (S-VSC). This model has been chosen as a representative of a VSG-based controller providing ancillary services to the grid. However, CCM can be applied to model any other controller available in the literature, by being a general modeling approach.
The system consists of the inverter hardware part, its control (current controller and S-VSC) and the connection to the equivalent grid, as shown in Figure 4. The system is modeled in per unit with V b base voltage, S b base power and ω b base angular speed.
More details on this model are available in the literature [23].

Defining System Inputs and Outputs
First, the inputs and the outputs of the system are defined. The system inputs U s are defined to model the possible electrical perturbations that can influence the system. In particular, step variations in the active and reactive power references (∆P * ext , ∆Q * ext ), grid frequency ∆ω g , grid voltage amplitude ∆E g and grid voltage phase angle ∆φ g variations. This choice allows full testing of the system under not-rated operating conditions.
The system outputs Y s are arbitrarily selected, depending on the quantities of interest. In this example, they have been chosen as follows: where ∆P i and ∆Q i are the active and reactive powers injected by the inverter.

Component Identification
The components are identified as shown in Figure 4. n = 4 dynamic blocks and m = 2 algebraic blocks are defined as follows: • Dynamic components: LCL filter, Inverter control loops (PI and delay model), S-VSC electrical part (stator and damper), S-VSC power loops (mechanical part and excitation control); • Algebraic components: Power reference calculation (power to current) and grid perturbation model.

LCL Filter
The inverter is connected to the grid by means of an LCL filter, as depicted in Figure 5. The filter is modeled in the (d,q) frame synchronous to the S-VSC virtual rotor position θ r , rotating at ω r .
Energies 2020, 13, 4824 9 of 25 Filter nverter is connected to the grid by means of an LCL filter, as depicted in Figure 5. T d in the (d,q) frame synchronous to the S-VSC virtual rotor position θ r , rotating at ω  The equations modeling this component (in per unit) are as follows: This block has the following state variables X LCL , inputs U LCL and outputs Y LCL : The output v pcc can be useful in the case of a multi-inverter plant where the voltage amplitude control at the plant point of common coupling (PCC) is required.
By linearizing (10), the necessary state-space matrices A LCL , B LCL , C LCL , D LCL are obtained.

Current Controller
The current controller considered in this model has a sampling time of T s and it is based on a proportional integral (PI) regulator implemented in the (d,q) synchronous reference. The proportional and integral gains of the PI regulator are k p and k i . The total delay T d = 1.5 · T s of the digital controller and the modulation is modeled with a first order Padé approximation. A higher order approximation can easily be considered by modifying this block. The controller complete block diagram is shown in Figure 6.
Delay e dq i Figure 6. Block diagram of the PI regulator and equivalent delay (PI + delay) of the digital control and modulation.
The following state variables X Inv are identified (the integrator ∆x dq i and the delay model ∆x dq d ), as well as the inputs U Inv and outputs Y Inv of this block: The state-space matrices of this block are A Inv , B Inv , C Inv , D Inv .

S-VSC Electromagnetic Equations
The electrical and magnetic equations of both virtual stator and rotor of the S-SVC [23] are (in per unit): where λ d , λ q , λ rq and λ e are the virtual flux linkages of the machine (d-axis, q-axis, damper winding and excitation, respectively); i vd and i vq are the machine virtual currents; R s and L s are the virtual stator resistance and inductance; L rq and τ rq0 are the virtual damper parameters, tuned as described in [38]. Therefore, the block state variables X Elt , inputs U Elt and outputs Y Elt are defined as follows: The state-space matrices A Elt , B Elt , C Elt , D Elt of this block are obtained from the linearization of (13).

S-VSC Power Loops Equations
The active and reactive power control equations of the S-SVC [23] are (in per unit): where P v and Q v are the virtual active and reactive power of the S-VSC. The S-VSC is always operated at zero reference power in order to obtain better stability and damping [23]. H is the inertia constant of the machine, δ is the virtual load angle of the machine (q-axis to grid voltage vector). V g is the peak value of the voltage across the filter capacitor C f and k e is the gain of the excitation control. This block state variables X Power , inputs U Power and outputs Y Power are as follows: The state-space matrices A Power , B Power , C Power , D Power of the power loops block are again obtained by the linearization of (15).

Power Reference Calculation
In this algebraic block the following calculation is performed to obtain the current references i * dq from the power references PQ * and the grid voltage v dq g : where: Are the sums of the external references and the S-VSC compensation power references. Due to the division involved in (17), a dedicated block is justified to simplify the modeling process. There are no state variables, while the inputs U Re f and outputs Y Re f of the block are: Being an algebraic block, only the D Re f matrix is obtained.

Grid Perturbations
This algebraic block generates the grid voltage variations e dq g according to the external disturbances ∆ω g , ∆E g , ∆φ g , given as system inputs. The grid voltage vector is defined as: Any phase displacement ∆φ g in the grid results in the variation of the load angle δ. As seen in the previous S-VSC power loops section, the grid frequency ∆ω g variation leads to a load angle variation and it is, therefore, included in (15). The vector diagram of the grid and S-VSC is shown in Figure 7, as well as the angle variation due to a phase jump in the grid. This block is defined by the following inputs U Grid and outputs Y Grid : And from the matrix D Grid , obtained by linearizing (20).

Aggregated Model
Once all the dynamic and algebraic blocks have been defined, the aggregated model can be obtained. First the aggregated state variables X s , inputs U and outputs Y are defined: Energies 2020, 13, 4824

of 25
Then, the aggregated model matrices are: Note that the matrices B a and C a are extended with several null elements equal to the number of inputs (8 in total) and outputs (4 in total) of the two algebraic blocks. The detailed expressions of the matrices in (23) are available in the Appendix A.

Connection Matrices
Now the connection matrices can be obtained by linking the inputs U and the outputs Y of the aggregated system together with the global inputs U s and outputs Y s . The matrix T ss is zero, since there is no direct feed-through from the system inputs to the system outputs.The detailed expressions of the connection matrices are available in the Appendix A.

Derivation of the Global State Space Model
Finally, by applying (8), the system matrices A s , B s , C s , D s are obtained. It must be noted that such model could have also been derived in a monolithic way, by studying the converter as a whole. However, by applying CCM, the model can be handled more easily and allows a quick and straightforward modification, in case some parts of the controller or of the physical system are changed. A practical and straightforward example of this advantage is the modification of the current feedback of the current controller. Usually, for grid-connected converters interfaced with LCL filters to the grid, two types of current feedbacks are adopted: grid side current feedback and converter side current feedback [39]. In the proposed example, the converter side current feedback was adopted. Therefore, the outputs of the LCL filter block Y LCL features the converter side current. However, if the current feedback is shifted to the grid side current, only the Y LCL vector and the relative matrices C LCL and D LCL must be modified. Each other block is not altered by this modification. Also the interconnection matrices are kept constant, being the two feedbacks equivalent from a signal routing point of view. A second example of the reconfiguration by adding new blocks is represented by the addition of an external droop controller. If a primary frequency regulation is required to the plant, then an extra proportional frequency controller is added, in order to generate the necessary active power references for the control. With the adopted CCM, the existing model is not modified, but an extra algebraic block is added before the reference calculation block. This extra block will receive as inputs the nominal and the actual grid frequency and generate the active droop power reference, which is then summed to the external power references.

Analysis of the Derived State-Space Model
The poles λ of the system can be obtained numerically by solving: In Figure 8, the poles of the system (also listed in Table 1) are depicted in the complex plane. The parameters of the state-space model have been chosen according to the experimental setup and are listed in Table 2. The classical observations about the stability and damping of the system can be done. Moreover, the poles of the system can visually be distinguished as follows: To clearly define which phenomena are related to the single poles, the analysis of the participation factors [14] can be performed. The participation factor p ik of the k-th state to the i-th mode is defined as: where Φ ik is the k-th value of the right eigenvector Φ i and Ψ ki is the k-th value of the left eigenvector Ψ i . From (26), the states and the modes of the system can be correlated as the results in Table 1. In this way, the poles can be associated with the physical quantities that influence them.   Table 2. Inverter and S-VSC parameters for the state-space model and of the experimental setup. From the point of view of a multi-timescale analysis, the poles whose time constants are too small or too large can be excluded to simplify the model. For example, in the considered case study, the model can be simplified to analyze the low frequency behavior of the system (e.g., integration in a wider network to study the inertial behavior of the system during a frequency drop), by neglecting the high frequency poles related to the LCL filter physical parameters and from the current controller, which can be approximated with a direct feed-through with no dynamics, being orders of magnitude faster than the electromechanical dynamics of the S-VSC. The blocks and their interconnections can be rearranged to obtain a simplified model. This simplified model is useful to study the low frequency interaction within a more complex network.

Parameter Value Parameter Value
Moreover, the state-space model allows the study of the behavior of the system under a change of parameters. A practical example is the variation of the short circuit ratio (SCR) in the connection to the grid, representing the inverse of the magnitude of the grid impedance in per unit. This analysis is especially important for wind power applications connected to very weak grids. In fact, due to the often isolated geographical positions, long cables or overhead lines connections are necessary and SCR ranging down to 1.5 or even less have been reported [40].
In Figure 9 the SCR of the system is swept from 10 to 1.5. The S-SVC damper and excitation control parameters are tuned accordingly. As it can be seen from the pole map, the poles relative to the LCL filter (1-4) are altered in their frequency, as the grid side inductance is modified. The S-VSC stator poles (9, 10) are also affected, being the stator in an equivalent series connection with the grid inductance. The effect is a lower damping of such poles that can be however easily compensated for by increasing the virtual stator resistance R s . Finally, the low frequency mechanical poles (13-15) do not lose damping, thanks to the tuning algorithm described in [38], but only change their natural frequency. The excitation control pole (16) is not modified, as it is tuned to always obtain the desired time constant.
As previously mentioned, the state-space model can be used for a wide range of analyses. Analyses of interest are, for example, the pole map for different operating points (i.e., operation under load) and the pole variation due to the influence of parametric uncertainty of the physical components (i.e., grid inductance, filter parameters) on the tuning of both the controllers and the VSG.

Experimental Validation
The obtained state-space model can then be verified by a comparison with either a simulation of the complete system (e.g., Simulink, PLECS, PSCAD and other simulation tools can be used) or experimentally.
In this case, the S-VSC has been implemented on a dSPACE DS 1007, controlling a 15 kVA three-phase inverter connected to a grid emulator, as shown in Figure 10. The control runs at f s = 10 kHz, which also corresponds to the switching frequency f sw of the converter. The parameters of both the experimental setup and the S-VSC are listed in Table 2.
The following four tests have been performed to validate the state-space model using all the five available inputs ∆P * ext , ∆Q * ext , ∆ω g , ∆E g and ∆φ g : 1.
Step drop of Grid frequency ∆ω g ; 4. Grid voltage drop ∆E g with phase jump ∆φ g .
In the first test ( Figure 11) the active power fed to the grid and the frequency of the S-VSC are compared with the outputs of the state-space model. The active power reference rises from 0.2 pu to 0.3 pu at t = 0.2 s. This choice allows a more general test of the state-space model. In fact, as it can be seen in (A5), a large part of the matrix D s depends on the initial active and reactive power references P * 0 and Q * 0 . Therefore, a non zero initial power operating point has been chosen, better to verify this part of the model. As it can be seen from Figure 11 both the S-VSC virtual speed ω r and the injected active power are similar to the results from the state-space model. The state space-model, as it has been described, does not take into account the non-ideal behavior of the measurement process (e.g., noise, delays), which on the other hand may affect the experimental setup. In the second test (Figure 12), the reactive power injected by the inverter is compared, when the reactive power reference rises from 0.1 pu to 0.2 pu. As with Test 1, the initial non-zero operating point has been chosen better to test the model. Also in this case, the obtained model is accurate enough to simulate the step transient in the reactive power reference. Again, the state-space model is not including the non-ideal behavior of the experimental setup. This non-ideal behavior can be neglected when dealing with longer timescales, such as in Test 2. In fact, the delays and the noise act with much shorter time constants, which do not affect the behavior during these transients (operating in the time scale of seconds). Test 3 ( Figure 13) deals with the input relative to the grid frequency variation ∆ω g . A step frequency variation of −0.2 Hz has been applied by the grid emulator. The S-VSC tries to compensate the frequency drop by injecting active power into the grid, providing a virtual inertial effect. The state-space model well predicts both the S-VSC speed ω r profile (Figure 13a) and the amount of active power injected (Figure 13b). The modeling of the frequency variations, as obtained here, can be useful in system level studies, when analyzing frequency regulation and inertial support. This kind of analysis also helps studying the inertial effect resulting from a different tuning of the S-VSC (the key parameters are in this case the inertia constant H and the virtual damper parameters τ rq0 and L rq , which are directly related to the electromechanical damping ζ of the virtual machine [38]). Finally, Test 4 ( Figure 14) validates the behavior of the system in case of a realistic grid fault. During the fault, the voltage of the grid drops to 95% of its nominal value and a phase jump of −5 • is applied. For such tests, the quantities of interest are the reactive power injected into the grid (Figure 14a) to provide reactive support and the virtual excitation flux of the S-VSC λ e (Figure 14b) to evaluate the time constant of the excitation control. As expected, the state-space model is well predicting both the shape and the amplitude of such quantities, proving itself as a good analysis tool to correctly tune the S-VSC to guarantee the desired reactive response during grid faults.

Conclusions
In this paper, a general step-by-step procedure to easily obtain the state-space model of a grid-connected converter equipped with advanced cascaded controllers using CCM is presented. This mathematical method is suitable to model cascaded controllers with interconnected signals thanks to its modular approach. Moreover, it is easily possible to modify or reconfigure the system, without remodeling it.
This approach can be used to derive state-space models of grid-tied inverters equipped with advanced cascaded controllers or emerging control techniques, such as VSGs in order to study and simulate the stability of a power system with a higher integration of renewable energy sources. In addition, state-space models are favorable in case of multi-timescale analysis of the system: the eigenvalues of the system can be obtained, as well as their correlation to the system state variables. Therefore, simplified models can be obtained, neglecting high or low frequency phenomena which are out of the scope of the analysis.
The single models obtained following this procedure can represent a useful tool for both power electronics designers and grid operators. The first can obtain preliminary information on the weak Energies 2020, 13, 4824 20 of 25 spots of the system they are designing and test their behavior under different operating conditions. From the grid side, such models would be provided by the manufacturers with different level of details [3,4] to be integrated in a more system-level analysis.
This step-by-step approach has been verified with a practical example of the modeling of a VSG model (S-VSC), which is then validated experimentally on a 15 kVA grid-connected inverter.

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
The following abbreviations are used in this manuscript:

Appendix A
The subscript 0 indicates the value around which the linearization is performed.