COMPUTER INTEGRATION ON THE

TETON SHORT LINE

Wayne Roderick, 3rd Division, PNR, NMRA (life)

11/28/98 rev 01/15/07

11/21/04: Continuing to enhance the operation of the TSL, we have integrated Bruce Chubbs CMRI as our Layout Control Bus (LCB). The revised QBasic 4.5 source code is included for you to peruse and maybe pick up and idea or two.

01/19/03: We have installed EasyDCC and that's a departure from the usual do-it-yourself (DIY) methodology of the TSL. The integration of EasyDCC was a fun and interesting effort.

11/28/98:This is the last major electronic system on the Teton Short Line (TSL) to be described. I've delayed it because so much change has been taking place in the last year. We use the title "Computer Integration" because that's exactly what it does- It brings all sub-systems together with a processor that can integrate them in any way that you can imagine. Change is easy from now on. I believe that some day most model railroads larger than a loop around the Christmas tree will use these concepts with a minimum of wire and using software modules that hook it all together. The Automatic Cab Control (ACC) system that has served us well for about 25 years has been replaced with a Digital Command Control (DCC) system of our own making, but in conformance with the NMRA Standards. Read down a bit while a big (749 x 541 pixel,) diagram paints.

EVOLUTION

The embedded computer started back about 1984 with a homemade system using a Motorola 6800 uproc' to enhance and expand the ACC system. It evolved up through the Heathkit generation of 8080 & Z80 computers using the CPM operating system. Until recently, there was no keyboard or monitor, the computer just quietly done it's thing supporting our Automatic Cab Control while our operators blissfully ran trains without a hint of the technology that made multiple train operation possible. Initial cab/block assignments were made from a dispatchers panel and the walk-around cabs. Today, an old dog IBM compatible 386 lies deeply embedded in the TSL and it has a keyboard and monitor that's convenient for entering the DCC setup commands, controlling switches, fast clock and making sub-system tests. These features are also networked to a remote computer for our dispatcher. The system runs under MS-DOS 6.22 and is programmed in QBASIC

The TSL computer integrates together THREE major sub-systems- they are:

  1. DCC SYSTEM
  2. The DCC sub-system permits us to control locomotives individually or jointly when MU'ed together, on the same track with others. DCC uses a "CONTROL BUS" as defined by the NMRA to connect DCC commands from a CONTROL STATION to POWER BOOSTERS in the conventional "store-bought" systems. The power boosters provide the the power and data commands to run the loco's. Typically the railroad will be sub-divided into two or more sections with a booster on each, but you can get started with only one booster. We use three and have a spare one in place.

    In our case, the computer replaces the control station and generates the DCC commands according to instructions from the stationary and walk-around cabs.

  3. CAB SYSTEM
  4. The commercial or "store-bought" DCC systems include a cab system, but the interface between cab and control station is usually proprietory, as there is no accepted standard, so interchange of differant brand cabs is generally not possible. You use the cabs provided by your DCC system maker.

    Our walk-around cabs. have served the TSL for more than 20 years using a homemade system consisting of a 10 kilobaud synchronous data line that the handheld cabs can plug into at a number of convenient locations around the railroad. CAB commands are passed to the computer where software can be used to "simulate" real life conditions before sending the DCC commands to the loco(s). The Teton Short Line CAB system goes back to 1978 when I first got into designing with TTL. It was originally designed as a stand-alone CAB bus that controlled hard-wired, diminishing pulse analog throttles. In 1987 we interfaced the synchronous data line to the computer in a successful, but discontinued project to generate compatible track signals for use with Abbott Lahti's (Power Systems Inc) Dynatrol System. Recently we converted to DCC with only software changes. The only hardware change to the cab system was to relabel the direction switch from East-West to Forward-Reverse

    Herein is the anti-obsolescent value of a data system dedicated to the cabs. Adaptation of our cab system to the new DCC was a matter of software changes in the computer, and here we can do as we darn well please.

  5. LAYOUT CONTROL BUS (LCB)
  6. The acronym LCB emerged a few years back- I may even have been the originator, but that's of no significance. LCB describes the communicaation system that interconnects the fixed or field equipment i.e. turnout motors, animation, signals, occupancy detectors, control panel buttons and switchs (other than cabs). A true multiplexed BUS for this purpose is yet to be standardized, although several folks and vendors have implemented their own versions. Probably the most well known is Bruce Chubbs Computerized Model Railroad Interface (C/MRI). Bruce introduced it to the hobby in the February 1985 Model Rairoader and it has grown to satisfy the needs of the biggest and most complex model railroads.

    The Teton Short Line, until recently (2003) did not use an LCB, but rather gathered all the I/O connections with hundreds of individual or cabled runs, using salvaged telephone cable, to a central rack mounted assembly of INPUT/OUTPUT cards that interfaced to the embedded IBM compatible 386-25mHz computer. That is now history We have recently de-centralized, scrapping the rack system and adopting C/MRI as our LCB. Our LCB uses two pair of RS-485 balanced lines, one for sending and one for receiving. The added C/MRI hardware is known as a SUSIC, a smart little device that interfaces the numerous digital I/O cards to the 19,400 kb serial bus. The communication protocal is C/MRI. The computer is any off-shelf, IBM compatible with two serial ports. Three I/O nodes connect to the LCB and many more can be added in the future.

    The Yardmaster has a hidden computer with the monitor inconspicuously suspended from the ceiling in a corner of Malfunction Junction. His keyboard is under a work surface used for Car cards, where he can access it for occasional use. This is a TSL extension of the classic C/MRI system, another is the interface of our CAB bus. Click here> for further information.

    INPUT/OUPUT STANARDS

    In the early years, while using home-made computer systems, it quickly became obvious that standards of interface were needed and we evolved to that. All devices (like push buttons, lamps and switch machines) work at standard 5 volt TTL levels. An action such as closing a switch pulls the line toward ground (logic LOW) and a device such as a switch machine is activated by pulling its control line to a logic LOW. This standard makes interfacing and changes a snap, and over the lifespan (since 1965) of the TSL, there have been many changes.

