Electronics > Projects, Designs, and Technical Stuff

Temperature independent constant current with fast transient response to PWM ?

(1/3) > >>

Heisen:
Hello Everyone,

I am designing a LED driver. My board consists of one microcontroller which gives 32 individual PWM signals independent of each other. Each PWM signal drives a channel. So making my board 32 channel LED driver. Each PWM signal not only varies by duty cycle but also by frequency. The maximum frequency at one point comes to about 3kHz. Each channel will drive a bunch of LEDs in series.

So these LED channels getting individual PWM signals, turning the load on and off, I want to limit the current while they are in ON state. So each channel will be configured in constant current.

I need all LED channels to have a common VCC, which makes the system constant current sink. I went with linear constant current not switching type. I can deal with heat and want less parts also but most importantly, I want quick transient response of current waveform matching with the pwm signal. So while the PWM signal is low the channel is off but when the pwm signal is high the channel is in constant current mode. Just like the response you get when you PWM a LED directly from a microcontroller GPIO with current limiting resistor.

So that makes it a constant current with PWM combination for each channel. I am using the below mentioned Dual NPN general constant current circuit for each PWM Channel.



Observe the (Red) PWM signal (which is at 3kHz frequency at 50% duty cycle) and (Green) current waveform response to that.



Let's see at 99% duty cycle.



Zooming in on the 1% off time. Looks like this.



Everything seems to be working fine at this point except that this circuit is temperature dependent, due to vbe of Q1 being temperature sensitive. Current changes through the LEDs due to temperature change, which is a problem for me. I am trying to push this thing to be workable in automotive enviornment.

To overcome this problem I went with another general circuit which does the same thing but with an op amp and a transistor. Here is what it looks like.



As this circuit ensures change in temperature will not affect the constant current through the LEDs but with a trade off of delayed transient response. Let's observe that.

3kHz frequency at 50% duty cycle. (Red) PWM signal. (Green) Current waveform.



Let's see at 99% duty cycle, which makes it worse.



Zooming in on the 1% off time. The transient response looks like this.



As you can see the current waveform can't keep up with the PWM signal. This might be due to the slower slew rate of the op amp. So the solution to overcome this might be a faster op amp, which are expensive considering I have to use 32 of them.  :(

I was looking for a solution to this problem which uses jellybean parts. General components. No matter what circuit I find and try I loose either the fast transient response or temperature independence. Can't have both at the same time with low overall cost, due to circuit being replicated 32 times. One for each channel.

I already gave up trying to make this work.  |O Thought posting on the forum as one last shot. Hoping someone might come up with a easy solution.

Thanks anyways.

Dabbot:
Isn't electronics fun?  ;D

It's all about trade-offs, especially when you have a budget.

Question: Do the LEDs absolutely have to be driven by the PWM waveform?

Why not turn this circuit into a voltage controlled current source by RC filtering the PWM signal before the op-amp input. The current will still be set by that PWM signal and, by extension, the regulator powering your microcontroller.

Ian.M:
The only problem with the first circuit is that the Vbe of Q1 falls with temperature.  The solution is simple - lift the emitter voltage of Q1 proportionally with temperature.   You only need one compensation voltage circuit for all 32 LED drivers.   To avoid interaction, between LED drivers, you'll probably want each to have a PNP emitter follower driving Q1 emitter, with its base fed by the shared compensation ciruit, which unfortunately adds a bit over a volt to the LED driver dropout voltage and increases the dissipation in R2, which must be increased to maintain the same target LED current.  Its easily possible to stabilise the current to better than 1% over a -25 deg C to +125 deg C temperature range.  See attached LTspice sim.

Heisen:

--- Quote from: Dabbot on August 15, 2020, 07:12:56 am ---Why not turn this circuit into a voltage controlled current source by RC filtering the PWM signal before the op-amp input. The current will still be set by that PWM signal and, by extension, the regulator powering your microcontroller.

--- End quote ---



I think that will add more delay. In the video you'll see this is what I am generating with pure PWM signals. These LEDs are not just turning on and off, they are dimming from high to low or vice versa. Hard to see in 60fps video. In reality it's more smoother.

Heisen:

--- Quote from: Ian.M on August 15, 2020, 07:51:29 am ---The only problem with the first circuit is that the Vbe of Q1 falls with temperature.  The solution is simple - lift the emitter voltage of Q1 proportionally with temperature.   You only need one compensation voltage circuit for all 32 LED drivers.   To avoid interaction, between LED drivers, you'll probably want each to have a PNP emitter follower driving Q1 emitter, with its base fed by the shared compensation ciruit, which unfortunately adds a bit over a volt to the LED driver dropout voltage and increases the dissipation in R2, which must be increased to maintain the same target LED current.  Its easily possible to stabilise the current to better than 1% over a -25 deg C to +125 deg C temperature range.  See attached LTspice sim.

--- End quote ---
Ian.M

You did it. I have yet to understand how all this actually works, I'll get back to you. But for now in simulation it's working flawless. Can't believe this was that easy for someone else.

Ian.M for the win.  :-+

Thank you very much.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod