This is the design document for the MRNet project.

MRNet -- Model Railroad Network

Table of Contents

Introduction to MRNet

MRNet is a suite of hardware modules and software protocols that can be plugged together in a hierarchical (i.e. tree-like) fashion and connected to a standard personal computer to provide a computerized model railroad layout. MRNet interoperates with the popular NMRA DCC standard. MRNet is based around standard personal computers, inexpensive Catagory 5 network cable and inexpesive microcontollers. The overall goal of MRNet is to achieve a significant advance in realistic model railroad operations at a reasonable price. It is intended that the MRNet electrical standards and software protocols be made freely available without any royalty or licensing obligations so that various vendors may compete in the marketplace to provide low cost and high quality products to the model railroad community. It is a futher goal of MRNet to reduce those rats nests of wires that are under so many model railroad layouts!

The MRNet architectual diagram is shown immediately below:

MRNet Architectual Diagram
The layout is controlled from a standard personal computer using whatever hardware and operating system the owner wishes. A simulation/control program is run that can talk to the MRNet modules and/or DCC controller. The MRNet modules a grouped into cab stations, cabs, and layout control modules. A variety of different cabs are supported -- stationary, wired handheld, IR handheld, etc. The modules are intermixed in whatever fashion that makes under layout wiring easiest.

The current concept behind MRNet borrows heavily from the current hiearchical EtherNet technology (e.g. 10BaseT and 100BaseT.) In fact, I would expect future versions of MRNet to use actual EtherNet technology whenever microcontrollers start to have embedded Ethernet interfaces built onto the chip.

Basically, MRNet consists of a bunch of modules connected in a hiearchical (i.e. tree-like) fashion with cables. All modules that do anything interesting contain an embedded microcontroler with some sort of interface electronics for interfacing to MRNet (i.e. an on-board UART.)

The modules that make up MRNet consist of a root module that connects to a central control computer and a number of control and sensor modules. Example sensor modules are block occupancy, buttons being depressed, and handheld cabs. Example control modules are turnout controls, decoupling electromagnets, light/LED lights, etc.

Signal Cable Specification and Rational

{Cable Signal Introduction goes here.}

Signal Cable Specification

MRNet uses standard Ethernet technology Catagory 5 cable with RJ45 connectors. The cables are wired straight through with the twisted pairs connected to pins 1&2, 3&6, 4&5, and 7&8 of the RJ45 connector. Currently, only two of the pairs are used (4 wires total). The wire pairs are allocated as follows:

Up+ (pin-4) & Up- (pin-5)
This is the data up link that sends data up towards root module via a differential signal. Up+ is assigned to pin 4 and and Up- to pin 5. This signal is a RS-422 differential signal transmitted at 115.2KBS.
Down+ (pin-3) & Down- (pin-6)
This is the data down link that sends data down from the root module out to all of the MRNet nodes using a differential signal. Down+ is assigned to pin-3 and Down- to pin 6. This signal is a RS-422 differential signal transmitted at 115.2KBS.

With the remaining pins, I am experimenting with using Cat5 cable for power distribution. I expect this experiment to fail. For the power distribution experiment, the remaining pairs are assigned as follows:

PWR1 & PWR2
This is conceptually the power feed wires. The power can be either 8 volts DC or 8 volts VDC. These are pins 1 & 8.
GND1 & GND2
This is the ground return lines. These are pins 2 & 7.
If somehow, a cross-over Cat-5 cable is introduced (this real easy if you crimp your own cables), the power wires do not cause a short.

If the power distribution experiment fails, I expect the PWR1 and PWR2 signals to go away, and the GND1 and GND2 wires to be used as a ground reference. In this scenerio, each module would be attached to the ground reference through a resistor whose value is to be decided. There would be no rigid ground requirement, just a requirement that the grounds between successive modules be within a volt or so of one another. This should make ground loops be pretty much of a non-issue.

If the power experiment fails, I suggest that power distribution be done using standard 3.5mm (1/8 inch) power jacks. Wall transformers in a variety of voltages and currents are available with a 3.5mm jack on the end. The 3.5mm jack can also be run into a standard audio splitter cable so that one wall transformer can power more than one MRNet module.

Signal Cable Rational

Below are a bunch of questions with corresponding answers:

Why use Catagory 5 cable?
Catagory 5 cable is readily available at reasonable prices because it is used heavily for computer networking. The pairs are twisted for superior noise rejection. People can purchase the cables prefabricated or cut and crimp their own cables. The RJ45 connector is gold plated, has excellent contact wiping, and positive retention via a clip.
Why not use telephone cable?
Telephone cable tends not to have twisted pairs. The noise environment in a layout can be rather severe with turn-outs switching, engines running over dirty track, etc. It was felt that it would be better to have the extra noise rejection offered by Catagory 5 cable. The cost difference between telephone cables and catagory 5 cable is pretty small for people who crimp their own cables.
Why use differential signaling?
{Answer goes here}
{More Questions and Answers go here}

