Introduction to CAN Bus Technology

9,849 views

Published on

In this CAN Bus Technology introduction learn about the history and applications of the technology.

Published in: Technology
1 Comment
7 Likes
Statistics
Notes
No Downloads
Views
Total views
9,849
On SlideShare
0
From Embeds
0
Number of Embeds
15
Actions
Shares
0
Downloads
765
Comments
1
Likes
7
Embeds 0
No embeds

No notes for slide
  • I will be presenting an introduction to the CAN bus.
  • CAN is an acronym that stands for Control Area Network. It is a form of multiplexed wiring designed by Bosch that allows the linking of a number of control systems together, normally in a vehicle, so that they can share information. CAN has been used in automobiles for over 20 years . The first CAN controller chips, produced by Intel and Philips, came on the market in 1987. CAN is a very reliable data transmission that satisfies the real-time requirements for many applications. CAN is not only used in automotive electronic control units, but also in industrial controllers and devices as well as other application fields. In recent years an increasing number of sensors with integrated CAN interfaces have been developed. Some sensors are complex devices such as joysticks, GPS units, and exhaust measurement systems. Many low cost microprocessors have integrated CAN interfaces.
  • There are two data formats that can be used in a CAN network. “Standard” format or CAN 2.0A uses 11 bit identifiers. “Extended” format defined in CAN 2.0B uses 29 bit identifiers. The 29 bit identifier consists of an 11 bit base identifier and an 18 bit identifier extension . The International standard for high speed CAN is ISO11898
  • CAN began as an automotive standard, but has expanded into to applications. Actuators and sensors with embedded CAN interfaces are available. Many of the devices with embedded CAN interfaces also support higher level protocols built on CAN such as CANopen and DeviceNET.
  • This diagram shows the seven layer OSI network layer model. CAN defines the most of the lowest two layers in the model. Since the CAN standard does not include tasks of application layer protocols, such as flow control , device addressing, and transportation of data blocks larger than one message, many implementations of higher layer protocols were created. Some examples of higher layer protocols a re: DeviceNet was developed by Allen Bradley . It is used in automation and industrial control applications. CANopen is an international standard maintained by the CAN in Automation user’s group . It is also used in automation and industrial control applications . MilCAN is a deterministic protocol initially developed for Military Land Systems . SAE J1939 is the vehicle bus standard used for communication and diagnostics among vehicle components. It was originally used by the car and heavy duty truck industry in the United States. ISO 11992 is a vehicle bus standard used by the heavy duty truck industry . It is used for communication between the tractor and one or more trailers.
  • There are no bus masters or slave devices in CAN. Devices do not have addresses either. Any node on the bus is allowed to broadcast a message at any time. Each message has an identifier that indentifies the message content. All receivers receive all of the messages and selectively process the messages with content that applies to that receiver. If two devices attempt to transmit simultaneously they automatically participate in an arbitration sequence. The message with the lower numbered identifier wins the arbitration and is allowed to continue transmitting. The node transmitting the message that lost arbitration must stop transmitting and retry at the next bus idle time.
  • The CAN bit rate is dependant on the bus length. Longer buses require slower bit rates. Some of the higher level standards specify a fixed bit rate and maximum bus length. This chart shows some recommended maximum bus lengths for some common bit rates.
  • A CAN network consists of a number of CAN nodes which are linked via the physical transmission medium, twisted pair wire. At the ends of the CAN network are bus termination resistors. These resistors prevent signal reflections that would harm the signal integrity.
  • The CAN bus uses differential signaling. This is a technique that provides good electrical noise immunity. The bus has two states referred to as dominant and recessive. In the dominant state both of the CAN signal are driven, one high and one low. In the recessive state, neither of the CAN signals is driven and the bus voltage is at its mid point. If two nodes attempt to transmit simultaneously, the node transmitting the dominant state during a bit time that another node is transmitting the recessive state wins the arbitration. Communications can continue even if CAN_H or CAN_L is broken, with less noise immunity
  • Each CAN node has its own local oscillator for timing. Since each of these oscillators will have a slightly different frequency, each node must synchronize with the transmitter periodically. This synchronization takes place on each recessive to dominant transition. Once synchronized, the receivers can sample the CAN signals at the correct time within the bit period. This optimal timing is based on bit rate and bus length and must be tuned by the systems engineer.
  • The CAN specification does not state a maximum number of nodes. The maximum number of nodes is dependant on the drive strength of the weakest transceiver and the electrical loads of each of the nodes on the network. Networks containing up to 64 nodes are common.
  • There are four different messages types defined by the CAN protocol. The Data Frame is the predominant message type used on the CAN bus to transfer data. The Remote Frames is used to request data transmission from another node. It is used infrequently. An Error Frame is sent by a node that detects a transmission error. An Overload Frame is sent by a receiving node to notify other nodes that it is not ready to receive more data.
  • This slide shows the components of message in “Standard” format. Transmission of a data frame begins with a “Start of frame” bit. This bit is used by all receivers to synchronize the entire network. Next is the 11 bit message identifier. The “Remote transmission “ bit is set if the message is a “Remote Frame” message. The next bit indicates if this message is a “Standard” or “Extended frame” message. There is one reserved bit. The data length code indicates the length of the data field, followed by 0 to 8 data bytes. The CRC or “cyclic redundancy check” field and its delimiter facilitate error checking. Next is a ACK or acknowledge bit time slot. This bit is sent by any receiver that has correctly received the message. The message is terminated with “end of frame” delimiter, seven successive recessive bits. Any receiving node that has detected an error would send its error flags during the time the time the sender is transmitting the end of frame delimiter.
  • CAN has several error detection mechanisms that contribute to the robustness of CAN. The sender and all receivers of the message participate in error detection. The sender monitors each bit it transmits to ensure that the correct level appears on the bus. The sender checks that ACK bit to make sure that at least one receiver has correctly received the message Each CAN message is checked for validity by all CAN receivers. The receivers check for delimiters appearing at the correct times The receivers calculate the CRC value and compare their calculated value to the transmitted value. The receivers check that no more than 5 successive bits of the same level are sent
  • Any node that detects an error on the CAN bus can interrupt a message. To ensure that a faulty transmitter or receiver does not prevent all communications on the bus, a node must tolerate some occasional errors but also detect a persistent local fault and stop transmissions. Each CAN controller contains transmit and receive error counters . Each message received or sent in error adds 8 to the error counter. Each correct message decrements the error counter. As the error counts exceed predetermined thresholds , the node transitions between its error states. In Error-Active state it participates in normal communications and error reporting. If the error counters reach the first threshold the nodes transition to error-passive. A node in this mode will only report errors using the passive error message, consisting of all recessive bits. If an excessive number of errors accumulate, the node stops participating in communications.
  • Introduction to CAN Bus Technology

    1. 1. CAN Bus Technology
    2. 2. CAN Bus Introduction <ul><li>Controller Area Network (CAN) </li></ul><ul><li>Originally developed by Robert Bosch for automobile in-vehicle network </li></ul><ul><li>Multi-drop, Multi-master serial bus provides communications between controllers, sensors, and actuators. </li></ul><ul><li>Very reliable and robust, well proven technology (introduced mid 1980s) </li></ul><ul><li>Inexpensive </li></ul>
    3. 3. CAN Bus Introduction <ul><li>CAN 2.0 A </li></ul><ul><ul><li>Standard format </li></ul></ul><ul><li>CAN 2.0 B </li></ul><ul><ul><li>Extended format </li></ul></ul><ul><li>International Standard ISO 11898 </li></ul><ul><ul><li>ISO 11898-2 High speed applications up to 1 Mbps </li></ul></ul><ul><ul><li>ISO 11898-3 Low speed applications up to 125 Kbps </li></ul></ul>
    4. 4. CAN Bus Introduction <ul><li>CAN Applications </li></ul><ul><li>Automotive </li></ul><ul><li>Military vehicles </li></ul><ul><li>Industrial machinery </li></ul><ul><li>Medical systems </li></ul><ul><li>Agricultural machinery </li></ul><ul><li>Marine control and navigation </li></ul><ul><li>Elevator control systems </li></ul>
    5. 5. CAN Bus Introduction <ul><li>Network Layered Model </li></ul>Application Presentation Session Transport Network Data Link Physical CAN defines most of the lowest two layers Higher layer protocols defined by various industry standards: DeviceNet, CANOpen, CANaerospace, MilCAN, SAE J1939, ISO1192 and others
    6. 6. CAN Bus Introduction <ul><li>CAN Characteristics </li></ul><ul><li>All messages are broadcast </li></ul><ul><li>Any node is allowed to broadcast a message </li></ul><ul><li>Each message contains an ID that identifies the source or content of a message </li></ul><ul><li>Each receiver decides to process or ignore each message </li></ul>
    7. 7. CAN Bus Introduction <ul><li>CAN Characteristics </li></ul><ul><li>Bus length / Bit rate tradeoff </li></ul><ul><li>1M bit/sec 40 meters (131 feet) </li></ul><ul><li> 500K bit/sec 100 meters (328 feet) </li></ul><ul><li> 250K bit/sec 200 meters (656 feet) </li></ul><ul><li> 125K bit/sec 500 meters (1640 feet) </li></ul>
    8. 8. CAN Bus Introduction <ul><li>CAN characteristics – Physical Medium </li></ul><ul><li>Single twisted pair wire terminated on each end </li></ul>Node A Node B 120 Ω 120 Ω
    9. 9. CAN Bus Introduction <ul><li>CAN characteristics – Signal Levels </li></ul><ul><li>Differential signaling </li></ul>Volts 3.5 2.5 1.5 CAN H CAN L recessive1 dominant 0 recessive 1
    10. 10. CAN Bus Introduction <ul><li>CAN characteristics – Bit timing </li></ul>previous bit next bit Nominal bit time sync prop phase 1 phase 2 sample point Time Quanta Local timing logic re-synchronizes with bus on each recessive to dominant transition
    11. 11. CAN Bus Introduction <ul><li>CAN Characteristics </li></ul><ul><li>Network Size </li></ul><ul><li>The maximum number of nodes is not specified. </li></ul><ul><li>Networks are limited by electrical loading, up to 64 nodes is normal </li></ul>
    12. 12. CAN Bus Introduction <ul><li>Four Message Types </li></ul><ul><li>Data Frame </li></ul><ul><ul><li>Used to transmit data </li></ul></ul><ul><li>Remote Frame </li></ul><ul><ul><li>Used to request data transmission </li></ul></ul><ul><li>Error Frame </li></ul><ul><ul><li>Sent by a node that detects an error </li></ul></ul><ul><li>Overload Frame </li></ul><ul><ul><li>Sent by a node to request a delay in transmission </li></ul></ul>
    13. 13. CAN Bus Introduction <ul><li>Message Format (standard) </li></ul>0 – 64 Data field 0 – 8 bytes 1 Start of frame 7 End of frame 4 Data length code 1 ACK delimiter 1 Reserved 1 ACK slot 1 ID extension 1 CRC delimiter 1 Remote trans. 15 CRC 11 Identifier Bits Field Bits Field
    14. 14. CAN Bus Introduction <ul><li>Message Collision Detection / Arbitration </li></ul><ul><li>All nodes must wait for an idle bus condition </li></ul><ul><li>If two nodes begin transmitting simultaneously, they then participate in a non-destructive arbitration sequence </li></ul><ul><li>The node with the lower ID number wins the arbitration and continues transmitting its message </li></ul><ul><li>The loser of the arbitration backs off and re-tries </li></ul>
    15. 15. CAN Bus Introduction <ul><li>Error Detection Capabilities </li></ul><ul><li>Bit error </li></ul><ul><li>Acknowledge error </li></ul><ul><li>Form error </li></ul><ul><li>CRC errors </li></ul><ul><li>Stuff error </li></ul>
    16. 16. CAN Bus Introduction <ul><li>Error States </li></ul><ul><li>Error-active </li></ul><ul><ul><li>Normal operating mode, node participates in communications and error reporting </li></ul></ul><ul><li>Error-passive </li></ul><ul><ul><li>Node switches to passive error reporting </li></ul></ul><ul><li>Bus-off </li></ul><ul><ul><li>Node has detected too many transmit errors, stops transmitting (fault containment) </li></ul></ul>
    17. 17. CAN Bus Introduction <ul><li>End of presentation </li></ul>

    ×