The invention provides a digital single cycle method control active power filter based on delay compensation, belonging to the field of digital control. The implementation of the filter comprises the following steps: (1) detecting load current and using a harmonic calculation method to calculate harmonic current ilha, ilhb, and ilhc, (2) detecting three-phase power supply voltage ea, eb and ec and DC side capacitance voltage Udc, and inputting the three-phase power supply voltage and the DC side voltage into a DSP(digital signal processor) for sampling, (3) inputting the above sampling value into a single cycle control module to calculate the duty ratio of a switch tube, and (4) multiplying the calculated duty ratio with the cycle register value of a timer in the DSP, taking the result as the value of a comparison register, controlling the DSP to generate a PWM signal, controlling the switch-on and switch-off of a switch in a converter, turning on a switch device when the PWM signal is high level, turning off the switch device when the PWM signal is low level, and thus generating compensation current. According to the active power filter, the delay effect of the active power filter can be effectively reduced.