Digital Track Voltage

Background

The Märklin digital system uses the track as a conduit for communication with the digital decoders installed on a layout. This communication occurs using digitally-encoded signals, which are embedded into the track voltage that powers the locomotives and accessories. These signals represent a series of digital address and command sets that are transmitted by the control system to all of the decoders on the layout. Since each decoder is assigned a unique digital address, only the intended decoder will respond to the commands corresponding to that address.

However, the system also uses two different signal frequencies to modulate the commands onto the power in the track. Since the address and command sets for both locomotives and accessories are similar in structure, these two frequencies separate the signals that are intended for each type of decoder. The signal format uses a very unique scheme to encode the digital address and commands, as well redundant transmission to improve the signal's reliability.

The following sections describe the details of the standard Motorola data format used in the Märklin Digital system.

 

Data Encoding

Before any digital data can be transmitted to the decoders on the layout, the central unit must first build, or encode, the data. Each set, or packet, of digital information consists of the address followed by the command that will be executed by the corresponding decoder. This data packet is encoded as binary information. The term "binary" simply means that there are only two valid electrical states possible in the system, Hi ("1") or Lo ("0"). Although it might sound strange, most common digital circuits are binary, just like this one.

What is unique about the Motorola data format however is that it actually uses this binary system to represent the address of each packet using a three-state, or trinary, encoding. In a true trinary system, there are three valid electrical states: Hi ("1"), Lo ("0"), and Open ("Z"). To achieve three states in a binary system, the Motorola format uses two consecutive binary digits, or bits, to represent each trinary digit, or trit. This type of encoding is not very common and, at Modell-Zug Elektronix, we refer to it as "binary-encoded trinary."

To encode the address of each data packet, the Motorola format uses 4 trits (4 pairs of bits). This results in the system limit of 34 = 81 addresses, although address "0" is not used. This address range applies to both locomotive decoders and accessory decoders, even though the Märklin Digital system supports only 64 accessory decoder addresses. This is due to the fact that the central unit can communicate with a maximum of 16 Keyboard units, and so 16 Keyboards operating 4 decoders each results in 64 accessory decoder addresses.

The command portion of each data packet is much more straightforward, and uses standard binary encoding. The command is represented by 5 pairs of bits, where the two bits that make up each pair are identical.

In summary, each data packet consists of 4 pairs of bits to represent the address and 5 pairs of bits for the command. The complete data packet then contains 9 pairs of bits, which appear in the digital signal as 18 pulses:

 

The significance of each pair of bits in the address portion of the data packet is the same for both locomotives and accessories. The first pair of bits represents the least significant trinary digit, while the fourth pair represents the most significant digit. To convert the address from trinary (base 3) to decimal (base 10), multiply the value of each digit by the appropriate power of 3 and then add the resulting decimal values together. The following table summarizes the significance of the address digits, using the data packet shown above as an example:

Digit # Trinary Value Multiplier Decimal Value Address
1 "1" = 1 x 30 = 1 46
2 "0" = 0 x 31 = 0
3 "Z" = 2 x 32 = 18
4 "1" = 1 x 33 = 27

Unlike the address, the command portion of each packet is interpreted differently for locomotives and accessories. However, the command is always encoded in binary format.

The command for locomotives contains the status of its auxiliary function (On or Off) in digit 5 and its speed level in digits 6-9. The speed level is binary encoded, with digit 6 as the LSB and digit 9 as the MSB. The command can be converted as shown previously for the address, except using base 2 instead of base 3. The following table summarizes the significance of the locomotive command digits, using the data packet shown above as an example:

Digit # Binary Value Multiplier Description Value
5 "0" 1

Aux. Function: "1"=On; "0"=Off

Lights OFF
6 "0" x 20

Speed Level:

0 - stopped

1 - reverse direction

2 - minimum speed

15 - maximum speed

Speed 10
7 "1" x 21
8 "0" x 22
9 "1" x 23

For accessories, the command contains the position of the accessory (Red or Green) in digit 6, the decoder output (A-D) in digits 7-8, and the action of the output (On or Off) in digit 9. Digit 5 is always set to "0" for accessories, so that the data packet is compatible with the receiver chip used in the accessory decoders. The following table summarizes the significance of the accessory command digits, using the data packet shown above as an example:

Digit # Binary Value Multiplier Description Value
5 "0" 1

Always "0"

0
6 "0" 1

Position: "1"=Green; "0"=Red

Red
7 "1" x 20

Decoder Output:

0=A; 1=B; 2=C; 3=D

Output B
8 "0" x 21
9 "1" 1

Action: "1"=On; "0"=Off

ON

 

Data Transmission

To improve the reliability of the decoded data, data packets are transmitted in identical pairs. When a decoder receives the first data packet, it checks the packet address against the address that is coded on the DIP switches of the decoder board. If the addresses match, the decoder stores the command portion of that packet in its internal memory, but does not execute the command yet. When the decoder receives the second packet, it confirms the correct address just as before, and then compares the packet command to the one in memory. The command will only be executed if the information in both data packets is exactly identical. Otherwise, the decoder maintains the last valid command that it received.

In order to transmit both the locomotive and accessory data using the same encoding format, they are modulated onto two different carrier frequencies. This allows the data to be separated so that it does not create interference in the decoding process. The locomotive data is transmitted at a bit rate of approximately 4800 Hz, and accessory data at 9600 Hz. Each type of decoder is permanently electronically tuned to receive only the signals on the correct carrier frequency.

After the data has been encoded and modulated by the central unit, the transmission to the track is performed by a booster. The low voltage logic-level signal from the central unit is amplified by a power transistor stage within the booster. These transistors switch the booster output between its two internal power supply voltages of -22V and +22V, creating a powerful digital signal that is capable of directly driving locomotives and accessories.

Since locomotives may briefly lose contact with either the center or outer rails during operation, locomotive data in the track is refreshed periodically to prevent locomotives from losing their settings. This process is handled in different ways, depending on the type of central unit used in the system.

The Märklin 6020 Central Unit and 6022/6023 Central Control contain only 10 memory locations, enough for the maximum number of 10 locomotive controllers possible in the system. With these central units, only the data for locomotives that are currently addressed on a controller are refreshed, regardless of whether they are operating or not. The newer Märklin 6021 Control Unit contains 80 memory locations, one for each locomotive address possible in the system. With this central unit, any locomotive that has been addressed since the last system power-on-reset will remain in the data refresh cycle. When a new command is issued from a controller, both types of central unit will generate the new locomotive data immediately. The new data will be transmitted to the track several times before being entering into the refresh cycle, in numerical order according to the locomotive address.

Accessory data is not refreshed in this way, since these decoders are directly wired to the layout and are not subject to the same type of intermittent contact as locomotives. When a command is issued from an accessory controller, the central unit inserts the new accessory data into the next available opening in the locomotive data stream. Only one data packet pair is transmitted to activate an accessory (i.e. when a Keyboard button is pressed), and another pair to deactivate the accessory (i.e. when the button is released).

During normal operation with both locomotives and accessories in use, the digital voltage present in the track resembles the example shown in the following diagram:

 

 

 

All brand names, product names, and logos herein are the property of their respective owners or companies. No portion of this site may be reproduced without the written consent of Modell-Zug Elektronix.

Copyright © 2006 by Modell-Zug Elektronix. All rights reserved.