Improved Automotive CAN Protocol Based On Payload
Improved Automotive CAN Protocol Based On Payload
Abstract
In this research paper, the implementation strategies of automotive controller area network
protocol are investigated and the short messaging scheme with selective bit stuffing method to
improve the effective utilization of its bandwidth has been proposed. There would be a sharp de-
crease in the performance of traditional CAN protocol because of considerable increase in the
number of ECUs (Electronic Control Units) and infotainment gadgets connected in the vehicle ar-
chitecture. The demand for safety, emission, diagnostics and comfort norms has steeply in-
creased the number of messages in the 250 Kbps CAN network as the computational power of
ECUs has gone up. To overcome this problem, the short CAN method has been proposed and the
work is benchmarked with SAEJ1939 Heavy commercial vehicle CAN standard. The Matlab Simu-
link based short CAN has been modeled and the performance of the proposed system has eva-
luated using virtual instrument cluster. Experimental results have shown that compared to the
traditional CAN, the proposed method has reduced the worst case response time of CAN extended
frame from 160 µ sec to 144 µ sec. Selective bit stuffing technique has reduced the impact of bit
stuffing over the payload and improved the utilization factor for the CAN bus without affecting
the CAN message ID properties. The proposed algorithm has been modeled and simulated using
CAN Matlab model Simulink and it has been verified using virtual CAN tool and real time CAN bus
hardware.
Keywords
CAN, Selective Bit Stuffing, Payload Reduction, Worst Case Response Time
How to cite this paper: Vinodh Kumar, B. and Ramesh, J. (2016) Improved Automotive CAN Protocol Based on Payload Re-
duction and Selective Bit Stuffing. Circuits and Systems, 7, 3415-3429. http://dx.doi.org/10.4236/cs.2016.710291
B. Vinodh Kumar, J. Ramesh
1. Introduction
The computational power of the microprocessor and microcontroller keeps on increasing along with the demand
of sophisticated vehicle electronics. The complexity of automobile electronics has now become much more
complicated as the requirements of vehicle to vehicle data communication systems, navigation systems and oth-
er driving assistance systems are steadily growing [1]. In the cost competitive commercial vehicle business, it is
challenging for the automobile original equipment manufacturers have a greater responsibility of delivering safe
vehicles to sustain world class standards. In this research work, instrument cluster model of a heavy commercial
vehicle is being designed using Matlab Simulink and verifies the implementation of short CAN over SAEJ1839
messages with selective bit stuffing. Two virtual Controller Area Network (CAN) nodes have been developed
and made communicated with each other as per SAEJ1939 standard. In a basic commercial vehicle, one CAN
bus connects all power train related Electronic Control Units (ECUs) such as ABS, Engine control unit, Trans-
mission control units and much more. When it comes to hybrid vehicle or pure electric vehicle, the number of
ECUs connected in a vehicle is doubled. Most of the ECUs use CAN as a main communication protocol and it is
supposed to be working at 250 Kbps. Research work of Peng Hao and Yang Shun clearly shows that Rate Mo-
notonic based CAN bus network messages will meet all its deadline only when its utilization rate is not above
30% [2]. To overcome this problem, OEMs would always prefer 2 to 3 CAN bus for handling the bandwidth
scarcity problem with an increase in the vehicle cost.
Alternate communication protocols like fast CAN, LIN, Flexray and MOST are being considered by vehicle
manufactures. But when it comes to cost, performance, reliability, safety, standardization and vendor support
CAN outperforms all the other networks. All vehicle network protocols are classified according to their operat-
ing speed, length, cost and safety features. Steve C. Talbot and Shangping Ren’s work on automotive commu-
nication protocols discusses about CAN, LIN and Flexray protocols which are mostly used in vehicle powertrain
and safety [3]. LIN is preferred for the applications such as door control, window control, etc. because it sup-
ports less than 20 Kbps speed and it is viewed as a sub bus for CAN network. Controller Area Network comes in
three speed grades such as basic CAN with 125 Kbps, low speed CAN with 500 Kbps and high speed CAN with
1 Mbps. Depending upon the vehicle architecture requirement, low speed and medium speed CAN are being
used. Usually power train CAN is fitted with HS CAN as powertrain handles a higher number of messages and
infotainments. CAN is designed with low speed as it has to handle infotainment, information to instrument clus-
ter and the navigation systems. MOST is the special kind of protocol which supports more than 1 Mbps and it is
more suitable for audio video communication inside the vehicle
2. CAN History
In 1985, Bosch GmbH had developed CAN for in-vehicle network and then certified with ISO 11,898 interna-
tional standards. Since then several higher level protocols like CANopen and Devicenet have been standardized
for industrial automation. During 1986, Robert Bosch has introduced CAN at Society of Automotive Engineers
congress (SAE). Since 1994, several higher-level protocols have been standardized on CAN, such as CANopen
and DeviceNet. In February of 1986, Robert Bosch GmbH introduced the serial bus system CAN at the Society
of Automotive Engineers (SAE) congress. Since then CAN is being exclusively used in automotive in-vehicle
networking. Low cost, reliable, universal standardization, plug and play features with Automatic error correction
and detection mechanism makes this CAN protocol as an ideal choice for safety critical applications, but at 250
kbps along with bit stuffing technique for synchronizations and error detection that increases worst case re-
sponse time and slows the system performance.
3416
B. Vinodh Kumar, J. Ramesh.
3417
B. Vinodh Kumar, J. Ramesh
Version Features
is followed by SRR/RTR which stands for Identifier Extension Bit. This bit actually indicates whether the frame
format is standard or an extension version. The IDE bit transmitted in the Standard Format is “dominant”, whe-
reas in the Extended Format the IDE bit is recessive. Control bit consists of six bits in which IDE is used to
identify the standard and extended frame formats. R0 and R1 are reserve bits. These reserved bits have to be sent
as “dominant”, but receivers accept “dominant” and “recessive” bits in all combinations. DLC stands for Data
Length Code which is 4 bit wide used to represent the data length 0000, stands for 0 bytes and 1000 stands for 8
byte.
Depending upon the DLC length, the data filed would carry the required data which each contain 8 bits which
are transferred MSB first. Table 2 lists the different types of fames in CAN communication.
4. Bit Stuffing
In CAN message transmission, bit stuffing is done at the transmission side and removed at the receiver end.
During bit stuffing a non information bit is inserted by the controller during the data sequence of 5 similar bits
which would be a complimentary logic to the sequence as shown in Figure 3 Bit stuffing is done to limit the
3418
B. Vinodh Kumar, J. Ramesh.
number of consecutive bits of the same value in the data to be transmitted and the receiver does not need any
extra information about the location of the bit stuffing in order to do the de-stuffing. Any violation of this rule is
understood as a bit stuffing error in the network.
3419
B. Vinodh Kumar, J. Ramesh
Type Message ID size in bits Total bit size in bits Maximum possible bit stuffing
CAN 2.0A
11 135 24
(No of bits)
CAN 2.0B
29 160 29
(No of bits)
the bitmask or the complement of the bitmask it will be transmitted without masking. The algorithm explains
this method.
(1)
The calculation of the worst case response time of each message in the CAN network is guided by Response
time analysis and hence it could be compared with the dead line of the message to verify the schedule of mes-
sages. Three different parameters that influence worst case response time are queuing jitter Jm, queuing delay qm
and transmission time Cm.
Queuing jitter Jm—longest time between event initiation and message being queued before ready for transmit
on the CAN bus.
Queuing delay qm—maximum time that a message spends in the CAN node before successful transmission on
the CAN bus.
Transmission time Cm—maximum time that a message could take for transmission.
Inherited from sender’s task, the effective queuing time is given by
(2)
where
Cj is the transmission time of message j
Tbit is the bit time
hp(m) is the high priority set of messages than that of m
lp(m) is the low priority set of messages than that of m
3 × Tbit is considered as inter frame gap as a port of the data frame represented in Tindell calculation.
Maximum blocking time or worst case blocking time of a frame sent on Sm
(3)
3420
B. Vinodh Kumar, J. Ramesh.
The maximum blocking time of a CAN message happens when a low priority message starts to transmit just
before a message m is placed when it is ready to transmit. This message m has to wait for the low priority mes-
sage to transmit completely and bus goes to idle. The time duration is represented as Bm called maximum block-
ing time.
(4)
The CAN standard specifies that the maximum data payload is 8 byte and lest is at 0 byte. Sm denotes the
maximum number of bytes of payload of a packet and Tbit specifies the bit time of a single bit.
Transmission time of a CAN message is represented as
(5)
For CAN 2.0A has g value of 34 and CAN 2.0B has g as 54, where g is the number of frame header subjected
to bit stuffing. Maximum transmission time is denoted as Cmax and minimum transmission time is denoted as C
min. Applying Sm = 0 and Sm = 8 on equation (5) we get
(6)
(7)
To understand the impact of payload versus the CAN unitization, the payload size has been applied on above
equation 6 and 7 to compute the utilization factor. Table 4 has been computed to understand the payload impact
which clearly indicates that there is a significant improvement in unitization rate of standard and extended frame
formats. The utilization rate of CAN for standard is 26% and extended is 29%, it is understood that all the mes-
sages in the network are schedulable under this value and without any deadline missed.
Bytes C min Std C min Ext C Max Std C Max Ext Utilization Rate Std Utilization Rate Ext
0 47 67 55.25 80.25 45.9 45.5
1 47 67 65.25 90.25 41.2 42.6
2 47 67 75.25 100.25 38.4 40
3 47 67 85.25 110.25 35.5 37.7
4 47 67 95.25 120.25 33 35.7
5 47 67 105.25 130.25 30.8 33.9
6 47 67 115.25 140.25 28.9 32.3
7 47 67 125.25 150.25 27.2 30.8
8 47 67 135.25 160.25 25.7 29.4
focus on optimum payload size to handle bandwidth requirement. This proposed short works in payload size
3421
B. Vinodh Kumar, J. Ramesh
from 0 byte to 4 byte maximum. Payload reduction in any networked communication increases the network uti-
lization as the overhead for a single packet is being reduced. The above study about the controller area network
protocol follows in the same fashion. Optimum payload for the real time communication protocol like CAN has
to be of four bytes. Because both standard and extended protocols have almost same utilization factor of 33 and
35.7, planning larger number will have the same impact on the utilization factor.
In CAN standard and extended protocol version it has been defined that the Message pay load size various
from 0 to 8 bytes and in short CAN it is defined to be 0 to 4 bytes. Table 5 shows clearly that whenever the
payload size of the CAN is reduced from 64 to 32, the maximum transmission time of CAN 2.0A reduces from
135 to 95 and for extended CAN frame format CAN 2.0B, the transmission time has been reduced from 160 to
120. The calculation is made for 1 Mbps gross bit rate and one bit is computed as 1 µSec.
In the proposed Short CAN frame format, all the Start of Frames (SOF) and Message Identifiers which arbi-
trate with other messages follow the same standard protocol of 11 bits for standard and 29 bits for extended
CAN frame format. Control bit is 6 bits, CRC 15 and CRC delimiter, ACK delimiter and ACK slot shares one
bit each. Maximum bit stuffing values are taken for the computation purpose.
Bit Name CAN 2.0A CAN 2.0B Short CAN 2.0A Short CAN 2.0B
SOF 1 1 1 1
Identification bits 11 11 11 11
SRR x 1 x 1
IDE x 1 x 1
Identification bits x 18 x 18
RTR 1 1 1 1
Control bit (Max) 6 6 6 6
Data bits 64 64 32 32
CRC 15 15 15 15
CRC delimiter 1 1 1 1
Bit stuff max 24 29 16 21
ACK slot 1 1 1 1
Ack delimiter bit 1 1 1 1
End of frame 7 7 7 7
Interframe space 3 3 3 3
Total (Maximum time µSec) 135 160 95 120
Table 6. SAE J1939 message ID and its fuctions.
3422
B. Vinodh Kumar, J. Ramesh.
6. Experimental Setup
Model based system design and development is a fast developing powerful design and analysis tool. The pro-
posed instrument cluster design is developed using vehicle network toolbox which provides real-time connectiv-
ity to the Matlab Simulink models, CAN transceivers and vector virtual CAN bus driver.
Model based designing is the latest design methodology in the field of automobile electronics. As the embed-
ded system software development depends on the High level languages like C, Embedded C, assembly level
languages and etc, development any small logic or control is completely depending upon the programming ca-
pability of a particular software development team. To overcome effective software development with limited
programming knowledge, model based software development has opened the doors of aspirant hardware engi-
neers to program the desired functionally in a common development platform like Matlab where actual control
or logic could be designed using Simulink blocks and the developed algorithm could be implemented in the tar-
get platforms
3423
B. Vinodh Kumar, J. Ramesh
PGN WITH
27
UNSPLITABLE…
PGN WITH SPLITABLE
150
DATA 8 BYTES
3424
B. Vinodh Kumar, J. Ramesh.
3425
B. Vinodh Kumar, J. Ramesh
payload from 24 bits to 8 bits in standard CAN messaging scheme and from 29 to 13 in extended frame format.
3426
B. Vinodh Kumar, J. Ramesh.
Table 8. Real time CAN data analysis results for peack load.
Frame length = 114 + (max no of stuff bits) = 114 + 8 Frame length = 131 + (max no of stuff bits) = 131 + 13
(with selective bit stuffing technique) = 122 (with selective bit stuffing technique) = 144
Net bit rate = ((11 + 1 + 4 + 64)/122) * 1 Mbps = (80/122) * 1 Net bit rate = ((29 + 1 + 4 + 64)/144) * 1 Mbps = (98/144) * 1
Mbps = 655.73 kbps Mbps = 680.55 kbps
same analysis was performed with different CAN message payloads. The selective bit stuffing was having ap-
proximate 650 kbps for standard and 680 kbps for extended CAN frame format.
Selective bit stuffing algorithm results for various payload has been listed in Figure 10. The Net bit rate has
increased from 579 kbps to 655.73 kbps for standard CAN 2.0A and for 680.55 kbps for extended CAN 2.0B
frame formats.
8. Conclusion
This paper presents a novel short CAN technique for effective utilization of available CAN bandwidth and ex-
plores the impact of selective bit stuffing over data payload without altering major modification in the existing
CAN protocol. Various experiments have been conducted on different payload sizes using Matlab Simulink and
the influence of payload; bit stuffing, worst case response time and busload have been studied. Smaller the
payload size is, smaller the bus load is. There was no performance degradation in Simulink working model si-
mulation and real time CANoe hardware with multi functional display has been shown on the study on 266 PGN
3427
B. Vinodh Kumar, J. Ramesh
30
25
20
15
10
5
0
No of Bytes
0 1 2 3 4 5 6 7 8
Utilization Rate Std 45.9 41.2 38.4 35.5 33 30.8 28.9 27.2 25.7
Utilization Rate Ext 45.5 42.6 40 37.7 35.7 33.9 32.3 30.8 29.4
messages. The implementation of short CAN is possible without any additional hardware and resources as clearly
indicated by benchmarking with SAEJ1939, thereby improving the protocol as backward compatible.
Future Work
The future work of the research work is to integrate short CAN technique and selective bit stuffing technique on
a single VLSI CAN IP core for ASIC and FPGA prototyping.
References
[1] Najafzadeh, S., Ithnin, N., Razak, S.A. and Karimi, R. (2014) BSM: Broadcasting of Safety Messages in Vehicular Ad
3428
B. Vinodh Kumar, J. Ramesh.
Hoc Networks. Arabian Journal for Science and Engineering, 29, 777-782.
http://dx.doi.org/10.1007/s13369-013-0686-y
[2] Hao, P. and Shun, Y. (2010) Computing Utilization Rate of Rate Monotonic Scheduling Mechanism in Controller Area
Network. 2010 IEEE International Conference on Vehicular Electronics and Safety (ICVES), Qingdao, 15-17 July
2010, 133-137. http://dx.doi.org/10.1109/ICVES.2010.5550934
[3] Steve C. Talbot and ShangpingRen (2009) Comparison of Field Bus Systems, CAN, TTCAN, Flex Ray and LIN in
Passenger Vehicles. 29th IEEE International Conference on Distributed Computing Systems Workshops, ICDCS
Workshops’09, Montreal, 22-26 June 2009, 26-31. http://dx.doi.org/10.1109/ICDCSW.2009.15
[4] Nahas, M., Pont, M. and Short, M. (2009) Reducing Message Length Variations in Resource Constrained Embedded
Systems Implemented Using CAN Protocol. Journal of Systems Architecture, 55, 344-354.
http://dx.doi.org/10.1016/j.sysarc.2009.03.004
[5] Nolte, T., Hansson, H., Norstrom, C. and Punnekkat, S. (2001) Using Bit Stuffing Distribution in CAN Analysis.
IEEE/IEE Real-Time Embedded Systems Workshop, London.
[6] Hassan, M.M. (2015) Bit Stuffing Techniques Analysis and a Novel Bit Stuffing Algorithm for Controller Area Net-
work. International Journal of Computer Systems, 2, 80-87.
[7] Sheik, I. and Short, M. (2009) Improving Information Throughput in Controller Area Networks: Implementing the
Dual Speed Approach. Proceedings of 8th International Workshop on Real Time Networks, Dublin, June 2009, 57-62.
[8] Sheikh, I. (2011). Doctor Thesis of Philosophy, University of Leicester, Leicester.
[9] Bosch, R. CAN Specification 2.0. Technical Report, Robert Bosch-Gmbh.
[10] Tindell, K., Burns, A. and Wellings, A.J. (1995) Calculating Controller Area Network (CAN) Message Response
Times. Control Engineering Practice, 3, 1163-1169. http://dx.doi.org/10.1016/0967-0661(95)00112-8
[11] Vinodh Kumar, B. and Ramesh, J. (2014) Automotive in Vehicle Network Protocols. 2014 International Conference
on Computer Communication and Informatics, Coimbatore, 3-5 January 2014, 1-5.
[12] Kokkolaras, M. (2004) Simulation-Based Optimal Design of Heavy Trucks by Model-Based Decomposition. Interna-
tional Journal of Heavy Vehicle Systems, 11.
Submit or recommend next manuscript to SCIRP and we will provide best service for you:
Accepting pre-submission inquiries through Email, Facebook, LinkedIn, Twitter, etc.
A wide selection of journals (inclusive of 9 subjects, more than 200 journals)
Providing 24-hour high-quality service
User-friendly online submission system
Fair and swift peer-review system
Efficient typesetting and proofreading procedure
Display of the result of downloads and visits, as well as the number of cited articles
Maximum dissemination of your research work
Submit your manuscript at: http://papersubmission.scirp.org/
3429