Skip to main content

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:

 Capture

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:

DeviceCapacitance (F)VmaxVminEnergy (J)Runtime (s)
ESU Powerpack1.02.51.71.70.2
ESU Powerpack, modified5.02.51.78.41.0
Homebrew1.05.02.010.51.2
Homebrew2.55.02.026.33.0
Homebrew5.05.02.052.56.0
LiPo battery 125mAhr 4.23.01800.0204.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:

IMG_8287

IMG_8288IMG_8290IMG_8291

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:

 Capture

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:

IMG_9537IMG_9538

 

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:

 IMG_9539

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!

Attachments

Images (9)
  • Capture
  • IMG_8287
  • IMG_8288
  • IMG_8290
  • IMG_8291
  • Capture
  • IMG_9537
  • IMG_9538
  • IMG_9539
Videos (1)
IMG_9462
Last edited by thor73
Original Post

Replies sorted oldest to newest

gunrunnerjohn posted:

Your link to the boost converter takes you to the supercap.  I'd also consider maybe a slightly lower Zener voltage as a 5.1V rated Zener may allow the voltage to exceed the rating of the supercap.

Oops, thanks, fixed the link.

The datasheet for the zener lists a working voltage of 5.0V to 5.2V at 5 mA, so I think that should be ok. I tested the assembled unit with 6V applied at one point, and it kicked in at just over 5V.

Engineer-Joe posted:

 You just have them tied to your decoders at the input?

Wouldn't it work the same if just tied to the input of the PS3 boards then?

When you add caps to the input circuit, doesn't that raise the track voltage it sees?

This is over my head but I am always interested with your work. Sorry if the questions are too stupid.

Hey Joe, the connections to the decoder described above are all after the DCC signal has been rectified and filtered. So:

U+: What I call the high or track voltage bus, is basically just the rectified and filtered track voltage. This is provided as an output on just about every decoder. It will actually be 1 to 2 volts below the DCC voltage, due to the voltage drop in the rectifier. This is the main power bus in the decoder that provides power to the motors, lights, and (via additional regulators) the microprocessor and so on. The output of the boost converter ties in here, to provide power to the entire decoder if the track voltage goes away.

+5V: A 5VDC output provided on the Loksound, so instead of the U+ output, you have the option of powering lights and so on with 5V. Very handy for converting MTH stuff. Also works nicely with this supercap concept, as described above.

Ground: The DC ground output of the rectifier.

So the trick to applying this to a PS3 decoder is figuring out where to tie in to their high voltage bus. The supercaps they have in there now are farther downstream, and only power the microprocessor and ancillary functions, not the motors.

DaveJfr0 posted:

Interesting write up.  Thanks for publishing it.

Here is a source for information on other commercial keepalives... (and other stuff DCC if you ever need it down the road)

https://sites.google.com/site/...-alive-compatibility

 

I was looking at solving a similar problem, but trying to use the soundtraxx currentkeeper with my Loksound L decoders in O scale. I was going to connect them to the to U+ and GND pads on the decoder, similar to how its instructed to be used on the soundtraxx decoders.  Outside of price/time considerations, any idea on how this would compare to your solution? Looks like it lands somewhere between your Homebrew 1.0 and Homebrew 2.5, but maybe I'm not thinking it through.

The stats on this keepalive are in the table in the above website I provided.

Yeah, that is a comprehensive list, however the "estimated energy" values are incorrect. The values in that table (at least the couple I checked) assume the capacitor is charged to its max rated voltage and discharged to zero volts. Neither of those assumptions is correct, particularly the latter.

For example, in the case of the ESU powerpack, 1F at 2.7V is, indeed, 3.65J, if all that energy were usable. However, the actual peak voltage is 2.5V. And the minimum operating voltage is about 1.7V, nowhere near zero. Remember, the boost converter needs a finite voltage with which to operate. So, using those voltages, you get the 1.7J that I list above.

Similarly for the Soundtraxx one, the 18.2J listed assumes 0.2F at 13.5V, discharged completely to zero, and is waaaay optimistic. That keepalive is not regulated, meaning there is no boost converter, and the cap output is tied directly to U+ on the decoder. So that voltage is going to drop as the capacitor discharges, which is going to put the minimum usable voltage at, optimistically, around 10V. The actual usable energy is going to be in the 6-8J range, comparable to my modified ESU powerpack, which I felt was barely adequate. That's assuming it starts absolutely fully charged, and that you can tolerate some degraded performance as it discharges.

DaveJfr0 posted:

I knew there was a catch that I wasn't account for.  Then again, I am only hoping to account for <=1s moments of dirty track.  Perhaps I need to construct a few of these and do a little testing when I can finally get back to my trains.

 

What do we think the lifetime on these are?  2000 full charge cycles? Probably enough for my lifetime.

The soundtraxx one would probably do that, at least for smaller locos/trains.

