Skip to main content

As with others, many others, this is needed and would boost reliability in our TMCC related engines.  Yes, there are other products to do same on the market, but not at the savings and originality in design that John proposes along with great input from other Forum members.   I, also, am interested in this, along with other endeavors purchased from him.

Jesse    TCA  12-68275 

This is all black magic to me, so me trying to figure out if the VLBB or B6sb have the battery circuit would be as effective as me doing brain surgery.  As for your design, by all means please Microchip components, that's where my dad works as a software engineer, making dev kits if I remember correctly.  And if you sold these as just PCBs for us to buy our own components to populate the board, I'd be good with that.  Then I could buy the boards I needed (And some extras.) and then build them up as I have the time and money.

gunrunnerjohn posted:

...The resistor does the trick, but I'm open to a more elegant solution, especially if it costs significantly less. Let's talk about the constant current and limiting the charge to 5V maximum. How were you visualizing accomplishing that? Is there a simple trick to add to the LM317 circuit to cutoff at a specific voltage? I was thinking along the lines of a Zener diode circuit.

Well, as charging circuit go, I don't think you can get cheaper than a resistor!  I'd go with that if it does the trick.

If you want to talk about constant current charging, I'm still unclear on where the 100 mA charging current comes from.  Is this from the drooping of the half-wave input with "only" a 150uF cap?  As shown, with the 7810 and 22 ohm resistor, on power-up into an empty supercap you're drawing ~500 mA (10V / 22 ohms) albeit dropping rapidly...but still attempting to source over 100 mA half a minute later (time constant R x C = 22 ohms x 1 Farad = 22 seconds).  So if you've done-the-math and the choice of "only" 150uF purposely starves the 78xx regulator which then limits the charging current, then that's a clever current limiting method!  Sort of like the trick of inserting a 5 cent diode into the AC path to dim passenger car lamps on command-voltage tracks.  Of course this applies to TMCC which as I understand it only operates on AC track voltage (vs. PS2/3 where you might have DC on the track).

So if the numbers work, then it seems you could have a 7805 charging a single 5V supercap with a single resistor.

Getting back to the constant current.  I'd still like to hear the duty-cycle requirement on how many interruptions must be handled, how quickly, how often, whatever.  I have little experience running TMCC engines so don't have a feel for how often the 9V battery is called into service or what the expectations are.  A constant-current 100 mA into a 1 F cap has a charge rate of "only" 0.1 V/sec.  So charging from 0 to 5V would take 50 seconds; I don't have a sense of whether this is OK.  Obviously once fully charged, I suspect the 9V battery applies to conventional operators pressing DIRECTION that get the long dropout while command operators might get fraction-of-a-sec dropouts?

I did realize that the current was more than 100ma for the charge at first but it drops quickly.  I sized the 33 ohm resistor to be a 2 watt after a couple of back of the envelope calculations.  When you start with the cap at zero volts, you have a little less than 10 volts across the resistor, (the Schottky diode drops a bit).  The resistor starts out dissipating around 3 watts and ramps down to less than 2 watts in ten seconds.  By the time you get to 20 seconds, we down to a watt of dissipation across the resistor.  Doing that it barely gets warm, so I figured I was home free.

The 150uf cap was really picked as I didn't want to go to a larger form-factor cap, so I just used the maximum value in that form factor.  I know it does happen to starve the regulator when there's excessive load, but that's an accidental happening.  When I tested the combination on the bench, it worked fine to charge the caps and didn't have any overheating issues, the object of the exercise.

The battery use with TMCC, or even conventional, is pretty low duty cycle.  The only time it's needed with TMCC is on occasion where you lose the power briefly over switches or dirty track as a rule.  For conventional, you use the battery typically when you reverse directions, that should be less than a second.  Obviously, the conventional case is more battery intensive, so I'd probably want to size the capacitor to allow for a few seconds of conventional running before dropping below the usable output for providing the output power.  With that being said, I'd probably go with at least a 1F 5V cap for the storage to give me a bit more run time.

