Controller Area Network (CAN Bus)

Table of Content

            Controller Area Network (CAN) is a broadcast, serial bus system for real-time control applications which operates at data rates of up to 1 Megabits per second, and has a very high level of security and error detection mechanisms. It is primarily used to network drive train electronic control units (ECU) and communication nodes for body electronics in high-end passenger cars. This network serves as a replacement to the expensive, cumbersome and unreliable wiring looms and connectors in cars. Nowadays, CAN are used in many embedded control applications for factory automation, building automation, aircraft and aerospace as well as in trucks, and buses.

            Historically, CAN was initiated by Uwe Kiencke as a new serial bus system for automobile in 1983. It was developed based on the request from Mercedes and BMW when they face difficulty in connecting or sharing among ECUs. Professor Dr. Wolfhard Lawrenz from the University of Applied in Braunschweig-Wolfenbüttel, Germany, coined the name “Controller Area Network” for the protocol (CiA, 2004).

This essay could be plagiarized. Get your custom essay
“Dirty Pretty Things” Acts of Desperation: The State of Being Desperate
128 writers

ready to help you now

Get original paper

Without paying upfront

            In February of 1986, CAN was born. As a new bus system developed by Robert Bosch Gmbh, it was introduced as ‘Automotive Serial Controller Area Network’ at the Society of Automotive Engineers (SAE) congress in Detriot. Error detection mechanisms and error handling were later implemented by the fathers of CAN to shoulder automatic disconnection of faulty bus nodes (CiA, 2004).

            The first CAN controller chip, the 82526, was available in 1987 by the potential semiconductor vendor, Intel, which provided a DPRAM-style interface to the programmer. Then came along Philips Semiconductors with their 82C200 which uses FIFO-oriented programming model and limited filtering abilities. These two earliest CAN controller chips established distinctions relative to their programming model, acceptance filtering, and message handling. People for some reason termed the Intel way as “Full CAN” and the Philips way as “Basic CAN”. Apparently, most CAN controller chips today allow for both programming models making the use of the terms “Full CAN” and “Basic CAN” obsolete (CiA, 2004).

            Overall, the CAN bus is a well-define protocol which employs a two-wire, serial communications via an electrical or optical signal between a number a of sensors, actuators, entertainment, and navigation systems and their corresponding electronic control units on in a typical automobile. These nodes, however, are connected to a single power rail, typically of 12 Volts, distributed around the vehicle to provide potential energy for the different vehicle functions. Such vehicle functions would include temperature readings, alarms, the positions of switches, window and seat operations, engine management, brake control, and many other systems which are monitored by sensors connected to the bus and the controller can direct the actuators to initiate the appropriate response as required.

            The CAN communication protocol is, also, referred as CSMA/CD (Carrier Sense Multiple Access with Collision Detection) protocol. For these nodes to provide such services, the network monitors the bus for an idle activity before it sends out a message on the bus. Additionally, these nodes have an equal opportunity to transmit a message on the bus when it is idle. However, “when two nodes on the network start transmitting at the same time, the nodes will detect the collision” (Pazul, p. 1) and “a non-destructive arbitration technique guarantees that messages are sent in order of priority and that no messages are lost” (Schofield, 2006).

