Power quality control with distributed generation units