<p>The increasing integration of decentralized production from renewable energies on the electricity grids should contribute to improving the stability and quality of the energy produced. The main objective of this work is to prove how renewable energy sources can improve the quality of electrical energy in the grid. In particular, controlled by the oriented flux technique, a double - feed induction generator DFIG driven by a wind turbine is together used to produce active power to the electrical network and to compensate the currentharmonics generated by a non - linear load, which leads to improve the supplied energy quality. The Active filtering function consists first of all in identifying the current harmonics using the theory of instantaneous active and reactive powers quality (PQ). Then, the closed loop based on the fast terminal sliding mode control (FTSMC) control allows both the generator to follow the optimal operating point of the wind turbine and to compensate for the current harmonics. The analysis and simulation results using MATLAB/Simulink confirm the effectiveness and the limits of the proposed methods and also show the performances of the law control which provides flexibility, high precision and fast response.</p>