Show Posts
Pages: [1] 2
1  Using Arduino / Interfacing w/ Software on the Computer / Re: Leonardo and MATLAB interface? on: February 03, 2013, 07:16:51 pm
Quote
Everything a Uno can do a Leonardo can do.
On the other hand, the serial port must be opened using DtrEnable, to talk to the Leonardo. If MATLAB does not use that flag, it can't communicate with the Leonardo.

Has someone tried of getting Leonardo to work with Matlab, and even succeeded in that?

In Python it seems as easy as putting:
Code:
comport.DtrEnable = true;

(e.g. http://www.raspberrypi.org/phpBB3/viewtopic.php?t=16490&p=168611)

So now one should probably modify the Arduino class (arduino.m of the Arduino I/O package) in similar manner? Or simply set the DtrEnable flag to true for the Matlab programs you are about to develop?

I don't have yet Leonardo and was thinking of purchasing one also to be used with Matlab so if someone can confirm in advance that it has worked, it would be great
2  Using Arduino / LEDs and Multiplexing / Re: "Fooling" constant-current control loops in LED driving? on: October 30, 2012, 05:41:04 am
Quote
it looks like that:

I don't fully understand the purpose of having T2, as that leg of the mirror should be shunting the led so nothing should be there (other than the led driver's current sensing resistor).

T1 turns on / off the shunt. So what is LED1?

You mean if I put the shunt and the LED in parallel the shunt would take all the current? I thought that the resistance of the LED would be so small so that if I shunt the LED driver via the switching transistor T1 then I would need another leg of the mirror to take the LED current or did I misunderstood this?

So the LED1 is the LED that I want to control and which would be normally connected to the LED driver, and then for example with 50% duty cycle half of the time the T1 leg would take the 1000 mA of the LED driver and half of the time the T2 leg would take the 1000 mA.
3  Using Arduino / LEDs and Multiplexing / Re: "Fooling" constant-current control loops in LED driving? on: October 28, 2012, 02:16:58 pm
If I recall correctly, your led driver will be providing a constant current and the purpose of the current mirror is really to divert current away from your leds without letting the driver know.

If that is true, you will need pnp current mirrors, and switch on your "current shunt" on the low side.

That is not what your circuit is trying to do.


That is very true, so okay for the clarification, and clearly I messed a bit when trying to ensure constant current operation. I updated the circuit with PNPs, and it looks like that:



And I have to try to find the matched PNP pairs or quad arrays
4  Using Arduino / LEDs and Multiplexing / Re: "Fooling" constant-current control loops in LED driving? on: October 28, 2012, 12:07:17 pm
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.

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).

I did some more research on this topic, and found a nice summary on current sources/mirrors by Rod Elliott mainly taken from "Designing Analog Chips" by Hans Camenzind. So there I picked up the Four Transistor Circuit Mirror circuit (Figure 11b):



And then tried to find a transistor array with all the four transistors thermally coupled but ran into some problems as most components seemed to be for low current applications (e.g. That 300 series, 20 mA),and the high current ones were in mA-range for example at 100 mA (Intersil CA-3083). The ULN2075B Quad NPN Darlington switch could take 1.5 A with the downside of slowing down the response times a bit due to the Darlington design.

So when not finding really high current (more than 1 A) PNP arrays (or P-channel MOSFET arrays) I decided to try to build the idea around the ULN2075B, however I was not quite sure about how to implement the constant current part for the current mirror branches. I would not like to use some fixed resistor values as at least LED current should be able to be varied from the constant current source, thus changing voltages across the transistors and ideally the circuit would not be that picky in regard to voltage supply if I want to put more LEDs in series for example.

So would the low-cost constant current circuit of the following Instructables work? A bit like replacing the resistors from Recom's example sheet using current mirror to balance current for parallel LED strings (Figure 7 on Page 9).

So my bare design without the constant current blocks looked like that:



And if I add the constant current parts with a limiting resistor of 0.5 ohms (R6 and R8) for 1 A then the circuit would look like that:



The ~V_in taken from the emitters of the Darlingtons would correspond to the supply voltage of the Instructables that was allowed to vary between 2 and 18 volts in the Instructables still getting the constant current operation.

