LOLbooster: Output Stage (Part 1)
Learn more about the LOLbooster, and purchase PCBs and kits.
The output stage of a DCC booster is basically a class-D amplifier output stage. It takes the processed DCC signal, a square-wave signal of approximately 15KHz, and pumps it to the specified output voltage (~12Vp for N scale, less for Z and more for HO) and current (as required by what’s on the track, up to the specified maximum).
Unlike audio signals, however, DCC signals are differential-mode—whatever signal is put onto rail A is mirrored and inverted on rail B. So, a booster output stage uses two push-pull amplifiers in what is known as an H-bridge configuration.
The nice thing about H-bridges is that we don’t have to design one from the ground up if we don’t want to: Several manufacturers offer integrated H-bridge circuits in monolithic packages. These ICs take logic-level square-wave inputs, and amplify that signal to the track. They also provide many of the auxiliary components (fly-back diodes, charge-pumps, etc.), and error detection facilities. More to the point, they are often cheaper than designs from discrete components.
Here is a review of several monolithic H-bridge ICs that can provide sufficient current suitable for a small booster. We should compare these against the NMRA specifications for the maximum signal distortion permitted by a booster.
According to S-9.1, booster outputs must be able to transition in the range -4V to +4V with a slew rate no slower than 2.5V/μs. Because this range includes a zero-crossing, we must factor in that many of the ICs below include a dead time at the zero crossing (a period in which both rails will be at ground together) to ensure against “shoot-through” short circuits inside the IC (when current bypasses the rails entirely, and just passes right through the control circuitry—very bad). S-9.1 also proscribes against certain kinds of distortion that for now I’m not going to worry about.
Moreover, according to RP-9.1.2, the rising-edge delay (Ton) shall not exceed 5μs, and the total distortion (|Ton – Toff|) shall not exceed 2μs. Thus, the falling-edge delay (Toff) must not exceed Ton+2μs (in the worst case, 7μs).
Finally, we need to worry about the voltage drop across the switch elements, as this will impact the supply voltage considerations. S-9.1 specifies the nominal, minimum, and maximum peak voltage outputs for N, HO, and larger scales (interestingly, not Z). Minimum voltage is 7V; maximum for N is 12V; maximum for HO is 14V. The specs permit boosters to exceed the listed maximum by 2V to compensate for voltage drops in the switching elements within decoders. This drop is typically about 1V, so we should aim to be able to provide output voltages selectable from 8V, 12V, and 14V, with adjustments available for ±1V.
Here, then, are the ICs. (I have selected only H-bridge ICs with a maximum output current >= 3A, or dual H-bridge ICs with a maximum current of >2A/channel and whose channels can be paralleled to achieve a higher maximum current.) L298, L6203, L6205/L6206, LMD18200/LMD18201.
- L298. This chip is a favorite among roboticists, for being cheap and robust. Unlike the other ICs reviewed here, the L298 uses bipolar transistors for the switching elements, which means decreased efficiency and increased signal distortion. Nevertheless, the spec sheet says its good for square wave signals up to 25KHz. The L298 takes TTL logic levels as input, provides an output for low-side current sensing, and enable pin. The L298 does not provide automatic over-temperature or over-current shutdown, nor integrated flyback diodes.
- Price: ~ $4.00
- Input voltage: 5V–46V
- Absolute maximum current: 4A (DC) / 5A (DCC)
- Worst-case Ton/Toff: 2.7μs / 1.7μs
- Worst-case slew-rate: 14.8V/μs (estimated)
- Voltage drop across switching elements: less than 4.9V, 3.7V typical (not including drop due to current sense resistor, typically 0.5V peak).
- Pros:
- Cheap!
- In ready supply.
- Cons:
- Not the best response times, but within spec, although we will have to be very careful that the response times of the input stage doesn’t lead to an out-of-spec total distortion.
- Very few bells-and-whistles. Requires external flyback diodes, hefty current sense resistor. No over-temperature warning.
- Very high voltage drop across switching elements necessitates a larger supply voltage.
- Requires separate logic power supply
- L6203. I think the L6203 is under-appreciated: It doesn’t show up in DIY projects on the web very often. Low availability may contribute to this fact. It can pump out as much current as the L298, but uses MOSFET switching elements for increased efficiency and response time. The L6203 includes a current sense pin. The L6203 also includes integrated flyback diodes (as do all MOSFET based H-bridges), and thermal protection. But all of this comes at an increased cost!
- Price: ~ $8.00
- Input voltage: 12V–48V (9V–18V minimum with additional components)
- Absolute maximum current: 5A (DCC)
- Worst-case Ton/Toff: 0.6μs / 0.5μs
- Worst-case slew-rate: 43.3V/μs (estimated)
- Voltage drop across switching elements: less than 1.8V (not including drop due to current sense resistor, typically 0.5V peak).
- Pros:
- Fast response times.
- Lower power requirements.
- Does not require separate logic power supply
- Cons:
- Not widely available.
- L6205/L6206. The L6205 and L6206 are a step up from the L6203, although they do not come in the multiwatt package that the L298 and L6203 do, thus requiring more complex heatsinking via copper traces in the PCB. The L6206 includes a programmable, auto-resetting current-limiter, releasing us from having to design our own circuit. However These ICs do not include an integrated charge pump, however, and so require additional external components. Both used MOSFET switching elements, and include thermal shutdown, current sense pin (which is redundant), integrated flyback diodes, and fast response times. Interestingly, the L6206 is cheaper than the L6205 by about $2. Anyway, although it is an attractive chip, there’s no way we can keep it sufficiently cool for our purposes, without resorting to something exotic.
- Price: ~ $10.00 (L6206)
- Input voltage: 8V–52V
- Absolute maximum current: 5.6A (DCC) / 2.8A (DC)
- Worst-case Ton/Toff: 1.85μs (including dead time of 1μs) / 0.85μs
- Worst-case slew-rate: 41.6V/μs (estimated)
- Voltage drop across switching elements: about 1.2V (estimated) (no sense resistor necessary).
- Pros:
- Fast response times.
- Low power requirements.
- Adjustable current limiting circuitry eliminates external overcurrent-detection circuit.
- Cons:
- Not widely available.
- Expensive.
- Requires a fair number of external components, including charge-pump.
- The through-hole package (Power-DIP) cannot be adequately cooled to achieve maximum current output.
- LMD18200/LMD18201. The LMD18200 is the Cadillac of H-bridge drivers; it includes a dedicated current sense circuit that does not require a hefty sense resistor in the DCC current path, over-current and thermal shutdown, integrated charge pump and flyback diodes, and a thermal warning pin (which can be used, e.g., to activate a cooling fan)—all for a price. The LMD18201 is the same, sans the dedicated current sense circuit, but for about $1 less. The LMD18200/01 provide very fast response times.
- Price: ~ $14.00 (LMD18200)
- Input voltage: 12V–55V
- Absolute maximum current: 6A (DCC) / 3A (DC)
- Worst-case Ton/Toff: 0.4μs / 0.275μs
- Worst-case slew-rate: 52V/μs (estimated)
- Voltage drop across switching elements: less than 3.5V / 1.6V typical (estimated) (no sense resistor necessary).
- Pros:
- Very fast response times.
- Low power requirements.
- Internal current-sense circuitry eliminates current-sense resistor.
- Low thermal resistance (1ºC/W junction-to-case)
- Does not require separate logic power supply
- Cons:
- Very expensive.
Although my first inclination is to go with the L298 because it is cheap and should work, there is one very good if not very obvious reason to prefer a MOSFET-based IC: Heat. The switching resistance in all switching elements increases with temperature; the spec sheets will list the “typical” resistance or voltage with a junction temperature of 25ºC—room temperature, which is not a value that can be maintained even with the best heatsink, for more than a brief moment of use. If you only looked at that spec, you might think the L298 was just fine. But the worst-case value listed in the spec sheets is at 100ºC operating temperature, which is a reasonable temperature to maintain. And here the L298 doesn’t fare so well.
So, let’s compare. Suppose we wish to maintain a 100ºC junction temperature at 25ºC ambient temperature. This gives us wiggle room in case the booster gets installed somewhere stagnant, and the ambient temperature rises to a rather nasty 50ºC. Suppose moreover that we wish to be able to maintain a steady 3A of power to the layout: We’re running the rig right up to the edge. Let’s also assume that we’ve got thermal compound rated at 0.2ºC/W, pretty common stuff. The equation we’re looking at, then is this:
Tj = P×(θjc+θch+θha) + Ta
where Tj = the junction temperature, which we want to maintain at 100ºC; P is the power dissipated; the θ terms are the thermal resistances: junction-to-case, case-to-heatsink (via thermal compound), and heatsink-to-ambient; Ta is the ambient temperature, which we’ve specified to be 25ºC. Let’s fill in the constants:
100ºC = P×(θjc + 0.2ºC/W + θha) + 25ºC
and since we know θjc for each chip, let’s solve for the required worst-case thermal resistance of the heatsink
θha = (75ºC/P) – (θjc+0.2)
Compare:
- L298: 4.9V drop across each pair of switches; 2 pairs “on” at any given moment, and passing 1.5A of current; θjc = 3ºC/W:
- 4.9V×1.5A×2 = 14.7W (assuming zero power dissipation when transistors are “off”, which is false, but close enough)
- so, θha = 0.63ºC/W —that’s a pretty honking powerful heatsink! We’re at the absolute limits of passive cooling here.
- L6203: 1.1Ohm resistance for each pair of switches, passing 3A of current at 18VDC (worst case for HO); θjc = 3ºC/W. The spec sheet’s calculations yield:
- 10.7W
- so, θha = 4.3ºC/W —a big heatsink, but not overly unreasonable.
- L6206: 1.12Ohm per pair of switches, θjc = 18ºC/W (!!!). We have approximately:
- 1.12Ohm × 3A × 3A = 10.8W
- so, θha = -11.2ºC/W, well into hard-core active cooling territory. Think peltier+waterblock. Think $$$.
- LMD18200: 1.2Ohm per pair of switches, assume 18VDC for the motor; θjc = 1ºC/W (nice!). By Application Note 694, we have:
- 11.45W
- so, θha = 5.4ºC/W, fairly reasonable.
What about the MOSFET devices?
The L298 requires a very large, and possibly exotic, heatsink to operate at the levels we’re asking of it. The L6206 requires massive amounts of active cooling: Very difficult with a PDIP package, and expensive. But the L6203 and LMD18200 come out as having more reasonable heatsinking requirements: 4ºC/W sinks run about $2–$3. So, we can definitively rule out the L298 and L6206.
The L6203 is cheaper than the LMD18200, but it is not easy to find. Jameco and MCM both stock it for reasonable prices, less than $7, but then tack on nearly $10 in shipping. Digikey can order it for $12, and offers dirt-cheap USPS first-class shipping—but it won’t ship until next month. The LMD18200 is easier to find, but about twice as expensive. Digikey has it for $18 (~$20), Arrow for $13 + $8 shipping ($21), and Element-14 for $15+$5 shipping ($20). So on price, the L6203 just shaves past the LMD18200. This difference is likely to be made up for with the sense resistor required by the L6203 (including the PCB real-estate), so let’s call it even.
But the LMD18200 is easier to source, and (more to the point) has more bells and whistles (in addition to the slightly better thermal performance). It doesn’t require a sense resistor in series with the load to measure current (and hence no need for a transistor to amplify the current-sense signal). It provides a thermal warning to let you know things are about to go pear-shaped, and it offers thermal shutdown and overcurrent limiting (albeit at 10A) where the L6203 does not.
So, for the LOLbooster, I think that the LMD18200 is the best choice, although ironically the most expensive of the lineup. I’m interested in hearing readers’ responses to this choice (I’d really, really like to like the L298! Convince me I’m wrong about it!)
In the next post, if the LMD18200 looks like a go, I’ll discuss the auxiliary circuitry surrounding it, and present a schematic of the output stage, with a bill of materials and estimated cost. Remaining to cover are the input stages, the fail-safes, and the power supply.
Well, $4 vs $14 is tempting, but not much use if you spend the difference on a larger power supply due to ineffeciency, and additional protection circuits to keep it from cooking itself. Not to mention the heating problem, which probably means it’s only suitable for smaller designs (if it weren’t for the heat-sink issue, I’d say it’s nice for the “self-powered circuit breaker” concept, but somthing passively cooled and mounted under the base-board can’t really afford excess waste-heat production).
I’m not familiar enough with electrical design to comment on the specifics, but based on your summary, it sounds like you made the right choice. I do think heat is something to be concerned with. One of the things that baffles me about my expensive Digitrax command station is that they warn about overheating, yet chose to passively cool it (admittedly with a massive external heat sink). Their suggestion: if it overheats, aim a fan at it. I’m less than impressed; at the cost, they could have mounted a fan on the heat sink, like a computer graphics card cooler.
The thermal warning capability, and using it to trigger a fan if the builder desires, seems like a good capability to have, and worth a few extra dollars. And someone who wants a small/cheap booster can always go with a big heat sink and ignore the warning line, counting on the thermal protection to rescue them. Just be sure to do your board layout in a way that doesn’t limit heat sink size, so builders have options.
I’m less convinced that overcurrent limiting is adequate; 10 amps seems like enough to do a lot of damage. Some external safety circuit seems warranted.
Ken,
Great points all. Let first start by agreeing that 10A is way too much. I plan on using the current sense line to trigger a shutdown at 3–3.5A. I’ll be designing the fault-detection circuitry in a later post, which will include this shutdown. The internal 10A shutdown will only kick in if the external 3.5A shutdown circuits fail for some reason.
It shouldn’t be hard, in theory, to design the board layout to accomodate different heatsink designs; however in practice, finding a heatsink designed for multiwatt/TO-220 packages designed to have a fan mounted is hard: I’ve not seen one. I’m willing to bet this may be one reason why Digitrax went for a purely passive solution. Still, it should be very easy to provide a 12V header to connect a PC-style cooling fan in the PCB design.
I’ll report back here with some concrete possibilities for heatsink options.
I think this is the heatsink I am going to go with:
http://www.thermalloy.com/cgi-bin/stdisp.pl?Pnum=6400bg
Thermal resistance of 2.70ºC/W, and max temp. rise of of about 20ºC @ 12W with natural convection: perfect.
I’ve ordered some samples. I’ll have to figure out a way to mount a fan to it: Will probably require a set of standoffs on the PCB, rather than mounting it directly to the heatsink.