Optimization of power quality in photovoltaic module factories