embedded computer system

TODAYS COMPUTER

We've evolved from a homemade computer to a Heathkit 8080/CPM through all the steps to its present off-shelf, generic P1-500mHz. The QBASIC program, that has grown to over 200k bytes, reads the railroad status, runs the EasyDCC, three color signal heads, official clock, reads and writes the MUX CAB, presents CTC graphics for a dispatcher and communicates graphics and I/O to another PC on the LCB..

The dispatcher has full color graphics of track occupancy, switch position and signal indications, DCC loco lineups, Speed and direction of each train using ideas gleaned from Union Pacifics dispatch center that existed in Portland OR for a short time. The dispatcher has control of switches or he can "give switch power" to a someone local. The switch is backlighted with bright yellow when in this condition. He can put a track out of service such as when cars are stored there and it is colored magenta as you see block 17 or he can put it out of service for maintenance (Track & Time) and it appears blue. In either case, the signals protect it. Local "mini-panels" at stations make it easy for the walkaround crews to work with or without a dispatacher.

HARDWARE

The circuit cards we use are few and have evolved over time. The time and resources to make printed circuits is/was simply not justified, so in most cases the cards are hand wired with 30 guage wire, the kind used for wrap-wire. Some cards are true wire-wrap salvaged from some forgotten source. The C/MRI SUSICs, being a commercial product, are printed circuit boards. Most detector cards are scattered about the layout to be closer to the DCC power distribution.


nodeO.jpg This is the Bigger Node0, 19" x 24" plywood, suspended under the layout. It is hinged so you can set on the floor with it in your lap and work on either side- Very handy that way. The rack is a common 19" with 22/44 pin sockets, a carry-over from the old central rack days. On the left is the green C/MRI SUSIC. I/O terminals use the common 66c telco punch blocks. Not shown in the back, the wires between the rack and the punch block pass through surplus 25 pair telco connectors so the whole thing is removable. The barrier terminal strip is for the RS485 pairs, Cab bus and Telephone system. A circuit breaker for the +12Volt supply is top right. The 5-Volt regulators for the TTL are bolted to the rack frame for heat-sinking.


node1.jpg This is Node2, Node1 is the same. Like Node0, they are suspended on hinges, but against an outside wall. Keeps you from having to rest on your elbows while you work. Fewer circuit cards were needed so no card rack. Top left is the 66c punch block for I/O connections. Upper center is one of our octal resonant detectors. Then the barrier strip for the various bus lines. On the far right is a 2-amp circuit breaker for the +12Volt supply, and a 5Volt regulator. In the center is the green C/MRI SUSIC. Lower left is two wire-wrapped cards that each drive eight 3-color signal heads. To the right of that is a couple of our I/O cards built on Radio Shack (no longer available) perf' cards.

SOFTWARE

The software is all done at home. When we started, it was hand entered binary code to a Motorola 6800 processor with a battery to remember it. As time and hardware improved, we arrived at Microsofts QBASIC 4.5 and stopped there. It seems to do most everything we want and it's real friendly. That's important if you're not a programmer, and I'm certainly not! Somewhere back there I learned a few BASIC statements and commands like PRINT "name" and looked up and learned a few more as the need arose. QBASIC has a set of graphic commands that lets you create some pretty impressive displays, but nothing like the current popular VISUAL BASIC, I'm sure. I bought VISUAL BASIC, worked on it a while and decided I wasn't having fun. My code is a pot-porri of old and new- It's evolved over time, and a "programmer" would surely denounce it-but it works! If you're interested in the source code- most of it is pretty well documented- download it and play.

What? You're too new to have QBASIC? - big 270k package includes the needed files. You don't need to Unzip it onto your computer- just Unzip it to a floppy, then run it as an MS-DOS program from A:\ Typing QB will open the QuickBasic4.5, then ALT-F to get to the TSL4B21.BAS program. ALT-R will launch it. QB.EXE is an executable, so be smart and have your virus checker look it over :-) I know it's safe, but do you? :-)

Here is a 640 x 480 inanimate picture of the screen. Blocks 5, 10 & 15 are OTS because a doorway is open.

embedded computer graphics

To avoid timing problems, I run it under DOS6.22 but for playing with it W98 should do OK. XP- uh ??

If you choose to run it, look in the lower right corner for a counter. This is the cycle counter as the program loops through reading the input data and taking action. Quite fast enough for model railroading on my 500 mHz P1 machine. Also- use the left/right/up/down arrow keys to scroll the Stations or Cab Assignments. You're not connected to the Teton Short Line so there is no data coming in. The program will recognize this and interpret loco assignments as block occupancy so you can play a bit and observe how the signals work. Use the (W)ork menu to switch operation (M)ode from between APB signals and CTC operation. Snoop around the source code and maybe you'll find something you can use. Enjoy

If you're a skilled programmer, please be kind and don't laugh too hard- it works.

Teton Short Line Home Page