Why is my current source oscillating? - Page 1
Forum section: electronics / projects

author: arildj78
author_rank: Regular Contributor
timestamp: August 18, 2019, 09:48:13 am
content: I'm trying to build a LED current source based on figure 4.13 in The Art of Electronics - third edition. I'd like it to supply .5 to 1A while not burning to much power in U1 or R1. Now I tried to simulate but the current through D1 oscillates like crazy. Obviously there is positive feedback going on but according to the textbook, R2C1 was supposed to help with that. I tried to remove them and play with the values but it didn't make much of a difference.I have not bought the parts yet so I have not breadboarded the circuit. Can anyone help me with the stability analysis?The P-channel MOSFETSi3417DVSpice modelThe OpAmpLMC6482Spice modelThe LEDsCree® XLamp® XP-E2 LEDSpice modelEdit: Fixed typo in subject

author: OM222O
author_rank: Frequent Contributor
timestamp: August 18, 2019, 12:14:52 pm
content: your design is quite unconventional AFAIK. the oscillations are due to AC loop stability, but your bigger issue would be the control signal / accuracy. to minimize power loss in R1 (shunt resistor) it should be as small as possible. 1\$\Omega\$ @1A is 1Watt. so something like 100m\$\Omega\$ is a much more suitable value. that requires 100mV difference across the resistor to achieve 1A. that means generating an accurate 9.9V signal ... good luck with that! no DAC can produce that or it would require a whole lot of other parts such as an amplifier for the output of the DAC etc to get the set point right!the circuit on the left is your circuit, and the one on the left is the better choice (as you can see, the current through both shunt resistors is the same):now to the compensation network: you have the correct idea about using a feedback resistor and capacitor, they're just not large enough. try increasing the capacitor from 1n to something like 100n. also add a 1K gate resistor and see how that affects things.

author: SiliconWizard
author_rank: Super Contributor
timestamp: August 18, 2019, 03:02:51 pm
content: I agree with using an NMOS instead - much easier to control, and NMOS usually have lower RDSon than their PMOS counterparts. So unless you absolutely NEED the load to be directly grounded, the NMOS version will make your life easier.As for oscillations, your compensation network here may make things worse actually.

author: arildj78
author_rank: Regular Contributor
timestamp: August 18, 2019, 04:36:16 pm
content: My 10V source is from a SMPS and in an effort to minimize EMI, I was hoping that U1 would dissipate the ripple so that there would be minimal voltage swing on the long traces out to my LEDs. As for control I have a resistor from ground in series with a LM4040 (2V reference) up to +10V. Then I hope to get a reference voltage that follows the ripple.I might turn the design around and use a N-channel device, but I still don't understand how to do the stability analysis of my original design. Without R2C1 I obviously have 180° of phase shift at 0dB gain. This seems to happen close to 1MHz, but why doesn't the RC filter with fc=48.2kHz introduce enough phase shift to avoid the problem?

author: OM222O
author_rank: Frequent Contributor
timestamp: August 18, 2019, 05:53:45 pm
content: I had the same issue a while ago and this fixed it:https://www.eevblog.com/forum/projects/current-source-feedback-capacitor/msg2428941/#msg2428941you need to add an AC source and run a ac sweep across the frequency range, then check for gain margin and phase margin.

author: mikerj
author_rank: Super Contributor
timestamp: August 18, 2019, 06:08:43 pm
content: Put some resistance in series with the PMOS gate, 500R-1k should calm things down.