The rise of the smart, connected equipment is transforming competition. To implement “smarter” equipment, working knowledge of the accuracy of the data being transmitted throughout that equipment is needed. The controller area network (CAN) bus is the current interface to machine operation data transmitted between electronic control units (ECUs).
Let’s start at the beginning, what is CAN?
What are the best advantages of CAN Bus?
The CAN Bus network has endless advantages:
- It allows multi-master configuration, meaning that any ECU connected can control the bus and transmit data.
- CAN Bus is centralised, meaning that it provides a single point-of-entry to all ECUs, enabling central diagnostics, data logging, and configuration.
- CAN is also robust towards electromagnetic interference by requiring only two wires twisted together (commonly known as twisted pair).
- It is highly efficient as it prioritises messages based on IDs, and it is flexible by allowing the connection of new ECUs at any given time.
CAN Bus automation, essential for engineers.
Why was the CAN bus invented, and by whom?
How does CAN bus work?
- One hundred twenty-five kilobits per second (125kbps) is a low-speed bus, and it has a maximum length of 500 metres.
- One megabit per second (1Mbps) is a high-speed bus, and the distance between devices should not surpass 40 metres.
Now, what type of wiring and voltages are used?
The CAN bus line is a high-speed data bus. Thus, it requires a terminator resistor at both ends to prevent part of the signal from reflecting and interfering with the incoming data. In other words, always remember to connect a resistor of around 120 Ohms at both sides.
What message frame does CAN use?
A CAN message or message frame has eight essential parts:
- Start of Frame or SoF. It is a dominant 0 bit that tells other ECUs that a message is coming.
- Identifier or CAN-ID. It contains the message priority and the functional address of the device.
- Remote Transmission Request or RTR. 1 bit long signal that allows ECUs to request messages from other ECUs.
- Control. 6 bits part of the message that informs the length of the data in bytes.
- Data. Up to 8 bytes and contains the actual data that needs to be scaled or converted to be readable.
- Cyclic Redundancy Check or CRC. A 16-bit check for data integrity.
- Acknowledgement or ACK. 2-bit that indicates the CRC process is okay or if retransmission is needed.
- End of Frame or EoF. It indicates the end of a CAN message and is 7 bits long.
So, how does the ECU understand the message?
The CAN standard does not specify how to translate or handle a message. As a result, standardised protocols exist to define how ECUs communicate data among each other in a given network. The most common ones are:
SAE J1939. The Standard in-vehicle network for buses, trucks and other heavy-duty machines relies on the extended 29 bit CAN-ID. A Suspect Parameter Number (SPN) identifies data parameters, which are, in turn, grouped in Parameter Group Numbers (PGN). So, it is possible to interpret messages using parameter tables from the J1939 standard. For example, the Hydraulic Temperature is in the 65128 PGN message, part of the 1638 SPN.
OBD-II. On-Board Diagnostic is a self-diagnostic and reporting capability that identifies what is wrong with the vehicle. Using a CAN logger or diagnostic tool to retrieve the standardised Diagnostic Trouble Codes (DTCs) generated by this protocol.
CANOpen. Industrial automation applications used it widely. It builds on CAN in terms of the physical layer (number of lines used and voltages) and the data link layer (CAN frame message-based protocol). The data conversion will vary depending on the specific application.
Is CAN bus being improved?
Yes! The most recent CAN developed is the CAN FD or CAN with Flexible Data Rate, which is compatible with existing CAN 2.0 networks. CAN FD is quite similar to CAN 2.0, except for a new data frame format that allows using different data lengths and switching to the fastest bit rate after deciding the operation. Bosh developed CAN FD in 2011, and they released it in 2012 for commercial use. This new CAN bus can operate at fifteen megabits per second (15Mbps) with a maximum length for stubs of 10 metres.