Wiki/Standards/Train Standards

It is very important to standardize trains. A train consists of one or more engines and any number of stock cars.

For all the cars in a train to work together they must adhere to three sets of standards:

-> COUPLING: the mechanical linkage of cars. and

-> SIGNALING: the communication of key signals including throttle, braking, and command heirarchy information throughout the train.

-> Power: basic rules of electrical connections.

[Coupling] In the editor it is preferred to move the design around so that the wheels are in the lowest permissiable position. This is so that the train will spawn on the rails and not in mid air and then, hopefully, fall into position.

The standard for all rail cars in the stock game was developed by Donkk.

The Donkk style coupler consists of a single electrical connector commonly mounted to a passive hinge part. and two spring-bumpers on either side positioned at the same height as the connector and in line with the rails.

The connector must always be four blocks above the ground.

Single-wheel assembly shunters (engines) SHOULD NOT have the hinge, the connector should be hard-mounted to the frame of the shunter. Engines may omitt the hinge on the connector, but stock cars must always use hinges. Stock cars that do not have hinged connectors are NOT compatible with engines that also do not have hinged connectors.

The Donkk coupler has a few disadvantages. The most notable of which is that it tends to buckle when in a push configuration, because the contact point can bend just as the hinge can, creating an accordian fan type situation. A coupler that is three blocks WIDE and has two electrical connectors, one on each side, would not be able to bend and would therefore be more stable but presents other problems in hooking it up in the intended configuration.

[Signaling]

The concept of front and back does not exist in rail cars. Since it is often impossible to swich the direction of a car, it must be used in whatever direction it happens to be pointing. Whenever I say front, I am only referring to the direction the arrow in the editor points and to nothing inherent in the design or use of the car.

Donkk provided a "tram master slave system" microcontroller in his train. This is the standard for signaling. It has three analog channels. THROTTLE (1), BRAKE (2) and a SPARE(3) channel. All stock cars should pass this signal unchanged throughout the length of the train. However, it should read the BRAKE channel from the network in each direction and then send the sum of this signal to its own wheels. It is important that all stock cars assist the engine in slowing down the train, this is how real trains do it.

Engines have two modes, MASTER mode and SLAVE mode. When an engine is master, it broadcasts its operator's commands to the network. When it is slave, it must relay the commands from the master to its drive and braking assemblies.

However, it is not known where in the train the slave engine will be or which way it will be facing with respect to which direction it was facing in the editor. Therefore all slaves INVERT (check this) the throttle signal from the train of cars in front of them and all MASTERS invert all throttle signals to the cars behind them. So if the slave is behind the master and facing forward, both the master and the slave will invert the signal and the slave will roll forward with the master. If the slave is pointed backwards it will NOT invert while the master inverts and therefore drive its wheels backwards which, in theory, will be the same direction as the master.

[Power] The engine must provide electrical power to both of its connecotors.

Ideally, stock cars should receive this power and accomplish whatever they need. However, the blocks in the game must be powered regardless of what makes sense or doesn't. Therefore stock cars will probably need to carry a small battery and have a few solar pannels somewhere to keep that battery charged so that things such as doors and couplers can be operated when an engine is not present.