ABCD of Controller Area Network (CAN) in Electric Vehicles

Explore the fundamental concepts of Controller Area Network (CAN) in Electric Vehicles, including its importance and applications, with EV Pro School.

In the realm of modern automotive technology, Controller Area Network (CAN) has emerged as a cornerstone for efficient communication and control systems, particularly in electric vehicles (EVs). In this comprehensive guide, we delve into the intricacies of CAN, exploring its architecture, functions, applications, and significance in the EV landscape.

A. The Fundamentals of CAN

Imagine you have a small remote-controlled car that has different parts like wheels, lights, and a motor. Each of these parts needs to work together smoothly for the car to move and function properly.

Now, think of the CAN as a communication system that allows all these different parts of the car to talk to each other. It’s like a group chat for the car’s parts!

For example, when you use the remote to make the car move forward, the remote sends a message to the car’s ‘brain’ (which is like a mini-computer). This message is then shared with the motor and the wheels through the CAN. The motor knows it needs to start working, and the wheels know they need to start turning, all because they received the message through the CAN.

Similarly, if you want to turn on the car’s lights, a message is sent from the remote to the car’s brain and then to the lights through the CAN, telling them to turn on.

So, the CAN is like a communication system that helps different parts of the car talk to each other and work together smoothly, just like how you and your friends communicate in a group chat to plan a group activity!

Controller Area Network (CAN) is a robust serial communication protocol designed for real-time applications in automotive and industrial environments. Originating in the 1980s, CAN was developed by Bosch to address the growing complexity of communication between electronic control units (ECUs) in vehicles. Its key features include high reliability, low cost, and deterministic behavior, making it an ideal choice for critical systems.

B. How Does CAN Work?

The Controller Area Network (CAN) works by allowing multiple devices, often referred to as nodes, to communicate with each other within a vehicle without the need for a central computer. Here’s a simplified explanation of how it works:

  1. Message-based Communication: Unlike traditional wiring systems where each device needs a direct connection to the central computer, CAN uses a message-based protocol. This means that devices send and receive messages through a shared communication line (the CAN bus).
  2. CAN Bus: The CAN bus is a two-wire, differential signal bus that allows devices to communicate with each other. The two wires are known as CAN High and CAN Low. The difference in voltage between these two wires determines whether a transmitted bit is a 0 or a 1.
  3. Transmission: When a device wants to send a message, it checks to see if the bus is free (no other device is transmitting). If the bus is free, the device starts transmitting its message, bit by bit. The message contains an identifier, which indicates the priority of the message and the type of data being sent.
  4. Collision Handling: If two devices start transmitting at the same time, the device with the higher priority message (lower identifier value) will continue transmitting, while the other device stops and waits for the bus to be free again. This is known as arbitration and ensures that the most important messages are sent first.
  5. Receiving Messages: All devices on the network listen to every message transmitted on the CAN bus. Each device checks the identifier of the message to determine if it is relevant to them. If the message is relevant, the device processes the data. If not, the device ignores the message.
  6. Error Handling: CAN has built-in error detection and handling mechanisms. If a device detects an error in a message (e.g., due to noise on the line), it will send an error frame to signal that an error has occurred. This causes the transmitting device to retransmit the message.
  7. Termination: To ensure proper communication and minimize reflections on the CAN bus, the ends of the bus are terminated with resistors, typically 120 ohms.

In summary, CAN works by providing a shared communication line (the CAN bus) for devices to transmit messages. It uses message-based communication with priority-based arbitration, error handling, and termination to ensure reliable and efficient communication between devices in a vehicle.

C. Comparison With & Without CAN Bus in EV

Let’s take the example of a battery management system (BMS), a motor controller, and a cluster (the display that shows information to the driver) in an electric vehicle and see how they communicate with and without CAN bus.

With CAN Bus:
  1. BMS: The BMS monitors the battery’s voltage, current, temperature, etc. When it needs to communicate this information to the cluster or the motor controller, it sends a message with a specific identifier onto the CAN bus.
  2. Motor Controller: The motor controller controls the electric motor’s speed and torque. It might need information from the BMS about the battery’s state of charge to manage the motor’s power. It listens for messages on the CAN bus, identifies relevant messages (e.g., battery state of charge), and adjusts the motor’s operation accordingly.
  3. Cluster: The cluster displays information like battery charge level, speed, etc. It listens for messages on the CAN bus and updates the display based on the received data (e.g., from the BMS or motor controller).

In this setup, all three devices are connected to the same CAN bus. They can communicate by sending and receiving messages over just two wires (CAN High and CAN Low), reducing the complexity and weight of the wiring.

Without CAN Bus (Using Multiple Wires):
  1. BMS: The BMS would need a separate set of wires to communicate with the motor controller and another set to communicate with the cluster. For example, it might need one wire for each parameter it wants to communicate (voltage, current, temperature, etc.), leading to a large number of wires.
  2. Motor Controller: Similarly, the motor controller would need separate wires to receive information from the BMS and possibly other wires to send information to the cluster (e.g., motor speed).
  3. Cluster: The cluster would need multiple wires coming in from the BMS and motor controller to display various pieces of information.

In this setup, the absence of a CAN bus means that each piece of information requires its own dedicated wire, leading to a complex, heavy, and less reliable wiring system.

In summary, using a CAN bus simplifies communication between devices in a vehicle by reducing the number of wires needed and providing a standardized way for devices to exchange information. Without a CAN bus, each connection between devices would require multiple wires, resulting in a more complex and less efficient system.

D. Decoding the Magic of sending so many signals over just two wires

