Pages: 1 [2] 3   Go Down
Author Topic: "Fooling" constant-current control loops in LED driving?  (Read 7204 times)
0 Members and 1 Guest are viewing this topic.
Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 152
Posts: 5760
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

1) 32-bit resolution would give me 4.29 x 10^9 levels, thus around 9.6 log levels of light intensity which would be little less than normal ambient light levels experienced by humans [1]. So when designing a visual stimulator like that one for example in optimal case you would like to have the whole ambient light level intensity under electronic control and not having to play with neutral density filters for example. For example, using the same system when the subject is light-adapted and after full dark adaptation when retinal sensitivity is significantly increased [2].


You should have started by stating what it is you're trying to do. It always saves a lot of time. (All posters take note!)

For a first attempt I'd use a TLC5940. That gives 12 bit PWM values (0 to 4095) plus a separate six-bit 'power' setting for each LED.

For steps smaller then 4096 you can multiplex the PWM values.

eg. To get a brightness value of 1/32768 you can sent the following PWM sequence: 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

(ie. one PWM cycle of 1/4096 followed by eight PWM cycles of 0/4096).

Eight steps of mutiplexing gives you an extra three bits, that's 15-bit precision. Combined with the power setting it might be enough. To get better results with cheap hardware could be difficult.

Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Troy, NY, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Finnish in USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You should have started by stating what it is you're trying to do. It always saves a lot of time. (All posters take note!)

For a first attempt I'd use a TLC5940. That gives 12 bit PWM values (0 to 4095) plus a separate six-bit 'power' setting for each LED.

I am sorry about the initial confusion. I was not aware that the need for dynamic range would attract more interest than the actual electronics problem that I was trying to solve.

I did not quite understand the benefit of the TLC5940 chip to my project?

