In order to reduce impact of grid voltage asymmetry or distortion on UPF harmonic detection algorithm, an improved UPF harmonic detection algorithm introducing PLL circuit was used to produce fundamental positive sequence voltage and correct active power, which inhibited impact of voltage distortion, while improved real-time performance of detection. Current waveforms of the power supply side before and after the compensation were compared by Matlab, which verifies feasibility of the improved algorithm. Experimental results show that harmonic content of the fifth harmonic which has the highest harmonic content is reduced from 22.8% before the compensation to 8.1% after the compensation by the improved algorithm, and the main harmonic component of the load current has been effectively inhibited, which achieves purpose of harmonic suppression.