Transistor as a current limiter

On Mon, 15 Jul 2013 00:54:00 -0500, John Fields
<jfields@austininstruments.com> wrote:

snip
The sim I posted earlier was wrong in that it didn't show what
happened during power-up and power down. Sorry 'bout that...

This one does, and there still seems to be no tendency for the thing
to oscillate without the cap.
snip
No. I completely understand that behavior and it's NOT
oscillation. Change C1 to 1p. Rerun. Looks better. Right?

Jon
 
On Sun, 14 Jul 2013 11:10:54 -0700, I wrote:

snip
All current mirrors depend on matching Is, less with
degeneration. From my limited experience, this isn't a big
problem for LED driving if using parts from the same reel.
snip
Looking back on notes I wrote a long time ago, I find
something like worst case 5% difference in Ic for small
signal PN2222A parts from the same reel, without the use of
degeneration. That suggests about 1.2mV of Vbe variation.
With 100mV of emitter degeneration, I would naively expect
1.2% difference in Ic but my notes suggest that this was more
like 0.6%. Suggesting a divide by 2 that I'm missed in my
naive (without paper) analysis, which doesn't shock me.

Emitter degeneration is pretty effective. Not just with part
variation but also with thermal runaway.

With LEDs soaking up most of the rail voltage, it's all just
good.

Jon
 
On Sun, 14 Jul 2013 23:47:12 -0700, Jon Kirwan <jonk@infinitefactors.org> wrote:

On Sun, 14 Jul 2013 20:16:42 -0700, John Larkin
jjlarkin@highNOTlandTHIStechnologyPART.com> wrote:

On Sun, 14 Jul 2013 15:01:25 -0700, Jon Kirwan <jonk@infinitefactors.org> wrote:

On Sun, 14 Jul 2013 12:05:32 -0700, John Larkin
jjlarkin@highNOTlandTHIStechnologyPART.com> wrote:

On Sun, 14 Jul 2013 11:10:54 -0700, Jon Kirwan <jonk@infinitefactors.org> wrote:

On Sun, 14 Jul 2013 08:56:02 -0700, John Larkin
jjlarkin@highNOTlandTHIStechnologyPART.com> wrote:

On Sat, 13 Jul 2013 23:15:32 -0700, Jon Kirwan <jonk@infinitefactors.org> wrote:

On Sat, 13 Jul 2013 15:11:40 -0500, John Fields
jfields@austininstruments.com> wrote:

snip
http://www.edn.com/design/power-management/4324682/Current-mirror-drives-multiple-LEDs-from-a-low-supply-voltage
snip

Nice link. Using a diff-amp in a controlled feedback loop.
Thanks.

It wastes 25% of the supply power just to sense the LED current.

A current mirror wastes current. That's what they do.

And it depends on transistor matching.

All current mirrors depend on matching Is, less with
degeneration. From my limited experience, this isn't a big
problem for LED driving if using parts from the same reel.
And it's pretty easy to test for, anyway.

I don't see how it avoids thermal runaway
by pulsing.

Yeah. If one of them heats up more than others, it's Vbe
declines by 2.3mV/C or something like that and this pulls the
others down with it, lowering their Ic. And if the feedback
BJT lowers its Ic the feedback circuit supplies more drive
current... and so on. I've epoxied parts together with
modestly okay effect here. But I've also bought arrays on
ICs, too (which at the prices I pay aren't exactly matched
well but again aren't terrible, either.)

Degeneration would seem to be a partial answer here, too.

A point in this circuit is low overhead drivers. What would
you do if designing a discrete, bipolar solution here? I'd
learn something from a good answer.

Usual EDN standard of quality. They need filler between the ads.

:)

I do NOT like the capacitor there. When inactive (OFF), C1
charges up to Vcc across it, if C1 is small enough (if C1 is
big, then it never reaches Vcc across it.) When active (ON),
the common node between C1 and R4 jumps up towards 1.2V below
Vcc and in doing so causes the collector of Q2 to be driven
below ground, Vcc-1.2V-Vc1=-1.2V since Vc1=Vcc. As C1
discharges it actually borrows current from Q3's collector
(rather than from R3) causing a lower current in R3, yielding
a lower voltage potential for Q2's base... leading to
diversion of R2's current towards Q1 and thus MORE drive
current into Q4 through Q7. The upshot is that upon turn-on,
the peak current in the LEDs is actually HIGHER than designed
and it then gently settles down to the desired level as C1
discharges to a new (lower) potential across its leads. This
is spikey behavior instead of a "soft start." Make C1 bigger
and it gets worse, too. The sharp leading edge will reach
even higher initial currents in the LEDs that way.

So it's value should be kept small. I'm not yet convinced
about the danger of oscillations or the source of them in
this circuit. There are very low impedances on every node of
Q2. It just doesn't seem necessary to me. I don't see how the
small Cbc value and the value of Rb' can conspire to make a
problem here, even with the collector making a small jump at
turn on. And it actually seems to have a downside where I'd
rather simply remove it.

I might also invert the whole structure and delete R1 and D1,
if my LED supply was a volt or more above the micro rail
voltage. The pin output won't be loaded much and will
probably be a very close reflection of the micro rail
voltage. Of course, I'd adjust values, accordingly.

For example, if my micro were running on 3.6V and my LED
supply were 6V (hypothetically) and I wanted 100mA and 5
chains of them (not 4), then I might invert the polarities
and use R3=36 ohms, R2=470 ohms, and R4=270 ohms, kill C1,
and just drive the base of Q1 directly.

I'd start the design by estimating the total base currents
required for Q3 through Q7 (600mA/beta=200, or about 3mA.)
Then I'd double that for the diff-amp pair to 6mA. Given 3.6V
drive and an estimated 0.7V drop on Q1, I get 2.9V at Q1's
emitter. So 2.9V/6mA is 483 ohms. 470 is a standard value and
gives a slight increase in estimated current, so I'd use that
value instead. I also want 3.6V across R3 at 100mA, so 36
ohms. Changing that to 33 or 39 ohms would change the LED
currents by 10% or more. Luckily, 5% resistors do come in 36
ohms. So I'd stick with that. Then, since R4 should be
(assuming 3mA in each branch, hopefully) at about one 100mA
sized Vbe (about 110mV added to 700mV as a guess), so R4
should be about 0.81/3mA, or 270 ohms. Nice. Standard value.
So that's where I'd get my values.

I'm still stuck trying to understand C1's benefit.

It probably keeps the loop from oscillating.

That's what they say. But I still don't see it, probably
because I'm blind and not necessarily because it doesn't do
that. It's why I said I can't see it -- hoping someone would
explain it in detail to me. If you can see the exact
mechanism here, I'd like to see a detailed explanation.

Jon

https://dl.dropboxusercontent.com/u/53724080/Circuits/Current_Sources/CC_Driver.JPG

Not an explanation of the oscillation issue, which is what I
seek.

Jon

It's all about control theory. Some closed loops oscillate, some don't.

A high-gain loop with two active elements, each with similar frequency rolloffs,
is a prime candidate for oscillation. The added cap radically slows down one of
those two elements.

I'm looking for the mathematical explanation -- quantitative
-- as well as the theoretical underpinning. Can you elucidate
that?

Jon

For a quantitative, mathematical explanation, you'd need a couple of years of EE
classes and a course on control theory. And you'd have to know all about the
transistors in that circuit... Ft, capacitances, base resistances, all that.

The crude qualitative explanation is that a closed-loop negative feedback system
with gain is stable if there is only one dominant pole, namely one first-order
lag, one slow element. It has at most 90 degrees of phase shift as frequency
goes up.

If the loop has two lagging elements, each can contribute 90 degrees at higher
frequencies. There's usually some other mechanism that adds a few degrees of
phase lag, so at some frequeny you get 180, and the negative feedback becomes
positive. If that happens at a frequency when the gain is above 1, you get
positive feedback with gain, and it oscillates.

Adding the cap radically slows down one of the two gain elements, so the loop
runs out of gain at a low frequency, before the other one kicks in. We usually
figure these sorts of things out with scribbled Bode plots, or Spice sims. Both
will miss more complex issues, like RF oscillation.

Sorry, no simple explanation.




--

John Larkin Highland Technology Inc
www.highlandtechnology.com jlarkin at highlandtechnology dot com

Precision electronic instrumentation
Picosecond-resolution Digital Delay and Pulse generators
Custom timing and laser controllers
Photonics and fiberoptic TTL data links
VME analog, thermocouple, LVDT, synchro, tachometer
Multichannel arbitrary waveform generators
 