As mentioned earlier, the CAN bus is a broadcast type of bus “which is based on a message-oriented transmission protocol” (CiA, 2002), not an address based protocol. That means, when a message is transmitted it doesn’t specify which node would it be directed to; hence, all nodes would consistently pick up all traffic. However, it is up to each node in the network “to decide whether the message received should be immediately discarded or kept to be processed” (Pazul, p. 2). Built within these messages is a unique identifier which determines the priority of the message. The lower the numerical value of the identifier, the higher the priority. Moreover, it is the CAN controllers provide which provide filtering mechanism to these interesting messages.

            Another interesting feature built within the CAN protocol is the Remote Transmit Request (RTR) which enables a node to request information from other nodes instead of waiting for information to be sent by a particular node. Besides RTR, CAN also have the ability to recognize additional nodes in the network without the need to reprogram all other nodes for recognition. “This new node will start receiving messages ID, decide whether to process or discard the received information” (Pazul, p. 2).

            Error handling is of great importance to the CAN bus. The error handling mechanism covers error detection which detects errors in messages and fault confinement on which the erroneous message received would be discarded by all the nodes in the network. The CAN protocol implements three mechanisms for error detection at the message level – Cyclic Redundancy Check (CRC), Frame Check, and Acknowledgement (ACK) Check –  and two at the bit level – Bit Monitoring, and Bit Stuffing.

            Every transmitted message features a 15-bit frame check sequence (FCS), which safeguards the information in the frame. All receivers that accept the transmitted message performs similar calculation and does a comparison of this FCS against the received FCS and flag any errors. Frame Check, however, embeds a predefined bit values within the CAN Message Frame. “If the receiver detects an invalid bit in one of these positions a Form Error (also known as Format Error) will be flagged” (Schofield, 2006).  And while, ACK error occurs when a transmitter does not receive any acknowledgement from the transmitted message.

            On the bit level, any transmitter automatically monitors the bus levels of the transmitted signal level, hence, detects differences between the bit transmitted and the bit received. Bit stuffing, on the other hand, is used for checking on communication integrity. After five consecutive bits of the same level have been transmitted by a node, it will inject (stuff) a bit representation using a Non Return to Zero (NRZ) coding of opposite polarity to the outgoing bit stream. The “receivers of the message will automatically delete (de-stuff) such bit before processing the message in any way” (Schofield, 2006).  If more than five consecutive bits of the same level are detected, a stuff error s flagged.

            Schofield summarizes fault confinement as a mechanism for every CAN controller to discriminate between temporary errors and permanent failures within each transmitted message. One possibility cause of a temporary error is due to spurious external conditions. Whereby, permanent failures are caused by long term external disturbances that would lead to a faulty system.

            CAN communications protocol is an international standard and classifies different applications relative to their speed. ISO 11519 was the first version of the CAN standards which ruled for low-speed CAN applications up to 125 kbps with a standard 11-bit identifier. A second version was later released, ISO 11898, also with 11-bit identifiers provides for signaling rates from 125 kbps to 1 Mbps while the more recent ISO 11898 with addendum introduces the extended 29-bit identifier.  The ISO 11898 11-bit versions is considered to as Standard CAN version 2.0A, while the ISO 11898 29-bit versions is considered to as Extended CAN Version 2.0B (Corrigan, 2002).

            Other emerging CAN-based protocols are also making their way into most industries. Some examples of which are Allen-Bradley’s DeviceNet, Honeywell’s Smart-Distributed System (SDS), CAN Application Layer (CAL), CANOpen, and KVASER’s CANKingdom.

            Generally, ISO 11898 describes how CAN controllers passes information between devices on a network, and conforms to the Data-Link Layer, with the Logical Link Control (LLC) and Media Access Control (MAC) as sublayers, and the Physical Layer of the Open Systems Interconnection (OSI) model and uses a broadcast method for placing frames on the wire.

The Data-Link Layer is usually implemented in hardware which it is used to construct the messages to be sent to the Physical Layer and decode messages received from the Physical Layer. That is, “the Logical Link Layer (LLC) manages the overload control and notification, message filtering and recovery management functions. Whereby, “the Medium Access Control (MAC) performs the data encapsulation or decapsulation, error detection and control, bit stuffing or destuffing, and the serialization and deserialization functions” (Richards, p. 1).

The Physical Layer, as Schofield describe, “specifies the physical and electrical characteristics of the bus and of the hardware that converts the characters of a message into electrical signals for transmitted messages – and electrical signals into characters for received messages”. Seemingly, the Physical Layer is conveyed as the “real” hardware as the other layers are implemented in either hardware or software. And Davis adds that the CAN standard defines a communication network of using a balanced (differential) 2-wire interface running over a Shielded Twisted Pair (STP), Un-shielded Twisted Pair (UTP), or Ribbon cable that links each node. The physical signaling, however, comprises bit encoding and decoding as well as bit timing and synchronization.

The standard documents the maximum speed of a CAN bus of 1 Megabits per second. “Some CAN controllers will nevertheless handle higher speeds than 1 Megabit per second and may be considered for special applications” (KVASER, 2006). For low-speed CAN can go up to 125 kilobits per second, and for single-wire CAN can go up to around 50 kilobits per second and can boost to 100 kilobits per second through ECU programming.

The maximum cable length for a speed of 1 Megabits per second is 40 meters. “This is because the arbitration scheme requires that the wave front of the signal can propagate to the most remote node and back again before the bit is sampled” (KVASER, 2006). Other cable lengths would vary relative to the speed. For example, transmission of message at 500 kilobits per second uses a maximum length of 100 meters, 200 meters at 250 kilobits per second, 500 meters at 125 kilobits per second, and 6 kilometers at 10 kilobits per second.

“It is possible to overcome the limitations of the basic line topology by suing repeaters, bridges, or gateways” (CiA, 2006). A repeater can be regarded as a passive component which transfers electrical signal from one physical bus segment to another segment. The transfer adds propagation time of two physically independent segments but, logically, it is still a one bus system. A bridge connects two bus systems with different CAN identifiers for them to communicate. The bridge implements a store-and-forward scheme to pass messages from one bus to the other. “A gateway provides the connection of networks with different HLPs” (CiA, 2006). It resembles as a translator between two bus systems of different protocols. This translation takes place on the application layer.

