Once you have the power supply built and tested as a standalone
circuit, you need to consider how it’s going to interact with
the circuit it’s meant to power. (I call this the “load
circuit” below.) The characteristics of that circuit affect the
power supply, so you have to consider the two as a complete system.
Where Should the Power Switch Go?
You can put the power switch either on the AC side of the
power supply, or between the load and the power supply. Or both,
or neither.
Which is best? It depends.
Switch on the AC Side
With the switch on the AC side of the power supply, the power
supply and its load start up and shut down together. There is a
potential for problems here because the two circuits do not instantly
power up and power down. One circuit will come up before the other,
and one will shut down before the other.
Whether it works or not is all very contingent. Here are the
possibilites that cover the vast majority of real-world cases:
- everything works fine
- the load kills the regulator during startup
- the load kills the regulator during shutdown
- the combined circuit simply doesn’t start correctly
Since I can’t know the details of all possible configurations,
I can’t recommend this as a default configuration because I
have to assume equal probabilities for all the possibilites. 75%
chance of failure doesn’t make me happy.
If you do know the details of the two circuits, the probabilities
shift, so you can make better predictions than that.
If the load circuit has enough reservoir capacitance, it can
still be running when the regulator shuts down. If that happens,
the load circuit can reverse-bias the protection diodes around the
regulator. If done repeatedly with a big enough current dump, this
can kill the protection diodes, and then on the next power cycle,
the regulator, too. If that’s happening to you, see the next section.
If instead the load circuit shuts down first, that pretty much
ensures that the regulator won’t die during shutdown. But,
that can happen for two very different reasons, which affects whether
there can be a problem during startup instead.
The first possibility is that the load is relatively light, so that
the power supply’s big power reservoir keeps
the regulator running until after the load circuit shuts down. Such
a light load will generally not cause problems on startup, either,
so all is fine.
If on the other hand the load circuit has a high current drain
but also a big power reservoir, it’ll behave similarly to the
light-load case during shutdown. But on startup, the regulator will
see the load as nearly a dead short circuit until the load reservoir
charges sufficiently. If the regulator is already running when the
load comes up, the full power supply voltage across that near short
circuit will cause a higher charging current than if the regulator is
coming up along with the load. If the regulator’s protection
circuitry is inadequate, the regulator may die in the higher load
situation but not when both circuits come up together.
If you’re using the power supply to run a DIY amplifier, you
have a great resource available: search the forums to find reports
from people with similar configurations to yours. This reduces the
probability stuff above to rubble — the collective wisdom of
the forums trumps generalities.
Switch Between the Load and Power Supply
If you always power the load up and down by flipping a switch
between the two circuits, you eliminate the possibilities that the
regulator doesn’t start up correctly, and that the load is
killing the regulator during shutdown. It simply becomes a question
of whether the startup load kills the regulator or not. If you
don’t know in advance which way things will play out and you
just want to pick one method and try it, I think this gives you
better odds of success. If this switching setup works for you, the
only downside is that there’s a constant power wastage whether
the system is running or not, that being the regulator’s idling
current. It’s only 10-20 mA, but some people care about such
small losses.
If for some reason you have a problem in this configuration, moving
the switch to the AC side to fix it is a bad bet if you don’t
know why you’re having the problem. It may be that moving the
switch is exactly the right fix, but if you’re just trying things
without understanding exactly what the problem is, this would just
be a desperation move, its only virtue being that it’s easy
to try. The fixes in the next section
are going to have a higher chance of success.
No Switches
If the power supply is cased separately from the load circuit, no
switches are actually necessary. You can turn the whole system on and
off by plugging and unplugging the AC cord to the power supply. If
you want the power supply to come up before the load circuit,
you simply don’t plug the power supply into the load circuit
until you’ve plugged the power supply into the AC supply. The
connectors are the switches.
Two Switches
Now, if the two circuits are in a single case and you want the
power supply to come up first, it can still be useful to have a
switch on the AC side as well. The AC side switch would probably be
on the back of the enclosure, and normally be left on; it would only
exist for those times when you want the power supply to be completely
shut down, such as when going on vacation. The switch between the
two circuits would probably be on the front side of the enclosure,
for convenience, as it’s the one normally used to turn the load
circuit on and off.
The Regulator Keeps Dying. How Can I Fix This?
Most of the time, the regulator dies due to an incorrect switch arrangement. If you’ve already
tried changing that, here are some things you can try to keep your
regulator alive and happy.
Reduce the Load Capacitance
The single biggest mistake people make when building amplifiers is using too much rail capacitance.
The thought process goes that if low rail capacitance is bad,
then lots and lots must be good. It is, up to a point, but you can
go overboard. There are two problems stemming from having too big
a rail cap bank.
The first problem is, the bigger the cap bank, the more energy
it takes to charge it. The energy required is also related to the
charging voltage, so this problem is more severe if you have the
switch between the power supply and the load. (But see the next
paragraph before you decide that you shouldn’t put the switch
there!) For an excellent description of the processes involved, see this
page. If you work through the math on that page, you find that
there is no way you can charge big rail capacitors as fast as they
can theoretically be charged. Some current limiter somewhere is going
to kick in early on, so the charge time will end up taking something
on the order of a second. That’s plenty of time for disaster
to happen down in the microelectronic world.
At turn-off, we have a different problem: now we have to dump all
that energy in the rail cap banks in the load circuit and the power
supply. A good part of it will go into driving the load circuit as
it shuts down, but if the power supply’s reservoir cap falls
in voltage faster than that of the load circuit, current will start
flowing back from the load into the power supply once the power
supply’s voltage drops far enough below the load. Enough
current flowing backwards through the regulator will kill it,
which is why the protection diode exists:
it starts conducting before the regulator starts running backwards,
saving the regulator. But, if the rail cap bank is big enough, the
discharge current through this diode will kill it eventually. With the
protection diode blown, the regulator will probably die the next time
the system is powered down. You avoid this problem entirely if you put
the power switch between the power supply and its load circuit, because
the power supply can shut down separately from the load circuit. You
still need D2 to protect against C8 running the regulator
backwards during shutdown, but it’s a much smaller cap.
Bigger rail cap banks exacerbate all of these problems. If the
documentation for the circuit being powered puts some limit on
the recommended amount of capacitance, heed it. Using the maximum
recommended capacitance vs. only a fair fraction of it usually gives
only a small improvement.
Change the Regulator Type
If the regulator is dying and the switch is on the AC side of
the power supply, you can try changing to a higher current version
of the same regulator you’re using now. For example, use the
LM338 instead of the LM317. The higher output current ability means
it will have less trouble charging the load’s rail capacitance
than the smaller regulator. It may also actually perform better,
too, because higher output current implies lower output impedance,
always a good thing in a power supply.
If the regulator doesn’t actually die, but rather fails to
start correctly when you power both circuits up together, it’s
probably that you’re using an LDO and the load capacitance is
too high. The fix is simple: switch to a standard regulator. You may
be able to fix this by moving the power switch to the DC side of the
power supply, but because this goes against the datasheet’s
recommendations, I can’t recommend it. Use the right part for
the job.
Add a Soft-Start Circuit
If the switch is on the AC side of the power supply and the
regulator is dying due to having too high a load on startup, you can
add some kind of soft-start circuit to fix this. There are a number
of choices.
The simplest is to put an NTC thermistor between the supply and
the load. An NTC thermistor has a relatively high resistance at
room temperature, so at turn-on, it limits the current charging
the load’s rail capacitors. As the thermistor heats up,
its resistance drops, so the power supply becomes relatively low
impedance. A typical thermistor made for this purpose starts at
33 Ω at room temperature, and drops to about 0.5 Ω at
0.3 A of load current. (This is just one example: you’ll have
to run the numbers for the thermistor you actually use.) The downside
of this is that even half an ohm is pretty high as output impedances
for power supplies go, but if it keeps the reguator working, it may
be a price you’re willing to pay.
There are many more complicated circuits of this type. Google
for “soft start,” “inrush current limit”
and other such terms.
Use a Bigger Protection Diode
If the regulator dies, the first thing to test is whether the
protection diode across it (D2) has also died. If it
has, you know that it died first, and then the regulator was killed
because the diode wasn’t there to protect it. If that’s
happening and none of the above solutions works or is palatable, you
can simply try using a bigger protection diode. You can find diodes
capable of handling up to 10 A that can be crammed into this position.
It’s a bit brute-force, but it can work.