Skip to main content

Reply to "TMCC Control With Arduino"

Randy P. posted:

Ameentrainguy, I agree with Don's reply to you, but I'm not sure he was clear about one thing: You can write your software to send exclusively TMCC commands out the serial port, and if you upgrade to Legacy hardware and optionally also Legacy locos -- your software will still work fine.  All of the Legacy hardware and all Legacy locos will respond to TMCC commands -- whether from a Lionel TMCC control system or from serial data being spit out of an Arduino serial port.  As Don pointed out, the hardware interface will need to be upgraded for Legacy (to include an SER2), but your software will continue to work exactly as before.

My exclusively-Legacy project would work just fine if all I used were TMCC commands -- and my software would be simpler because the TMCC protocol is simpler.  The incentive to go with the Legacy protocol is that Legacy equipment offers more control -- more speeds, more control over triggering announcements, controlling smoke, etc.  If you look at the plain-English description of the commands in the TMCC protocol versus the Legacy protocol, you'll see what the differences are.

Randy P. posted:

Don, one of the approaches that I considered for registering trains into the system is similar to what you're describing.  I would manually drive an engine past the RFID sensor, at which time the computer would take over all control of that train -- adjusting the (absolute) speed and directing it on whatever route my algorithm assigned.  The operator (me) would then select a different engine or train on the CAB, and drive that train past the RFID sensor.  And so on.

I'm not sure how your hall effect sensors work -- do they show "occupied" whenever an engine is anywhere inside an electrically isolated block?  How do you do this?  Remember that a long train can extend into a block on either side...  I'd like to see exactly what sensors you are using and how they are connected to the track and an Arduino.  If you could post specific information about your hall effect occupancy sensors,  I'd very much appreciate it.

I'm using old-school isolated rail sections connected to time-delay relays (to avoid bounce/chatter), and have a sensor at each end of every block.  The length of the sections is adjustable as I'm using kapton tape with copper foil tape on top of the rails, rather than cutting the rail to create the electrical isolation.  So I keep a accurate accounting of when trains enter *and completely exit* each block.  Regardless of how long at train is, I know when a block has been completely cleared, and (because I use absolute rather than relative speed adjustments) I know when it is likely to reach the next sensor.  I like that certainty.

I know how many inches per second each train is moving at each speed step (I have four pre-defined for each loco - crawl, slow, medium, and fast.)  Using relative speed adjustments is just too arbitrary for my taste ;-)  This is beyond what you'll require, but I've also got tables that indicate rates of deceleration -- so I can calculate when to start slowing a train after hitting a destination siding entry sensor, and attempt to be at crawl speed the moment the train trips the destination siding exit sensor -- giving the software an opportunity to stop the train before it overshoots and fouls the mainline.  Note that entry/exit sensors are identical -- it just depends which direction the train is moving.  I also use these sensors to trip accessories such as crossing gates etc.

I buy virtually all of my parts on eBay, Amazon, and Sparkfun.

 

Here's the Hall-Effect boards I used from eBay.

https://www.ebay.com/itm/Curre...?hash=item283e9b6153

You are right that this detection, while simple, does well on block entry but not on block exit.  On exit it may drop out after the engine leaves the block unless you are hauling passenger cars with incandescent lights.  I don't worry about the "overhang" right now as our blocks are long so I concern myself with just entry, not exit.  Time is calculated from entry to entry and I put in a delay before declaring "unoccupied" just to be safe.  A potentiometer allows you to adjust the pickup current but it won't detect cabooses with LED lights very well.  You could drop in a low ohm resistor in each caboose or around each EOT to suck enough current to declare occupancy.  Board outputs are dry 10a SPDT relay contacts to be used any way you choose.  No isolated track sections or overlays.  I detect all current at its source on our control panel so no wires to remote locations, a big plus.

I'm not sure what I'd do with absolute speed as I'd have to determine the sweet spot separately for each engine.  I'd rather set a nominal target speed for the first engine out and let the others queue up behind that one by adjusting their speed incrementally.  Obviously all speculation for now, we'll see how all this works out in a few months.  I'm sure that my scale MPH calculations will not be very precise but good enough for me, I hope.

OGR Publishing, Inc., 1310 Eastside Centre Ct, Suite 6, Mountain Home, AR 72653
800-980-OGRR (6477)
www.ogaugerr.com

×
×
×
×
×