For the 5V regulator and resistor, I'd probably go with a 2 watt 10 ohm resistor to limit current.  When the capacitor is flat, that would give me around 2.5 watts for a few seconds before dropping well below the 2 watt rating, so that should be fine.  Within 5 seconds I have a volt on the capacitor (assuming the regulator is actually able to deliver the power, which I doubt).  In any case, the resistor is fine, the regulator on TMCC track power may be the hot item here, but hopefully the short time for maximum power demands will mitigate that issue.

It would be pretty simple if it got down to the diode, cap, regulator, and resistor.  Can't get much simpler than that!

The one thing that tilts the scale in favor of the LM317 would be the fact that I may have to use a different cap if I can't get the ones I normally use.  If they were 5V rated, the resistors could be adjusted to still give a full charge.  I'll have to think about that...  I'll probably do a prototype with the LM7806 and then consider the other.  I could always lay down a pad for an additional diode and just short it in the copper so it could be added for a 5V capacitor.

Here's a first cut at the configuration with the dual regulator design and a single SuperCap. 

The large cap on the back would be the supercap, it folds away from the regulator and hangs out the side.  You can see the outline of the supercap beyond the board footprint.  The whole affair is about 1.6" long and less than an inch wide.  Thickness will be around 5/8" to 3/4".  The regulator folds over the PCB to reduce the size.  The headers aren't actually installed, they're just holes in the PCB to solder wires to.  The outputs would be soldered to a 9V battery connector, the input roller and wheels would be soldered to the track power.  Polarity is important as the battery in TMCC locomotives shares it's negative with frame ground.

Powered TMCC Battery Replacement With Switching SupplyPowered TMCC Battery Replacement PCB FrontPowered TMCC Battery Replacement PCB Back

Attachments

Images (3)
  • Powered TMCC Battery Replacement With Switching Supply
  • Powered TMCC Battery Replacement PCB Front
  • Powered TMCC Battery Replacement PCB Back
Last edited by gunrunnerjohn

I know it's early in the process but have you considered some type of insulating housing / sheathing so the PCB doesn't short out in contact with the 9V battery clip? I suppose ideally, the assembly would be dimensionally identical to a 9v like a BCR for a snug fit. 

Last edited by GregR

I'm personally planning when I build mine to simply put them into heatshrink.  That's how I install other modules like the Super-Chuffer, solve the problem of shorting to anything.

Trying to make it the exact form factor of a 9V battery seems a bit of work.  It's as short and as narrow, but the thickness will be close.  However, since the battery clip is going to be on a wire, you'll have more flexibility in placing it.

Stan, there's a good reason not to.  The BAT +/- will be directly soldered to a 9V battery connector, the wheels and roller will be wires going to the track power.  I'm not really saving anything significant by doubling up one wire, and I feel this is clearer as to what is happening.

For one of these that was assembled, I'm figuring that on one end the battery connector will be soldered and come out of the heatshrink envelope.

Image result for 9v battery connector

On the other end, two wires, perhaps orange and black, will come out for track power.

gunrunnerjohn posted:

..Trying to make it the exact form factor of a 9V battery seems a bit of work.  It's as short and as narrow, but the thickness will be close.  However, since the battery clip is going to be on a wire, you'll have more flexibility in placing it.

If the BAT+ and BAT- pads were connected to edge-card leaf style rectangular pads, could a 9V battery connector of style shown below be soldered to eliminate the 2-wire 9V battery connector?  I don't know if practical but sure seems like a big plus if the finished product fit in the space where the 9V Alkaline fits now.  Sorry for the horrible 3-D rendering!

Powered%20TMCC%20Battery%20Replacement%20PCB%20Back

Attachments

Images (1)
  • Powered%20TMCC%20Battery%20Replacement%20PCB%20Back

Well, I'm afraid that limits how you install it if the battery lead doesn't happen to reach where you want to put the module.  I could probably change the spacing of the holes if there were a battery clip like that that could be soldered on based on user preferences.  I see the Keystone #968, that looks like what you posted.