MRNet Modules

The MRNet modules are partioned into three broad catagories of modules:

Root Modules
There is one root module per MRNet network that connects it to the controlling computer. There is one kind of root module for each different way to connect to the controlling computer (e.g. RS-232, RS-422, 10BaseT, etc.)
Cab Station Modules
A cab is the user interface that is used to control the layout. Cabs can be either fixed (i.e. stationary) or portable (i.e. walk-around.) Cabs can communicate with MRNet either via wires, infra-red signals, or radio signals; these cabs are respectively called wired cabs, IR cabs, and RF cabs. A cab station module is the portion of the MRNet electronics that communicates with a walk-around cab that is attached to a fixed location on the layout.
Control/Sense Modules
The control and sense modules are used for layout control (e.g. turn outs, signal lights, decoupling electromagnets, etc.) and layout sensing (e.g. block occupancy, turnout positions, etc.)
These module classes are discussed in separate sections below.

Before diving into the various modules in greater detail, it should be pointed out that most MRNet modules have an up-link and 2 or more downlinks. A basic module looks as follows:

Basic Module Schematic
This circuit simply takes any signal from the link connector and replicates it to the three down link connectors. Similarly, the signal from the three down link connectors is logically OR'ed together to form the up link signal. It is important that no spurious signal be generated when nothing is plugged into a connector. Since the 26LS32 outputs a 1 signal when there is no signal present, it is necessary to do the OR'ing using `negative' logic. Hence, the use of NAND gates instead of OR gates.

The base parts list is shown in the table below:

Name Description Jameco Part Jameco Price
R1-4 100 Ohm 1/4 Watt Line Termination Resistor 29946 $0.89/100
U1 26LS32 Quad Differential RS-422 Receiver 39600 $0.79
U2 26LS31 Quad Differential Rs-422 Driver 39589 $0.79
U3 74LS20 Dual 4-Input NAND Gate 47095 $0.25
U4 Microcontroller
As you can see, the required parts for a basic module total to less that 2 dollars using quantity one pricing from Jameco. Actually, U1 and U3 can be replaced by the even cheaper 26LS33 with open collector outputs (Jameco part 39626 for $0.49) and a couple of pull up resistors in some modules. Actually, the most expensive parts are the RJ45 connectors which cost $0.69 each from Digikey (Digikey part A9044-ND.) I feel confident that vendors will be able to get all of the parts listed above for substantially less than the quantity one prices listed above.

Root Modules

The purpose of a root module is to provide a connection to the controlling computer. There are a number of different connection standards that make sense for a computer connection. It is anticipated that a root module will be generated for each popular connection standard.

RS-232
All popular computers have an RS-232 interface. Some of the older interface cards can not run at 115200 bits per second that MRNet runs at. However, replacement cards that do run at 115.2kbps are readily available.
RS-422
For those people who have a fairly substantial distance between their layout and the controlling computer, an RS-422 interface may be more appropriate. This interface also makes sense for people who live in a high noise environment (e.g. under a commercial pradio transmitter.) The RS-422 standard is much more resistant to indouced noise than RS-232.
10BaseT Ethernet
Rather than run a special RS-232 or RS-422 line between the layout and the controlling computer, some people will decide to just plug their layout into their home computer network directly. This module allows the control of MRNet using standard Internet UDP packets.
USB (Unversal Serial Bus)
USB is bus being pushed by Intel and Microsoft. There are some pretty severe length restrictions on the length of USB cables, but some people will have their controlling computer right next to their layout, so they will be happy with USB.
In additon to these modules, some people will prefer to have a dedicated computer that controls their MRNet modules. This computer will probably be directly embedded into a root module.

At the moment I have not layed out and root module printed circuit boards. Instead, I have included the functionality of an RS-232 root module on the wired cab station module. The next time I send in some printed circuit boards to be fabricated, I expect to have both an RS-232 and RS-422 root module layout out.

Cab Station Modules

The next batch of modules have to do with cabs. A cab is the user interface for controlling trains on a model railroad layout. A stationary cab is one that is in a fixed location and does not move. A walk-around cab is a portable cab that moves around with the operator.

There are a number of differnt technologies that can be used for communicating between a walk-around cab and the layout computer -- wires, infra red signalling, and radio signalling. The cab station modules implement the portion of the signalling that bridges the gap from the layout to the walk-around cab. If the cab station to walk-around cab signalling is standardized, it is possible to have mulltiple different walk-around cabs all interoperating with one another (e.g. person A uses a wired cab from vendor A and person B uses a wired cab from vendor B and both plugging into the same wired cab stations.) Similarly, it is possible to conceive of a club layout that implements all three cab signaling technologies (i.e. wire, IR, and RF) and various club members using different cab signalling technology at the same time during an operating session (e.g. person A using a wired cab, person B using an IR cab, and person C using an RF cab.)

A reasonably long time ago I wrote up a fairly long wish list of what I might want in a walk-around cab. This document is called Handheld Cab Requirements and Issues. My plan is start out with fairly simple wired cabs and work my way towards more and more complicated cabs based on IR and RF signaling.

Before getting into the details of various cab options, I sat down and decided on some technology that could be used to construct walk-around cab boxes. This is written up in a separate document called Walk Around Cab Box Construction.

For each kind of cab communication technology (i.e. wire, infrared or radio frequency), there is a station that plugs into the MRNet. In the case of wire and infrared technology, these modules are sprinkled around the edges of the layout; conversely, for radio technology there is only one station needed. For each technology, there can be a multitude of different cab implementations that interoperate with one another as long as they use the same signalling protocols.

Wired Cab Stations

A wired cab uses a physical wire to connect the cab to MRNet. The connector that is used is a standard quarter inch phone jack (i.e. tip-ring-sleeve connector.) High quality versions of the connector are available from multiple vendors. Since the phone jack is axially symetric, there is now way to plug it in wrong. Power and ground are run on two of the conductors and the remaining conductor forms a bi-directional half duplex connection using open collector TTL gates. The wired cab station is acutally pretty dumb since it does not need a microprocessor to forward the MRNet signal to the wired cab.

I would like to digress a little and talk about plugging in wired cabs. One of the big problems with wired cabs is that they tend to require that the train operator take their attention off the train whenever it is time to plug the handheld cab into another cab station. The basic problem is that the operator has to find a fairly small jack hole and stick the jack into it. One potential solution to this problem is to make the hole bigger so that is can be found by sense of touch rather than having the operator divert their eyes from the train. This proposal is shown below:

Wired Cab Plug Hole Proposal
In this proposal, a common plastic household funnel has its tip sawed off and mounted on the side of the train layout. The phone jack plug is mounted on a panel so that the plug is centered exactly behind the funnel hole. The means the train operator can feel along the side of layout until the funnel opening is found. As the end of the jack is pushed into the funnel, its tip is guided towards the plug hole.

I have a wired cab station board layed out. As usual, I have several revisions:

Revision A
This version was sent out to fabricated in mid-February 1999. There are a few problems as outlined in the Notes Section.
Revision B
This version has fixes to the problems encountered in revision A. It has not been sent out to be fabricated yet.

In additon to the wired cab station above, I have layed out my first wired cab.
Revision A
This cab was sent out to be fabricated in mid-Februrary 1999. I still have to stuff the pieces into it. As I find problems, I will document them in the Notes Section.

Soon, I hope to start working on another wired cab that is not quite as large and bulky as the the first one.

Infrared Cab Stations

An infrared cab station talks with an infrared cab via infrared signalling. In order to permit the train operator to keep his or her eyes on the train, both the infrared cab station and the infrared cab have multiple infrared send LED's and multiple infrared receivers. This design is still in its preliminary design stages.

Radio Cab Stations

I have not started any work on radio cab stations.

Control and Sense Modules

I have organized the next batch of modules over something I call a layout control mother board. The layout control mother board contains the microcontroller that talks to the rest of MRNet. A number of board plug into the layout control mother board to provide switch sensing, LED lighting, turnout control, block occupancy detection, etc. The modules are listed below:

Layout Control Mother Board
The layout control mother board talks MRNet on one end and a simple shift register protocol on the other. The following revisions are available:
LED Card
The LED card provides a way of lighting up to 32 LED's for signal lights, railroad crossing lights, control panel indicators and the like. The following revisions are available:
Button Card
The button card provides a way to sensing up to 24 buttons (contact closures.) The contact closures can sense the status of a switch machine, a control panel button, etc. The following revisions are available:
Bipolar Turnout Card
The bipolar turnout card provides a way to switch up to 8 bipolar turnouts. Kato is is one manufacturer that uses bipolar turnouts. The following revisions are available:
Block Occupancy Card
A block occupancy card should be designed by the next time I send cards out for fabrication.

Summary

{Summary goes here}

Acknowledgements

I would like to acknowledge that a number of very good ideas came from Rob Hupfield's Model Railroad Control Concepts page and his RRSim mail list. In addition, I would like to thank the members of the RRSim workgroup:

Finally, I would like to acknowledge that I got some good ideas from Paul Mallery, Bruce Chubb, and Wayne Roderick.


Copyright (c) 1997-1999 by Wayne Gramlich All rights reserved.