Lenz RS-bus

When I restarted with the model railroad hobby a couple of years ago, I investigated what the different standards, manufactures and so one that was available for the digital solutions. I decided to go with Lenz and that gave me the RS-bus for feedback data. From what I could read, there where many users that had a lot to say about the RS bus, and basically that it was not the best solution in the world. You had to be very careful when laying the cables, and using the correcty type and so on. RS-bus is not an open standard, so finding a specification for it was impossible. But I still went with Lenz and bought my feedback modules completed or as kits that I put together myself.

But when I started with my new layout after we moved to the new house, I rechecked if there where any specifications for the RS bus available. And ohhh yes, there where. Not from Lenz, but from reverse-engineering by Lenz users around the world. After studying schematics and how the bus really works, I have to say that I like it alot. A very smart design. Two cables, only the feedback modules can send data, but the master tells the modules when they are allowed to send. Together with that, those two cables also feed the power to the bus part of the circuit on the modules. Optocouplers protect the rest of the curcuit from the RS-bus.

How does the RS-Bus work?

300px-RSBusPulsfolge

Pretty simple actually. LZ100 or something simular acts as a master and sends 130 pulses, around 109 us high and around 93 us low, with an interval of 7 seconds. The feedback moduls counts these pulses. When the number of pulses is equal to the address in the feedback module, the module sends one byte of data, and one byte only. Only the status of 4 ports can be sent in one byte, so if the modules need to send status for all the ports on one address, it will send two bytes. But the second byte will be sent the next time the master is sending out pulses

From an electronic point of view, this bus have a couple of advantages compared to other buses. The transfer is made thru current levels, and not voltage leves as in example S88. The data is also protected by a parity bit, and the bus wont be over flooded with data with alot of modules on it.

Protocol

The data is transered with the speed of 4800bits / s. It contains 8 bits of feedback data.

  • Startbit (0)
  • Parity (even)
  • 2 TT bits (always 10 with a standard module)
  • Nibblebit (0 = input port 1-4, 1 = input port 5-8)
  • 4 databits D3, D2, D1, D0

D0-D3 represent input 1 to 4, or 5 to 8 depending on the nibblebit. This is the reason why we need to send two bytes to return status for all 8 ports

The TT bit identify the type of feedback module.

00 – turnout decoder without feedback
01 – turnout decoder with feedback
10 – standard feedback (this is what we use)
11 – reserved for future use

It’s unknown why Lenz created this encoding. For standard feedback modules, we always send 10 in the TT bits.

These 8 bits are sent, the other way around compared to standard UARTS, with the P bit first, and the D0 last

P 1 (t), 0 (T), Nibble, D3, D2, D1, D0

Message example

The message is coded in the following way

S, P, T1, T0, N, D3, D2, D1, D0

S – Start bit (Low)
P – Parity(Even)
T1 – always 1 for feedback moduls
T0 – always 0 for feedback moduls
N – Nibble (0 for input 1-4, 1 for input 5-8)
D3 – Input 4 or 8
D2 – Input 3 or 7
D1 – Input 2 or 6
D0 – Input 1 or 5

Example:

No.SPT1T0ND3D2D1D0Description
1001000000Input 1, 2, 3 & 4 low
20110000011 high, 2, 3 & 4 low
30110000102 high, 1, 3 & 4 low
40010001011 & 3 high, 2 & 4 low
50010100015 high, 6, 7 & 8 low
60010110008 high, 5, , & 7 low
7011010000input 5, 6, 7 & 8 low
8.10110000012 messages: 1 and…
8.2001000010… 6 high, resten low

References

For additional information, and also the page where I learned about the RS-bus, I can recommend Der-Moba’s webpage.

 

Leave a Reply

Your email address will not be published. Required fields are marked *