JMRI - hardware needed for smart autonomous operations?

Taymar May 19, 2018

  1. Taymar

    Taymar TrainBoard Member

    121
    17
    7
    Hello all,

    I'm looking into options for dcc with layout automation - locomotives and structures. I need to be able to set up a whole bunch of logic steps and timers, and ideally have the whole ''program" run on a loop.

    From my research so far, it sounds like JMRI and the software modules can do all of this and then some. Where I'm stuck though is what hardware I will need to get everything working.

    The z scale is probably going to be toughest since there doesn't seem to be tons of options for micro decoders (I model steam). Assuming I can go with any of the brands that'll fit (digitrax), what items do I need to go between the computer running JMRI and the layout?

    I'm a little fuzzy on some of the terminology like command center and loconet, so any dumbed down explanation would be a massive help to get me started.

    Thank you
     
  2. sachsr1

    sachsr1 TrainBoard Member

    60
    23
    5
    You can do some automation with scripts, but to really do automation you will need to install block detection (or other sensors), and some type of signalling. You don't have to install a physical signal on the layout you can use virtual signals. As for what hardware you'll need to install there are a ton of sensor types all having pros and cons. I've been trying on and off for over a year to get an train to run automatically but with no success. That being said I haven't really committed myself to making this happen. I have found it hard to find information on how to get it done, and I happily move on to some other project. When I bought my train setup on Craigslist it came with some CTI hardware. I was able to write a simple script that ran one train from sensor to sensor it would slow down, pause, at a station and then go again. The process for automating a simple one train going around the track was really quite easy to setup.

    JMRI is a great program that can do a lot, but it does require the user to invest some time to learn how to use it. JMRI will connect multiple brands of hardware, and does a pretty good job of making them interact. You can have a Digitrax signal lamp turn activated by a NCE signal. There is a lot of Arduino based DIY solutions that can control lights, sensors, etc. I find it easier to think of a complex system of switches (sensors) and lights (turnouts and actual lights). You tell the system what to do with the information. "When sensor X changes (on/off) make turnout X move". It's up to you to define how complex the sensor system is and what the actual output is...a led bulb?, a turnout motor?, a servo?

    I like to use the smartphone example. I have zero clue about the inner workings of my iPhone, and even less understanding about how telecommunications systems work. I do know how to set up my phone so that when I tap on a picture of my mom it will call her, and that's what I as the "end user" want to happen. I did have to input the picture and the phone number, but I have nothing to do with what the phone and phone system do once I set it up.

    Whatever DCC system you plan on using will have interface requirements listed in JMRI it will include instructions and required hardware.

    There is a ton of hobby specific vocabulary and terminology that you have to absorb to help understand the concepts better. Some a slang terms, and some are brand specific (Loconet.
     
    Taymar likes this.
  3. Taymar

    Taymar TrainBoard Member

    121
    17
    7
    Wow, thank you very much for the clarity. Definitely sounds like a challenge, but an exciting one. I'm fine with a learning curve on the programming side.

    Does this hardware list cover the major components of what I'd need to at least get a train running on this setup? I understand that sensors would also be needed to actually add any major automation.

    - Digitrax PR4 USB to loconet interface (allows the PC running JMRI to 'talk' to the command station?)
    - Digitrax DZ126t decoder(s) 1 per loco (allows each loco to receive and act on the commands sent to it)
    - ZEPX Zephyr Xtra command station (supplies the power/commands to the track/locos?)
    - Windows PC w/JMRI installed

    Thank you so much for the help. I may try and document this from a complete beginner perspective in case it helps folks in the future.
     
  4. papahnash

    papahnash TrainBoard Member

    337
    69
    17
    By connecting them with a Loconet cable, you will be able to control your decoder.
    As stated above, JMRI is a very powerful resource but to accomplish "Smart Autonomous Operations" a method of read-back is necessary which is not easily implemented. What I mean is that JMRI tells your command station to issue a signal to the decoder but there is no feed back to confirm the signal has completed the request. Therefore subsequent commands may not act the way it is planned.
    I have written a number of scripts to control trains on my layout which work very well but I always monitor the operation.
     
    Taymar likes this.
  5. Taymar

    Taymar TrainBoard Member

    121
    17
    7
    Ahh, I see, thank you. Would it be possible/feasible to combine each major movement command with a block sensor, e.g. move train A to point X, then the next command is dependent on the sensor at point X detecting a train?

    (I realize that's an extremely simplified example; I'm just trying to understand my options).

    Makes absolute sense that if there was an issue with one command, the chain reaction that could cause would be very messy.

    Are there relatively inexpensive ways to detect the presence of a specific loco at a location (RFID or similar), or are they mainly train/no train sensors?

    Thanks again for the assistance and advice!
     
  6. sachsr1

    sachsr1 TrainBoard Member

    60
    23
    5
    I think there are other USB interfaces available for the Digitrax systems, but I'm not 100% sure (DIgitrax users would know)

    You don't have to use Digitrax decoders with a Digitrax system, but they are great decoders. DCC is one of the few consumer available hobby systems where all most all the different brands work interchangeably.

    This list will control the locomotive, but you'll need to add sensors to the system if you want to trigger automation. There is usally some type of interface required to report sensor data. NCE has the AIU, but I'm not sure about the Digitrax version. I used a mixture of the NCE AIU and Arduino based CMRI to connect sensors. I have block detection based on current draw using NCE sensors, and reed switches with magnets hidden under the locos. I got tired of forgetting to change a certain turnout and derailing my trains. I added a reed sensor to both approaching tracks so when the sensor is tripped it moved the turnout to that track.

    I think the easiest way to set this automation would be to run a locomotive until it trips a certain sensor. I'm pretty sure there's a sample script on the JMRI website that will do this, but I haven't played with scripts much.
     
  7. sachsr1

    sachsr1 TrainBoard Member

    60
    23
    5
    There are RFID systems available, but they are not cheap. I played around a bit with Arduino based RFID, and I found the detection of the tags to be less than 50% at normal running speeds. Digitrax has something called transponding available, but I'm not sure exactly how it works. I'm not sure exactly how complex you want your system to be, or if knowing exactly where each specific train is located is really that critical. It may be easier and a lot cheaper to design a system of logic rather than identifying each train. It may be easier to program a system with logic rather than using RFID. An example would be having a sensor that trips a relay that kills power to a section of track as a way to stop a train, and when the other train trips another sensor the section of track powers back up. I'm easily impressed by things I call "stupid logic", I like things that do simple or even complex things but with the most basic design. My uncle has these little screw drive turnout motors that move back and forth on 12 and -12 volts. I asked how he programmed them to stop, and he said the little motor spins and moves the contact off of the 12 volt trace on the board. When he throws the switch to turn the turnout it provides -12 to another trace that moves the motor backwards...my simple mind was blown. I'm sure this is a pretty common setup, but it works.
     
    Taymar likes this.
  8. Taymar

    Taymar TrainBoard Member

    121
    17
    7
    Got it, thank you! Great to know on the decoder/command center compatibility.

    The logic approach is very interesting - if I were to use a relay to cut power, does the decoder allow me to smoothly start the loco once power is restored or would it behave as a DC system does?

    Transponding is also something I'm curious about - I'd read elsewhere that the transponding feature can be leveraged for DCC sound (my goal would be to control a series of below-layout speakers depending on which speaker(s) a loco was nearest).

    To add context, my hope for this layout is to model a late 1800s/early 1900 coal mining setup, with exclusively steam locomotives. I'd like to be able to couple/uncouple cars, start and stop trains, add wait periods/timers, and control motorized layout elements and lighting on a schedule. Likely a maximum of 4 locomotives on the layout at any one time.

    Thank you guys so much again for the advice, it's really helping me understand what I need before I spend any money.
     
  9. sachsr1

    sachsr1 TrainBoard Member

    60
    23
    5
    No it would work like a DC train.

    I'm sure you can do everything you want if you're willing to put in the effort.
     
    Taymar likes this.
  10. papahnash

    papahnash TrainBoard Member

    337
    69
    17
    The loco in this video is being controlled by a JMRI script. Occupancy sensors report to JMRI and movements are timed from the sensors.

     
    Taymar likes this.
  11. Taymar

    Taymar TrainBoard Member

    121
    17
    7
    Very nice! In this setup, are the speakers on-board the loco/cars? Also - when it uncouples on the bridge, is that small downwards slope needed to facilitate uncoupling or is it unrelated?

    Thanks for the video, the concepts are definitely pretty similar to what I'm hoping to eventually achieve.
     
  12. papahnash

    papahnash TrainBoard Member

    337
    69
    17

    The speaker is in the Loco tender the decoder is a LokSound mini select. The slope is not necessary for the magnetic uncoupling. The un-coupler works good about 95% of the time but sometimes it re-couples while backing. At that point you may want to operate manually.
     
  13. DCESharkman

    DCESharkman TrainBoard Member

    4,397
    3,030
    87
    Full on automation is a very expensive situation. There are expensive software programs that can do it, and there are advanced DCC systems that are better at it than others.

    Any system that truly relies on RailSync and uses it it to its fullest potential has the ability to have 2-way communication or "real" control. Most systems like Digitrax and NCE are what is termed fire and forget, in that there is no feedback. Actually the more appropriate term is open event-driven.

    Systems like Zimo and ESU and to a lesser extent, Lenz have a lot more capability for true command and control. This comes at a substantial price. The base Zimo command station is over $1500. And the additional functional modules come with similar increased prices over Digitrax and NCE.

    Given the desire for automation it may be that delving into DCC++ may allow you you to get the features you want, but then you will be building and programming every device from scratch.
     
    papahnash likes this.

Share This Page