On Mon, 15 Jul 2013 07:18:24 -0700, John Larkin
<jjlarkin@highNOTlandTHIStechnologyPART.com> wrote:
snip
For a quantitative, mathematical explanation, you'd need a couple of years of EE
classes and a course on control theory.
I have all of the mathematics required (which just happens to
be most of the first two years of an EE degree -- I've
checked.) I also have _some_ closed loop control theory, but
mostly with PID -- I can do the math for that. I'm pretty
sure I could follow anything you could write on the subject.
I use calculus almost every single day of my life in my
"other work."

And you'd have to know all about the
transistors in that circuit... Ft, capacitances, base resistances, all that.
I'm fairly well informed about the models. I cannot say I
know "all about" them. Which is why I'm asking for help here.
I don't need a broad brush-off. I think I could look at
anything you are capable of preparing and asking informed and
precise questions where I felt I didn't understand. I can
navigate fairly complicated math, as I do it normally in my
work.

The crude qualitative explanation is that a closed-loop negative feedback system
with gain is stable if there is only one dominant pole, namely one first-order
lag, one slow element. It has at most 90 degrees of phase shift as frequency
goes up.
I understand poles and zeros -- very simple thing
mathematically. What I don't see is the equation showing them
and how that equation is created from that particular
circuit.

If the loop has two lagging elements, each can contribute 90 degrees at higher
frequencies. There's usually some other mechanism that adds a few degrees of
phase lag, so at some frequeny you get 180, and the negative feedback becomes
positive. If that happens at a frequency when the gain is above 1, you get
positive feedback with gain, and it oscillates.

Adding the cap radically slows down one of the two gain elements, so the loop
runs out of gain at a low frequency, before the other one kicks in. We usually
figure these sorts of things out with scribbled Bode plots, or Spice sims. Both
will miss more complex issues, like RF oscillation.

Sorry, no simple explanation.
Just develop the simple poles-zeros equation for me and show
me how you constructed it. I can do the rest. I won't need
any further help.

Jon
 
On Sun, 14 Jul 2013 11:16:30 -0700, Jon Kirwan
<jonk@infinitefactors.org> wrote:

On Sun, 14 Jul 2013 13:01:36 -0500, John Fields
jfields@austininstruments.com> wrote:

On Sun, 14 Jul 2013 08:56:02 -0700, John Larkin
jjlarkin@highNOTlandTHIStechnologyPART.com> wrote:

On Sat, 13 Jul 2013 23:15:32 -0700, Jon Kirwan <jonk@infinitefactors.org> wrote:

On Sat, 13 Jul 2013 15:11:40 -0500, John Fields
jfields@austininstruments.com> wrote:

snip
http://www.edn.com/design/power-management/4324682/Current-mirror-drives-multiple-LEDs-from-a-low-supply-voltage
snip

Nice link. Using a diff-amp in a controlled feedback loop.
Thanks.

It wastes 25% of the supply power just to sense the LED current.

And it depends on transistor matching. I don't see how it avoids thermal runaway
by pulsing.

---
Read the article; he states why.
---

He appears to depend upon a slow enough operation with low
enough duty cycles to allow cooling back towards ambient.
Saying, "The thermal-runaway effect does not have time to
develop."
---
Yes, and he's not really exact about the thermal time constant and how
long it takes to cool back close enough to ambient to keep from
ratcheting up to runaway.
---

snip
.

I'm still stuck trying to understand C1's benefit.

It probably keeps the loop from oscillating.

---
During turn-on and turn-off.

Yes. As the article states. But as I point out, the effect of
a larger valued C1 is to cause the leading edge of the pulse
to have a noticeable higher current edge that gradually drops
back to the design value. Small values for C1 would have
little impact on it. Ahyway, he doesn't mention that behavior
and instead says it "prevents transient oscillations" but I
don't see how they occur as a result of switching on and off.

Jon
--
JF
 
On Sun, 14 Jul 2013 11:10:54 -0700, Jon Kirwan
<jonk@infinitefactors.org> wrote:

On Sun, 14 Jul 2013 08:56:02 -0700, John Larkin
jjlarkin@highNOTlandTHIStechnologyPART.com> wrote:

On Sat, 13 Jul 2013 23:15:32 -0700, Jon Kirwan <jonk@infinitefactors.org> wrote:

On Sat, 13 Jul 2013 15:11:40 -0500, John Fields
jfields@austininstruments.com> wrote:

snip
http://www.edn.com/design/power-management/4324682/Current-mirror-drives-multiple-LEDs-from-a-low-supply-voltage
snip

Nice link. Using a diff-amp in a controlled feedback loop.
Thanks.

It wastes 25% of the supply power just to sense the LED current.

A current mirror wastes current. That's what they do.

And it depends on transistor matching.

All current mirrors depend on matching Is, less with
degeneration. From my limited experience, this isn't a big
problem for LED driving if using parts from the same reel.
And it's pretty easy to test for, anyway.

I don't see how it avoids thermal runaway
by pulsing.

Yeah. If one of them heats up more than others, it's Vbe
declines by 2.3mV/C or something like that and this pulls the
others down with it, lowering their Ic. And if the feedback
BJT lowers its Ic the feedback circuit supplies more drive
current... and so on. I've epoxied parts together with
modestly okay effect here. But I've also bought arrays on
ICs, too (which at the prices I pay aren't exactly matched
well but again aren't terrible, either.)

Degeneration would seem to be a partial answer here, too.

A point in this circuit is low overhead drivers. What would
you do if designing a discrete, bipolar solution here? I'd
learn something from a good answer.

Usual EDN standard of quality. They need filler between the ads.

:)

I do NOT like the capacitor there. When inactive (OFF), C1
charges up to Vcc across it, if C1 is small enough (if C1 is
big, then it never reaches Vcc across it.) When active (ON),
the common node between C1 and R4 jumps up towards 1.2V below
Vcc and in doing so causes the collector of Q2 to be driven
below ground, Vcc-1.2V-Vc1=-1.2V since Vc1=Vcc. As C1
discharges it actually borrows current from Q3's collector
(rather than from R3) causing a lower current in R3, yielding
a lower voltage potential for Q2's base... leading to
diversion of R2's current towards Q1 and thus MORE drive
current into Q4 through Q7. The upshot is that upon turn-on,
the peak current in the LEDs is actually HIGHER than designed
and it then gently settles down to the desired level as C1
discharges to a new (lower) potential across its leads. This
is spikey behavior instead of a "soft start." Make C1 bigger
and it gets worse, too. The sharp leading edge will reach
even higher initial currents in the LEDs that way.

So it's value should be kept small. I'm not yet convinced
about the danger of oscillations or the source of them in
this circuit. There are very low impedances on every node of
Q2. It just doesn't seem necessary to me. I don't see how the
small Cbc value and the value of Rb' can conspire to make a
problem here, even with the collector making a small jump at
turn on. And it actually seems to have a downside where I'd
rather simply remove it.

I might also invert the whole structure and delete R1 and D1,
if my LED supply was a volt or more above the micro rail
voltage. The pin output won't be loaded much and will
probably be a very close reflection of the micro rail
voltage. Of course, I'd adjust values, accordingly.

For example, if my micro were running on 3.6V and my LED
supply were 6V (hypothetically) and I wanted 100mA and 5
chains of them (not 4), then I might invert the polarities
and use R3=36 ohms, R2=470 ohms, and R4=270 ohms, kill C1,
and just drive the base of Q1 directly.

I'd start the design by estimating the total base currents
required for Q3 through Q7 (600mA/beta=200, or about 3mA.)
Then I'd double that for the diff-amp pair to 6mA. Given 3.6V
drive and an estimated 0.7V drop on Q1, I get 2.9V at Q1's
emitter. So 2.9V/6mA is 483 ohms. 470 is a standard value and
gives a slight increase in estimated current, so I'd use that
value instead. I also want 3.6V across R3 at 100mA, so 36
ohms. Changing that to 33 or 39 ohms would change the LED
currents by 10% or more. Luckily, 5% resistors do come in 36
ohms. So I'd stick with that. Then, since R4 should be
(assuming 3mA in each branch, hopefully) at about one 100mA
sized Vbe (about 110mV added to 700mV as a guess), so R4
should be about 0.81/3mA, or 270 ohms. Nice. Standard value.
So that's where I'd get my values.

I'm still stuck trying to understand C1's benefit.

It probably keeps the loop from oscillating.

That's what they say. But I still don't see it, probably
because I'm blind and not necessarily because it doesn't do
that. It's why I said I can't see it -- hoping someone would
explain it in detail to me. If you can see the exact
mechanism here, I'd like to see a detailed explanation.

