PID algorithm (power factor monitoring and compensation system based on PD algorithm)