lamaPLC Communication: CAN

lamaPLC Communication: CAN A controller area network (CAN bus) is a vehicle bus standard designed to allow microcontrollers and devices to communicate with each other. It is a message-based protocol, designed originally for multiplex electrical wiring within automobiles to save on copper, but it can also be used in many other contexts. For each device, the data in a frame is transmitted serially but in such a way that if more than one device transmits at the same time, the highest priority device can continue while the others back off. Frames are received by all devices, including by the transmitting device.

Development of the CAN bus started in 1983 at Robert Bosch GmbH. The protocol was officially released in 1986 at the Society of Automotive Engineers (SAE) conference in Detroit, Michigan. The first CAN controller chips were introduced by Intel in 1987, and shortly thereafter by Philips. Released in 1991, the Mercedes-Benz W140 was the first production vehicle to feature a CAN-based multiplex wiring system.

The CAN bus history in short:

  • Pre CAN: Car ECUs relied on complex point-to-point wiring
  • 1986: Bosch developed the CAN protocol as a solution
  • 1991: Bosch published CAN 2.0 (CAN 2.0A: 11 bit, 2.0B: 29 bit)
  • 1993: CAN is adopted as international standard (ISO 11898)
  • 2003: ISO 11898 becomes a standard series
  • 2012: Bosch released the CAN FD 1.0 (flexible data rate)
  • 2015: The CAN FD protocol is standardized (ISO 11898-1)
  • 2016: The physical CAN layer for data-rates up to 5 Mbit/s standardized in ISO 11898-2

The CAN bus physical layer defines things like cable types, electrical signal levels, node requirements, cable impedance etc. For example, ISO 11898-2 dictates a number of things, including below:

  • Baud rate: CAN nodes must be connected via a two wire bus with baud rates up to 1 Mbit/s (Classical CAN) or 5 Mbit/s (CAN FD)
  • Cable length: Maximal CAN cable lengths should be between 500 meters (125 kbit/s) and 40 meters (1 Mbit/s)
  • Termination: The CAN bus must be properly terminated using a 120 Ohms CAN bus termination resistor at each end of the bus

CANopen

CANopen is a higher-layer protocol that is used for embedded control applications. Because it is based on the CAN messaging protocol, DAQ systems and data loggers that can read and record CAN data can also access data from CANopen.

CANopen was invented to provide easy interoperability among devices in motion control systems. Communication among and between devices is implemented at a high level, and device configuration is also supported. It’s heavily used in motion control, robotics, and motor control applications.

CANopen is managed by the international organization CAN in Automation - CiA. Established in Germany in 1992, CiA is a non-profit international users/manufacturers group for CAN. They take pride in being an unbiased platform for the development of the CAN protocol, and for promoting the image of CAN technology.

Low-Speed CAN Bus

The low-speed CAN Bus, a fault-tolerant CAN, supports bit rates between 40 kbit/s and 125 kbit/s. It provides a robust communication system that allows communication to continue even when one of the two wires experiences a fault. The resilience is further enhanced by each CAN node’s dedicated CAN termination, ensuring seamless data transfer.

High-Speed CAN Bus

The high-speed CAN Bus is based on the ISO 11898 standard and is widely used in modern applications. It supports bit rates between 40 kbit/s and 1 Mbit/s and offers simple cabling solutions, making it the most popular choice in the industry today. It is the foundation for various higher-layer protocols such as OBD2, CANopen, and j1939, further solidifying its significance in communication systems.

CAN FD (CAN Flexible Data Rate)

CAN FD, or CAN Flexible Data Rate, is an advanced communication protocol in modern high-performance vehicles. Released in 2012 by Bosch as an extension of the original CAN Bus protocol, CAN FD was developed to satisfy the growing demand for increased data transfer rates in sophisticated automotive systems. The technology has considerably enhanced the efficiency and performance of vehicle communication networks while being an integral part of contemporary automobile design.

CAN Frame

CAN Frame

  • SOF: The Start of Frame is a 'dominant 0' to tell the other nodes that a CAN node intends to talk
  • ID: The ID is the frame identifier - lower values have higher priority
  • RTR: The Remote Transmission Request indicates whether a node sends data or requests dedicated data from another node
  • Control: The Control contains the Identifier Extension Bit (IDE) which is a 'dominant 0' for 11-bit. It also contains the 4 bit Data Length Code (DLC) that specifies the length of the data bytes to be transmitted (0 to 8 bytes)
  • Data: The Data contains the data bytes aka payload, which includes CAN signals that can be extracted and decoded for information
  • CRC: The Cyclic Redundancy Check is used to ensure data integrity
  • ACK: The ACK slot indicates if the node has acknowledged and received the data correctly
  • EOF: The EOF marks the end of the CAN frame

In addition to CAN and the protocols that run on it described in the previous sections, there are other communication buses that are used for vehicle applications:

  • MOST (Media-Oriented Systems Transport)
  • Automotive Ethernet
  • SENT SAE-J2716
  • FlexRAY
  • LIN Bus - Local Interconnect Network

Sources