Patent ID: 8325505

Claim:
A power supply, comprising: an energy transfer element coupled between an input voltage source and an output of the power supply; a switch coupled to the energy transfer element, wherein the switch opens and closes in response to a drive signal; and a controller coupled to the switch to control switching of the switch to regulate an output current of the power supply, wherein the controller includes: a logic circuit coupled to generate the drive signal in response to a control signal; a constant current control circuit coupled to the logic circuit and coupled to generate the control signal in response to a received input current sense signal, input voltage sense signal, and output voltage sense signal; and an integrator included in the constant current control circuit, wherein the integrator is adapted to integrate the input current sense signal during a switching period of the control signal to generate an integrated signal representative of a charge taken from the input voltage source, wherein the constant current control circuit is adapted to generate the control signal such that the integrated signal is proportional to a ratio of the output voltage sense signal to the input voltage sense signal.