All You Need To Know About CAN (Controller Area Network)
Controller Area Network (CAN) is a communication protocol used in automotive electronics to facilitate communication between microcontrollers, sensors, and actuators. It is a two-wire, high-speed, half-duplex network system far advanced to conventional serial technologies such as RS232 regarding reliability& functionality, yet CAN implementations are more profitable.
The Controller Area Network (CAN) is a crucial component of On-Board Diagnostics 2 (OBD2) systems, used to diagnose and report problems with a vehicle’s engine, transmission, and emissions systems. OBD2 communicates with numerous sensors and electronic control modules (ECMs) in a car through CAN to acquire diagnostic trouble codes (DTCs) and monitor real-time data. To access this data and perform diagnostics, technicians use a variety of OBD2 scanners, including the Foxwell scanner, which is known for its advanced diagnostic features and user-friendly interface.
One of the elemental advantages of using CAN in OBD2 is its ability to transfer data fast and precisely. It’s critical for diagnosing faults in a vehicle’s complicated systems since it allows OBD2 to swiftly identify potential issues and deliver a solution to the user. Furthermore, CAN supports bidirectional communication, which means that OBD2 can not only receive data from the vehicle but also transmit commands to execute specific functions, such as turning off the check engine light after a repair.
History of CAN
Robert Bosch GmbH first created CAN in 1986 to facilitate communication between various electronic systems in automobiles. Initially designed for high-speed transfer of engine control data, it quickly found more comprehensive applications in the automobile sector. CAN standardize as ISO 11898 in 1993, and it has subsequently been widely utilized in industries other than automotive.
The controller area network (CAN) is used for antilock braking, transmission airbags, electric power steering, etc.
· Utilized in audio-video systems.
· CAN is operated in lifts and escalators.
· Employed in sports cameras, automatic doors, coffee machines & telescopes
CAN Physical Layer
Electrical Characteristics of CAN:
Differential Signaling Scheme
The CAN bus utilizes a differential signaling scheme that allows data transmission over a twisted pair of wires. The differential signaling scheme consists of two wires: CANH and CANL. The CANH wire carries the positive signal, while the CANL wire carries the negative signal. The differential voltage between these two wires determines the state of the bit transmitted.
A high differential voltage indicates logic 0, while a low differential voltage indicates logic 1. The differential signaling scheme provides immunity to electromagnetic interference (EMI) and reduces the effects of potential ground differences.
The CAN bus employs a 120-ohm termination resistor at both ends of the communication channel to match the impedance of the transmission line. The termination resistor reduces reflections and ensures that the signals are transmitted correctly.
Communication Speed and Maximum Distance
The CAN bus has a maximum communication speed of 1 Mbps. However, lower speeds, such as 125 Kbps, are also commonly used. The CAN bus supports up to 30 nodes on a single network, and the maximum distance between nodes is typically limited to 40 meters.
Types of CAN Physical Layers
CAN physical layers transmit the data over the communication channel, and several physical layers can be used with the CAN protocol. The different types of physical layers are as follows:
Classical CAN is the most commonly used physical layer, operating at a maximum speed of 1 Mbps. It uses a 5V differential signaling scheme, and the maximum cable length is limited to 40 meters. Classical CAN is widely used in the automotive and industrial sectors.
CAN FD (Flexible Data-rate) is a new physical layer that enables data transfer faster than classical CAN. It can operate at speeds up to 8 Mbps and uses an improved differential signaling scheme that provides better immunity to EMI. CAN FD is suitable for high-speed applications requiring large data transfer.
CANopen is a higher-level protocol that operates on the CAN physical layer. It defines a set of communication and application layer protocols that enable interoperability between different devices. CANopen is used extensively in the industrial sector.
CAN Data Link Layer
The Controller Area Network (CAN) data link layer is a communication protocol that provides a reliable and efficient method for transmitting data between devices in a network. It is a two-wire, half-duplex communication protocol widely used in automotive and industrial applications. The CAN data link layer ensures that messages are transmitted and received accurately and efficiently.
Classical CAN and CAN FD are the two CAN data communication layers (Flexible Data-rate). Traditional CAN has been used for decades and has a maximum data rate of 1 Mbps. In contrast, CAN FD was introduced in 2011 with a maximum data throughput of 8 Mbps. CAN FD also has a larger payload and more efficient transmission than Classical CAN.
Several ways how CAN handles message transmission and reception:
a) Message Transmission:
i) Arbitration: When a device wants to send a message, it first checks if the bus is free. If the bus is free, the device starts transmitting its message. If multiple devices try to transmit a message simultaneously, there is an arbitration process that takes place. The device with the highest priority message wins the arbitration and can continue transmitting it.
ii) Message Framing: Once a device wins the arbitration, it starts transmitting its message. The message is divided into frames, which include an identifier, control bits, data bytes, and an error-checking code. These frames are transmitted sequentially over the bus.
iii) Acknowledgement: After a message is transmitted, the receiving device sends an acknowledgment frame to confirm that the message was received successfully.
b) Message Reception:
i) Reception: A device monitors the bus for incoming messages. When a message is detected, the receiving device checks the message identifier to determine its relevance. If the message is relevant, the device starts receiving the message frames.
ii) Error Checking: Once the message frames are received, the receiving device performs an error-checking process to ensure the message was received correctly. The receiving device sends an acknowledgment frame to confirm successful reception if the message is correct. If the message has an error, the receiving device sends an error frame to notify the transmitting device.
iii) Buffering: The receiving device stores the message in a buffer until the higher layers of the protocol process it.
CAN Application Layer
The Controller Area Network (CAN) application layer defines the format and content of messages transmitted between devices in a CAN network. The application layer determines how data is structured and interpreted by the devices in the network. The application layer is implemented on top of the data link layer, which provides a reliable and efficient method of transmitting data.
There are several types of CAN application layers, including:
· J1939: Used in heavy-duty vehicles and industrial applications
· CANopen: Used in industrial automation and process control
· DeviceNet: Used in factory automation and industrial control systems
· CAN Kingdom: Used in automotive and industrial applications
Examples Of Messages Sent Using The CAN Application Layer:
i) PGN (Parameter Group Number): Used to define the content and structure of a message.
ii) DM1 (Diagnostic Message 1): Used to report diagnostic trouble codes in heavy-duty vehicles.
iii) TP (Transport Protocol): Used to transmit large data sets between devices.
i) SDO (Service Data Object): Used to read and write data between devices.
ii) PDO (Process Data Object): Used to transmit process data between devices.
iii) NMT (Network Management): Used to manage the state of the network.
i) Explicit Message: Used to send and receive data between devices.
ii) Implicit Message: Used to control the behavior of devices on the network.
d) CAN Kingdom:
i) KWP (Key Word Protocol): Used for diagnostic communication in automotive applications.
ii) UDS (Unified Diagnostic Services): Used for diagnostic communication in automotive applications.
Advantages of CAN
Reliability and Error Detection:
CAN use various methods to ensure reliable and error-free communication between devices. The protocol provides an efficient detection mechanism to detect errors during transmission. Reliability ensures that corrupted messages are not processed, and the data transmitted is accurate.
Additionally, CAN uses an acknowledgment mechanism, ensuring the intended device receives each message. Error Detection makes CAN a highly reliable protocol, making it suitable for critical applications such as automotive and industrial control systems.
Flexibility and Scalability:
CAN is a highly flexible and scalable protocol, making it suitable for various applications. CAN allow for adding or removing devices on the network without interrupting the communication between existing devices. Flexibility enables the network to be easily expanded or reconfigured as needed, making it a cost-effective solution for complex systems.
Low Cost and Simplicity:
CAN is a low-cost and straightforward communication protocol that is widely used in a variety of applications. The protocol uses only two wires for communication, making it easy to install and maintain. Additionally, CAN does not require a dedicated network manager, reducing costs. These features make CAN an attractive option for applications where cost and simplicity are critical factors.
Limitations of CAN
Limited Distance and Speed
CAN is designed to operate over relatively short distances, typically up to several hundred meters. Additionally, CAN’s maximum data transfer rate is limited to 1 Mbps, significantly slower than other communication protocols such as Ethernet or USB. Limited Distance and Speed make CAN less suitable for applications that require high-speed data transfer over long distances.
Vulnerability to Electromagnetic Interference
CAN communication can be susceptible to electromagnetic interference (EMI) caused by sources such as radio transmitters, motors, or power lines. Vulnerability to Electromagnetic Interference can result in errors or corrupted messages transmitted on the network. While CAN includes error detection and correction mechanisms, more is needed to handle all types of EMI, particularly in harsh environments.
Limited Message Size
CAN has a maximum message size of 8 bytes, which can limit its ability to transmit more significant amounts of data efficiently. While the protocol does support methods for transmitting larger messages, such as segmented data transfer, these methods can be less efficient and add complexity to the system.
Controller Area Network (CAN) has become an essential communication protocol in many industries, particularly onboard diagnostics (OBD2) for automobiles. Its development in the 1980s by Robert Bosch GmbH has led to its widespread adoption, providing reliable and efficient data transmission between devices. CAN’s use of differential signaling and error detection mechanisms ensures the reliability of data transmission, and its flexibility and scalability make it suitable for various applications.
Despite its limitations, such as its limited distance and speed, CAN remains a valuable communication protocol with ongoing developments to improve its capabilities. As technology advances, it is clear that CAN will play a significant role in various industries, enhancing communication and data transmission between devices.
As a mechanical engineer, it’s easy for David to explain the functionality of the tool. David tests most of the tools before writing a review. It helps him to learn something new and suggest the best product for you