CAN Bus

==Description==
Not a lot is known about the CAN Bus protocol. Zimo uses a CAN network with RJ45The RJ45 is a 8P8C modular connector often seen on networking cables 8Zimo may only use 6 conductors conductor cables to transmit data to Zimo's controllers, turnout and track section modules. A socket is also found on some Zimo command stations for connection to other networks such as X-Bus, S88 and possibly Digitrax's LocoNet, but implementation details are unknown at this time. 
==Technology==
CAN bus uses simple twisted-pair cabling that connects all layout control devices. The cable may also supply power to devices including wired throttles. Commercial implementations commonly use phone (RJ12) or network (RJ45) cables and connectors.
It is bi-directional and any device may transmit or receive data. CAN can operate over a wide speed range, with a linear trade-off between bus speeds and bus lengths. The 2.0b specification runs at up to 1Mbit/s and the newer CAN FD specification at up to 5Mbit/s, although the two are not compatible. Depending on the data rate, bus lengths of up to 1000m are possible. A common speed for model rail implementations is 125kbit/s, allowing a maximum bus length of 500m and up to 100 devices.
Since it is very prevalent in automotive applications, there are a large number of components available at low cost due to their large scale of application in various industries. The reason why CAN bus was selected for critical applications, such as automotive use, is due to its inherent noise tolerance and is designed for the 12/24V world.
Unlike other Peer to ­Peer systems, CAN Bus can operate at a 100% data throughput rate with error free collision resolution.
=== CBUS ===
CBUS is an implementation of a Layout Control Bus by MERG in the UK. They felt it was a good choice as Zimo had demonstrated it would work on the layout, and a lot of devices are available on the market for CAN Bus applications.
==Current Usage==
* Zimo uses CAN bus to connect wired throttles and layout control devices with the command station. 
* MERG’s CBUS layout control bus is based on CAN bus. Numerous devices (‘modules’) are available for layout control, train detection and computer interfacing, as well as MERG’s DCC command station and throttles. Self-assembly kits are available to members and there are software implementations for Arduino and Raspberry Pi as well, in addition to projects
designed by individual members.
* Layout Command Control (LCC) is the NMRA approved portions of the OpenLCB protocols and is based on CAN bus.
==Disadvantages of CAN==
The relatively high CAN bus speed does not allow free form network design. A CAN network segment requires a linear bus with terminations at each end. Timing and other electrical limitations mean that a single CAN segment is limited to 40 or fewer physical nodes. There are solutions to expand a CAN network into multiple segments. 
=== Cabling ===
CAN supports several different cabling and connector standards. Some require large (and costly) connectors. Often CAN will use the DB­9 connectors found on RS­232 serial cables. Another CAN connector option uses RJ45 connectors and cables, as wired Ethernet does. 
The OpenLCB engineers opted for RJ45 connectors because of relative low cost and availability worldwide. The 4 wire pairs of an Ethernet cable also allow for additional options such as power and other signals in addition to the CAN signal pair itself.
== Layout Command Control ==
Layout Command Control chose to use CAN for a number of reasons.
As mentioned above, the 125 kHz signalling and a maximum run of 1000 feet or 305 metres was determined to be an ideal situation for model railroading. These parameters are directly impact the cabling, which is determined by the propagation time and pulse widths.
For this to work reliably, the ethernet cabling should be made of at least 24AWG conductors. Lighter gauge wiring could impact the bus operation. The driver at the beginning of a network segment must be able to reliably drive a terminator at the other end, without going out of spec. A termination of approximately 120Ω is required to prevent reflections distorting the signals on the cable. The impedance of 24AWG wiring is such that it is possible to have a 1000' run of CAT5 wiring which will work reliably with a 120Ω termination.
Using lighter gauge CAT5 cables will work, but it will impact speed and maximum bus distance
== See Also ==
* OpenLCB - The engineers who brought us Layout Command Control.
* Controller Area Network Physical Layer Requirements
== CAN Bus Properties and Troubleshooting ==