There is no theoretical limit to the number of cycles.

You can get 1" heatshrink all over the place, here's Uxcell 1" Heat Shrink at Amazon.  I typically buy it in 100 foot rolls as I use a lot of it, eBay: 142853211575

1in (25mm) Diameter Heat Shrink Tubing Shrinkable Tube 100ft Black

If you like clear, here's a 50 foot roll of clear 1" heat shrink, eBay: 222608967307

50 FT. 50' Feet CLEAR 3/4" 19mm Polyolefin 2:1 Heat Shrink Tubing Tube Cable US

Gandpa63445 posted:

A picture is worth a thousand words, I have the items ordered to make a couple of these  stay alives. I would like to verify the connections to the loksound L decoder. The red wire goes to +5v, the black wire to U+ and the purple wire to ground. Your input is appreciated, Thank you 

If you use the same color scheme as I did, it would be:

  • Black: ground on the decoder, as well as the converter and supercap
  • Red: +5V on the decoder, tied to the resistor that charges the supercap
  • Purple: U+ on the decoder, to the output of the converter.

I'm on travel at the moment - I'll post details on the questions that you asked about above when I get a chance.

DaveJfr0 posted:

I knew there was a catch that I wasn't account for.  Then again, I am only hoping to account for <=1s moments of dirty track.  Perhaps I need to construct a few of these and do a little testing when I can finally get back to my trains.

 

What do we think the lifetime on these are?  2000 full charge cycles? Probably enough for my lifetime.

Below is the datasheet. On page 10 is the expected lifetime, which is dependent on the operating voltage and temperature.  If you can keep it below 120F, and 90% of operating voltage, it should be good for 15 years. Even then, it wont fail, it simply wont deliver the performance it did when new. 

Also, page 2 has some test scenarios, one of which was the following:

Capacitors are cycled between rated voltage and half-rated voltage under constant current at +25°C for 500,000 cycles. (No remarkable defects)

 

https://www.mouser.com/datashe.../AVX-SCM-1018838.pdf

Last edited by MJCAT

Ideally, you'll want to set the regulator output as low as you can, without having a noticeable impact on performance when the supercap kicks in. In my case, I run a DCC voltage of 16V, and I started to see reduced motor performance around 11V regulator output. I ended up with 12.5V being a pretty happy medium.

You could try ~3V below track voltage as a starting point, and then tweak from there. If you leave the shell off the loco, you can check and adjust the regulator voltage in place. Just let it charge up, test with a power interruption, and go from there. The adjustment is fairly sensitive, so proceed slowly.

thanks thor73 for this sweet diy keep alive. you mention that the pololu converter has "sufficient capacitors on the output". do you still use the 10 uf cap shown in your diagram? I don't see one in your pictures.

and do you set the 12.5 output voltage with no load, or with a decoder connected and running?

 

thanks again

calvin.

 

It's a pretty good regulator, and I've noticed almost no variation in output voltage with load. I set it on the bench before I solder everything up. I just feed it a 5VDC input and then adjust. That way the output voltage is in the ballpark when you first power everything up. Then, if you are still experimenting to find the right voltage, adjust after installation while powered on the track. Make sure you give it a minute or two for the cap to get above the minimum operating voltage of the regulator.

You don't need to add a separate output capacitor with this regulator.

Not sure how I missed this thread before.  This is great info as the ESU keep alive on my LokSound L decoder in fact seemed not to do anything.  Sadly it's the Lionel 0-6-0 docksider, so it won't have room for anything else (Nor am I going to take that thing apart ever again.), but this will come in handy for all the other steam and diesel I plan on converting where there is tons of room.

