A novel software implementation for current polarity detection and current compensation is presented. For a three-phase zero-voltage soft-switching (ZVS) PWM converter based on phase and amplitude control (PAC), when saw-tooth carriers with alternate positive and negative slopes are adopted, the positive or negative slopes are chosen according to the phase current polarity. Since po-larity reversal causes current distortion, current at the instant of reversal should be compensated for. Based on the characteristic of unity power factor converter in rectification and regeneration modes, a software implementation for current polarity detection is proposed. Distortion of current zero-crossing caused by using saw-tooth carriers with alternate positive and negative slopes is analyzed, and the relevant compensation method is proposed. Experimental study with a 1.5 kW device shows that phase current has a small harmonic content and power factor is high both in rectification and regeneration modes.