Well, to make the car start, several antennas and Electronic Control Units communicated with the key fob. The Controller Area Network (CAN) protocol ensures communication between your key fob, antennas, and ECUs happen appropriately inside your car.
So what is the CAN protocol, and how does it help the devices on your vehicle’s systems work together? Well, let’s find out.
What Is the CAN Protocol, and Why Is It Needed?
Back in the day, cars did not have a lot of electronics. In fact, if you wanted to start your vehicle in the early-1900s, you had to get out of your vehicle and crank the engine by hand.
Today’s cars, on the contrary, have several electronic sensors, and electronic devices monitor everything from the cabin temperature to the revolutions of the crankshaft.
That said, the data received from these sensors is of no value until it’s processed. This data processing is performed by computing devices known as Electronic Control Units (ECUs).
Unlike a computer with a single CPU, a car has several ECUs, each of which is responsible for performing a particular task. Although these ECUs can perform a single task efficiently, they must work together to ensure features like ABS and ESC work properly.
Due to this, all the ECUs on a car need to be connected. One could use a point-to-point topology to make these connections, where each ECU is connected directly to every other ECU. However, this architecture would make the system complex. In fact, a modern vehicle has over 70 ECUs, and connecting them in a one-to-one fashion would increase the weight of the wiring exponentially.
To solve this problem, Bosch, along with Mercedes-Benz and Intel, created the Controller Area Network protocol in 1986. This protocol enabled ECUs to communicate with one another using a shared data bus known as the CAN bus.
How Does CAN Work?
The CAN protocol is a message-based communication methodology that relies on a set of twisted pair cables for data transmission. These wires are known as CAN high and CAN low.
To enable data transmission on these wires, their voltage levels are changed. These changes in voltage levels are then translated to logic levels enabling the ECUs on a car to communicate with one another.
For transmitting logic one on the CAN bus, the voltage of both the lines is set to 2.5 volts. This state is also known as the recessive state, which means the CAN bus is available for use by any ECU.
On the contrary, logic 0 is transmitted on the CAN bus when the CAN high line is at a voltage of 3.5 volts and the CAN low line is at 1.5 volts. This state of the bus is also known as the dominant state, which tells every ECU in the system that another ECU is transmitting, so they should wait until the tranmission is over before they start transmitting their message.
To enable these voltage changes, the car’s ECUs are connected to the CAN bus through a CAN transceiver and a CAN controller. The transceiver is responsible for converting the voltage levels on the CAN bus to levels that the ECU can understand. The controller, on the other hand, is used to manage the received data and ensure that the requirements of the protocol are fulfilled.
All these ECUs connected to the CAN bus can transmit data on the twisted cable, but there is a catch, only the message with the highest priority can be transmitted on the CAN bus. To understand how an ECU transmits data on the CAN bus, we need to understand the message structure of the CAN protocol.
Understanding the Message Structure of the CAN Protocol
Whenever two ECUs want to communicate, messages with the structure below are transmitted on the CAN bus.
These messages are transferred by changing the voltage levels on the CAN bus, and the twisted pair design of the CAN wires prevents data corruption during transmission.
SOF: Short for Start Of Frame, the SOF bit is a single dominant bit data frame. This bit is transmitted by a node when it wants to send data on the CAN bus. Identifier: The identifier on the CAN protocol can be either 11 bits or 29 bits in size. The size of the identifier is based on the version of the CAN protocol being used. If the extended version of CAN is used, then the size of the identifier is 29 bits, and in other cases, the size of the identifier is 11 bits. The main goal of the identifier is to identify the message’s priority. RTR: The Remote Transmission Request or the RTR is used by a node when data needs to be requested from another node. To do this, the node which wants the data sends a message with a recessive bit in the RTR frame to the intended node. DLC: The data length code defines the size of data being transmitted in the data field. Data field: This field contains the data payload. The size of this payload is 8 bytes, but newer protocols like CAN FD increase the size of this payload to 64 bytes. CRC: Short for Cyclic Redundancy Check, the CRC field is an error checking frame. The same is 15 bits in size and is computed by both the receiver and the transmitter. The transmitting node creates a CRC for the data when transmitted. On receiving the data, the receiver computes the CRC for the received data. If both CRCs match, the integrity of the data is confirmed. If not, the data has errors. Acknowledgment field: Once the data is received and is free of errors, the receiving node feeds a dominant bit into the acknowledgment frame and sends it back to the transmitter. This tells the transmitter that the data has been received and is free of errors. End Of Frame: Once the data transmission is completed, seven consecutive recessive bits are transmitted. This ensures that all nodes know that a node has completed data transmission, and they can transmit data on the bus.
In addition to the bits above, the CAN protocol has a few bits reserved for future use.
Simplifying CAN Through an Example
Now that we have a basic understanding of what a message on the CAN bus looks like, we can understand how data is transmitted between different ECUs.
For simplicity, let’s say that our car has 3 ECUs: Node 1, Node 2, and Node 3. Out of the 3 ECUs, Node 1 and Node 2 want to communicate with Node 3.
Let’s see how the CAN protocol helps ensure communication in such a scenario.
Detecting the state of the bus: All the ECUs on the car are connected to the CAN bus. In the case of our example, Node 1 and Node 2 want to send data to another ECU; before doing that, both ECUs need to check the state of the CAN bus. If the bus is in a dominant state, then the ECUs can’t transmit data as the bus is in use. On the other hand, if the bus is in a recessive state, the ECUs can transmit data. Sending the Start of Frame: If the differential voltage on the CAN bus is zero, both Node 1 and Node 2 change the state of the bus to dominant. To do this, the voltage of CAN high is raised to 3. 5 volts, and the voltage of CAN low is reduced to 1. 5 volts. Deciding which node can access the bus: Once the SOF is sent, both the nodes compete to access the CAN bus. The CAN bus uses the Carrier Sense Multiple Access/Collision Detection (CSMA/CD) protocol to decide which node gets access. This protocol compares the identifiers transmitted by both nodes and gives access to the one with the higher priority. Sending data: Once the node has access to the bus, the data field, along with the CRC, is sent to the receiver. Checking and ending the communication: On receiving the data, Node 3 checks the CRC of the received data. If there are no errors, Node 3 sends a CAN message to the transmitting node with a dominant bit on the acknowledgment frame along with the EOF to terminate the communication.
Different Types of CAN
Although the message structure used by the CAN protocol remains the same, the speed of data transmission and the size of the data bits are changed to transfer higher bandwidths of data.
Due to these differences, the CAN protocol has different versions, and an overview of the same is given below:
High-speed CAN: The data on the CAN wires is transmitted serially, and this transmission can be done at different rates. For high-speed CAN, this speed is 1 Mbps. Due to this high data transmission speed, high speed can is used for ECUs, which control the powertrain and safety systems. Low-speed CAN: In the case of low-speed CAN, the rate at which data is transmitted is reduced to 125 kbps. As the low speed can offer lower data rates, it is used to connect ECUs which manage the passenger’s comfort, like the air conditioning or the infotainment system. Can FD: Short for CAN flexible data rate, CAN FD is the newest version of the CAN protocol. It increases the size of the data frame to 64 bytes and allows the ECUs to transmit data at speeds ranging from 1 Mbps to 8 Mbps. This data transmission speed can be managed by the ECUs in real time based on system requirements, allowing data to be transferred at higher speeds.
What Is the Future of Automotive Communication?
The CAN protocol allows several ECUs to communicate with one another. This communication enables safety features like electronic stability control and advanced driver assistance systems like blind spot detection and adaptive cruise control.
That said, with the advent of advanced features like autonomous driving, the amount of data being transmitted by the CAN bus is increasing exponentially. To enable these features, newer versions of the CAN protocol, like the CAN FD, are entering the market.