Jon
---
My guess would be that when he built it he found ringing at turn-on
and turn-off which he cured by connecting a cap across various points
in the circuit until the ringing went away.
--
JF
 
On Mon, 15 Jul 2013 19:18:14 -0500, John Fields
<jfields@austininstruments.com> wrote:

On Sun, 14 Jul 2013 11:10:54 -0700, Jon Kirwan
jonk@infinitefactors.org> wrote:

On Sun, 14 Jul 2013 08:56:02 -0700, John Larkin
jjlarkin@highNOTlandTHIStechnologyPART.com> wrote:

On Sat, 13 Jul 2013 23:15:32 -0700, Jon Kirwan <jonk@infinitefactors.org> wrote:

On Sat, 13 Jul 2013 15:11:40 -0500, John Fields
jfields@austininstruments.com> wrote:

snip
http://www.edn.com/design/power-management/4324682/Current-mirror-drives-multiple-LEDs-from-a-low-supply-voltage
snip

Nice link. Using a diff-amp in a controlled feedback loop.
Thanks.

It wastes 25% of the supply power just to sense the LED current.

A current mirror wastes current. That's what they do.

And it depends on transistor matching.

All current mirrors depend on matching Is, less with
degeneration. From my limited experience, this isn't a big
problem for LED driving if using parts from the same reel.
And it's pretty easy to test for, anyway.

I don't see how it avoids thermal runaway
by pulsing.

Yeah. If one of them heats up more than others, it's Vbe
declines by 2.3mV/C or something like that and this pulls the
others down with it, lowering their Ic. And if the feedback
BJT lowers its Ic the feedback circuit supplies more drive
current... and so on. I've epoxied parts together with
modestly okay effect here. But I've also bought arrays on
ICs, too (which at the prices I pay aren't exactly matched
well but again aren't terrible, either.)

Degeneration would seem to be a partial answer here, too.

A point in this circuit is low overhead drivers. What would
you do if designing a discrete, bipolar solution here? I'd
learn something from a good answer.

Usual EDN standard of quality. They need filler between the ads.

:)

I do NOT like the capacitor there. When inactive (OFF), C1
charges up to Vcc across it, if C1 is small enough (if C1 is
big, then it never reaches Vcc across it.) When active (ON),
the common node between C1 and R4 jumps up towards 1.2V below
Vcc and in doing so causes the collector of Q2 to be driven
below ground, Vcc-1.2V-Vc1=-1.2V since Vc1=Vcc. As C1
discharges it actually borrows current from Q3's collector
(rather than from R3) causing a lower current in R3, yielding
a lower voltage potential for Q2's base... leading to
diversion of R2's current towards Q1 and thus MORE drive
current into Q4 through Q7. The upshot is that upon turn-on,
the peak current in the LEDs is actually HIGHER than designed
and it then gently settles down to the desired level as C1
discharges to a new (lower) potential across its leads. This
is spikey behavior instead of a "soft start." Make C1 bigger
and it gets worse, too. The sharp leading edge will reach
even higher initial currents in the LEDs that way.

So it's value should be kept small. I'm not yet convinced
about the danger of oscillations or the source of them in
this circuit. There are very low impedances on every node of
Q2. It just doesn't seem necessary to me. I don't see how the
small Cbc value and the value of Rb' can conspire to make a
problem here, even with the collector making a small jump at
turn on. And it actually seems to have a downside where I'd
rather simply remove it.

I might also invert the whole structure and delete R1 and D1,
if my LED supply was a volt or more above the micro rail
voltage. The pin output won't be loaded much and will
probably be a very close reflection of the micro rail
voltage. Of course, I'd adjust values, accordingly.

For example, if my micro were running on 3.6V and my LED
supply were 6V (hypothetically) and I wanted 100mA and 5
chains of them (not 4), then I might invert the polarities
and use R3=36 ohms, R2=470 ohms, and R4=270 ohms, kill C1,
and just drive the base of Q1 directly.

I'd start the design by estimating the total base currents
required for Q3 through Q7 (600mA/beta=200, or about 3mA.)
Then I'd double that for the diff-amp pair to 6mA. Given 3.6V
drive and an estimated 0.7V drop on Q1, I get 2.9V at Q1's
emitter. So 2.9V/6mA is 483 ohms. 470 is a standard value and
gives a slight increase in estimated current, so I'd use that
value instead. I also want 3.6V across R3 at 100mA, so 36
ohms. Changing that to 33 or 39 ohms would change the LED
currents by 10% or more. Luckily, 5% resistors do come in 36
ohms. So I'd stick with that. Then, since R4 should be
(assuming 3mA in each branch, hopefully) at about one 100mA
sized Vbe (about 110mV added to 700mV as a guess), so R4
should be about 0.81/3mA, or 270 ohms. Nice. Standard value.
So that's where I'd get my values.

I'm still stuck trying to understand C1's benefit.

It probably keeps the loop from oscillating.

That's what they say. But I still don't see it, probably
because I'm blind and not necessarily because it doesn't do
that. It's why I said I can't see it -- hoping someone would
explain it in detail to me. If you can see the exact
mechanism here, I'd like to see a detailed explanation.

Jon

---
My guess would be that when he built it he found ringing at turn-on
and turn-off which he cured by connecting a cap across various points
in the circuit until the ringing went away.
Sure, that is an assumption one can make. But it doesn't help
me learn anything at all.

I already explained, in detail, what I can SEE that C1
actually does do. It makes the circuit WORSE, from one
perspective. I will CAUSE a higher than normal leading edge
current peak. And I completely understand exactly WHY it does
that. I can actually sit down and easily compute the time
constant and the peak excess that will occur for various
component values, even, and get both results right (to the
degree that Spice agrees, anyway.) So I do understand one
thing that C1 does do and I frankly don't like it.

The problem for me remains, in that I still don't see the
"other problem" nor why C1 fixes it. (It's hard to see how
something gets fixed if you can't even see the problem in the
first place, I suppose.)

Anyway, I want to be able to (1) see the problem, (2) COMPUTE
the problem, quantitatively, (3) recognize cases where the
problem is significant enough to be worth fixing, and (4)
understand the effect C1 has on resolving that problem in the
circumstances where it is a significant issue. I can follow a
good argument, if someone would just make one.

So far, I'm clueless. And so far, John Larkin hasn't done
anything to educate me. I'm not complaining. He owes me
nothing. But he has wasted his valuable time on me, in
effect, because what he has written is worse than just vague.

