Electrical – unstable PWM constant current

constant-currentled-drivermosfetoperational-amplifierpwm

I am building a four channel constant current LED driver with PWM control. I have used the following circuit (replicated four times off a quad op amp). The circuit functions OK but as I wind the set point down the square output of the circuit becomes more and more resonant until it resembles a sine wave.

The power supply rail is damped by two 470 uF capacitors between the supply rails and close to the LED positive connection.

Any suggestions as to how to remove the oscillation without damping the frequency response of the circuit, as the minimum pulse width (1 bit) of the PWM output is approximately 2 microseconds at approximately 1kHz repetition rate?

The current in the LEDs is set to 700mA and the aim is to run it from 12 V but as the PSU is increased beyond about 11 V the drive current oscillations become large and the output becomes quite unstable. For info, there is a voltage droop of about 100mV on the supply rails during the on cycle of the MOSFET.

schematic

simulate this circuit – Schematic created using CircuitLab

Best Answer

Most opamps will oscillate in this situation.

Your MOSFET gate is a capacitor. Opamps with a capacitive load lose phase margin. With enough capacitive load, phase margin becomes negative and circuit oscillates. This is normal.

To regain phase margin,

  • Add MOSFET gate resistor (starting value 100 ohms) to isolate opamp output from capacitive load
  • Replace R4 with capacitor of suitable value, like 10-100pF, to close feedback loop at HF.

Determine component values according to opamp unity gain bandwidth and output impedance using Spice simulation.

Does anyone have suggestions as to how to remove the oscillation without damping the frequency response of the circuit as the minimum pulse width (1 bit) of the PWM output is approximately 2 microseconds at approximately 1kHz repetition rate.

Your opamp is very slow. It is a CMOS opamp intended for low power DC amplification: low slew rate, low GBW, next to non-existent output drive current.

Compounding the damage is a large MOSFET, with high gate charge, therefore lots of capacitance.

Solutions:

  • Use smallest BJT or FET that will do the job (faster, lower capacitance).
  • Use suitable opamp (faster, more drive current, etc)

Also, you have to decide whether you want to:

  • use your opamp as an ON/OFF transistor driver (which IMO is... weird) which will need a reeeeeeally fast opamp with tons of drive...
  • or control average current, in which case you'd low pass filter the PWM before feeding it to the opamp, it will be much simpler, but the LED won't blink.