Detailed analysis of closed-loop control of output-voltage harmonics in voltage-source inverters