The paper focuses on an efficient method to compensate the harmonics and zero-sequence component caused by the variable unbalanced nonlinear loads. The studied compensator is based on the conventional Static Compensator (STATCOM) which is supplied by a photovoltaic generator rather than the storage passive components. That constitutes a Photovoltaic Static Compensator (PV-STATCOM). In addition to the active power production, this PV-STATCOM will improve the quality of the electric grid highly disturbed without any additional devices and costs. The used control strategy is based on the instantaneous power method and current control. The obtained results show the benefits of the photovoltaic active filter compensator to improve the energy quality. Specially, the Total Harmonic Distortion (THD) is decreased from 28.80 % to 2.03 %. The zero-sequence component of the load currents is reduced from 31.50 % to 4.26 %. The results prove also a high stabilization and limitation of the harmful repercussions of the compensator on the photovoltaic station and an automatic adapting to the solar variable radiation and to the unbalanced nonlinear load variations.