LOLbooster: Power Supply

Next up: The power supply. LOLbooster includes one 6V regulator for the various logic chips, but where most DIY designs defer track-level voltage regulation to the wall-wart, I’ve opted to include it on the board. Why? Because wall-wart regulators are very good at keeping a steady voltage—at the power jack. But we, finicky modelers that we are, want to keep a steady voltage not at the power jack, but at the rails. Which is an entirely different bucket of colored horses: It means we need regulation on the booster itself. Read on.

1 Nov 2010: Turns out the load regulation circuit below (the bit involving the LM358) is a flawed design. A working design will be included in the final schematics, but the ones included in this post are unworkable.

1 Sept 2010: I’ve added a bit to the schematic to reflect the points that Ken raises in the comments, including a bridge rectifier on the input, and a filter capacitor on the difference amplifier.

31 Aug 2010: I’ve added some discussion of the power adapter—which I completely forgot in my earlier draft—to the end of the discussion, below

First, let’s set out some desiderata.

  • Must provide a logic-level supply.
  • Voltage to track should not decrease with increased load.
  • Voltage to track should be user-selectable for N and HO gauges.
  • Voltage to track should have fine-grain tenability.

Here is the schematic to reference as I discuss how I’ve attempted to meet the desiderata. As usual, I provide the schematic under a Creative Commons Attribution-ShareAlike 3.0 Unported License. Eagle files will be made available once the entire design is complete.

LOLbooster Power Supply REV B

First, the logic level supply. I’ve picked a somewhat unconventional L7806 6V regulator for logic-levels, as most CMOS devices can run safely at this level, and it won’t have to dissipate as much power as a 5V regulator, since it may be run on something as large as a 20VDC power supply. That said, it might be called upon to dissipate as much as 5 or 6W. By tying its input the the larger regulator’s output (see below), we can reduce the power dissipation by several volts. Not much else to be said about this one. Dissipation numbers can’t really be crunched until the booster design is complete: I’ll be designing the input stage with an eye to minimizing current consumption on the logic supply.

I’ve opted for on-board regulation of the track voltage, something novel for DIY boosters. The power comes through a largish rectifier bridge—so it doesn’t matter which socket gets the hot wire, and which the neutral; nor does it matter if the power supply is AC or DC. On board regulation requires a big ol’ regulator: here, an L338. It’s basically a hefty, adjustable version of the regulator above. But you have no doubt noticed the auxiliary circuitry is a tad bit more complex. Normally, adjustable regulators watch the voltage difference between their output and ground by way of negative feedback: You construct a voltage divider such that the adjustment pin sees 1.25V when the output voltage is at the desired level. But this method isn’t enough to get us a steady voltage on the rails.

As the load increases on the rails, the voltage drop across the h-bridge increases in train (cue drum hit). At low loads, the voltage drop will be less than about half a volt, but as the load increases towards 3A, the voltage drop increases to about 4 volts! Which means that if we relied on external regulation to provide, say, 12V, at no load, then at maximum load the rails near the booster output would only see about 8 of those 12—and rails further away would see even less. Ugh!

But by tying the adjust pin of an adjustable regulator to the rails, we can ensure a steady voltage, no mater the load. However, doing so is non-trivial, because the “low” signal to the rails will always be floating above ground, and it will increase with increasing load.

The adjust pin on the regulator expects to see 1.25V when the voltage is where it should be. If the adjust pin goes higher, the output voltage goes lower; if the adjust pin goes lower, the output voltage goes higher. Negative feedback. But, as the current increases, the switches in the h-bridge will be causing the voltage at the tracks to drop lower and lower for the same input voltage: That’s no good!

So I call upon the venerable LM358, configured as a voltage subtractor, to measure the voltage at the tracks, with the output set to control the regulator’s adjust pin to maintain a constant track voltage even as the load changes (and with it the voltage drop across the switching elements). I’d like to think that was clever.

The diodes are a bridge-rectifier to transform the DCC signal into a plain DC level for easy measuring. The resistor networks are voltage dividers to ensure that the 12V—16V or more across the rails are reduced to safe levels, within the 6V logic-level range. The op-amp measures the difference between the (reduced) low and high voltages. Finally, the output of the op-amp (which is set up to range between roughly 2 and 3V) is run through a second voltage divider, one that includes a trimpot. The trimpot is for setting the desired track voltage, and the resistor values have been selected to allow variation between about 11.5VDC and 16.5VDC. This second voltage divider ensures that the op-amp outputs exactly 1.25V when the difference between the “low” and “high” DCC voltages is at the desired range.

(I have decided to rely on just the trimpot to save costs; there is no gauge selection switch, as on some commercial boosters. All track voltage adjustments are made with this trimpot. Really, how often are you going to change it around, anyway?)

What about the supply voltage? How big a wall-wart does this thing need? Naturally, it depends on what voltage you want on the rails. In general, you will need to take the desired track voltage, and add 8V—which may sound like a lot, but that’s the cost of regulated track voltage. The rectifier drops 2V, and the L358 drops 2V, these are just a brute fact that we can’t do anything about. The h-bridge will drop anywhere between half a volt (at no load) to 3.6V (worst case full load). 3.6V+2V+2V = 7.6V, rounded up is 8V. So to maintain full voltage at full loads, we will need a power adapter that can supply the track voltage + 8V. So, 20V is the minimum for N-scale, and 22V might be more realistic.