So as a summary, do you think dhenry that this would be a feasible alternative to what you proposed or did I miss something and the circuit would not work as designed while waiting to get the transistor array?
5  Using Arduino / LEDs and Multiplexing / Re: "Fooling" constant-current control loops in LED driving? on: October 23, 2012, 12:42:51 pm
I calibrated the light output with the previously desribed "brute force" npn-pnp combination, and got the following light output as a function of the duty cycle (8bit, 0-255). Light output was quasilinear from ~125 until 255 which was indeed not very good use of duty cycle (black line - linear regression):

6  Using Arduino / LEDs and Multiplexing / Re: "Fooling" constant-current control loops in LED driving? on: October 19, 2012, 07:56:34 pm
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 ?

That is quite easy to test when I am around the setup tomorrow again, thanks for the tip

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).

Thanks for the tip on using a current mirror, I wouldn't had ended up there probably without your tip smiley I found similar thread from Parallax forums with the following design for driving LEDs (with UP04401 PNP composite transistor and 2SC5658 general purpose NPN transistor)



I found possibly functioning design examples from datasheetarchive.com which I have to study a bit.
7  Using Arduino / LEDs and Multiplexing / Re: "Fooling" constant-current control loops in LED driving? on: October 19, 2012, 10:58:24 am
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.
8  Using Arduino / LEDs and Multiplexing / Re: "Fooling" constant-current control loops in LED driving? on: October 19, 2012, 09:05:05 am
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?
9  Using Arduino / LEDs and Multiplexing / Re: "Fooling" constant-current control loops in LED driving? on: October 19, 2012, 08:55:50 am
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.
10  Using Arduino / LEDs and Multiplexing / Re: "Fooling" constant-current control loops in LED driving? on: October 19, 2012, 08:34:45 am
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
11  Using Arduino / LEDs and Multiplexing / Re: "Fooling" constant-current control loops in LED driving? on: October 19, 2012, 08:24:49 am
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
12  Using Arduino / LEDs and Multiplexing / Re: "Fooling" constant-current control loops in LED driving? on: October 19, 2012, 07:27:31 am
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?
13  Using Arduino / LEDs and Multiplexing / Re: "Fooling" constant-current control loops in LED driving? on: October 19, 2012, 05:52:30 am
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.
14  Using Arduino / LEDs and Multiplexing / Re: "Fooling" constant-current control loops in LED driving? on: October 19, 2012, 05:14:45 am
, between 65,534 and 65,535, or between 30,000 and 30,001, etc.!   

Brightnesses in that range are a bit more difficult.


And as my main interest for such a system is scientific, so if the power meter detects a difference between 30,000 and 30,001 or more importantly between 40 and 41 then it is a useful property for me. And then you could for example use the setup for a psychophysical experiment to actually measure which step differences are actually perceived smiley-razz
15  Using Arduino / LEDs and Multiplexing / Re: "Fooling" constant-current control loops in LED driving? on: October 19, 2012, 04:58:52 am
Quote
4000 duty cycle steps

That's about 12 bits, on a 80Mhz mcu.

From there, it goes up exponentially.

If I were you, I would try to understand what you are trying to do, and what can be done realistically and decide where to compromise.


I get the impression that I was not very clear what I wanted to do, so maybe a simple scheme would illustrate the idea a bit better.



So I already have a LED driver that I can control with DMX512/RDM signal at a theoretical 16-bit resolution and when measuring the light output with a power meter, some bits are lost but the resolution is still quite good in practice. And that driver can combine to 8-bit DMX signals as HI and LO bytes (or coarse and fine) so that part is already under control with the digital output pin of Arduino and a DMX shield (http://www.arduino.cc/playground/DMX/DMXShield)

So now my problem is that I cannot really switch the output current from that LED driver with a single transistor as the control algorithm of the LED driver would like to keep the output current constant. So I thought of adding the PNP transistor to the scheme so that it would conduct when the PWM signal from Arduino is LO (basically short circuit) to "fool" (thus the title) the LED driver to sense non-changing current even though I would be changing the current going through the LED.

I could then independently set the DC current from LED driver with DMX at 16-bit resolution and add to that the switching stage with 8-16 bit resolution of duty cycle which would be totally satisfactory for me and I would not need to go to the 200 GHz clock frequency ever.

In other words

ResolutionSUM = DMX(8 bit + 8 bit) + PWM(8-16 bit) = 16 + (8 to 16 bits) = 24 to 32 bits
Pages: [1] 2