I wouldn't want to preclude using wires as I think that's the more flexible use.

Well, I can't let go of the idea of fitting it all into the form-factor of a 9V battery...plus the extra wire(s) to connect to the roller/wheel.

IMG_1423

Yes, that's the Keystone connector.  Suppose the circuit board is the size of the 2 shortest dimensions of a 9V battery.  You mount parts on both sides of the board to get the necessary real-estate.  The Keystone is mounted as shown (not flush to the board) with shorter SMD components (resistors, caps, etc.) between the board and the Keystone   Kind of like the photo above except the Keystone would be mounted a bit further from the board.  The taller components such as the supercap which I assume is the tallest component would mount from the top side as shown.  Those taller components can be about the length of a 9V battery.

Attachments

Images (1)
  • IMG_1423
Last edited by stan2004

Stan, the board layout takes more than the size of the end of a battery.   I don't know if I can fit it into that form-factor.  I may get one made (it's cheap), just to see if everything works when it's assembled.  If so, then maybe I could try cramming it into a smaller board.  The switcher want's a pretty specific layout and they seem to strongly suggest a ground plane on the back side.  Since I want this to work the first time, I figured I'd do that.

I'm thinking if I just the 150uf cap to the other side, it might all slip into that form factor without making a tiny board.  Here's what it looks like then.  The battery is 5/8" thick x 1" wide.  The supercap and regulator folder over are 5/16" and so is the 150uf electrolytic height.  The board can be .032", better anyway as it gets 2oz copper.  The components on the other side are not 1/4" high, so it all fits in the 5/8 thickness.  The board width is .8", no problem there.  The total length of the board and folded over cap is shorter than the battery by over 1/8".  That's length doesn't consider the battery connectors sticking out farther on the real battery.  I believe it's able to fit the way it is into a 9V form factor.

Attachments

Images (2)
  • blobid0
  • blobid1

Seeing as to how the original plan was 2 separate boards, perhaps another option is to do so with slightly different partitioning.  Obviously this adds to assembly complexity but with board pricing based strictly on real-estate without set-up costs...

I'm thinking putting the MCP1661 circuit on a tiny 2-layer board allowing the backside ground plane.  It would essentially be like that 5V switching regulator packaged into a TO-220 you use on the Super Chuffer.  So a 3-pin interconnect to the main board.  This sub-circuit would then be another "tall" thru-hole component that might free up enough real-estate to use the small-board Keystone method.  That is, I assume you have not closed the doors to the peanut gallery...

Well, the door is not totally closed, but there's only a crack.   I'm wondering why you're so hard over on this particular structure.  As long as I can fit it into the space of a 9V battery, it would seem we've accomplished the goal.

I think I'd like to see this function before I invest much more time in it, it could easily become a career.   I could send you the DipTrace files and let you take a whack at it.

gunrunnerjohn posted:

Well, the door is not totally closed, but there's only a crack.   I'm wondering why you're so hard over on this particular structure.  As long as I can fit it into the space of a 9V battery, it would seem we've accomplished the goal.

I think I'd like to see this function before I invest much more time in it, it could easily become a career.   I could send you the DipTrace files and let you take a whack at it.

LOL.  And I don't even have a TMCC engine!  OK, I'll cease and desist on the form-factor.  Go ahead and close the door...I'll try not to let it hit me on the way out.   And we haven't even gotten to wireless charging to eliminate the two input wires 

Wireless charging...  Now, there's a concept!

I think I'll get a board and see if the darned thing works at all and then consider the options.  The nice part is I only spend $5 on three boards, so it's not cost prohibitive.  I'm going for the .31" boards with the 2oz copper, makes the stack a little thinner and gives me lower resistance for the traces, a win-win.  I followed the layout guidelines pretty close for the switcher, but I confess as to never tried creating a switching power supply before.  With the chip, it sure looks simple, we'll see if I continue to hold that opinion.  I know the Chinese can do it for peanuts, I wish I had their component supply.

