[SOLVED] How to increase phase margin for Voltage-Controlled Current Source?

Hi

within my project to drive LEDs with some hybrid AM-/PWM-Supply I have to set up a voltage controlled currrent source.
At high currents the LEDs shall be driven by constant current, which can be externally modified in its amplitude (Amplitude-Modulation) to control (higher-) brightness levels. At lower brightness levels the scheme switches to PWM.

So far, everything is working and, if hardware is not working ideally I have an idea why not - and that I hardly can do something against.
However, something I like to better understand, for which I kindly ask you for support.

Please consider following circuit:

CW_Ref is a signal, which is AM/PWM-modulated and to control the current through the LED, which is in my test circuit simply the 68R resistor.

When I run this circuit at "low brightness levels", i.e. the MOSFET is temporarily switch off by setting CW_Ref to 0V, I observe some oscillations during switching, as shown below:

YELLOW: Signal to switch MOSFET off
PURPLE: CW_Ref as shown in schematic above. Output of an OpAmp voltage follower (not shown)
BLUE: Voltage across R42, i.e. proportional to current flow

Well, please ignore

  • little overshoot in CW_Ref during switch-off ... to my understanding some charging/de-charging of MOSFET capacitances in the circuity providing CW_REF.

  • The low amplitude ringing in blue signal. It is on a breadboard mounted and some 100nF are installed - but, well, it is breadboard.

SO, I like to better understand the damped oscillation of the current (blue) when MOSFET Q3 is switched on again --- and what parameters I have to consider to control this oscillation. Or, with given OpAmp and MOSFET, what is a feasible measure to get rid of this oscillation?

Two remarks:

  1. The oscillation somehow looks "non-linear", i.e. not purely sinusodial.
  2. Increasing R39 doesn't help. Matter of fact, its is getting worse with higher values for R39

Your help is appreciated

I cannot answer the questions you ask, but you cannot use a resistor to represent an LED because a resistor has a voltage across it which varies with the current, as per Ohm's Law, whereas an LED has a nearly constant voltage across it, which varies very little for a large change in current. The two thing are not even nearly equivalent.

Have you calibrated your probes?

Opamps are somewhat slow, resulting in ringing output when driven by a rectangle. Add capacitors to improve that behaviour.

Your circuit is okay in general, but also try with your later (non-linear) LED load.

1 Like

...and... are you even using 10x probes? You should.

I don't think you ever told us the pulse duration.

Also how did you make the scope ground connection?

For sure. Will later on use an LED, but what not runs with a resistor unlikely will work with an LED.

Yes

Upps? Adding capacitors to make things faster? Don't know how to do this here.

No, just in 1x position. I can try later on ...

I didn't. When PWM is activated the frequency is almost 2kHz as per proper configuration of an Arduino UNO. With 8 Bit resolution, the shortest pulse is about 1/(2000*255) = 2us being in the range of what you see in the scope's shot.

It is/has been there (ok not right now because I had to clean up my desk :smiley:) )

You can replace the resistors in the feedback network by RC low/high pass filters.

Without calibrated 10x probes all dynamic waves are crap.

You can't calibrate a 1x probe. :slight_smile:

Also "there" doesn't really specify the location of a ground connection. :slight_smile:

Hm, no? :grimacing:

I will check with 10x probes, properly calibrated. Give me some time do to this ...

It may not matter as much as the ground connection location, in the R42 measurement because it is low impedance. But it would be safer to just repeat everything with 10x.

What is the pulse period?

When you measure, the ground clip should go as electrically (so usually physically) close to the DUT as possible.

I set to duty cycle on the functions generator to something 0.4% at a frequency of 2kHz resulting in the above mentioned 2us period to get both rising and falling edge on one shot at a horinzontal speed of 500ns/s. But making it longer doesn't change anything. As you can see from the scope it reaches new steady state.

I'll take care for. Guess, it hasn't been perfect in the shown measurement.

Would you mind to explain a little more in detail? An R-C series in parallel to R42? Any hints on how to select R and C?

Okay, it was just a test pulse. So what will be the final working pulse width? I ask because op amp bandwidth has now been introduced to the discussion.

A little bit of occasional overshoot and ringing may not be a significant problem depending on what you are expecting the circuit to do.

E.g. a high pass at the positive input, or a low pass in the negative input feedback.

Pulse width does not matter, it's the limited rise and fall times at the edges.

What I'm getting at is, frequency matters because that influences the actual impact of that problem. For example, if the transitions are slow, heat dissipation increases with frequency. Low frequency, maybe not a big problem.

That does not affect the diagnostic transition scope shots. Faster or more powerful opamps and FETs or BjT can be substituted at any time.

I'm asking about the non-diagnostic, final application. Also I would have used that information to know the time scale. I can't read that from the scope face clearly.

Frist, there was something wrong: 500ns/div, or course (not per second) :wink: Unfortunately the grid is not visible on the picture, but I guess you get a picture of it

That is the final, at least when it comes to the shortest. It ranges from 1/2000*255 (shortest on - time) to permantly on.

Well, rising and falling edge should be short enough to actually create a pulse of about 2us, isn't it?

Sorry about this, that is the way the scope is creating the picture. It has 14 div horizontal ... so knowing 500ns/div at least one get a picture of time scale.

Why would you use such timing for dimming LEDs? Important is only the PWM frequency, with two transitions per cycle.

Also there is little use of a constant current source with digital (PWM...) outputs - a current limiting resistor is more efficient.

Not making the story too long: it is to dimm a LED. For higher brightness with controlling a constant current (e.g. 30% to 100% or rated current of the LED). Below 30% the equivalent current is pulse-width modulated. This approach is used to cope with color change of (white) LED at low currents - by doing so white remains white. Rated current of LED is 130mA, to be driven at about 35V.
So far I'm testing with just 12V and a resistor. Then I'll switch to higher voltages (and resistor), than replacing resistor by approbriate Zener-Diodes (that come closer to non-linear behaviour of LED) and then LED. Simply this sequence because I don't want to accidently kill the LEDs during development - it has been tricky to get them as sample; next time I would need to buy much more than I actually need. So its risk mitigation to avoid costs.

Not an issue. 2kHz PWM.

Okay. You better have a good heatsink on the MOSFET(s).

Why do you want to PWM (only) on the low intensity range? It does more sense to PWM the high intensity to keep losses low.