But you don’t want just any old big supply, either. The power dissipated by the L358 is a function of the current draw on the rails and the voltage dropped across the regulator. Let’s suppose, for the moment, that we want 12V at the rails. We need a minimum of 20V to avoid voltage drops under heavy load. At high loads (say, 3A), the power dissipated by the regulator is (18V-15.6V)*3A = 7W—not bad. But suppose we use a 22V power supply instead of an 20V. Now we’re looking at 13.2W under load—ouch, that’s hot. And a 24V supply: 19.2W—forget about it, the regulator is pretty much going to fry at this point without a heatsink the size of Delaware.

So we’ll need a largish heatsink. I want to run my tracks at 13V, but no-one (that I can see, anyway) makes a 21V power supply. I’m going to have to move a step up, to a 22V. (As will folks running at 15V will have problems locating a 23V supply, necessitating a move to 24V.) Which means some of us may well see something close to 12W in the worst case. So the heatsink used must be selected with this figure in mind.

Here’s the bill of materials for the power supply.

LOLbooster Power Supply Bill of Materials
Label Value Description Newark Part No. Newark Price Notes
$10.166
C6 0.33uF 50V 46P6304 $0.104
C7,8,12 100nF 25V 98K1025 $0.171
C9 10uF 50V 69K7855 $0.038
C10 22uF 16V 70K9672 $0.036
C11 150uF 35V 25M9194 $0.308
B1 GBU806 92K0234 $0.859 Lots of substitutions available
B2 W02 14M6583 $0.222 Lots of substitutions available
IC2 L7806 89K1383 $0.393
IC3 LM338 41K4748 $2.560
IC4 LM358N 89K0710 $0.219
R3,5,7 30K 1% 59K8669 $0.138
R4,6 8K2 1% 58K3880 $0.092
R8 20K trimpot 61M2862 $1.320
R9 56K 38K0383 $0.012
X2 screw terminals 14N5685 $0.270
H/S2 563002B00000G <= 13ºC/W @ 7W 18M8189 $0.444 for IC2
H/S3 MC33265 <= 5.5ºC/W @ 12.8W 09R3150 $1.480
H/S mounting hardware $1.000 local hardware store
thermal compound $0.500 local computer repair shop

So far, the running total is under $30, with the Input Stage, Fault-Detection Stage, and PCB itself as remaining costs. So far, so good!

I should note something here about using this booster with common-rail wiring: Don’t. It won’t work. it should work just fine. Because the booster uses a single-rail power supply and an h-bridge, the low-level output on the rails isn’t ground. It’s in fact about 0.4VDC, and this value will increase with increasing current (the LMD18200 uses MOSFET switching elements which have a fixed resistance; Ohm’s law says that, given a fixed resistance, voltage increases with current; so increasing current will result in increasing voltage drop across each switch). The apparent problem with this arrangement is this: Imagine if you have two adjacent LOLboosters, with one rail tied together in common, and where one booster has several trains all pulling a ton of current, and the other doesn’t. Then the booster with many trains will have a “low” value of perhaps as much as 4V; the unloaded booster will have a “low” value of at most 0.5V. Current—perhaps as much as 2A—will flow from the loaded booster to the unloaded until the load is shared between the two boosters. This is probably just fine, provided that the current is shared between the metal rails and a wired bus in parallel.

Of course, when the rails are double-isolated, this issue doesn’t arise, except when a train is crossing from one to the other. In this case, the two boosters will attempt to share the load through the train crossing the power districts. I’m not sure that 1 or 2A current passing across a truck is a problem or not yet, but given that this is an issue common to all current DIY booster designs, I’m not inclined to make too much hay of it. We’ll see.

As always, critique and discussion of the design are welcome!

2 Comments

  1. KenS says:

    Don,

    I don’t know enought about circuit design to offer a meaningful critique, but three questions spring to mind:

    1) Since you’re measuring the track voltage for your feedback, and simply rectifying that into DC, would distortions of the DCC signal (e.g., overshoot or ringing) affect the accuracy of that regulation in a meaningful way, or is their transient nature going to minimize that? Once it’s connected to a track, real-world DCC isn’t very clean.

    2) I notice that your input isn’t rectified, so I’m presuming the wall wart needs to be a DC one. Many commercial boosters allow AC or DC input, which gives you more choice in wall warts for a relatively small cost. Had you considered that option? And on a related note, could you just use a simple transformer with a rectifier, or does the DC need to be relatively stable (i.e. filtered a bit)?

    3) How quick/sensitive is the feedback loop? I’m wondering what happens if something like a track-powered stationary decoder is used that puts a short-duration but high load on the track (either when it throws a solenoid turnout, or to recharge a capacitor discharge unit afterwards).

    Ken

    • Don Goodman-Wilson says:

      Ken, as always, good questions to raise.

      1) I’m measuring it as it comes out of the h-bridge, so to a large degree, reflections, dirt, etc. won’t be an issue (see next installment on failsafes). That said, I’m probably better off throwing a filter cap after the diode bridge—better safe than sorry! I’ll add that to the next revision.

      2) I worried that adding a bridge rectifier—or even just a single diode to prevent blowing the booster up when you plug the power lines in backwards—would add yet another voltage drop, and increase the input voltage requirements. But, again, if I am designing for reliability, I should include a bridge so that it won’t matter if the wires get crossed, or the adapter puts out AC or DC. I’ll have to bite the bullet, and revise the input voltage requirements up. I guess it’s not that big a deal.

      3) The feedback loop is both sensitive and fast. Transients like that should pose no particular difficulty that I can see.

      I’m also beginning to think that this booster will work with common-rail wiring. I just ran a simulation, and the results were not the heartstopping, unfettered flow of current I thought they would be. So I’m going to strike that from the prohibitions.

Leave a Comment