Patent ID: 8487539

Claim:
A power supply for powering one or more light-emitting diodes comprising: a rectifier circuit coupled to a commercial AC power source and configured to provide a pulsating rectified voltage output; a switching element; a series circuit comprising the one or more light-emitting diodes and an inductive element, the series circuit coupled on a first end to the rectifier circuit and coupled on a second end to ground through the switching element; a diode coupled in parallel with the series circuit; a current sensor positioned to detect a current flowing to the light-emitting diode; a detection circuit coupled to detect a phase of the rectified voltage output, the detection circuit comprising a transistor coupled across the current sensor and a resistor coupled on a first end to the transistor; and a control circuit coupled to the switching element and to a second end of the resistor in the detection circuit, the control circuit configured to generate a PWM signal for driving the switching element at a frequency higher than a commercial power source AC frequency, the PWM signal having a pulse width determined in accordance with one or more of a feedback control based on a current detected by the current sensor and a feed-forward control based on a phase of the pulsating voltage detected by the detection circuit.