## 1 Introduction  
The global energy market, strictly dependent on fossil fuels, requires substantial changes in order to target more environmentally sustainable energy sources. Indeed, the increase of renewable energy sources (RESs), while ensuring a significant reduction in CO\({}_{2}\) emissions, requires a deep upgrade of the transmission and/or distribution network in order to capitalize the contribution of complex interconnected systems [1; 2]. This implies the adoption of an advanced electric system, which, by employing innovative technologies, ensures smart management of both energy and power flows. Indeed, the typically intermittent and non-programmable nature of RESs, needs a substantial modification of the electric grid, which must adapt to the locations and times of availability of such sources; therefore, it must ensure the energy supply required by users, operating with a novel management/control approach; in this context, the end user becomes a \"prosumer\", i.e., a producer and not just a consumer.  
This evolution process has started an infrastructure upgrade of the power grids, with the increase of system interconnections, the creation of new nodes (stations), and the development of real-time management systems. This revolution can be achieved only after an overall upgrade of the system components.  
Power Electronic Transformers (PETs) have been identified as emerging clever electronic devices in the future smart grid [3; 4; 5], especially for applications of renewable energy conversion and management [6; 7]. Considering that the PET is directly connected to a medium-voltage grid, e.g., a 20 kV distribution system, its structural issues are more complex and severe. Different topologies have been presented and discussed in the literature relating to a realization in distribution grid applications [8; 9; 10; 11]. The most consolidated topology performs either voltage transformation or power quality management, using power electronics both on primary and secondary side of a transformer that operates in medium frequency [12; 13; 14; 15]. Therefore, a frequency converter on each side of the transformer is needed. The requirements of reliability, availability, safety, and maintenance suggest the use of multilevel architectures in order to exploit their intrinsic advantages in terms of voltage withstand properties and to improve robustness to the faults in power electronics converters. Therefore, the proposed architecture for a 3-phase MV AC distribution grid is built around a Modular Multilevel Converter, based on several low-voltage cells, each one being a Full-Bridge converter with a dedicated DC-Link capacitor.  
The LV distribution grid is fed through a three-phase/four-wires Voltage Source Inverter (VSI), whereas the galvanic insulation is achieved thanks to a central single-phase transformer, which operates at high frequencies.  
This paper proposes a new modulation technique, with the aim to ensure the balancing between each submodules of the same leg of the MMC [16]. Indeed, thanks to an optimized sorting algorithm, which acts upon the compensated current leg based on a predictive correction, the capacitors voltages are kept balanced both in stationary and transient conditions.  
The system topology is described in Section 2, the mathematical model is presented in Section 3, the control strategy for MMC is reported in Section 4, while numerical results and conclusion are presented in Sections 5 and 6, respectively.