I run at 18V and would love the 5F homebrew version for maximum run time to go slow over those Atlas switches (#5 and the O72/54 curved switches back to back.) I have with large dead spots.  What changes would I need to make for those?

Gandpa63445 posted:

Hello THOR73 and I have 2 of the keep alives assembled and had the regulator set around 12 volts on both. Can you bench test the completed unit before installing or does it have to be installed and then test? Thank you again for all the help.

Sure, you can power it on the bench with any 5V power supply. Just hook that up to the 5V+ and ground wires, then look at the voltage on the U+ wire as you adjust. Again, make sure you give it a few minutes for the cap to charge up.

Treat it carefully while charged - left to itself, it will be powered for quite a while after you disconnect it from the supply. It's a good idea to discharge it before attaching it to the decoder. You can do this by connecting the 5V+ and ground leads together for ~5 mins or so. The cap will simply discharge through the resistor.

Last edited by thor73
sinclair posted:

Not sure how I missed this thread before.  This is great info as the ESU keep alive on my LokSound L decoder in fact seemed not to do anything.  Sadly it's the Lionel 0-6-0 docksider, so it won't have room for anything else (Nor am I going to take that thing apart ever again.), but this will come in handy for all the other steam and diesel I plan on converting where there is tons of room.

I run at 18V and would love the 5F homebrew version for maximum run time to go slow over those Atlas switches (#5 and the O72/54 curved switches back to back.) I have with large dead spots.  What changes would I need to make for those?

No changes are required for the 5F version, just more space. It will take longer to charge up initially, of course.

I assume you did this already, but if not, make sure you check the CV setting for the keep alive runtime. FWIW, I'm pretty sure you could fit the 2.5F version in the docksider. I am going to upgrade mine from the modified ESU powerpack when I get around to it...

Here's a pic I took a while back of the three sizes of capacitors.

IMG_8292

Attachments

Images (1)
  • IMG_8292
Gandpa63445 posted:

THOR73 thank you for the information and I have one more question, you said in your last response (ground wires) did I miss something because I only have the one ground from the 5vdc power supply. Do I need another ground source?

when thor said "connecting the 5V+ and ground leads..." he means 1 ground and 1 +5v.

so i finally got one of these done and tested. with the 2.5f cap, i am limited (4 sec) not by the cap, but by the max value i can put in cv315 in the loksound select L. i ordered some 1.25 inch shrink wrap, and although it will shrink just barely enough, i'll order 1 inch for future builds. thanks again thor73!

20190306_223747

 

Attachments

Images (1)
  • 20190306_223747
calvin posted:

so i finally got one of these done and tested. with the 2.5f cap, i am limited (4 sec) not by the cap, but by the max value i can put in cv315 in the loksound select L. i ordered some 1.25 inch shrink wrap, and although it will shrink just barely enough, i'll order 1 inch for future builds. thanks again thor73!

Hah, looks great! Let us know what you end up running as far as voltages (DCC track voltage, regulator output voltage) and how everything works.

I usually set my decoders to stop after 1 second. You might not want them running too long if you issue an emergency stop... 

Gandpa63445 posted:

I would like to duplicate the esu maxi power pack THOR73. I would appreciate your input on making one. I would put 2-5F super capacitor in a series with a zener diode, a 1N4001 diode and a 100ohm 1/2W resistor, I’m wanting a few more seconds on the run time without power. Thank you for any suggestions 

Not sure what you're asking here. The homebrew with a single 5F cap will get you 5-6 seconds runtime. The Loksound will stop after ~4 seconds, regardless.

DaveJfr0 posted:
Some questions:

1. Do you have a suggestion for a mouser part number for the 5F caps? I'd like to try one of those in case I think I actually need more juice for certain power hungry locomotives I have (like the Weaver VO1000)

2. I noticed the alternate zener diodes you listed have different forward voltages and impedance than the part that's out of stock.  I'm pretty sure that doesn't matter in this circuit, but just checking.

3. I saw the previous questions, but to adjust and benchtest, to be clear:  You throw power on this, let it charge, then voltmeter test (no load) the U+ to GND and turn the knob on the converter until you achieve ~12.5V voltage.  Is that is sufficient or do I need to actually have this connected to the locomotive its intended to go into and adjust it until it can make the motors turn enough to get over dirty spots/gaps in the track (at slow speed)?

Thanks again for sharing this design and your logic behind it.

  1. 5F 5.5V capacitor is the one I've used.
  2. Yeah there are minor differences in the specs, no impact for our use here.
  3. Yep, power it with 5V on the bench and then set the regulator to your desired output. The regulation is very good, so it won't change with load. Make sure you discharge it before doing anything else with it by connecting the 5V and ground leads for a few minutes.

12.5V is what works for me at 16V DCC voltage. You may need to experiment, and maybe go a bit lower, if you are using a lower DCC voltage.

Make sure you build one or two and test them out, before you go building 10 of them. I'd hate to be responsible for all that time and effort if they didn't work out for some reason! 

Last edited by thor73
DaveJfr0 posted:
I'm looking at making 10 of these to compare with the soundtraxx currentkeeper installations I have with my Loksound decoders and make a decision on what I do going forward. I currently run my Digitrax system on the HO 15V setting. I think the parts list above should suit me fine.

Just occurred to me - are you running HO, and the standard Loksound decoders, or O, with the Loksound L?

If the former - definitely build one and test. I have one that I just recently put in my Lionel docksider with an HO decoder, and it is not working as expected at the moment. The cap and regulator are working (charging, etc.), but I'm not getting any run time after removal of power. Haven't had time to chase that one down yet.

DaveJfr0 posted:

Other than consuming less power out of the capacitors (and lasting longer), I don't see how lowering the input voltage to the decoder from the keepalive will change its behavior as the processor should remain on, maintaining constant speed to the motors, powering the sound, lights etc.

From my original post:

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.

and:

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.

So it may be fine at 15V DCC voltage (I think it probably will). But, it may also be that the decoder bus voltage drops below the regulator output voltage occasionally, which will be more likely with a lower track voltage.

Add Reply

Post
×
×
×
×
Link copied to your clipboard.
×
×