Patent ID: 7236376

Claim:
A controller for controlling an output current at a primary-side of a power supply, comprising; a waveform detector, coupled to a current sense device of said power supply to generate a current-waveform signal by sampling a primary side switching current signal, wherein said primary side switching current signal is generated by said current sense device from a primary side switching current of a transformer of said power supply; first and second control circuits, said second control circuit generating an oscillation signal to determine a switching frequency of a switching signal, wherein said switching signal is used for switching said transformer and regulating the output of said power supply; an integrator, generating an average current signal in response to said current-waveform signal and further generating an integrated signal by integrating said average current signal with a time signal, wherein said time signal is generated in accordance with said oscillation signal; and, said first control circuit including: an error amplifier, having an operational amplifier and a first reference voltage for amplifying said integrated signal; a first comparator, generating a reset signal for controlling a pulse width of said switching signal in reference to an output signal of said error amplifier, wherein said output current of said power supply is regulated in response to said first reference voltage; and a PWM circuit, generating said switching signal in response to said reset signal and said oscillation signal.