In addition, the bus must be properly terminated, in regardless of its speed, and this is done by putting a 120-Ohm resistor at each end of the bus. “The termination serves two purposes: remove the signal reflections at the end of the bus and ensure the bus gets correct DC levels” (KVASER, 2006). However, low-speed CAN, single-wire, and some special-purpose CAN may or may not require termination.

Apparently, the standard doesn’t give any regulations for CAN bus connectors. There are a number of common types of connectors used, namely, the 9-pin DSUB as proposed by CiA, 5-pin Mini-C and/or Micro-C used by DeviceNet and SDS, 6-pin Deutch connector as proposed by DANHUG for mobile hydraulics. Few other connector types are available which is defined by the Higher Layer Protocol (HLP).

As stated before, bit encoding uses NRZ coding with bit stuffing to ensure “compact messages with a minimum number of transitions and high resilience to external disturbance” (Davis, 2007). Furthermore, synchronization allows these transmitted messages to be correctly read at the receiver. The CAN protocol regulates each node in the network to access the bus by bit-wise arbitration. The signal propagation from the transmitter to the receiver and back to the transmitter must be complete within one bit-time.  This timing bit is logically divided into 4 quanta or segments – Synchronization Segment, Propagation Segment, Phase Segment 1, and Phase Segment 2.

“The Synchronization Segment is used for synchronization of the clocks. The Propagation Segment is needed to compensate for the delay in the bus lines. And the Phase Segments may be shortened (Phase Segment 1) or lengthened (Phase Segment 2) if necessary to keep the clocks in sync” (KVASER AB, 2005).

There are two types of synchronization the CAN protocol uses – hard synchronization and resynchronization. “Hard synchronization occurs on the recessive-to-dominant transition of the start bit” (KVASER AB, 2005) after which the bit is restarted at the end of this segment. On the other hand, “resynchronization shortens or lengthens the bit time so that the sample point is shifted according to the detected edge” (CiA, 2006).

In spite of what CAN is offering to the user, there are certain drawbacks. One problem that CAN is facing is the double receiving problem. From the standards mentioned previously, “a message is considered valid to the CAN transmitter when there is no error until the last but of the End of Frame (EOF). But a message is considered valid to the CAN receiver when there is no error until the last but one bit of the End of Frame. In this case, if the last bit of EOF fails, the transmitter will carry out the transmission and the receiver will receive twice the same signal” (Controller Area Network Sdn Bhd., 2003).

The other CAN setback is over voltage protection. “The old CAN transceiver, 82C250, available from Philips Semiconductors has only a over voltage protection of up to +18 Volts on both CAN_H and CAN_L only. This is because back in old days, CAN was used only in Automobiles which has supply voltage of 12 Volts. Strictly speaking it is not suitable to be used in industries that normally adopt +24 Volts.  Fortunately the new CAN transceiver, 82C251, has improved this to +40 Volts” (Controller Area Network Sdn Bhd., 2003).

References

CAN in Automation (CiA) (2006). Controller Area Network, An Overview. Retrieved from the Web March 10, 2007. http://www.can-cia.org/can/

CAN in Automation (CiA) (2006). CAN Specification 2.0 Part B. Retrieved from the Web March 12, 2007. http://www.can-cia.de/downloads/specifications/?269

Controller Area Network Sdn Bhd. (2003). Controller Area Network Solutions FAQ (Frequently Asked Questions). Retrieved from the Web March 13, 2007. http://www.cans.com.my/modules.php?name=FAQ;myfaq=yes;id_cat=1;categories=CAN

Corrigan, Steve (2002). Introduction to the Controller Area Network (CAN). Retrieved from the Web March 10, 2007. http://focus.ti.com/lit/an/sloa101/sloa101.pdf

Davis, Leroy (2007). CAN Bus. Retrieved from the Web March 10, 2007. http://www.interfacebus.com/Design_Connector_CAN.html

KVASER AB (2005). The CAN Protocol Tour. Retrieved from the Web March 10, 2007. http://www.kvaser.com/can/protocol/main.htm

Pazul, Keith (1999). Controller Area Network (CAN) Basics. Retrieved from the Web March 11, 2007. http://ww1.microchip.com/downloads/en/AppNotes/00713a.pdf

Richards, Pat (2002). A CAN Physical Layer Discussion. Retrieved from the Web

March 10, 2007. http://ww1.microchip.com/downloads/en/AppNotes/0028a.pdf

Robert Bosch Gmbh (1991). CAN Specification Version 2.0. Retrieved from the Web March 10, 2007. http://www.semiconductors.bosch.de/pdf/can2spec.pdf

Schofield, M. J. (2006). Controller Area Network (CANbus). Retrieved from the Web March 10, 2007. http://www.mjschofield.com/index.htm

Cite this page

Controller Area Network (CAN Bus). (2016, Aug 20). Retrieved from

https://graduateway.com/controller-area-network-can-bus/

Remember! This essay was written by a student

You can get a custom paper by one of our expert writers

Order custom paper Without paying upfront