Author Topic: Why is my current source oscillating?  (Read 1591 times)

0 Members and 1 Guest are viewing this topic.

Offline arildj78Topic starter

  • Regular Contributor
  • *
  • Posts: 67
  • Country: no
Why is my current source oscillating?
« on: August 18, 2019, 09:48:13 am »
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 MOSFET
Si3417DV Spice model

The OpAmp
LMC6482 Spice model

The LEDs
Cree® XLamp® XP-E2 LED Spice model

Edit: Fixed typo in subject
« Last Edit: August 18, 2019, 06:49:44 pm by arildj78 »
 

Offline OM222O

  • Frequent Contributor
  • **
  • Posts: 768
  • Country: gb
Re: Why is my current source oscillate?
« Reply #1 on: August 18, 2019, 12:14:52 pm »
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):
813588-0

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.
« Last Edit: August 18, 2019, 12:41:18 pm by OM222O »
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15360
  • Country: fr
Re: Why is my current source oscillate?
« Reply #2 on: August 18, 2019, 03:02:51 pm »
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.
 

Offline arildj78Topic starter

  • Regular Contributor
  • *
  • Posts: 67
  • Country: no
Re: Why is my current source oscillate?
« Reply #3 on: August 18, 2019, 04:36:16 pm »
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?
 

Offline OM222O

  • Frequent Contributor
  • **
  • Posts: 768
  • Country: gb
Re: Why is my current source oscillate?
« Reply #4 on: August 18, 2019, 05:53:45 pm »
I had the same issue a while ago and this fixed it:
https://www.eevblog.com/forum/projects/current-source-feedback-capacitor/msg2428941/#msg2428941

you need to add an AC source and run a ac sweep across the frequency range, then check for gain margin and phase margin.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3327
  • Country: gb
Re: Why is my current source oscillate?
« Reply #5 on: August 18, 2019, 06:08:43 pm »
Put some resistance in series with the PMOS gate, 500R-1k should calm things down.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf