Differences between LIN, CAN, and FlexRay Protocols
Today’s automobiles are not just about engines and wheels, it is much more. The factor that defines these automobiles is the electronic functionality with advanced technologies and safety features embedded in them. These electronic functions are controlled by Engine Control Units (ECUs), Transmission Control Units (TCUs), and Body Controlled Module (BCM). These control units need to be interconnected and they must communicate with each other. To establish this communication, there are several protocols, out of which the Local Interconnect Network (LIN), Controller Area Network (CAN), and FlexRay are predominantly used. Each of these protocols is used for different applications depending upon their behavior and characteristics.
Now, let us look at the brief introduction of these protocols.
LIN Protocol: LIN stands for Local Interconnect Network; it is a serial communication and low-cost protocol for various low-speed and non-critical electronic applications in an automobile. It is a master-slave type of communication-based on a polling strategy (like UART) and it is half-duplex or one-way communication at a given time. There is 1 Master and up to 15 slaves on a LIN bus. The communication between the Master and Slaves happens through a fixed frame structure initiated by the master always. The slave/(s) respond to the header accordingly. It is important to note that, sometimes the master can respond to its header.
CAN Protocol: CAN stands for Controller Area Network, which is a serial communication protocol supporting distributed real-time control with a very high level of security and efficiency. It is a broadcast type of protocol, in which the concept of ‘Master’ and ‘Slave’ is not present. The communication between nodes happens in a fixed frame structure. Any device/node having an update over a specific activity from any application could transmit the corresponding frame and every other device/node on the bus could read this frame and respond to it correspondingly. During such a situation, conflict on the bus is inevitable. This is resolved by ‘bit-wise arbitration’.
FlexRay Protocol: FlexRay is a fault-tolerant, deterministic, and high-speed automotive networking serial communication protocol. The fundamental idea of designing the FlexRay protocol was to meet the high-speed requirements of various applications in an automobile. Even in this protocol, multiple nodes are trying to communicate and there is no master-slave concept present. Each node is given a specific time during which the communication happens. A fixed frame structure is used to communicate between the nodes.
Now, let us look at the similarities and differences between these three protocols.
Parameters | LIN | CAN | FlexRay |
Architecture | Single master and up to 15 slaves | Multiple nodes (20, 32) | Multiple nodes (up to 64) |
Medium access or Bus access | Polling method | CSMA-CR method | TDMA method |
Topology | Bus topology | Bus topology | Bus/Star topology |
Message transmission | Synchronous | Asynchronous | Synchronous/Asynchronous |
Data rate or Baud rate | Max. 20kbps | Max. 1Mbps | Max. 10Mbps |
Bit coding | NRZ | NRZ and bit stuffing | NRZ |
Error checking mechanism | Checksum over the Protected Identifier and Data fields | CRC computation over the entire frame | Two CRC computations.
1. Header CRC: Over the header field (starting from the Sync frame indicator field) 2. Trailer CRC: Over the entire frame |
Hamming Distance (HD) | HD for the checksum is 2 | HD for the CRC computation is 6 | HD for the header CRC is 6 and for the trailer CRC it is 6 up to 2048 bits and 4 for data up to 4096 bits. |
Physical layer | Single electrical wire | Electrical dual wire | Dual wire – optical or electrical operating |
Operating voltage | 8v to 9v | 3.3v | Differential voltage of +2.0v |
Cabling impedance | 1k ohms | 120 ohms | 80-110 ohms |
Range | 1-5 kilometers | 40 meters | 10 meters |
After getting an idea about the differences, now let us look at their pros and cons.
Advantages of LIN protocol:
- As LIN is a single wire-based interface, it reduces the cost and the complexity of implementation.
- LIN is self-synchronized and therefore no need for external oscillators.
- LIN is the best and the most suited alternative to the CAN for applications that do not need high bandwidth and that are of low speed.
Disadvantages of LIN protocol:
- Since LIN is a low speed, it is not considered for safety and other important applications.
- The communication is always initiated by the master and therefore when the master device fails then the whole bus gets failed.
- There are no strong error-checking mechanisms in LIN.
Advantages of CAN protocol:
- CAN is used in different electrical environments which offers noise-free transmission.
- In CAN any node on the bus can initiate the communication and any node can respond. Therefore, the failure of one device/node will not lead to the failure of the entire system.
- CAN protocol offers strong error-checking mechanisms.
Disadvantages of CAN protocol:
- CAN bus is more expensive than the LIN
- Implementing CAN is a bit more complex than that of LIN due to the increased number of nodes.
Advantages of FlexRay:
- FlexRay is a deterministic, fault-tolerant, and high-speed protocol than that CAN protocol and therefore FlexRay is mostly used in safety-critical applications.
- Since FlexRay is a synchronous protocol, it synchronizes its nodes without an external synchronous clock.
- The star topology of the FlexRay reduces the exposed wire for the segment which in turn decreases the noise.
- It has a better error-checking mechanism compared to LIN and CAN.
Disadvantages of FlexRay:
- It is expensive compared to LIN and CAN protocols.
- It is a bit complex to implement
- It has lower operating voltages
Now, let us look at the applications of these protocols.
Applications of LIN
LIN is used in non-critical applications like:
- Sunroof sensors
- Light sensors
- Wiper sensors
- Climate control sensors
- In engines for engine fan cooling sensors
Applications of CAN
- CAN is used as a controller which makes direct communication with Engine Control Units (ECUs) for applications that are used by LIN.
- CAN also find its application outside the automotive industry such as in Avionics, Industrial automation, and escalators and elevators.
- CAN is used for internal hardware communication of a control unit or a CPU inside Battery Management Systems (BMS).
Applications of FlexRay
FlexRay is used in safety-critical applications like:
- Power train module
- Safety suspension
- Adaptive Cruise Control
Finally, to summarize, it all depends on the application requirements to choose between these three protocols. Despite their cons, all three of them serve their purpose to their best for a given application. Therefore, these protocols are widely used in automotive applications and other industrial applications even to this date.
ABOUT THE AUTHOR
Sumukha Bharadwaj is an FPGA Design Engineer at Prodigy Technovations. He has a Master’s Degree in Engineering – Information Technology from SRH Hochschule Heidelberg University, Heidelberg, Germany. His area of interest includes Digital Systems Design, Avionics, Automotive Electronics, and Embedded Systems.