2/14/19: Initial post. Background and 3-wire version for Loksound L decoders
2/17/20: Update with 2-wire version for MTH PS3 decoders and others without 5V onboard.
Background
As part of my efforts to get to "stone axe" reliability over my Ross #8 double crossover, I've been investigating various keepalive options. This is not a particularly new concept in the DCC world, but there aren't many options that are really practical for the power draw of O scale locomotives. All told, I played around with some off-the-shelf stuff (ESU Powerpacks), RC LiPo batteries, and ultimately, my own supercapacitor concept.
Here's a summary of what I tried along the way, and what I ended up with.
ESU Powerpack: This is the only commercial solution I'm aware of that's anywhere close, and it of course works well with the Loksound decoders. I've run a few of these in different engines. Off the shelf though, it's way too small, providing only about 0.2 seconds of runtime. I tested this in one of my steamers, and it's too short to be useful. I also modified one of them, replacing the 1F cap with a 5F cap. With this, it gets up to about a second of runtime. But, that's not a lot of margin over my 1 second design goal for bigger engines or heavier trains. Plus, if I'm going to desolder and modify a board like that, might as well start from scratch...
LiPo battery: I prototyped this with a small RC Lipo, and it works fine. Plenty of runtime, in fact overkill really, which is cool. However, there is no good way to prevent over discharge, which will damage the battery. It would also take a looooong time to charge to usable voltage if it falls below the converter minimum input. There is also added complexity, as it requires a dedicated charging board in addition to the boost converter. All told, those factors ruled this one out for me.
Now we get to the fun part. Since the LiPo and Powerpack both had significant drawbacks, I figured I'd see if I could roll my own. Here is the basic concept I came up with:
The supercap is charged via the 5V bus on the decoder. This is a key feature of the Loksound for this approach, because it happens to be just below the max voltage of the supercap. A resistor limits the current draw to about 100 mA, with a dissipation right at 0.5W, in the max case. The zener diode limits the voltage applied to the supercap in case the 5V bus is a bit high, which they frequently are. There will be a few mA current through the zener in this case.
The output of the converter is tied to the high (track) voltage bus U+ on the decoder. The capacitor on the converter output is important because the high voltage bus on the decoder actually fluctuates quite widely. Without a capacitor on the output of the converter, anytime the bus voltage drops below the converter output, it draws energy from the supercap to maintain it, and the supercap will never charge.
If you do the math, here is how the energy storage and runtimes of the various options compare:
Device | Capacitance (F) | Vmax | Vmin | Energy (J) | Runtime (s) |
ESU Powerpack | 1.0 | 2.5 | 1.7 | 1.7 | 0.2 |
ESU Powerpack, modified | 5.0 | 2.5 | 1.7 | 8.4 | 1.0 |
Homebrew | 1.0 | 5.0 | 2.0 | 10.5 | 1.2 |
Homebrew | 2.5 | 5.0 | 2.0 | 26.3 | 3.0 |
Homebrew | 5.0 | 5.0 | 2.0 | 52.5 | 6.0 |
LiPo battery 125mAhr | 4.2 | 3.0 | 1800.0 | 204.0 |
The runtime assumes a 7.5W load (12.5V and 0.6A at the motor), and 85% efficiency in the converter, and is just the stored energy divided by the power.
Bottom line for me, the 2.5F seems about the sweet spot here. I want 1 second of runtime, with some margin, so a theoretical 3 seconds is pretty nice. You can trade capacitance, 1F, 2.5F, or 5F, against engine load, initial charge time, and space available in the engine. A bigger cap will obviously carry an engine for a longer duration, but will take longer to reach a usable voltage when you first power up. The 1F satisfies my design goal, but just barely, however it is quite compact. The 5F stores a lot more, but is pretty chunky. The 2.5F seems just right for most. 200+ seconds for the LiPo is neat, but not actually really useful.
Hardware Implementation
After testing various configurations, here are the components of the final design. Total cost for the parts is about $15.
- Boost converter: There are a lot of these available to choose from. I went with the Pololu one because:
- It has sufficient capacitors on the output. I had to add my own output cap on some of the other converters I tested.
- Similarly, the diode on the output is such that an external one is not needed.
- It's very compact. The others I tested are huge by comparison.
- It is well documented on their site, and well supported. Pololu techs responded quickly to questions I had regarding its use for my design.
- Supercap: 2.5F, 5.4V. 5.4V is common due to the electrolyte used, but anything over 5V will work.
- Zener diode: The 5.1V zener diode limits the voltage across the cap.
- Resistor: 56 ohms, 0.5W.
I set the boost converter output to 12.5V. This number is important, and somewhat layout-dependent, since the high voltage bus on the decoder depends on your track voltage. Too low, and you will have a noticeable drop in speed when the keepalive kicks in. The ESU Powerpack actually exhibits this. Too high, and the supercap will never charge, because the converter will be intermittently supplying power to the high voltage bus. Testing on my layout showed the 12.5V provided nearly seamless transitions from track power to supercap, and charged reliably.
Finally, some pics of the finished product:
It takes about half an hour to solder up and heat shrink things. There are a few wire-to-wire solder joints, which is a bit of a kludge, but there's no custom PCB required. And it's cheap and effective - I have two of them installed now in engines running on my layout, and they are working great.
Next step: Figure out how to tie these in to MTH PS3 locos...
Update 2/17/20
2-Wire Version for decoders without 5V on board (including MTH PS3)
For decoders without a 5V supply on board, including MTH PS3 decoders, a step down regulator can be added to the keepalive to provide a regulated supply for charging the supercap. The block diagram looks like this:
The step down regulator basically takes the place of the onboard 5V supply on the Loksound. The zener diode is probably not strictly necessary in this case, since we know the regulator will provide a stable 5V, however it is still a good precaution against overcharging the capacitor.
Here is the regulator I used, from Polulu as with the boost converter above:
To install the keepalive to the decoder, simply wire to the decoder bus voltage U+ and ground. The U+ line provides power to the step down regulator while the decoder is powered from the track, and receives power from the boost converter when track power is lost. The same notes about setting the output voltage of the boost regulator described above apply here as well.
Here are a couple pics of one that I built recently. This was a modified version of the three wire one described above, so it's not as tidy as it could be:
Installation to MTH PS3 decoders
The 2-wire version of the keepalive can be used with MTH PS3 decoders in a manner similar to most dcc decoders. The only catch is that there are no ready-made solder points for ground and bus voltage. However, the large bridge rectifier on the board serves that purpose well, as it has large leads and solder points that are tied to the decoder bus voltage and ground.
Identifying the DC pins of the rectifier can be done using a standard DMM, by measuring the DC voltage between each of the pins. With the loco powered, test the voltage from each pin of the rectifier to the others. When you get a reading that indicates positive DC voltage of around 15V or so, note the pins and polarity - the positive pin is the 'U+' pin in the diagram, and the negative pin is the ground. Better yet, take the heatsink off, and look up the datasheet for the part number. I didn't do this, however.
Be sure to set the output voltage as above before installing the keepalive. I found 11V to 12V to work well with the PS3 decoder I tested, but this will vary depending on your track voltage.
At this point it is simply a matter of soldering the two leads from the keepalive to those two pins on the rectifier. Here's a pic of the rectifier on the PS3 steam engine board that I tested, with the AC inputs and DC outputs marked:
See my preliminary test results in this post, as well as discussion of the concept as it applies to PS3 at the beginning of the thread. Please note I have only bench tested this at this point, and only on one PS3 board. The results were promising, however. Here is a video of it in action:
Enjoy, and post results if you try it!