Professional Documents
Culture Documents
Abstract—The Controller Area Network (CAN) protocol was CPU loads in a given system, and cannot be implemented
originally developed for distributed automotive applications in without changes at the hardware level. Additionally, with
the 1980s, and has previously proved to be extremely popular for the evolution of mechatronic technology, in many situations
the implementation of low-cost distributed systems. Whilst CAN
has many features that make it suitable for such applications, the increased complexity and distribution of modern control
it also has a number of well-discussed drawbacks; data trans- system requirements also dictates a need for high-bandwidth
mission is limited to a fixed 8-byte payload at 1 Mbps, and the networks, capable of delivering information throughput at a
hardware bit-stuffing mechanism and automatic retransmission level that is not directly achievable with CAN, or any software-
scheme can act to severely decrease the predictability of a CAN based protocol to be employed with its standard hardware.
network. This paper will describe a modified CAN-like protocol
controller that can be implemented on a programmable-logic This paper will describe a modified CAN-like protocol
device such as an FPGA. The modified protocol controller can controller that can be implemented on a programmable-logic
help to ameliorate one of the drawbacks of CAN, whilst operating device such as an FPGA. The modified protocol controller can
as closely as is possible to the original protocol specification. help to ameliorate many of these drawbacks inherent in CAN,
Specifically, this paper will discuss an implementation of a simple
extension to the original protocol that allows for larger payloads, whilst operating as closely as is possible to the original
coupled with modifications to the bit-stuffing mechanism to protocol specification. It is suitable for use in distributed
increase predictability. The effectiveness of this modified CAN and embedded systems which require one (or more) of the
controller is illustrated in a series of experiments employing following features:
a novel test facility. The paper also discusses the potential
drawbacks of the new controller, and is then concluded by 1) The modified protocol controller can be operated, if
suggesting possible areas of further research. desired, as a fully-conformant, standard CAN controller;
2) One or more messages can be sent with a fixed (and
I. I NTRODUCTION hence predictable) transmission time regardless of the
This paper is concerned with the implementation of dis- payload contents;
tributed embedded systems where predictable timing be- 3) One or more messages can carry a payload of up to 1024
haviour and high information throughput are key system bytes;
requirements. The Controller Area Network (CAN) protocol 4) The bit-rate of one or more messages can be dynamically
[1] has previously proved to be extremely popular for the increased to up to 10 Mbps during data transmissions,
implementation of low-cost distributed systems that require whilst maintaining the priority-based arbitration scheme;
predictable timing behaviour. Whilst CAN has a number of The remainder of this paper is organised as follows. Section
beneficial features - such as comparatively low overheads, non- 2 reviews previous related work that has been performed with
destructive priority-based message arbitration, low message CAN in this area. Section 3 builds on this discussion, and
latency and good error detecting abilities-it also has a number proposes an enhancements to the CAN protocol to achieve
of well-discussed drawbacks. These drawbacks include (but the additional features as listed above. Section 4 describes
are not limited too) predictability and replica-determinism the implementation of this modified CAN controller on an
issues, information throughput restrictions, and variability in FPGA platform and a case-study that have been performed to
message transmission times due to bit-stuffing. assess the performance of the new controller, using a novel
Although many modification to the CAN protocol have test-facility. Section 5 discusses the results of the case study
previously been reported to help overcome these drawbacks presented in section 4 and section 6 will discuss the benefits -
this will discussed in more depth in section 2 - many of these and drawbacks - of the enhanced protocol and concludes the
techniques can be complex to implement, place measurable paper.
1737
III. P ROPOSED ENHANCEMENTS TO CAN AT THE
HARDWARE LEVEL
1738
Fig. 3. Chipscope Snapshot of Enhanced CAN Transmitter
than 8 bytes upto 1024 bytes and also can overclock in S- 1) The fact that the integrity of the data in this field is not
zone reference Figure 2. This snapshot depicts a 15 byte a required feature
message overclocked from 1 Mbps to 5 Mbps been with 2) The Data Plus field has not been added to the Error
additional Data Plus field transmitted successfully, we give Management Logic of the CAN protocol [1].
a brief account of the transmission state machine. 3) The Length of Data Plus is calculated on the local
1) Tx State xxx signals indicates different states of trans- node and it depends upon the CAN DLC (Data Length
mission cycle, the states before Tx State Data are send- Code) field hence there is zero possibility of this type
ing data at 1 Mbps, then the Data, CRC and Data Plus of error. In case of DLC been received incorrectly by
fields are overclocked to be transmitted at 5 Mbps. This the receiving nodes an error frame is generated and no
is also shown by the Sample Point field which indicates further transmission takes place [1].
the sampling interval of the CAN bits.
2) Number of bits field indicate the count of CAN mes- IV. C ASE S TUDY
sage bits transmitted since the start of the frame includ- In this section we will discuss the results obtained in our
ing any stuff bits, Marker ’X’ shows the same count case study, before this we will give a brief account of the Test
which is ’168’ i.e. the total number of bits already bench formed to conduct this study.
transmitted before Data Plus field. The test bench consist of 4 CAN nodes, each node consist
3) The Length of Data Plus field as explained before will on a development board with integrated FPGA and a host
be the difference calculated by subtracting Equation 1 ARM controller. One of the CAN nodes was working as a
from Number of bits. This difference is indicated by transmitter node while the other three nodes primarily worked
the Max bit diff field which in this test case is 28. as receiver’s but was setup to generate messages randomly to
4) The Data Plus field will last for 28 bit time and will send create a real world CAN network. The transmitter node was
alternate ’0’ and ’1’ to compensate for the worst case setup to generate a message at an interval of 1 millisecond,
message, (the choice of alternate bits is the minimize where a message of random length and contents was generated
the chances of stuffing even in case of erroneous trans- each time, also after every 50 message transmissions a best
mission/reception of a single or number of bits). This and worst case stuffed message was inserted. An independent
will make the total bits sent as ’196’ added the fixed 9 ARM board was setup to receive two signals one each from
bits of Acknowledgement and End of frame fields. This transmitter and one of the slave node, this was used to capture
number is equal to possible worst case frame length of the transmission time between start of a message on transmitter
a 15 byte CAN frame. and successful reception on a receiver node. These test were
The enhancement has been designed such that in case of any conducted over different periods ranging from 2 to 24 hours
erroneous bit transmission in Data Plus field no error frame continuously.
will be generated because The results of the study is given in Figure 4 and Table-I,
1739
Fig. 4. Average vs Ideal transmission times Fig. 5. Worst Case vs Best Case transmission times
1740
easily be integrated with nodes running the standard CAN [5] M. Nahas, M. Pont, and M. Short, “Reducing message-length variations
protocol by utilizing the CAN reserved bits r0 and r1. Hence in resource-constrained embedded systems implemented using the con-
troller area network (can) protocol,” Journal of Systems Architecture,
a particular logic level of r0 and r1 will indicate the CAN vol. 55, pp. 344–354, 2009.
controller not to overclock and add the Data Plus field making [6] T. Nolte, H. Hansson, C. Norstrm, and S. Punnekkat, “Using bit-stuffing
this implementation backward compatible. Also, in any given distributions in can analysis,” in IEEE Real-Time Embedded Systems
Workshop, Proceeding, Dec 2001.
design the use of the Data Plus field need not be employed [7] M. Nahas and M. Pont, “Using xor operations to reduce variations in
for every message that requires transmission over the CAN the transmission time of can messages: a pilot study,” in Proceedings of
network. It is especially suitable for systems which utilize the Second UK Embedded Forum 2005, A. Koelmans, Bystrov, A. Pont,
R. M Ong, and A. Brown, Eds., Birmingham, UK, October 2005, pp.
periodic time reference messages such as the shared clock 4–17.
familly of protocols described by [14]. [8] G. Cena and A. Valenzano, “Fastcan: a high-performance enhanced can-
like network,” Industrial Electronics, IEEE Transactions on, vol. 47,
VI. C ONCLUSION no. 4, pp. 951–963, Aug 2000.
[9] G. Cena and Valenzano, “Overclocking of controller area networks,”
This paper has considered an implementation of a modified Electronics Letters, vol. 35, no. 22, pp. 1923–1925, Oct 1999.
CAN controller which can help to improve the transmission [10] I. Sheikh and M. Short, “”improving information throughput in con-
troller area networks: Implementing the dual-speed approach”,,” in 8th
predictability of some (or all) messages in a CAN network. As International Workshop on Real-Time Networks, Proceedings, Dublin,
has been shown in the paper, the addition of a ’data plus field’, Ireland, 6 2009.
has the ability to virtually eliminate transmission jitter. The [11] S. Ziermann, T. Wildermann and J. Teich, “Can+: A new backward-
compatible controller area network (can) protocol with up to 16x higher
modified controller has been shown capable of transmitting data rates,” in 2009 Design, Automation and Test in Europe, April 2009,
CAN frames with an increased data payload size, and the pp. 1088–1093.
presented techniques are also applicable and effective in these [12] H. Kopetz and G. Grunsteidl, “Ttp - a time-triggered protocol for fault-
tolerant real-time systems,” pp. 524–533, 1993.
cases. [13] FlexRay communications system - protocol specification v3.0, Flexray
Although initial experiments with the technique indicate its Consortium, December 2009. [Online]. Available: www.flexray.com
effectiveness, it does have several drawbacks; it seems unlikely [14] D. Ayavoo, M. Pont, M. Short, and S. Parker, “Two novel shared-clock
scheduling algorithms for use with ’controller area network’ and related
that such a scheme can be made backwardly-compatible with protocols,” Microprocess. and Microsyst., 2007.
existing CAN implementations. When employed in a mixed [15] I. Sheikh, M. Pont, and M. Short, “Hardware implementation of a
system with one or more standard CAN controllers, numerous shared-clock scheduling protocol for can: A pilot study,” in Fourth UK
Embedded Forum, proceedings, University of Southampton, September
errors (most notably bit stuffng and CRC errors) are observed 2008.
and signalled. A potential area of future work would be
examining any possible impact of the techniques on bit-error
susceptibility and message transmission failure-rates in noisy
environments. In conclusion, with appropriate care in the
implementation stages, the proposed modifications to the CAN
protocol described in this paper seem to indeed be feasible and
may have the capability to further increase the applicability of
this popular protocol for systems that have stringent real-time
requirements.
ACKNOWLEDGMENT
The work in this paper is supported by the award of a
PhD scholarship to Sheikh Imran from the NWFP University
of Engineering & Technology, Peshawar, Pakistan through
the Higher Education Commission of Pakistan. Preliminary
versions of the some of the material described in this paper
were presented at the 4th UK Embedded Forum ([15]) and the
8th International workshop on realtime networks ([10]).
R EFERENCES
[1] ISO 11898-1 Road Vehicles -interchange of digital information
-controller area network (CAN) for high -speed communication, Inter-
national Standardization Organization (ISO), 1993.
[2] H. Kopetz, “A comparison of can and ttp,” vol. 24, 2000, pp. 177–188.
[3] T. Nolte, H. Hansson, and C. Norstrm, “Minimizing can response-
time jitter by message manipulation,” in 8th Real-time and Embedded
Technology and Applications Symposium, Proceedings, 2002, pp. 197–
206.
[4] M. Nahas, M. Short, and M. Pont, “The impact of bit stuffing on the real-
time performance of a distributed control system,” in 10th International
CAN conference,Proceeding, Rome, Italy, March 2005, pp. 10–1 to 10–
7.
1741