Limitation of fossil fuel reserves and environmental pollution resulting from their use, especially in cities, as well as low efficiency of current energy converters lead to the tendency towards the use of more efficient energy converters and renewable energy sources. The use of distributed generation (DG) is one of the appropriate solutions in this regard. There are various techniques provided to control these converters. In this study a new technique of Direct Power Control (DPC) is proposed to connect distributed generation sources to the nationwide grid. This technique not only adds power of distributed generation sources to the grid, but also is capable to compensate the reactive and harmonic power of non-linear loads as well. In this study, Converters’ voltage references for generating compensation current are directly calculated in synchronous rotating coordinate system in each period of sampling; then, a proper pulse width modulation (PWM) generates the used voltages. The proposed DPC technique has some advantages including simple algorithm of fast dynamic as well as fixed switching frequency and small sampling frequency. The performance of the proposed direct control technique is confirmed by simulation results.