This paper proposes a weighted Real-Time Digital Feedback Control for a grid connected Distributed Generation (DG) system (gas turbines, fuel cells, photovoltaic, wind.). The DG source is connected to the grid through a Power Conditioning Unit (PCU) consisting of a multilevel Flying Capacitors Inverter (FCI), an inductor, and a step-up transformer. The proposed controller is predictive type offering the possibility of furthering the capacitor voltages tracking, load current tracking, or a trade-off between all state variables tracking (capacitor voltages should be controlled in order to ensure a proper operation of the FCI). The Weighted Predictive Controller (WPC) transfers the power to the grid, even under grid voltage variation (sag or swell) due to its Voltage Ride Through (VRT) capability by controlling the current with unity power factor. Theoretical analysis, simulation and experimental results are described in this paper.