By the way, right now I'm struggling with the idea of how to
actively enable individual half-current mirror BJTs in such a
way that I can selectively enable various combinations of
these extended mirror sections without impacting others which
remain "on." I'm already including emitter degeneration of 1
Ohm (or 100mV at 100mA), which improves significantly in
dealing with variations in Is and temperature variations with
each BJT. And it works fine on a protoboard, so I'm liking
that result. But if one of the BJTs has no load (infinite
resistance in effect), it saturates like crazy and messes
with the other BJTs. (And the degree of that problem gets
worse with emitter degeneration, too.) So I need a cheap and
easy way (I'm coming up with HORRIBLY EXPENSIVE and HARD ways
I don't want to use) to be able to selectively activate an
opposing switch (current source/sink on one side that is
under active control and a BJT switch on the other side which
selectively permits or blocks the programmed current.)

I'm just not seeing a simple way. It's all way too hairy for
my liking. (Can easily see how it might be approached with
MOSFETs, for example, but I get BJTs at better than 2 for a
penny and I get MOSFETs for a LOT MORE than that, even when
on sale.) I'm looking for a BJT and discrete (I can't do
designs with equal emitter areas on common subtrates, for
example, and I can't afford to throw dozens of BJTs at
everything either because I'm not doing an ASIC.)

Fun problem.

Jon
 
On Mon, 15 Jul 2013 19:14:05 -0700, Jon Kirwan
<jonk@infinitefactors.org> wrote:

On Mon, 15 Jul 2013 19:18:14 -0500, John Fields
jfields@austininstruments.com> wrote:

On Sun, 14 Jul 2013 11:10:54 -0700, Jon Kirwan
jonk@infinitefactors.org> wrote:

On Sun, 14 Jul 2013 08:56:02 -0700, John Larkin
jjlarkin@highNOTlandTHIStechnologyPART.com> wrote:

On Sat, 13 Jul 2013 23:15:32 -0700, Jon Kirwan <jonk@infinitefactors.org> wrote:

On Sat, 13 Jul 2013 15:11:40 -0500, John Fields
jfields@austininstruments.com> wrote:

snip
http://www.edn.com/design/power-management/4324682/Current-mirror-drives-multiple-LEDs-from-a-low-supply-voltage
snip

Nice link. Using a diff-amp in a controlled feedback loop.
Thanks.

It wastes 25% of the supply power just to sense the LED current.

A current mirror wastes current. That's what they do.

And it depends on transistor matching.

All current mirrors depend on matching Is, less with
degeneration. From my limited experience, this isn't a big
problem for LED driving if using parts from the same reel.
And it's pretty easy to test for, anyway.

I don't see how it avoids thermal runaway
by pulsing.

Yeah. If one of them heats up more than others, it's Vbe
declines by 2.3mV/C or something like that and this pulls the
others down with it, lowering their Ic. And if the feedback
BJT lowers its Ic the feedback circuit supplies more drive
current... and so on. I've epoxied parts together with
modestly okay effect here. But I've also bought arrays on
ICs, too (which at the prices I pay aren't exactly matched
well but again aren't terrible, either.)

Degeneration would seem to be a partial answer here, too.

A point in this circuit is low overhead drivers. What would
you do if designing a discrete, bipolar solution here? I'd
learn something from a good answer.

Usual EDN standard of quality. They need filler between the ads.

:)

I do NOT like the capacitor there. When inactive (OFF), C1
charges up to Vcc across it, if C1 is small enough (if C1 is
big, then it never reaches Vcc across it.) When active (ON),
the common node between C1 and R4 jumps up towards 1.2V below
Vcc and in doing so causes the collector of Q2 to be driven
below ground, Vcc-1.2V-Vc1=-1.2V since Vc1=Vcc. As C1
discharges it actually borrows current from Q3's collector
(rather than from R3) causing a lower current in R3, yielding
a lower voltage potential for Q2's base... leading to
diversion of R2's current towards Q1 and thus MORE drive
current into Q4 through Q7. The upshot is that upon turn-on,
the peak current in the LEDs is actually HIGHER than designed
and it then gently settles down to the desired level as C1
discharges to a new (lower) potential across its leads. This
is spikey behavior instead of a "soft start." Make C1 bigger
and it gets worse, too. The sharp leading edge will reach
even higher initial currents in the LEDs that way.

So it's value should be kept small. I'm not yet convinced
about the danger of oscillations or the source of them in
this circuit. There are very low impedances on every node of
Q2. It just doesn't seem necessary to me. I don't see how the
small Cbc value and the value of Rb' can conspire to make a
problem here, even with the collector making a small jump at
turn on. And it actually seems to have a downside where I'd
rather simply remove it.

I might also invert the whole structure and delete R1 and D1,
if my LED supply was a volt or more above the micro rail
voltage. The pin output won't be loaded much and will
probably be a very close reflection of the micro rail
voltage. Of course, I'd adjust values, accordingly.

For example, if my micro were running on 3.6V and my LED
supply were 6V (hypothetically) and I wanted 100mA and 5
chains of them (not 4), then I might invert the polarities
and use R3=36 ohms, R2=470 ohms, and R4=270 ohms, kill C1,
and just drive the base of Q1 directly.

I'd start the design by estimating the total base currents
required for Q3 through Q7 (600mA/beta=200, or about 3mA.)
Then I'd double that for the diff-amp pair to 6mA. Given 3.6V
drive and an estimated 0.7V drop on Q1, I get 2.9V at Q1's
emitter. So 2.9V/6mA is 483 ohms. 470 is a standard value and
gives a slight increase in estimated current, so I'd use that
value instead. I also want 3.6V across R3 at 100mA, so 36
ohms. Changing that to 33 or 39 ohms would change the LED
currents by 10% or more. Luckily, 5% resistors do come in 36
ohms. So I'd stick with that. Then, since R4 should be
(assuming 3mA in each branch, hopefully) at about one 100mA
sized Vbe (about 110mV added to 700mV as a guess), so R4
should be about 0.81/3mA, or 270 ohms. Nice. Standard value.
So that's where I'd get my values.

I'm still stuck trying to understand C1's benefit.

It probably keeps the loop from oscillating.

That's what they say. But I still don't see it, probably
because I'm blind and not necessarily because it doesn't do
that. It's why I said I can't see it -- hoping someone would
explain it in detail to me. If you can see the exact
mechanism here, I'd like to see a detailed explanation.

Jon

---
My guess would be that when he built it he found ringing at turn-on
and turn-off which he cured by connecting a cap across various points
in the circuit until the ringing went away.

Sure, that is an assumption one can make. But it doesn't help
me learn anything at all.

I already explained, in detail, what I can SEE that C1
actually does do. It makes the circuit WORSE, from one
perspective. I will CAUSE a higher than normal leading edge
current peak. And I completely understand exactly WHY it does
that. I can actually sit down and easily compute the time
constant and the peak excess that will occur for various
component values, even, and get both results right (to the
degree that Spice agrees, anyway.) So I do understand one
thing that C1 does do and I frankly don't like it.

The problem for me remains, in that I still don't see the
"other problem" nor why C1 fixes it. (It's hard to see how
something gets fixed if you can't even see the problem in the
first place, I suppose.)

Anyway, I want to be able to (1) see the problem, (2) COMPUTE
the problem, quantitatively, (3) recognize cases where the
problem is significant enough to be worth fixing, and (4)
understand the effect C1 has on resolving that problem in the
circumstances where it is a significant issue. I can follow a
good argument, if someone would just make one.

So far, I'm clueless. And so far, John Larkin hasn't done
anything to educate me. I'm not complaining. He owes me
nothing. But he has wasted his valuable time on me, in
effect, because what he has written is worse than just vague.
What I told you is that loop analysis of a thing like this is far too
complex for simple (and free) explanations. And it's nonlinear as
hell, so closed-form solutions are impossible.

So simulate it, or even better build it.

I don't think my explanation of oscillation in 2nd order loops is
"worse than just vague." This is sci.electronics.BASICS after all.

I still don't see any virtue in pulsing, as opposed to DC. If the PWM
rate is high enough to avoid flicker, there's no "cooling off between
pulses" advantage... if there ever was one.


--

John Larkin Highland Technology, Inc

jlarkin at highlandtechnology dot com
http://www.highlandtechnology.com

Precision electronic instrumentation
Picosecond-resolution Digital Delay and Pulse generators
Custom laser drivers and controllers
Photonics and fiberoptic TTL data links
VME thermocouple, LVDT, synchro acquisition and simulation
 
On Tue, 16 Jul 2013 17:45:33 -0700, John Larkin
<jlarkin@highlandtechnology.com> wrote:

snip
So far, I'm clueless. And so far, John Larkin hasn't done
anything to educate me. I'm not complaining. He owes me
nothing. But he has wasted his valuable time on me, in
effect, because what he has written is worse than just vague.
....

What I told you is that loop analysis of a thing like this is far too
complex for simple (and free) explanations. And it's nonlinear as
hell, so closed-form solutions are impossible.
I'm certain that if I take this to a professor at a
university I would get a quick and adequate explanation that
would satisfy me and I would find that your "complexity"
really isn't there, at all. (Doesn't mean I'm not blind --
but I think my eyes would be quickly opened when the right
person answers.) Anyway, I suppose I will have to do that.
I'm interested enough. Might have to wait for late September,
but that's okay. I don't expect or get quantitative answers
from you. But I have appreciated some of your answers all the
same. So don't take it the wrong way. I just don't imagine
you have the math, is all. But you have intuition and I
accept and respect that.

So simulate it, or even better build it.
I have simulated it. But one doesn't (and shouldn't) learn
that way. A simulator is NOT reality. You don't hack and poke
at a simulator to learn about reality. You use it as an
effective tool to avoid doing those closed solutions you are
talking about, but only when you already pretty much
understand the theory and know why and where you are headed.
It's a way of keeping you from missing something important
that you already knew about, but didn't remember this time.
Or in finding those operating points that would have you
poking a calculator over and over again.

I don't think my explanation of oscillation in 2nd order loops is
"worse than just vague."
It was completely useless ... to me.

This is sci.electronics.BASICS after all.
Yes. But this really isn't appropriate for the design group.
It's too basic for that. And I imagine that when I get this
in front of a professor in a few months, I'll find the answer
extremely easy to understand and gather. (And he/she may just
tell me that I'm right and it's not a problem.)

The other effect of the capacitor, the one which forces a
rise in peak current at the leading edge is terrible and I do
understand that very well.

I still don't see any virtue in pulsing, as opposed to DC. If the PWM
rate is high enough to avoid flicker, there's no "cooling off between
pulses" advantage... if there ever was one.
That point is right, as far as the linked circuit goes and
the author's discussion about thermal runaway.

However, in my case and in the case of anyone doing LED
strings, the point is irrelevant. There is NO runaway that
takes place in those cases. I've done it, tried it. It
doesn't happen. What does happen is that the feedback BJT
gets hotter than the others and that reduces the currents
into the LED chains. Since that feedback BJT is under closed
loop control, there is NO RUNAWAY. So it's not an issue.

Pulsing or otherwise.

Jon
 
On Tue, 16 Jul 2013 17:45:33 -0700, John Larkin
<jlarkin@highlandtechnology.com> wrote:

snip
This is sci.electronics.BASICS after all.
snip
Speaking of which, any thoughts on this issue:

By the way, right now I'm struggling with the idea of how to
actively enable individual half-current mirror BJTs in such a
way that I can selectively enable various combinations of
these extended mirror sections without impacting others which
remain "on." I'm already including emitter degeneration of 1
Ohm (or 100mV at 100mA), which improves significantly in
dealing with variations in Is and temperature variations with
each BJT. And it works fine on a protoboard, so I'm liking
that result. But if one of the BJTs has no load (infinite
resistance in effect), it saturates like crazy and messes
with the other BJTs. (And the degree of that problem gets
worse with emitter degeneration, too.) So I need a cheap and
easy way (I'm coming up with HORRIBLY EXPENSIVE and HARD ways
I don't want to use) to be able to selectively activate an
opposing switch (current source/sink on one side that is
under active control and a BJT switch on the other side which
selectively permits or blocks the programmed current.)

I'm just not seeing a simple way. It's all way too hairy for
my liking. (Can easily see how it might be approached with
MOSFETs, for example, but I get BJTs at better than 2 for a
penny and I get MOSFETs for a LOT MORE than that, even when
on sale.) I'm looking for a BJT and discrete (I can't do
designs with equal emitter areas on common subtrates, for
example, and I can't afford to throw dozens of BJTs at
everything either because I'm not doing an ASIC.)

Fun problem.
I would plan to design the power supply to provide about 1.5V
of headroom beyond what is needed by the LEDs at peak current
drive. That should provide a good 1.2V for the current mirror
side of things and 0.3V for the switch on the other end. (If
it can be done with less headroom, so much the better.)

The issue is this:

To have a controlled current sink (or source) capable of
supporting ... let's say at least 8 sinks/sources ... and
where each sink/source can be individually enabled or
disabled without affecting any of the others. Only BJTs as
active devices. Only discretes, no ICs, no opamps, etc.

My imagination fails me for a reasonable solution here. How
about yours?

Jon
 
On Tue, 16 Jul 2013 19:12:24 -0700, Jon Kirwan <jonk@infinitefactors.org> wrote:

On Tue, 16 Jul 2013 17:45:33 -0700, John Larkin
jlarkin@highlandtechnology.com> wrote:

snip
So far, I'm clueless. And so far, John Larkin hasn't done
anything to educate me. I'm not complaining. He owes me
nothing. But he has wasted his valuable time on me, in
effect, because what he has written is worse than just vague.

...

What I told you is that loop analysis of a thing like this is far too
complex for simple (and free) explanations. And it's nonlinear as
hell, so closed-form solutions are impossible.

I'm certain that if I take this to a professor at a
university I would get a quick and adequate explanation that
would satisfy me and I would find that your "complexity"
really isn't there, at all.
I know guys who are working on PhDs in control theory. It's usually a junior or
more often a senior elective in EE schools. Some things just aren't simple.


(Doesn't mean I'm not blind --
but I think my eyes would be quickly opened when the right
person answers.) Anyway, I suppose I will have to do that.
I'm interested enough. Might have to wait for late September,
but that's okay. I don't expect or get quantitative answers
from you. But I have appreciated some of your answers all the
same. So don't take it the wrong way. I just don't imagine
you have the math, is all. But you have intuition and I
accept and respect that.
I have done serious LaPlace type math for control loops, but not lately. Simple
loops, like LDO regulators or boosted opamps, I can do by guessing (if the poles
are far apart) or with a quick Bode plot. Anything high-order of substantially
nonlinear is easier to just simulate.

Today/tonight I'm simulating a boost switching regulator. It's a
peak-current-limited thing with some foldback loops that smooth out startup and
such. There's no way to do that analytically.


So simulate it, or even better build it.

I have simulated it. But one doesn't (and shouldn't) learn
that way. A simulator is NOT reality. You don't hack and poke
at a simulator to learn about reality. You use it as an
effective tool to avoid doing those closed solutions you are
talking about, but only when you already pretty much
understand the theory and know why and where you are headed.
No argument there.

It's a way of keeping you from missing something important
that you already knew about, but didn't remember this time.
Or in finding those operating points that would have you
poking a calculator over and over again.

I don't think my explanation of oscillation in 2nd order loops is
"worse than just vague."

It was completely useless ... to me.
It makes sense to me, and I use the concept often, in real designs. You can
eyeball time constants around a loop, without even a calculator, and estimate
whether it will be stable. And if high performance isn't important, just
increase one of the time constants to make it the dominant pole, get it stable,
and be done. If you want critical damping or something, it takes a little more
work.

Using the single dominant pole idea, the parts values here can be guessed
successfully in an instant.

https://dl.dropboxusercontent.com/u/53724080/Circuits/Current_Sources/Current_Sink.JPG



--

John Larkin Highland Technology Inc
www.highlandtechnology.com jlarkin at highlandtechnology dot com

Precision electronic instrumentation
Picosecond-resolution Digital Delay and Pulse generators
Custom timing and laser controllers
Photonics and fiberoptic TTL data links
VME analog, thermocouple, LVDT, synchro, tachometer
Multichannel arbitrary waveform generators
 
On Tue, 16 Jul 2013 19:26:09 -0700, Jon Kirwan <jonk@infinitefactors.org> wrote:

On Tue, 16 Jul 2013 17:45:33 -0700, John Larkin
jlarkin@highlandtechnology.com> wrote:

snip
This is sci.electronics.BASICS after all.
snip

Speaking of which, any thoughts on this issue:

By the way, right now I'm struggling with the idea of how to
actively enable individual half-current mirror BJTs in such a
way that I can selectively enable various combinations of
these extended mirror sections without impacting others which
remain "on." I'm already including emitter degeneration of 1
Ohm (or 100mV at 100mA), which improves significantly in
dealing with variations in Is and temperature variations with
each BJT. And it works fine on a protoboard, so I'm liking
that result. But if one of the BJTs has no load (infinite
resistance in effect), it saturates like crazy and messes
with the other BJTs. (And the degree of that problem gets
worse with emitter degeneration, too.) So I need a cheap and
easy way (I'm coming up with HORRIBLY EXPENSIVE and HARD ways
I don't want to use) to be able to selectively activate an
opposing switch (current source/sink on one side that is
under active control and a BJT switch on the other side which
selectively permits or blocks the programmed current.)
How about an analog switch and an opamp per transistor? Opamp sections cost,
like, 6 cents each these days.






I'm just not seeing a simple way. It's all way too hairy for
my liking. (Can easily see how it might be approached with
MOSFETs, for example, but I get BJTs at better than 2 for a
penny and I get MOSFETs for a LOT MORE than that, even when
on sale.) I'm looking for a BJT and discrete (I can't do
designs with equal emitter areas on common subtrates, for
example, and I can't afford to throw dozens of BJTs at
everything either because I'm not doing an ASIC.)

Fun problem.

I would plan to design the power supply to provide about 1.5V
of headroom beyond what is needed by the LEDs at peak current
drive. That should provide a good 1.2V for the current mirror
side of things and 0.3V for the switch on the other end. (If
it can be done with less headroom, so much the better.)

The issue is this:

To have a controlled current sink (or source) capable of
supporting ... let's say at least 8 sinks/sources ... and
where each sink/source can be individually enabled or
disabled without affecting any of the others. Only BJTs as
active devices. Only discretes, no ICs, no opamps, etc.
Why not opamps?


--

John Larkin Highland Technology Inc
www.highlandtechnology.com jlarkin at highlandtechnology dot com

Precision electronic instrumentation
Picosecond-resolution Digital Delay and Pulse generators
Custom timing and laser controllers
Photonics and fiberoptic TTL data links
VME analog, thermocouple, LVDT, synchro, tachometer
Multichannel arbitrary waveform generators
 
On Tue, 16 Jul 2013 21:42:45 -0700, John Larkin
<jjlarkin@highNOTlandTHIStechnologyPART.com> wrote:

On Tue, 16 Jul 2013 19:26:09 -0700, Jon Kirwan <jonk@infinitefactors.org> wrote:

On Tue, 16 Jul 2013 17:45:33 -0700, John Larkin
jlarkin@highlandtechnology.com> wrote:

snip
This is sci.electronics.BASICS after all.
snip

Speaking of which, any thoughts on this issue:

By the way, right now I'm struggling with the idea of how to
actively enable individual half-current mirror BJTs in such a
way that I can selectively enable various combinations of
these extended mirror sections without impacting others which
remain "on." I'm already including emitter degeneration of 1
Ohm (or 100mV at 100mA), which improves significantly in
dealing with variations in Is and temperature variations with
each BJT. And it works fine on a protoboard, so I'm liking
that result. But if one of the BJTs has no load (infinite
resistance in effect), it saturates like crazy and messes
with the other BJTs. (And the degree of that problem gets
worse with emitter degeneration, too.) So I need a cheap and
easy way (I'm coming up with HORRIBLY EXPENSIVE and HARD ways
I don't want to use) to be able to selectively activate an
opposing switch (current source/sink on one side that is
under active control and a BJT switch on the other side which
selectively permits or blocks the programmed current.)

How about an analog switch and an opamp per transistor? Opamp sections cost,
like, 6 cents each these days.

I'm just not seeing a simple way. It's all way too hairy for
my liking. (Can easily see how it might be approached with
MOSFETs, for example, but I get BJTs at better than 2 for a
penny and I get MOSFETs for a LOT MORE than that, even when
on sale.) I'm looking for a BJT and discrete (I can't do
designs with equal emitter areas on common subtrates, for
example, and I can't afford to throw dozens of BJTs at
everything either because I'm not doing an ASIC.)

Fun problem.

I would plan to design the power supply to provide about 1.5V
of headroom beyond what is needed by the LEDs at peak current
drive. That should provide a good 1.2V for the current mirror
side of things and 0.3V for the switch on the other end. (If
it can be done with less headroom, so much the better.)

The issue is this:

To have a controlled current sink (or source) capable of
supporting ... let's say at least 8 sinks/sources ... and
where each sink/source can be individually enabled or
disabled without affecting any of the others. Only BJTs as
active devices. Only discretes, no ICs, no opamps, etc.

Why not opamps?
The fundamental answer is because I want to learn how to do
things without them. I have other reasons. But I'd like to
know how to do the design needed to do this without
handholding from opamp designers.

It's like building a telescope by buying a finished mirror.
You can do it. But you don't learn much about the various
orders of defects, how to recognize them, how to correct for
them... that way. There is a huge difference between an
amateur who has fabricated their own optical pieces, learned
how to test and correct the figures, and created their own
final unit and someone who just goes out and buys something.

That is the "elephant in the room" reason. But there are
others, of course.

Jonm
 
On Tue, 16 Jul 2013 19:26:09 -0700, I wrote:

On Tue, 16 Jul 2013 17:45:33 -0700, John Larkin
jlarkin@highlandtechnology.com> wrote:

snip
This is sci.electronics.BASICS after all.
snip

Speaking of which, any thoughts on this issue:

By the way, right now I'm struggling with the idea of how to
actively enable individual half-current mirror BJTs in such a
way that I can selectively enable various combinations of
these extended mirror sections without impacting others which
remain "on." I'm already including emitter degeneration of 1
Ohm (or 100mV at 100mA), which improves significantly in
dealing with variations in Is and temperature variations with
each BJT. And it works fine on a protoboard, so I'm liking
that result. But if one of the BJTs has no load (infinite
resistance in effect), it saturates like crazy and messes
with the other BJTs. (And the degree of that problem gets
worse with emitter degeneration, too.) So I need a cheap and
easy way (I'm coming up with HORRIBLY EXPENSIVE and HARD ways
I don't want to use) to be able to selectively activate an
opposing switch (current source/sink on one side that is
under active control and a BJT switch on the other side which
selectively permits or blocks the programmed current.)

I'm just not seeing a simple way. It's all way too hairy for
my liking. (Can easily see how it might be approached with
MOSFETs, for example, but I get BJTs at better than 2 for a
penny and I get MOSFETs for a LOT MORE than that, even when
on sale.) I'm looking for a BJT and discrete (I can't do
designs with equal emitter areas on common subtrates, for
example, and I can't afford to throw dozens of BJTs at
everything either because I'm not doing an ASIC.)

Fun problem.

I would plan to design the power supply to provide about 1.5V
of headroom beyond what is needed by the LEDs at peak current
drive. That should provide a good 1.2V for the current mirror
side of things and 0.3V for the switch on the other end. (If
it can be done with less headroom, so much the better.)

The issue is this:

To have a controlled current sink (or source) capable of
supporting ... let's say at least 8 sinks/sources ... and
where each sink/source can be individually enabled or
disabled without affecting any of the others. Only BJTs as
active devices. Only discretes, no ICs, no opamps, etc.

My imagination fails me for a reasonable solution here. How
about yours?
Here's the best I can do with my meager imagination, John.
This achieves my goals, but it takes 5 BJTs per section, plus
2 more BJTs for all sections. So the number of BJTs equals
5*N+2, where N is the number of individually controllable
current strings.

It doesn't use a common current setting method, though. Each
string is set individually through R1 (combined with the base
drive voltage at Q1.) So I'd like to improve that detail, as
well.

The example uses 6V for the LED supply and assumes 3.6V for
the microcontroller Vcc for illustration purposes. It also
uses two LEDs in a series chain, also for illustration
purposes.

: ,------ to other sections
: |
: |
: +6 +6 | +6
: | | | |
: | | | |
: | | | |
: | | | |
: |<e Q3 Q5 e>| | |<e Q6
: ,------------------| 2N3906 |-----+---+---| 2N3906
: | |\c c/| | |\c
: | | 2N3906 | | |
: | +6 | | | |
: | | | | | |
: | | | | | |
: | | | | Q7 e>| |
: | \ ,---------------+ 2N3906 |---+
: | R4 / | | | c/| |
: | 1k \ | | | | |
: | / | --- | | |
: | | | \ / D2 \ | |
: | | | --- LED R3 / | \
: | | | | 2.7k \ | / R4
: | | | | / gnd \ 5.6k
: | | | | | /
: |/c Q1 Q2 c\| | | | |
: Micro I/O ---| 2N3904 |---' --- | |
: |>e e<| \ / D1 | |
: | 2N3904 | --- LED | gnd
: | | | |
: '-----+-----' | |<e Q4
: | +----------| 2N3906
: | | |\c
: \ | |
: / R2 | |
: \ 2.7k \ |
: / / R1 |
: | \ 2.7 gnd
: | /
: | |
: gnd |
: |
: gnd
It's basically a diff-amp driven through a level shifter.

I'd love to see creative improvements (WITHOUT OPAMPS OR
MOSFETS.)

Jon
 
On Wed, 17 Jul 2013 09:51:54 -0700, Jon Kirwan
<jonk@infinitefactors.org> wrote:

On Tue, 16 Jul 2013 19:26:09 -0700, I wrote:

On Tue, 16 Jul 2013 17:45:33 -0700, John Larkin
jlarkin@highlandtechnology.com> wrote:

snip
This is sci.electronics.BASICS after all.
snip

Speaking of which, any thoughts on this issue:

By the way, right now I'm struggling with the idea of how to
actively enable individual half-current mirror BJTs in such a
way that I can selectively enable various combinations of
these extended mirror sections without impacting others which
remain "on." I'm already including emitter degeneration of 1
Ohm (or 100mV at 100mA), which improves significantly in
dealing with variations in Is and temperature variations with
each BJT. And it works fine on a protoboard, so I'm liking
that result. But if one of the BJTs has no load (infinite
resistance in effect), it saturates like crazy and messes
with the other BJTs. (And the degree of that problem gets
worse with emitter degeneration, too.) So I need a cheap and
easy way (I'm coming up with HORRIBLY EXPENSIVE and HARD ways
I don't want to use) to be able to selectively activate an
opposing switch (current source/sink on one side that is
under active control and a BJT switch on the other side which
selectively permits or blocks the programmed current.)

I'm just not seeing a simple way. It's all way too hairy for
my liking. (Can easily see how it might be approached with
MOSFETs, for example, but I get BJTs at better than 2 for a
penny and I get MOSFETs for a LOT MORE than that, even when
on sale.) I'm looking for a BJT and discrete (I can't do
designs with equal emitter areas on common subtrates, for
example, and I can't afford to throw dozens of BJTs at
everything either because I'm not doing an ASIC.)

Fun problem.

I would plan to design the power supply to provide about 1.5V
of headroom beyond what is needed by the LEDs at peak current
drive. That should provide a good 1.2V for the current mirror
side of things and 0.3V for the switch on the other end. (If
it can be done with less headroom, so much the better.)

The issue is this:

To have a controlled current sink (or source) capable of
supporting ... let's say at least 8 sinks/sources ... and
where each sink/source can be individually enabled or
disabled without affecting any of the others. Only BJTs as
active devices. Only discretes, no ICs, no opamps, etc.

My imagination fails me for a reasonable solution here. How
about yours?

Here's the best I can do with my meager imagination, John.
This achieves my goals, but it takes 5 BJTs per section, plus
2 more BJTs for all sections. So the number of BJTs equals
5*N+2, where N is the number of individually controllable
current strings.

It doesn't use a common current setting method, though. Each
string is set individually through R1 (combined with the base
drive voltage at Q1.) So I'd like to improve that detail, as
well.

The example uses 6V for the LED supply and assumes 3.6V for
the microcontroller Vcc for illustration purposes. It also
uses two LEDs in a series chain, also for illustration
purposes.

: ,------ to other sections
: |
: |
: +6 +6 | +6
: | | | |
: | | | |
: | | | |
: | | | |
: |<e Q3 Q5 e>| | |<e Q6
: ,------------------| 2N3906 |-----+---+---| 2N3906
: | |\c c/| | |\c
: | | 2N3906 | | |
: | +6 | | | |
: | | | | | |
: | | | | | |
: | | | | Q7 e>| |
: | \ ,---------------+ 2N3906 |---+
: | R4 / | | | c/| |
: | 1k \ | | | | |
: | / | --- | | |
: | | | \ / D2 \ | |
: | | | --- LED R3 / | \
: | | | | 2.7k \ | / R4
: | | | | / gnd \ 5.6k
: | | | | | /
: |/c Q1 Q2 c\| | | | |
: Micro I/O ---| 2N3904 |---' --- | |
: |>e e<| \ / D1 | |
: | 2N3904 | --- LED | gnd
: | | | |
: '-----+-----' | |<e Q4
: | +----------| 2N3906
: | | |\c
: \ | |
: / R2 | |
: \ 2.7k \ |
: / / R1 |
: | \ 2.7 gnd
: | /
: | |
: gnd |
: |
: gnd

It's basically a diff-amp driven through a level shifter.

I'd love to see creative improvements (WITHOUT OPAMPS OR
MOSFETS.)

Jon

No mosfets even?

https://dl.dropboxusercontent.com/u/53724080/Circuits/Current_Sources/LED_Regs.JPG




--

John Larkin Highland Technology, Inc

jlarkin at highlandtechnology dot com
http://www.highlandtechnology.com

Precision electronic instrumentation
Picosecond-resolution Digital Delay and Pulse generators
Custom laser drivers and controllers
Photonics and fiberoptic TTL data links
VME thermocouple, LVDT, synchro acquisition and simulation
 
On Wed, 17 Jul 2013 16:42:46 -0700, Jon Kirwan
<jonk@infinitefactors.org> wrote:

On Wed, 17 Jul 2013 15:40:30 -0700, John Larkin
jlarkin@highlandtechnology.com> wrote:

On Wed, 17 Jul 2013 09:51:54 -0700, Jon Kirwan
jonk@infinitefactors.org> wrote:

On Tue, 16 Jul 2013 19:26:09 -0700, I wrote:

On Tue, 16 Jul 2013 17:45:33 -0700, John Larkin
jlarkin@highlandtechnology.com> wrote:

snip
This is sci.electronics.BASICS after all.
snip

Speaking of which, any thoughts on this issue:

By the way, right now I'm struggling with the idea of how to
actively enable individual half-current mirror BJTs in such a
way that I can selectively enable various combinations of
these extended mirror sections without impacting others which
remain "on." I'm already including emitter degeneration of 1
Ohm (or 100mV at 100mA), which improves significantly in
dealing with variations in Is and temperature variations with
each BJT. And it works fine on a protoboard, so I'm liking
that result. But if one of the BJTs has no load (infinite
resistance in effect), it saturates like crazy and messes
with the other BJTs. (And the degree of that problem gets
worse with emitter degeneration, too.) So I need a cheap and
easy way (I'm coming up with HORRIBLY EXPENSIVE and HARD ways
I don't want to use) to be able to selectively activate an
opposing switch (current source/sink on one side that is
under active control and a BJT switch on the other side which
selectively permits or blocks the programmed current.)

I'm just not seeing a simple way. It's all way too hairy for
my liking. (Can easily see how it might be approached with
MOSFETs, for example, but I get BJTs at better than 2 for a
penny and I get MOSFETs for a LOT MORE than that, even when
on sale.) I'm looking for a BJT and discrete (I can't do
designs with equal emitter areas on common subtrates, for
example, and I can't afford to throw dozens of BJTs at
everything either because I'm not doing an ASIC.)

Fun problem.

I would plan to design the power supply to provide about 1.5V
of headroom beyond what is needed by the LEDs at peak current
drive. That should provide a good 1.2V for the current mirror
side of things and 0.3V for the switch on the other end. (If
it can be done with less headroom, so much the better.)

The issue is this:

To have a controlled current sink (or source) capable of
supporting ... let's say at least 8 sinks/sources ... and
where each sink/source can be individually enabled or
disabled without affecting any of the others. Only BJTs as
active devices. Only discretes, no ICs, no opamps, etc.

My imagination fails me for a reasonable solution here. How
about yours?

Here's the best I can do with my meager imagination, John.
This achieves my goals, but it takes 5 BJTs per section, plus
2 more BJTs for all sections. So the number of BJTs equals
5*N+2, where N is the number of individually controllable
current strings.

It doesn't use a common current setting method, though. Each
string is set individually through R1 (combined with the base
drive voltage at Q1.) So I'd like to improve that detail, as
well.

The example uses 6V for the LED supply and assumes 3.6V for
the microcontroller Vcc for illustration purposes. It also
uses two LEDs in a series chain, also for illustration
purposes.

: ,------ to other sections
: |
: |
: +6 +6 | +6
: | | | |
: | | | |
: | | | |
: | | | |
: |<e Q3 Q5 e>| | |<e Q6
: ,------------------| 2N3906 |-----+---+---| 2N3906
: | |\c c/| | |\c
: | | 2N3906 | | |
: | +6 | | | |
: | | | | | |
: | | | | | |
: | | | | Q7 e>| |
: | \ ,---------------+ 2N3906 |---+
: | R4 / | | | c/| |
: | 1k \ | | | | |
: | / | --- | | |
: | | | \ / D2 \ | |
: | | | --- LED R3 / | \
: | | | | 2.7k \ | / R4
: | | | | / gnd \ 5.6k
: | | | | | /
: |/c Q1 Q2 c\| | | | |
: Micro I/O ---| 2N3904 |---' --- | |
: |>e e<| \ / D1 | |
: | 2N3904 | --- LED | gnd
: | | | |
: '-----+-----' | |<e Q4
: | +----------| 2N3906
: | | |\c
: \ | |
: / R2 | |
: \ 2.7k \ |
: / / R1 |
: | \ 2.7 gnd
: | /
: | |
: gnd |
: |
: gnd

It's basically a diff-amp driven through a level shifter.

I'd love to see creative improvements (WITHOUT OPAMPS OR
MOSFETS.)

Jon

My R2 above provides way too much gain. Should be a lot
smaller -- orders of magnitude.

No mosfets even?

https://dl.dropboxusercontent.com/u/53724080/Circuits/Current_Sources/LED_Regs.JPG

No mosfets. I'm not fighting in that jungle, yet. I might
start if you know where I can get them for 2 for a penny in
10000 qty. (I give stuff away to kids and don't mind spending
$50 to $100 for stuff I will simply give away to anyone
interested.)

Jon
Sorry, a 2N7002 costs about 2 cents, about the same as a BCX70.

Those circuits could be made to work with a BCX70 or similar NPN.


--

John Larkin Highland Technology, Inc

jlarkin at highlandtechnology dot com
http://www.highlandtechnology.com

Precision electronic instrumentation
Picosecond-resolution Digital Delay and Pulse generators
Custom laser drivers and controllers
Photonics and fiberoptic TTL data links
VME thermocouple, LVDT, synchro acquisition and simulation
 
On Wed, 17 Jul 2013 17:00:07 -0700, John Larkin
<jlarkin@highlandtechnology.com> wrote:

On Wed, 17 Jul 2013 16:42:46 -0700, Jon Kirwan
jonk@infinitefactors.org> wrote:

On Wed, 17 Jul 2013 15:40:30 -0700, John Larkin
jlarkin@highlandtechnology.com> wrote:

On Wed, 17 Jul 2013 09:51:54 -0700, Jon Kirwan
jonk@infinitefactors.org> wrote:

On Tue, 16 Jul 2013 19:26:09 -0700, I wrote:

On Tue, 16 Jul 2013 17:45:33 -0700, John Larkin
jlarkin@highlandtechnology.com> wrote:

snip
This is sci.electronics.BASICS after all.
snip

Speaking of which, any thoughts on this issue:

By the way, right now I'm struggling with the idea of how to
actively enable individual half-current mirror BJTs in such a
way that I can selectively enable various combinations of
these extended mirror sections without impacting others which
remain "on." I'm already including emitter degeneration of 1
Ohm (or 100mV at 100mA), which improves significantly in
dealing with variations in Is and temperature variations with
each BJT. And it works fine on a protoboard, so I'm liking
that result. But if one of the BJTs has no load (infinite
resistance in effect), it saturates like crazy and messes
with the other BJTs. (And the degree of that problem gets
worse with emitter degeneration, too.) So I need a cheap and
easy way (I'm coming up with HORRIBLY EXPENSIVE and HARD ways
I don't want to use) to be able to selectively activate an
opposing switch (current source/sink on one side that is
under active control and a BJT switch on the other side which
selectively permits or blocks the programmed current.)

I'm just not seeing a simple way. It's all way too hairy for
my liking. (Can easily see how it might be approached with
MOSFETs, for example, but I get BJTs at better than 2 for a
penny and I get MOSFETs for a LOT MORE than that, even when
on sale.) I'm looking for a BJT and discrete (I can't do
designs with equal emitter areas on common subtrates, for
example, and I can't afford to throw dozens of BJTs at
everything either because I'm not doing an ASIC.)

Fun problem.

I would plan to design the power supply to provide about 1.5V
of headroom beyond what is needed by the LEDs at peak current
drive. That should provide a good 1.2V for the current mirror
side of things and 0.3V for the switch on the other end. (If
it can be done with less headroom, so much the better.)

The issue is this:

To have a controlled current sink (or source) capable of
supporting ... let's say at least 8 sinks/sources ... and
where each sink/source can be individually enabled or
disabled without affecting any of the others. Only BJTs as
active devices. Only discretes, no ICs, no opamps, etc.

My imagination fails me for a reasonable solution here. How
about yours?

Here's the best I can do with my meager imagination, John.
This achieves my goals, but it takes 5 BJTs per section, plus
2 more BJTs for all sections. So the number of BJTs equals
5*N+2, where N is the number of individually controllable
current strings.

It doesn't use a common current setting method, though. Each
string is set individually through R1 (combined with the base
drive voltage at Q1.) So I'd like to improve that detail, as
well.

The example uses 6V for the LED supply and assumes 3.6V for
the microcontroller Vcc for illustration purposes. It also
uses two LEDs in a series chain, also for illustration
purposes.

: ,------ to other sections
: |
: |
: +6 +6 | +6
: | | | |
: | | | |
: | | | |
: | | | |
: |<e Q3 Q5 e>| | |<e Q6
: ,------------------| 2N3906 |-----+---+---| 2N3906
: | |\c c/| | |\c
: | | 2N3906 | | |
: | +6 | | | |
: | | | | | |
: | | | | | |
: | | | | Q7 e>| |
: | \ ,---------------+ 2N3906 |---+
: | R4 / | | | c/| |
: | 1k \ | | | | |
: | / | --- | | |
: | | | \ / D2 \ | |
: | | | --- LED R3 / | \
: | | | | 2.7k \ | / R4
: | | | | / gnd \ 5.6k
: | | | | | /
: |/c Q1 Q2 c\| | | | |
: Micro I/O ---| 2N3904 |---' --- | |
: |>e e<| \ / D1 | |
: | 2N3904 | --- LED | gnd
: | | | |
: '-----+-----' | |<e Q4
: | +----------| 2N3906
: | | |\c
: \ | |
: / R2 | |
: \ 2.7k \ |
: / / R1 |
: | \ 2.7 gnd
: | /
: | |
: gnd |
: |
: gnd

It's basically a diff-amp driven through a level shifter.

I'd love to see creative improvements (WITHOUT OPAMPS OR
MOSFETS.)

Jon

My R2 above provides way too much gain. Should be a lot
smaller -- orders of magnitude.

No mosfets even?

https://dl.dropboxusercontent.com/u/53724080/Circuits/Current_Sources/LED_Regs.JPG

No mosfets. I'm not fighting in that jungle, yet. I might
start if you know where I can get them for 2 for a penny in
10000 qty. (I give stuff away to kids and don't mind spending
$50 to $100 for stuff I will simply give away to anyone
interested.)

Jon

Sorry, a 2N7002 costs about 2 cents
I have some, of course. Cheapest mosfet I could find.

about the same as a BCX70.
Perhaps. But I buy PN2222A for less than 0.4 cents each. And
3904/3906, if I keep my eyes open, I find at only slightly
more. The bcx70 is something I'll look around for, too, then.
But it doesn't seem quite cheap enough for me, today.

I give away 50 at a time. So the difference between .00385
and .02 is important to me.

In any case, I want to see how this is done with BJTs.

Those circuits could be made to work with a BCX70 or similar NPN.
Okay. So...

Jon
 
On Wed, 17 Jul 2013 19:22:27 -0700, Jon Kirwan <jonk@infinitefactors.org> wrote:

On Wed, 17 Jul 2013 15:40:30 -0700, John Larkin
jlarkin@highlandtechnology.com> wrote:

https://dl.dropboxusercontent.com/u/53724080/Circuits/Current_Sources/LED_Regs.JPG

So I just decided to take a look (besides seeing the mosfet.)

Looking at schematic A: I see a diff-amp with 0.2V input (I
suppose you would tell me to use a R-divider if I were being
cheap about this.)
The +0.2 could be a shared rail. Current ewquirement is low.


One of its collectors (let's call that PNP
Q1 for now) collector is used to pull up on the base of
another NPN (call it Q2 for now) that ties the mosfet gate.
To get the voltage at the base of Q2 high enough that it is
slightly or usefully active, the collector of Q1 must reach
near to 0.65V or so. But the base is 0.2V. You see any
problem here?
No. It should work.

I guess you offered as much thought as you felt
I deserved.
With your attitude, you don't deserve much.


--

John Larkin Highland Technology Inc
www.highlandtechnology.com jlarkin at highlandtechnology dot com

Precision electronic instrumentation
Picosecond-resolution Digital Delay and Pulse generators
Custom timing and laser controllers
Photonics and fiberoptic TTL data links
VME analog, thermocouple, LVDT, synchro, tachometer
Multichannel arbitrary waveform generators
 
On Wed, 17 Jul 2013 19:34:50 -0700, John Larkin
<jjlarkin@highNOTlandTHIStechnologyPART.com> wrote:

On Wed, 17 Jul 2013 19:22:27 -0700, Jon Kirwan <jonk@infinitefactors.org> wrote:

On Wed, 17 Jul 2013 15:40:30 -0700, John Larkin
jlarkin@highlandtechnology.com> wrote:

https://dl.dropboxusercontent.com/u/53724080/Circuits/Current_Sources/LED_Regs.JPG

So I just decided to take a look (besides seeing the mosfet.)

Looking at schematic A: I see a diff-amp with 0.2V input (I
suppose you would tell me to use a R-divider if I were being
cheap about this.)

The +0.2 could be a shared rail. Current ewquirement is low.


One of its collectors (let's call that PNP
Q1 for now) collector is used to pull up on the base of
another NPN (call it Q2 for now) that ties the mosfet gate.
To get the voltage at the base of Q2 high enough that it is
slightly or usefully active, the collector of Q1 must reach
near to 0.65V or so. But the base is 0.2V. You see any
problem here?

No. It should work.
Explain why.

I guess you offered as much thought as you felt
I deserved.

With your attitude, you don't deserve much.
Saturated BJT in the diff-amp?

Jon
 
On Wed, 17 Jul 2013 19:42:17 -0700, I wrote:

snip
Saturated BJT in the diff-amp?
(The base drive will have to be significant, relative to the
common diff-amp emitter currents. That means a stiff divider.
Gain will also be poor, I believe.)

Jon
 

Welcome to EDABoard.com

Sponsor

Back
Top