An Introduction to CAN-bus
Filed under: Racecar Engineering, Technical on October 4, 2007
This article appeared in Racecar Engineering, The International Journal of Motorsport Technology (RCE VN18 N7).
Fundamentally, motorsport is the management of risk. On the track, it is the drivers responsibility to take the risks he (or she) feels necessary, within their environment, to maximize performance and yield the best possible result. But off the track, this is an engineers job and by calculating the risks associated with set-up, electronics and engines (to name but a few), only then can the driver focus on the ultimate goal: to win the race.
As the technology on-board modern racing cars continues to increase, so does the complexity of managing it effectively. Traditional wiring looms have become cumbersome and increasingly within modern racing cars they are being replaced with CAN-bus systems. Migration will typically yield a substantial reduction in wires: the minimal configuration can contain just two (data and power) whilst potential still connecting an arbitrary number of sensors, actuators, gauges and ECUs.
CAN (or Controller Area Network) quickly became a standard in the automotive industry after its inception by Robert Bosch GmbH in 1988. However, its introduction into motorsport has proven more sedate – it featured on the first WTCC BMW (320si) in only 2006. Last year, the Power Control Module (PCM) from Ole Buhr Racing received full FIA homologation and its use is set to expand further into World Touring Cars and complement its already established position in sports and prototype racing.
What is it and how does it work?
A CAN-bus system consists of a collection of actuators and sensors (known as nodes), connected via a single twisted-pair (network) cable. CAN itself is the computer network protocol that allows these nodes to communicate without the use of a host computer. Essentially, CAN-bus connects the electronic devices on-board the car in a similar fashion to a traditional computer network.
All nodes on the network are able to transmit and receive messages. Messages carry a maximum payload of 8-bytes and are protected by a cyclic redundancy check (CRC). Within most applications (networks within 40m), transmission occurs at 1Mbit/s.
Unusually for a computer network, individual nodes are not assigned addresses. Instead, messages are broadcast to every node on the network and as such, simultaneous transmission is not possible. A scheme of bit-wise arbitration is used to determine which nodes can transmit based upon the priority of the message and the bus is always available to a node with a higher priority (or dominant) message, even if a lower priority (recessive) message is already in transmission. In which case, once the dominant message is complete and the bus becomes idle, the recessive message is transmitted again.
This bit-wise arbitration is particularly valuable in real-time environments where transmission efficiency is key and where a more common message-wise arbitration approach (such as CSMA/CD used in Ethernet) is not particularly well suited. In CAN, no bandwidth is used for any non-relevant information.
Error detection and prevention
Perhaps the most compelling features of CAN are its sophisticated mechanisms for preventing and detecting errors.
CAN is a differential serial bus which means it particularly good at reducing noise caused by electromagnetic interference (EMI). As the engine-bay of a racing car is a particularly hostile environment for EMI, this design increases the reliability of transmission and reduces the likelihood of unpredictable behavior – such as the loss of engine ignition (from the ECU).
Internally, complementary signals are sent over two separate wires and as a result, it doubles the noise immunity of the signal. This can be best expressed in mathematics.
The voltage difference of the high state is said to be , where the
represents one wire, and
represents the other. If these are exchanged on the low state (
), then the total combined difference is expressed as
and is therefore double the noise immunity of a single wire serial bus.
CAN hardware also retransmits faulty messages automatically by detecting errors at both a message and bit level.
At a bit level, two different techniques are used: bit-monitoring and bit-stuffing. Bit-monitoring is where a CAN node continuously reads back a transmission from the bus, comparing what was transmitted to what was received. If a difference exists, the message is considered faulty.
Similarly, bit-stuffing is where after five consecutive bits of the same level are transmitted, an additional sixth bit, of the opposite level, is added (but is not interpreted by the receivers). The actual purpose of this is to avoid excessive DC components but it serves as an additional means for detecting errors.
At the message level three further techniques are used: a frame check, an acknowledgement check and a CRC.
The form of a message (known as the frame check) is validated by comparing the expected sequence of bits (specified in the protocol) against the actual transmission.
Each receiving node adds an acknowledgment to the message and if this cannot be detected by the following node, the message is again considered faulty.
Finally, a basic Cyclic Redundancy Check is applied to the message bits in order to protect the integrity of the message payload.
The CAN specification also includes a slower fault-tolerance mode (below 125kb/s) which enables the bus to continue functioning in the event of the cable being damaged or even partially cut and is particularly relevant in the case of an accident or minor contact over the duration of a race. Ultimately, if a node or the cable is damaged, the network will continuing functioning (albeit at a slower speed).
Why use CAN?
It goes without saying that CAN is not suited to every environment. Although already small (197×107x46mm), Ole Buhr’s current PCM is still somewhat oversized for single-seaters. However, in LMP, sports and touring cars where space and weight is at a relative premium, its introduction is supported by good pedigree: ALMS Champions with Porsche (RS Sypder), LMP with Creation and BTCC Champions with VX Racing represent highlights from 2007.
And neither is it cheap – at almost GBP 3500+VAT, Ole Buhr Racing know its market. But in professional categories where the initial cost of components is secondary to the cost of poor reliability, it’s perfect.
In such applications, fast access to diagnostics means that CAN is the only reliable option. Instead of the time-consuming process of searching for short-circuits or faulty junctions with a voltmeter, software immediately shows the status of every node on the network and because of its architecture, nodes can be readily replaced, added or removed without any implication on other components.
The PCM also features a built-in, programmable logic controller which allows for the automation of tasks when certain conditions arise. For example, the engine could be automatically started as the car is released from its jacks.
It’s here to stay
Overall, it is the absolute simplicity of CAN which makes its use so valuable. An entire network of actuators, sensors or even switches and dials can be reliably maintained with enormous reductions in analogue wiring and therefore risk. As its application within motorsport continues to become more prevalent, the overall cost, given time, will settle. In the mean time, if you’re wondering whether adding another junction to your wiring loom is such a good idea, maybe take a closer look at CAN and what it can do for you.
References
- http://www.embedded.com/columns/murphyslaw/13000304
- http://www.computer-solutions.co.uk/info/Embedded_tutorials/can_tutorial.htm?gclid=CKON_5fTpZICFQ9BMAodRGZxMA
- http://www.sensorland.com/HowPage054.html
- http://www.obr.uk.com/Handbooks/PCM%20Handbook%20ver%20301a.pdf
- http://www.embedded.com/columns/murphyslaw/13000304?_requestid=498927
- http://www.ems-wuensche.com/CAN_technical_information.html#anchor639233
- http://www.kvaser.com/can/intro/index.htm


















Comments
sarika
February 10th, 2010
Good information
Leave a Comment