The boards are in the mix, I'll probably get them around the time of York, so after York I'll slap one of these together and see how it plays.  I'll also find out if it can fit into the 9V battery form-factor.  If so, I may figure out a way to mount the battery clip on the end to make it just like the battery with a tail on the other end for track power.  The beauty of only having to spend $5 on the boards means I can tweak them for the connector if everything else works.  Yes, I know the one silkscreen legend is under the outline of the folded down supercap, I figured I'd just leave it for this run.  Also, on the 3D run, the large cap seems to merge with the 150uf filter cap.  Since that will be folded over on the real board, that's also not an issue.

On another front, I found a bargain on 1.5F 5.5V supercaps with a nice low internal resistance that works for this project, so I got a whole fist-full of them.  When I can get them for $1, I figure that's time to jump.

Stay tuned to this channel...

Attachments

Images (4)
  • blobid0
  • blobid0
  • blobid1
  • blobid1
Last edited by gunrunnerjohn

Well... I got the boards in.  The good news is I got the boards and all the parts.  The bad news is, the switching circuit doesn't work.   I'm not sure what the issue is.  I actually traced out the whole circuit and replaced the switching IC in case one was bad, but no joy. 

I just populated this part of the circuit and fed 5VDC directly into it.  The output just follows the input voltage minus about .3 volts, and the switcher just sits there mute.  Obviously, the switching circuit isn't running.  That kinda' puts a crimp in this one until I figure that out.

Attachments

Images (1)
  • blobid0
Last edited by gunrunnerjohn
gunrunnerjohn posted:

Most of their examples don't show anything connected, but maybe I made assumptions that weren't warranted.  It's certainly worth connecting it to Vin as a test, I see one in the datasheet that has that connection.  I'll sure feel stupid if that is it!

That's not a thing to feel stupid about, just possibly a chance to learn one more thing.

DUH!!!

That was it!  Not only is it working now, but it's working way better than I had imagined!  It'll supply over 100ma at 8 volts for about ten seconds from the 1.5F superCAP!  I have a 62 ohm load on the 8 volt output, about 125ma of current.  I was hoping for four or five seconds!  I have to slap the rest of the components on the board and see how it works in total.  It does take quite a bit of time to charge the cap when it's flat, but it runs the converter until it's down to close to 2 volts before it drops out!  Other than taking some time to charge initially, it certainly be a worthwhile replacement for the battery.

Well, salvaging the board design is not a big issue, it's easy to lay out something else.  In any case, after putting the other components on, I've discovered that I'll really need more bulk capacitance for the input voltage regulator, I had to hang an external cap on to get it all working with a load while charging.

On the good side, for what I was targeting, it works perfectly right now.  If you replace your TMCC 9V battery with this, it will ride out an interruption of power for 8-10 seconds supplying around 125ma, that's more than most RailSounds boards are drawing.  Since while it's charging, the battery is not being called on to deliver any power, the input regulator current draw is not an issue in TMCC use.  I'm kind of torture testing it with a continuous load, so the input regulator is working all the time.  In the real world, the input regulator will be idling 99% of the time, and only be needed when you have a power interruption.

I'm flipping a coin as to whether I should add capacitance or just let it ride.  I'm tempted to add a spot for a couple additional 150uf caps. They can be optional parts if you're doing something that draws continuous power from the battery.  That would be easy and not compromise the rest of the design.

The bottom line is it's doing what was intended!   Thanks for spotting the obvious error, that's what I get for making an assumption.

I'd say we smashed right through the size targets as well, much smaller than the 9V battery in all dimensions.  Truthfully, I'll fit in places that the 9V battery won't.

TMCC 9V Battery Replacement N1TMCC 9V Battery Replacement N2

Attachments

Images (2)
  • TMCC 9V Battery Replacement N1
  • TMCC 9V Battery Replacement N2

