The working principle of the active power filter is to detect the load current in real time, separate the harmonic currents one by one based on the specified harmonic current detection algorithm, and generate a control signal according to the set filtering percentage to drive the IGBT output with the same phase as the load harmonic current amplitude.