## 4 Control Strategy  
According to the first relation of Equation (1), the space vector \(\mathbf{i}\) of the grid currents can be controlled through the MMC space vector voltage \(\mathbf{v}_{\Sigma}\); its reference can be computed in order to  
Figure 2: Equivalent circuit of the Modular Multilevel Converter (MMC)-based PET. achieve a proper control of the active/reactive power flow from the MV grid to the PET. Indeed, the instantaneous values of the grid powers can be evaluated as  
\[P_{in}=\frac{3}{2}\mathrm{Re}\bigg{\{}\mathbf{v}\ \overset{\sim}{\mathbf{i}} \bigg{\}},Q_{in}=\frac{3}{2}\mathrm{Im}\bigg{\{}\mathbf{v}\ \overset{\sim}{\mathbf{i}}\bigg{\}} \tag{7}\]  
By expressing the space vector of the grid voltages as \(\mathbf{v}=V\ \mathrm{e}^{\mathrm{i}\theta}\) and by referring the space vector of the grid currents to the reference frame identified by the angle \(\theta\), Equation (7) can be rewritten as  
\[P_{in}=\frac{3}{2}V\ i_{d},Q_{in}=-\frac{3}{2}V\ i_{q} \tag{8}\]  
where the direct/quadrature components \(i_{d}\), \(i_{q}\) are defined by the position \(\mathbf{i}^{\langle\theta\rangle}=\mathbf{i}\ e^{-j\theta}=i_{d}+j\ i_{q}\) Equation (8) highlights the linear dependence between the grid powers and the related currents space vector components. Therefore, the control of \(P_{in},\ Q_{in}\) can be performed by a proper tracking of \(i_{d}\), \(i_{q}\), which can be effectively performed by means of simple PI regulators. While the instantaneous voltage phase \(\theta\) and magnitude \(V\) can be obtained through a dq-based three-phase PLL [19], the active power flow through the grid can be driven by a voltage controller used in order to keep constant the total energy stored in the MMC capacitors. The reference value of the reactive power is instead set to zero with the aim to maximize the system energetic efficiency, reducing the grid-side currents' RMS. The second relation of Equation (6) defines the dynamical behavior of the space vector \(\mathbf{i}_{\Delta}\) of the differential currents, which represents recirculating currents for the MMC. It should be ideally set to zero in order to minimize the RMS values of the MMC currents, but can be used for balancing purposes, i.e., phase to phase balancing and upper to lower balancing. The last relation of the Equation (6) defines, instead, the dynamical behavior of the MF transformer primary side current \(i_{R}\), which depends on the voltage difference \(v_{\Delta 0}-v_{LV}^{\prime}\). The transformer power flow is controlled by means of a PSC algorithm with Square Wave Modulation (SQM): both the MMC voltage \(v_{\Delta 0}\) and the LV-side Full Bridge Inverter voltage \(v_{LV}^{\prime}\) are forced as square waves with the same frequency \(f_{R}\) and with magnitude respectively \(V_{\Delta 0}\) and \(V_{LV}^{\prime}\); the control of the power flow computes the time shift delay \(T_{\Delta}\) of the Full-Bridge square wave with respect to the MMC square wave, which is chosen as reference in order to simplify the converter modulation implementation. By neglecting the transformer magnetizing current and the circuit resistances, the current behavior can be assumed piece-wise linear. The ideal waveforms of the primary/secondary voltages and of the primary current are depicted in Figure 3.  
Figure 3: Ideal Phase-Shift Control (PSC) with Square Wave Modulation (SQM) waveforms.