Well I tried it out on the weekend. Actually the reverse setup just
for the test. ie. I used a MJE3055 NPN instead of the PNP and a
positive (5v) source on the base. It worked fine and gave a 2 second
fade using a 1k base resistor and a 2200uF cap. Only problem was the
transistor got very hot during the fade, even when only driving about
300mA.
The reason I was using a transistor rather than a mosfet was because
of that problem. I knew that mosfets don't like having the gate turned
down but I thought transistors were ok. Isn't that the whole point of
a transistor, being able to vary the base current to vary the drive
current?
Hmm... Well, the simple view is that when a transistor "gradually turns down
the current" it does this by gradually increasing the voltage drop across itself
-- the V(CE) drop. When "fully on" or saturated, this V(CE) is about .15V-.35V
and the current gain is not so good, usually somewhere in the 10-20 range.
Saturated, with I(C) = 1A on a MJE3055, V(CE) is about 0.21V and the base
current is about -40mA (gain is about 25.) V(BE) is well above V(CE), at about
0.78V. Dissipation is .78*.04+.21*1 (plus a tiny bit of heating, perhaps 1mW,
from I(BC)) or about 250mW. Most of this power is from the V(CE) difference and
the I(C) -- 210mW. That's not bad when the NPN is fully on, but this is your
focus for understanding why it gets hot when the NPN isn't fully on.
The full 35V sits across your lamp load and the NPN's CE connection. Combined,
they have to pick up this entire voltage. When most of it is working on the
lamp, the lamp is dissipating the heat. Fine, that means the transistor doesn't
have to carry much dissipation. But as you remove voltage across the lamp,
while still maintaining some current flow, then the rest of the voltage has to
be picked up by your NPN.
Ignoring base current and just focusing on the V(CE)*I(C) power consumption of
your NPN:
V(Supply) = 35V
V(Gnd) = 0V
V(C) = V(Supply) - R(Load) * I(Load)
V(CE) = V(C) - V(Gnd), in the NPN switch config I'm assuming you used
I(C) = I(Load)
so,
P(NPN) = V(CE) * I(C) = (V(C) - V(Gnd)) * I(Load)
= V(C) * I(Load)
= (V(Supply) - R(Load) * I(Load)) * I(Load)
= V(Supply)*I(Load) - R(Load)*I(Load)^2
You can see that this is the difference of a power varying linearly with load
current and a power varying on the square of the load current. The latter term
will go down faster than the first term.
The maximum can be found by taking the differential and setting it equal to
zero, or:
d P(NPN) / d I(Load) = V(Supply) - 2 * R(Load) * I(Load)
V(Supply) - 2 * R(Load) * I(Load) = 0
V(Supply) = 2 * R(Load) * I(Load)
therefore,
I(Load) = (1/2) * (V(Supply) / R(Load))
for maximum power dissipation in the NPN.
Or when you are at half of your full-on current, roughly speaking. So let's
look at that. At that level, about 1/2 the total supply voltage is sitting on
the NPN transistor. That's about 17.5V. The current though the load at this
point is 1/2A, too. So the transistor must dissipate about 17.5V * 0.5A or
8.75W. That's a lot more than 0.25W! Some 35 times as much.
In other words, it's exactly during the slow turn-off that you should expect the
higher dissipations!
It won't matter, by the way, if you substitute in a MOSFET (which you could do,
as well, and perhaps more easily.) The above calculations don't really care.
The MOSFET will have to carry that dissipation, too.
This is one reason why some folks suggested PWM. With PWM, you either operate
the transistor in the full-on mode or the full-off mode, keeping the dissipation
low in the NPN. Then, you flicker it fast enough so that the human eye doesn't
see the pulsing.
With regular filament lamps on AC, they are actually flickering a little,
because of the 60Hz/50Hz zero crossing, but the filament takes a much longer
time to radiate and reduce its temperature so the power is already increasing
again by the time it gets slightly cooler. I've "scope'd" this with a detector
and, for example, might see variations from 95% to 105% at 120Hz due to the
zero-cross of AC on tungsten lamps. If you DC regulate your V(Supply) you
should pulse your PWM fast enough to get some decent averaging going on in
either the filament, your eye, or both. If you just supply the AC directly, a
triac can be used along with a simple zero-cross detect for your CPU and you can
use either full half-cycle control or else phase control to adjust the
intensity. Some protection circuitry (RC snub) may be needed to keep your
control pin safe, though.
LEDs can turn full-off very fast, so the variations are greater with them and
the need for somewhat faster flickering to get our eye to do the averaging,
rather than depending somewhat on the thermal mass of a filament.
I'm a hobbyist and not a professional designer, so take what I say with a grain
of salt. Someone else may wish to correct me or else add considerations of
which I failed to take note.
Jon