*2.1. Modeling of Two-Stage Grid-Connected Inverter*

Referring to Figure 1b, a two-stage grid-connected inverter for V2G is studied in this paper. A DC/DC converter is employed to match the battery voltage and the dc-link voltage, while the two-level inverter converts DC power to AC power absorbed by the grid.

In general, the battery voltage of EV is rated from 300 V to 400 V. However, with respect to the grid-connected inverter, the restriction between dc-link voltage and grid-side voltage must be satisfied as:

$$
u\_{dc} \geq \sqrt{2} \varepsilon\_{line} \tag{1}$$

where *udc* is the dc-link voltage of the inverter; *eline* is the line-voltage of the grid rated at 380 V as in China.

Due to the bidirectional circuit in the cascaded structure as shown in Figure 1, two operating modes can be initiated, i.e., charging mode and V2G mode. For charging mode, it has to be noticed that the DC/DC part is operated as a buck converter, while the two-level inverter is carried out as a rectifier. In turn, the system is powered by the battery if V2G mode is initiated. In this case, the DC/DC converter operated as a boost circuit upgrades the battery voltage to fulfill the requirement of *udc*. Out of the two modes, the V2G operation is targeted for this paper. Concerning the required DC/DC converter, the mathematical model can be derived as:

$$D\_{\text{boot}} = \frac{\mathfrak{u}\_{dc} - \mathfrak{u}\_{\text{bat}}}{\mathfrak{u}\_{dc}} \tag{2}$$

where *Dboost* is the duty cycle of *Sboost*; *ubat* means the battery voltage.

Next, according to the Kirchhoff voltage law, the mathematical model of the grid-connected inverter can be deduced as:

$$L\frac{d}{dt}\begin{bmatrix}\dot{i}\_a\\ \dot{i}\_b\\ \dot{i}\_c\end{bmatrix} = \begin{bmatrix}u\_{aN}\\ u\_{bN}\\ u\_{bN}\end{bmatrix} - R\begin{bmatrix}\dot{i}\_a\\ \dot{i}\_b\\ \dot{i}\_c\end{bmatrix} - \begin{bmatrix}c\_b\\ c\_b\\ c\_c\end{bmatrix} \tag{3}$$

where *L* is the output filter inductance; *R* is the line resistance; *ei* and *ii* (*i* = *a*, *b*, *c*) are the grid voltages and output currents, respectively; *uiN* is the converter-side voltage, determined by the switching states *Energies* **2020**, *13*, 1312

*Si*. For the sake of conciseness, *Si* = 1 means the upper switch of phase *i* is ON, while *Si* = 0 means the down switch is ON.

Note that (3) is established at each instant, thus, regulation of the output currents can be realized by varying the states of *Si*. However, due to the inter-coupling relationship among three phases, the design of the control strategy based on (3) is very demanding. Generally, it is widely acknowledged that the decoupling methods can be implemented at two different coordinate planes, i.e., αβ and *dq* frames. In this study, a Park's transformation with invariant amplitude criterion is applied as:

$$T\_{abc/d\eta} = \frac{2}{3} \begin{bmatrix} \cos\theta & \cos(\theta - 2\pi/3) & \cos(\theta + 2\pi/3) \\ -\sin\theta & -\sin(\theta - 2\pi/3) & -\sin(\theta + 2\pi/3) \end{bmatrix} \tag{4}$$

where θ is the angle of the *d*-axis relative to the *a*-axis.

Thereafter, the mathematical model of grid-connected inverter in *dq* frame can be deduced as:

$$
\begin{bmatrix} L \frac{d\mathbf{u}\_d}{dt} \\ L \frac{d\mathbf{l}\_q}{dt} \end{bmatrix} = \begin{bmatrix} u\_d \\ u\_q \end{bmatrix} - \begin{bmatrix} R & \alpha L \\ -\alpha L & R \end{bmatrix} \begin{bmatrix} i\_d \\ i\_q \end{bmatrix} - \begin{bmatrix} \varepsilon\_d \\ \varepsilon\_q \end{bmatrix} \tag{5}
$$

where the subscripts *d* and *q* imply the *d*-*q* axis components; ω is the angle frequency of grid voltage.

In essence, the MPC method is a discrete solution to optimize the future behavior of the system, which is applicable in the digital controller. Thus, the continuous model shown in (5) should be transformed to the discrete model. For the sake of simplicity, the future behavior of the control variables is deduced by the forward Euler method as:

$$
\begin{bmatrix} L \frac{i\_d^{k+1} - i\_d^k}{T\_s} \\ L \frac{i\_q^{k+1} - i\_q^k}{T\_s} \end{bmatrix} = \begin{bmatrix} u\_d^k \\ u\_q^k \end{bmatrix} - \begin{bmatrix} R & \alpha L \\ -\omega L & R \end{bmatrix} \begin{bmatrix} i\_d^k \\ i\_q^k \end{bmatrix} - \begin{bmatrix} e\_d^k \\ e\_q^k \end{bmatrix} \tag{6}
$$

where the superscript *k* represents the *k*th sampling period; *Ts* is the sampling period.
