Patent ID: 7158865

Claim:
A method of providing a controlled current to an electronic device, comprising: producing a pulse-width modulation (PWM) signal to provide said current; measuring an average of said current provided to the electronic device using a dual-slope integrator, wherein said measuring an average of said current results in a measured average current; and setting a duty cycle of said pulse-width modulation signal based, at least in part, on said measuring, wherein said setting a duty cycle comprises: comparing said measured average current to an input value representing a desired average current; and regulating said duty cycle of said pulse-width modulation signal based on said comparing; wherein said duty cycle is computed by scaling said input value by a multiplicative factor and adding an additive factor; and wherein said regulating comprises: if said comparing indicates that said measured average current is less than said desired average current, increasing the additive factor by a first fixed amount; if said increasing the additive factor by a first fixed amount results in said additive factor exceeding a limit: zeroing said additive factor; and increasing said multiplicative factor by a second fixed amount; if said comparing indicates that said measured average current is greater than said desired average current, decreasing the additive factor by a first fixed amount; and if said decreasing the additive factor by a first fixed amount results in said additive factor falling below a limit: zeroing said additive factor; and decreasing said multiplicative factor by a second fixed amount.