A power supply comprises at least one power switch adapted to convey power between
input and output terminals of the power supply, and a digital controller adapted
to control operation of the at least one power switch responsive to an output measurement
of the power supply. The digital controller comprises an analog-to-digital converter
providing a digital error signal representing a difference between the output measurement
and a reference value, a digital filter providing a digital control output based
on a sum of previous error signals and previous control outputs, an error controller
adapted to modify operation of the digital filter upon an error condition, and
a digital pulse width modulator providing a control signal to the power switch
having a pulse width corresponding to the digital control output. A method for
controlling the power supply comprises the steps of receiving an output measurement
of the power supply, sampling the output measurement to provide a digital error
signal representing a difference between the output measurement and a reference
value, filtering the digital error signal to provide a digital control output based
on a sum of previous error signals and previous control outputs, modifying operation
of the filtering step upon an error condition, and providing a control signal to
the at least one power switch, the control signal having a pulse width corresponding
to the digital control output.