A PFC AC-to-DC power supply is disclosed. According to various
embodiments, the PFC AC-to-DC power supply comprises a switching
converter comprising at least one main power switch and a PFC controller
for controlling the at least one main power switch. The PFC controller
may comprise a processing unit comprising a processor and a memory having
firmware stored thereon which, when executed by the processor, causes the
processor to compute an input current set point for the AC-to-DC power
supply based on the output voltage of the AC-to-DC power supply. The PFC
controller may also comprise hardware circuitry in communication with the
processing unit. The hardware circuitry may comprise a first a/d
converter, such as a window a/d converter, for outputting a digital input
current error value based on the input current of the AC-to-DC power
supply and an analog form of the input current set point from the
processing unit. The hardware circuitry may also comprise a digital
current mode compensator in communication with the first a/d converter
for determining the duty cycle for the at least one main power switch
based on the digital input current error value from the a/d converter.