CAN High and CAN Low, lies in the way data is encoded and transmitted on the CAN bus. Here’s a simplified explanation:

  1. Digital Signals: The data on the CAN bus is transmitted as digital signals. This means that the information, like voltage, current, SOC (State of Charge), etc., is converted into binary form (a series of 0s and 1s) before being sent.
  2. Message Frames: Each piece of information is packaged into a structured format called a message frame. A message frame includes several parts, such as an identifier (which indicates the priority and type of message), data (the actual information being transmitted), and a checksum (for error detection).
  3. Time Division Multiplexing: The CAN bus uses a technique called time division multiplexing. This means that different messages are sent one after another in small time slots. Even though it seems like the messages are being sent simultaneously, they’re actually being transmitted sequentially, very quickly.
  4. Arbitration: If two devices try to send messages at the same time, the CAN protocol has a built-in arbitration mechanism. The message with the higher priority (lower identifier value) gets to be transmitted first, while the other device waits for its turn. This ensures that critical messages, like those related to safety, are transmitted before less important ones.
  5. Bit Stuffing: To ensure synchronization and error detection, the CAN protocol uses a technique called bit stuffing. After five consecutive bits of the same polarity, an opposite polarity bit is inserted. This helps the receiving devices stay in sync with the transmitting device and detect errors.

By using these techniques, the CAN bus can efficiently transmit a large number of signals over just two wires. This reduces the complexity and weight of the wiring harness in a vehicle and improves reliability.

E. The power, voltage, & current requirements

The power requirements for CAN bus are relatively low, making it suitable for automotive and industrial applications. Here are the typical specifications:

Voltage Levels:
  • CAN High (CAN_H): When transmitting a dominant bit (logical 0), the voltage is typically between 2.5V and 3.5V. When transmitting a recessive bit (logical 1), the voltage is usually between 2.5V and 5V.
  • CAN Low (CAN_L): For a dominant bit, the voltage is typically between 1.5V and 2.5V. For a recessive bit, it’s usually between 0V and 2.5V.

The differential voltage between CAN_H and CAN_L is what’s important for signaling. For a dominant bit, this differential is usually around 2V, and for a recessive bit, it’s close to 0V.

Current:
  • The current draw for a CAN transceiver (the device that interfaces between the CAN bus and the CAN controller) is typically low, often in the range of 5mA to 20mA, depending on the specific transceiver and the operating mode.
Power:
  • The power consumption of a CAN transceiver can be calculated using the formula:
  • Power = Voltage × Current. For example, if a transceiver operates at 5V and draws 10mA, the power consumption would be 50mW.

It’s important to note that these values can vary depending on the specific CAN implementation and the transceiver used. Always refer to the datasheets of the specific CAN transceiver and CAN controller for accurate specifications.

F. What is 11 bit and 29 bit IDs.

In the context of a Controller Area Network (CAN), the terms “11-bit” and “29-bit” refer to the length of the identifier field in a CAN message frame. The identifier is used to indicate the priority and type of message being transmitted. There are two formats for CAN messages: standard and extended.

  1. Standard CAN (11-bit Identifier): In this format, the identifier is 11 bits long, allowing for 2^11 or 2,048 different message identifiers. The standard format is also known as CAN 2.0A. This format is commonly used in applications where the number of different messages is relatively small.
  2. Extended CAN (29-bit Identifier): In this format, the identifier is extended to 29 bits, allowing for 2^29 or approximately 537 million different message identifiers. The extended format is also known as CAN 2.0B. This format is used in applications that require a large number of different messages or more detailed message identification.

The choice between standard and extended CAN depends on the specific requirements of the application, such as the number of different messages that need to be transmitted and the level of message prioritization required.

G. The baud rate in a CAN system

The Baud rate is the speed at which data is transmitted on the CAN bus. It is measured in bits per second (bps). The baud rate is a crucial parameter because it determines the overall speed of communication and impacts the maximum length of the CAN bus and the need for termination resistors.

Relationship between Baud Rate and Length of the Wire:
  1. Signal Propagation Time: The higher the baud rate, the shorter the time available for a signal to propagate from one end of the bus to the other. At higher baud rates, signals can become distorted due to the finite propagation speed of electrical signals in the wire.
  2. Maximum Bus Length: To ensure reliable communication, the length of the CAN bus is typically inversely proportional to the baud rate. At lower baud rates, longer bus lengths are possible because the signals have more time to travel without significant distortion. At higher baud rates, the maximum bus length is shorter.

For example, at a baud rate of 1 Mbps, the maximum bus length might be around 40 meters, whereas at 125 Kbps, the maximum length could be up to 500 meters.

Relationship between Baud Rate and CAN Termination Resistors:
  1. Reflections and Impedance Matching: Termination resistors are used to match the impedance of the bus and minimize reflections at the ends of the bus. These reflections can cause signal distortion, especially at higher baud rates.
  2. Effectiveness of Termination: At higher baud rates, the effectiveness of the termination resistors becomes more critical. Proper termination ensures that the signals are not distorted by reflections, maintaining signal integrity and reliable communication.

In summary, the baud rate in a CAN system affects both the maximum length of the bus and the need for proper termination. Lower baud rates allow for longer bus lengths but slower data transmission, while higher baud rates enable faster data transmission but require shorter bus lengths and more careful attention to termination to ensure reliable communication.

Conclusion:

Controller Area Network (CAN) stands as a cornerstone of communication and control systems in electric vehicles, enabling seamless integration of various subsystems and enhancing overall performance and safety. With its robust architecture, deterministic behavior, and adaptability, CAN continues to play a pivotal role in shaping the future of automotive technology, driving innovation and advancement in the EV landscape.