quick intro to Vehicle control protocols-CAN, FlexRay, LIN, MOST, UDS

Submitted by Ashutosh on Mon, 10/15/2018 - 13:53

Hi,

I am a freshman and have been working as an intern at a local car ECU service providers. Tomorrow I am going to sit for an interview with Nissan and I am preparing hard for it. I am confident with wiring harness sensors and other basic stuff that I have been working on so far. But I know nothing about the communication protocols that are being used in cars, although they are not important for my job profile I would like to know few basic things about them just to boost my confidence level. 

I am listing the protocols below, can someone give a brief intro on them 

  1.  CAN Protocol
  2. Drive Train CAN
  3. Convenience CAN
  4. Flexray
  5. Local Interconnect Network (LIN)
  6. Media Oriented System Transport (MOST)
  7. Unified Diagnostic Service (UDS)

I am not sure if I am the right person to answer this question, because my experience and knowledge is very limited so take this with a pinch of salt. But I cn sure provide you some very basic information about CAN if it would support your interview.

CAN Protocol:

The CAN protocol stands for Controller Area Network Protocol, it is kind of similar to other communication protocols like  USART, SPI, I2C etc, but is very efficient than all those and widely used in vehicles like Car, Truck, Bus etc.

The ultimate duty of this CAN is to connect various ECU (Electronic Control Unit) a.k.a Nodes inside a car and allow them to communicate with each other, since these ECU’s will be present at different parts of the car. An example would be you Airbag sensor ECU, Hydraulic sensor ECU etc. A modern car could have upto 70 ECU inside them and it is the duty of the CAN protocol to enable communication between 70 ECUs without causing an overload

But, why is CAN so popular than other protocol?

The reasons are listed below.

  • Low Cost – The CAN bus uses only two wires to communicate with all nodes, this way the number of wires required are less. So less copper and hence low cost  
  • Centralised – CAN protocol features a Central Error diagnostics. Al the ECU will be aware of the Error if any occurs
  • Robust – CAN wiring uses the typical twisted pair cable which makes it robust to EMI, also the protocol is very reliable
  • Efficient – Every message in CAN protocol has a priority, this way more urgent messages can be addressed immediately thus making it efficient.
  • Flexible – Every ECU(Chip) receives all transmitted message and hence inclusion/Remove of additional Node is easy thus making it flexible.

 

History:

I normally don’t stress in history, but since you said it is an interview lets scratch the surface. The Idea of CAN was first coined by BOSH in 1986. Then after we works it was finally released in 1991 as two versions CAN2.0(A) which is 11-bit and CAN2.0(B) which is 29-bit.

Then as technology progressed they released more versions like Flexible CAN released in 2012 then blah.. Blah.. blah...

It is also important know that CAN protocol is not limited to vehicles, apart from vehicles it is also used in Drones, Submarine, Prosthetic Limb and is even expected to support autonomous vehicles of the future.

 

CAN Connection and working rough idea:

Now let us look how the different ECU (nodes) will be connected in a CAN network. There are many ways to do this, for simplicity let’s look at the High-Speed CAN.

1.PNG

As told earlier each Node has two wires, the CAN_H and CAN_L all the information has to be exchanged by these two wires only. Every Node will have to main elements inside them they are the ECU transceiver and the ECU controller. From diagram you should be able to tell that whatever message is transmitted by any of the ECU, the message will reach all the Nodes in the network. So each message will have an unique identifier which will be read by all ECU and if that identifier’s data is required they proceed reading it else the message is neglected.  

Note that in real wiring there will be more than two wires since the ground wire is required for forming twisted pair connection.

 

 

CAN protocol bit format **Important**:

To understand any protocol you should know about its bit format and what they do, for can protocol consider these are the main important 8-key parts. For understanding assume that this is for 11-bit CAN2.0 (A) . The bit format is shown in the picture below

CAN Protocal Data Layout.PNG

To give a brief idea the SOF and EOF are the starting and ending. After the SOF we have CAN ID which tells the node about the message and from where it is coming from. The RTR bit is used to request for a message from a Node, if this bit is sent then the nodes receiving it will understand that some data is being requested for.

Then the Control bit contains some information about the data in the message. This information includes the length of the message etc, and can be used by the receiver to check of the data was read valid. Then the actual data comes in, note that this data can only be 64-bit (8-bytes) long. Then we have the CRC which checks if the data received was correct. Finally the ACK bit is sent to indicate a successful exchange and finishes the message with EOF.

 

Dominant and recessive bits in CAN:

If you put a probe on the CAN_H and CAN_L lines and take it to a scope you will get something like this. This that you have note here that can operates at 5V (some case also uses 3.3V) and when the bit is low (0) the CAN_H goes to 3.5V and CAN_L goes to 1.5V this stage is called the Dominant stage and when the bit is high (1) both CAN_H and CAN_L maintain at 2.5V this stage is called the recessive stage. We obtain 2.5V because the CAN_H and CAN_L lines are terminated with 120 ohm resistors which forms a potential divider (1/2)Vcc.

3.PNG

Apart from this you have know few other things if you need to understand CAN. As we sae the length of data can only be 8-bytes for any data more than that we need to use other common standards like SAE J1939 which deals with the extended 29-bit identifier

CAN also pave the way to OBD-II –On board diagnostics tool, which is present in almost every car today. Simply connect to this port using a OBD-II cable  and you can read all the data across the CAN bus this can be used to notice standardise error, get reports and even log them using CAN data logger.

There is also something called CANopen which is used in industrial automation, you also skim though it if you are interested.

 

Bit Stuffing in CAN:

Bit stuffing is a peculiar thing with CAN protocol so let’s discuss that too. Since CAN bus is asynchronous communication and we need to send data to all nodes, it must somehow re-sync with the bus. To do this the each nodes transceiver will try to re-sync when the signal changes from recessive to dominant.

But this will not be possible if the data bits are not changing, So they do not want more than 5 consequent bit in the same polarity so we deliberately stuff a bit after five bit so that the transceiver can re-sync. This is called bit stuffing.

There are lot more to cover but for now, let’s wind up with this. As far the other protocols are concerned I am also a new to them. But a quick google search made me understand these.

 

Flexray: Expensive, but is faster and more reliable than CAN. Dual channel configuration allows more bandwidth so no congestion problem.

Lin: Local Interconnect network cheaper than CAN but is also slower. It is a one wore communication.

Most: MOST (Media Oriented System Transport) was introduced at the beginning of this century to simplify the integration of infotainment ECUs into the vehicle thanks to its special communication mechanisms and high data rates.

UDS: Unified Diagnostic Service. Pre-defined Diagnostic protocol

 

  Joined September 07, 2017      256
Thursday at 12:15 PM

Thanks. It's a simple note to understand CAN protocol.

  Joined October 28, 2021      1
Thursday at 11:04 AM

which of the following number of flexray nodes in passive star topology is/are generally used

  Joined June 23, 2021      1
Wednesday at 08:08 PM

Great answer!

  Joined February 12, 2018      696
Monday at 02:11 PM