After assembling this one, I see where hand assembly will benefit from laying out some of the components slightly different, so I'll rework that.  I figure optional caps are free if I don't install them, so no problem there.   I also want to think about the maximum voltage on the SuperCAP, I'm right at the edge now.  They are two 2.7V caps inside the wrap, so 5.4V is the max they should see.  I'm close to that now.

If I wanted to use this to provide power all the time to some circuit, it would benefit from having additional filtering on the input regulator side to allow more current.  OTOH, it does do the TMCC battery function as it stands.

I was pleased at how much capacity the 1.5F SuperCAP had, I didn't expect it to hold up the load that long.

Last edited by gunrunnerjohn

If you'd like some outside testing, let me know (I'll pay for it.).  I have a Lionel ten wheeler that always drops out sound going over my Atlas O72/O54 when running at anything below speed step 60.  It's a pain as I'll have it labored and then all of a sudden it quiet then chuffing along easily.  I do want to add this to all my TMCC/Legacy locomotives that have a battery spot.

Well, I'm going to do some more refinement and checking internally first.   I have a couple of things I want to look at now that the thing is working.  I mentioned the peak voltage on the SuperCAP as one, and I'm also looking at the max charging current to see if I can optimize that.  I'm gratified that it's working, and I think the first one might go into a locomotive internally to see if it functions over a couple of weeks of running.  I'm also considering revising the layout to make it easier to hand assemble, a couple of the parts are somewhat of a PITA to solder on as their orientation doesn't leave much room to work.

Well, I did some bench testing with real TMCC components, and in conventional and command, the battery replacement worked great!  Other than waiting a minute or so from a cold power on to get the cap charged, I could operate and do frequently reversals in conventional mode with no dropped sounds, even at the lowest power that the R2LC and motor driver would keep running.  I kept nudging the power down until the drive dropped out, still had the battery charging away, so it works at a lower voltage than any of the other electronics.

I think my one remaining issue is the scheme I used to limit the voltage to the Super-Cap isn't sufficient.  The LM06 and the silicon diode don't drop enough at low currents to keep the voltage below the max for the caps.  I suspect I'll have to go to the LM317 and tune the output to around 5.5-5.6 volts to insure we don't push the supercaps over the 5V rating.  I was trying to save having to add a couple more components, but obviously that's probably going to be necessary.  If I let it sit and charge for long enough, I get up to about 5.45V on the supercap.  Since the cap is really two 2.7V caps in series in the package, that's too much.  Given that we seem to have plenty of capacity for the intended purpose, I'm thinking I'll try to limit the supercap voltage to around 5V max.  That still gives me the full 8-9 second shutdown, and the cap has more to give before the switcher shuts down.

gunrunnerjohn posted:

Well, I did some bench testing with real TMCC components, and in conventional and command, the battery replacement worked great!  Other than waiting a minute or so from a cold power on to get the cap charged, I could operate and do frequently reversals in conventional mode with no dropped sounds, even at the lowest power that the R2LC and motor driver would keep running.  I kept nudging the power down until the drive dropped out, still had the battery charging away, so it works at a lower voltage than any of the other electronics.

I think my one remaining issue is the scheme I used to limit the voltage to the Super-Cap isn't sufficient.  The LM06 and the silicon diode don't drop enough at low currents to keep the voltage below the max for the caps.  I suspect I'll have to go to the LM317 and tune the output to around 5.5-5.6 volts to insure we don't push the supercaps over the 5V rating.  I was trying to save having to add a couple more components, but obviously that's probably going to be necessary.  If I let it sit and charge for long enough, I get up to about 5.45V on the supercap.  Since the cap is really two 2.7V caps in series in the package, that's too much.  Given that we seem to have plenty of capacity for the intended purpose, I'm thinking I'll try to limit the supercap voltage to around 5V max.  That still gives me the full 8-9 second shutdown, and the cap has more to give before the switcher shuts down.

Just talking, but what would happen if you proportioned the voltage divider to use a little more current? You are down in the microamp range! Would 5 - 10 mA hold the voltage down adequately?

Thinking about what you could do without adding parts.

Add Reply

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