The maximum current (1000 mA in my case, whereas the maximum current of TLC5940 seems to be 120 mA?) is already set by the ISTL Quattro CC LED driver (http://www.istl.com/quattrocc.php) that I use to drive my power LEDs so I would want to switch that current with the proposed transistor scheme. And I already have the Digilent Uno32 which provides 5 PWM outputs which is sufficient for my use so there is no need to multiplex and get more PWM outputs.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 152
Posts: 5760
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The maximum current (1000 mA in my case, whereas the maximum current of TLC5940 seems to be 120 mA?) is already set by the ISTL Quattro CC LED driver (http://www.istl.com/quattrocc.php) that I use to drive my power LEDs so I would want to switch that current with the proposed transistor scheme. And I already have the Digilent Uno32 which provides 5 PWM outputs which is sufficient for my use so there is no need to multiplex and get more PWM outputs.


Before we go on: Is there anything else you forgot to mention...?

Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Troy, NY, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Finnish in USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The maximum current (1000 mA in my case, whereas the maximum current of TLC5940 seems to be 120 mA?) is already set by the ISTL Quattro CC LED driver (http://www.istl.com/quattrocc.php) that I use to drive my power LEDs so I would want to switch that current with the proposed transistor scheme. And I already have the Digilent Uno32 which provides 5 PWM outputs which is sufficient for my use so there is no need to multiplex and get more PWM outputs.

Before we go on: Is there anything else you forgot to mention...?

I think the specs were given before, but basically in summary. I have:
  * ISTL Quattro CC LED Driver -> 1000 mA DC out, DMX Control
  * Both Digilent Uno32 and Arduino UNO to generate the PWM
  * Power LEDs, maximum forward current 1000 mA

So  what I lack is somekind of transistor circuit to ensure that the control algorithm of the Quattro CC LED Driver provides constantly 1000 mA and does not try to correct the switching artifacts if I just had on NPN transistor.

And I tested the thing with a lab power supply so it provides also constant current and could be used instead of the ISTL Quattro CC for testing, or for final implementation.

[edit] Sorry if this forum category deals with multiplexing LEDs rather than driving LEDs without multiplexing but thought of this the most fitting part of this question but maybe I was mistaken?
« Last Edit: October 19, 2012, 07:41:54 am by petteri_t » Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So  what I lack is somekind of transistor circuit to ensure that the control algorithm of the Quattro CC LED Driver provides constantly 1000 mA and does not try to correct the switching artifacts if I just had on NPN transistor.

I have no idea what "switching artifacts" you are talking about but if I understand the module correctly, it sets the duty cycle for each channel on command.

So all you need to do is to low it with the desired intensity and it will do that by itself.

What else are you trying to do?
Logged

Troy, NY, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Finnish in USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So  what I lack is somekind of transistor circuit to ensure that the control algorithm of the Quattro CC LED Driver provides constantly 1000 mA and does not try to correct the switching artifacts if I just had on NPN transistor.

I have no idea what "switching artifacts" you are talking about but if I understand the module correctly, it sets the duty cycle for each channel on command.

So all you need to do is to low it with the desired intensity and it will do that by itself.

What else are you trying to do?


Switching artifacts meaning in this case the time that the LED is not on.

So if I have a duty cycle of 50% with the LED current being 1000 mA, then the time average of that is 500 mA, but the ISTL Quattro CC wants to output 1000 mA all the time so it won't like that half of the time there is no path for the current.

So the idea of putting a PNP transistor there to provide path for the current when the LED is turned off by the PWM would in theory "fool" the ISTL Quattro (or any other constant current source) to think that the current is truly constant. I guess if I had access to the derivative part of PID-algorithm of the LED driver I could tune it so that it would not react to such switching but that doesn't seem to be the case
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
but the ISTL Quattro CC wants to output 1000 mA all the time so it won't like that half of the time there is no path for the current.

Are you sure about that? If that's the case, how does the controller dim anything?

Essentially, you are saying that the controller is not capable of doing what it claims to do.
Logged

Troy, NY, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Finnish in USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
but the ISTL Quattro CC wants to output 1000 mA all the time so it won't like that half of the time there is no path for the current.

Are you sure about that? If that's the case, how does the controller dim anything?

Essentially, you are saying that the controller is not capable of doing what it claims to do.


According to the manufacturer and initial testing it is the case, and I don't really understand how would that be in conflict with the dimming capability?

Because you feed the driver DMX (DALI or PWM also possible) and then it outputs the current according to that. And then I would like to add my own circuit to that output and dim the output even more with the PWM from Arduino
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

They didn't provide a schematic for the controller. But if you look at the picture, you will see four inductors and 8 caps. This thing is a switching mode power supply (boost / buck I think, given the voltages). That means that it has a current sampling resistor in serial with the leds. The dimming controls the controler's duty cycle so that the output voltage across the leds produces the desired current (voltage drop) on the led string.

How the controller behaves with a dynamically changing low is really unknown, and unknowable until you put something to it. From my experience, I would say that something like that shouldn't be attempted.
Logged

Troy, NY, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Finnish in USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How the controller behaves with a dynamically changing low is really unknown, and unknowable until you put something to it. From my experience, I would say that something like that shouldn't be attempted.

Well now we finally get into to my question after all these messages. So this is exactly what I was trying to accomplish, and the manufacturer itself said that the controller would not like the switching of the current output, but the dual NPN-PNP-transistor pair could work.

And I now soldered a simple transistor pair (NPN and PNP bipolar transistors) to be tested with my benchtop voltage supply and now on its display the current stays constant which was not case with the inital attempt with only one transistor. So basically combined the NPN and PNP of those together and matched the resistor values for my hFE of around 30:
http://www.rason.org/Projects/transwit/transwit.htm (Figure 1 and Figure 2)

Now I can control the LED intensity with the Arduino but now the light intensity is slowly declining/fluctuating (-2% of the initial value more or less) with the given duty cycle when left untouched so there is some problem that I don't understand at the point.
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What you need is a shunt, electronically controlled load in parallel with the led string. The load will divert current away from the leds but without reducing the current going through the sampling resistor.

As the load is referenced to the leds' cathode, building it is no small matter.
Logged

Troy, NY, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Finnish in USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What you need is a shunt, electronically controlled load in parallel with the led string. The load will divert current away from the leds but without reducing the current going through the sampling resistor.

As the load is referenced to the leds' cathode, building it is no small matter.

You happen to have any insights what to look for when trying to find similar example circuits / projects?
Logged

Troy, NY, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Finnish in USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

And I quickly drew the schematics that I soldered and tried with both the benchtop power supply and the ISTL Quattro CC:



So with the benchtop supply, the scheme more or less worked as planned when measuring the light output with a power meter (Thorlabs PM30 + sensor S130A). And while controlling the light intensity of the LED with PWM I could simultaneously change the current setting of the ISO-TECH IPS3303S DC Power supply, thus having the desired two independent control blocks.

However when plugging the same circuit to the Quattro CC, the duty cycle indeed controlled the light output of the LED but then the DMX  control had no effect on the light output.
Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1222
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Perhaps you should use another NPN to drive the " off " shunt, with the base driven from the collector of the " on " driver, with a similar load resistor to smooth the load from the PSU ?


Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
You happen to have any insights what to look for when trying to find similar example circuits / projects?

Yes, I am thinking about a high-power current mirror.

Due to the cathode being floating, you cannot regulate it from the low side and you have to do it via the high side.

If you use the transistors as a resistor, their non-linearity means that they are fairly difficult to control and the current transistion would be sudden.

So here is my solution - totally unproven: use two p-channel mosfets to form a current mirror, with one of the mosfet in parallel with the led string. The other mosfet's drain goes to ground through a current sink controlled by your mcu. This current sink could be a constant current source with a voltage input (typically done by an opamp + npn).
Logged

Pages: 1 [2] 3   Go Up
Jump to: