Maker Pro
Maker Pro

Transistor as a current limiter

J

Jon Kirwan

Jan 1, 1970
0
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. 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
 
J

Jon Kirwan

Jan 1, 1970
0
<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.
And it's pretty easy to test for, anyway.
<snip>

I should explain more about my experiences, I suppose.

I've no doubt at all that if one of the BJTs carries a
different Vce than others in the chain, and if the currents
are enough, thermal runaway just happens. The BJT with the
larger Vce is going to have its Vbe decline steadily with
some bad news.

But LEDs present fairly consistent Vce's to their driving
BJTs. (Usually a very low Vce, in fact, if you are keeping
the margins down to minimize wasted power.) The only
substantially different Vce is the current mirror BJT that
sets the current and is under loop control. It's almost
always the case that the control BJT is the very hottest one,
more so than any of the LED driver BJTs, since it has the
highest Vce.

If the control BJT heats up, then the response by the rest of
the system is to have lower Ic's. And since its dissipation
is fixed by design (its Vce is set and so is its Ic), it
settles at some resulting Vbe and the other BJTs exhibit less
Ic as they have a lower Vbe drive, less Vce, and are cooler.
So no runaway.

Jon
 
J

Jon Kirwan

Jan 1, 1970
0
So as Q3 heats up, all the LEDs get dimmer.

Ic goes 2:1 with 25 mV of Vbe change. Vbe goes 2.5 mV/deg c. So it won't take
many degs of temperature difference to seriously affect LED currents.

Yeah. But it's not runaway. And besides, it's fixable with
ease with a slight design change.

Jon
 
J

Jon Kirwan

Jan 1, 1970
0
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
 
J

Jon Kirwan

Jan 1, 1970
0
<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
 
J

Jon Kirwan

Jan 1, 1970
0
<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
 
J

Jon Kirwan

Jan 1, 1970
0
<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
 
J

Jon Kirwan

Jan 1, 1970
0
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
 
J

Jon Kirwan

Jan 1, 1970
0
....

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
 
J

Jon Kirwan

Jan 1, 1970
0
<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
 
J

Jon Kirwan

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

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
 
J

Jon Kirwan

Jan 1, 1970
0
Speaking of which, any thoughts on this issue:


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
 
J

Jon Kirwan

Jan 1, 1970
0
J

Jon Kirwan

Jan 1, 1970
0
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
 
J

Jon Kirwan

Jan 1, 1970
0

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.) 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? I guess you offered as much thought as you felt
I deserved.

Jon
 
J

Jon Kirwan

Jan 1, 1970
0
The +0.2 could be a shared rail. Current ewquirement is low.


One of its collectors (let's call that PNP

No. It should work.

Explain why.
I guess you offered as much thought as you felt

With your attitude, you don't deserve much.

Saturated BJT in the diff-amp?

Jon
 
J

Jon Kirwan

Jan 1, 1970
0
<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
 
J

Jon Kirwan

Jan 1, 1970
0
I did and was summarily ignored except that he later wrote
that I could replace the mosfets with BJTs if I wanted to.

I'm below 200mV of headroom required for surprisingly good
current control with BJTs only. I still need to fix it so
that the LEDs aren't in the middle of the circuit, but can
share a common anode or cathode. That part was just because
it was easier to think about at the time.

Jon
 
Top