Can Tutorials 1
Can Tutorials 1
Many vehicles already have a large number If we also consider future developments
of electronic control systems. The growth of aimed at overall vehicle optimization, it be-
automotive electronics is the result partly of comes necessary to overcome the limitations
the customer‘s wish for better safety and of conventional control device linkage. This
greater comfort and partly of the govern- can only be done by networking the system
ment‘s requirements for improved emission components using a serial data bus system.
control and reduced fuel consumption. Con- lt was for this reason that Bosch developed
trol devices that meet these requirements the ”Controller Area Network” (CAN), which
have been in use for some time in the area has since been standardized internationally
of engine timing, gearbox and carburettor (ISO 11898) and has been ”cast in silicon”by
throttle control and in anti-block systems several semiconductor manufacturers.
(ABS) and acceleration skid control (ASC).
Using CAN, peer stations (controllers, sen-
The complexity of the functions implemented sors and actuators) are connected via a se-
in these systems necessitates an exchange rial bus. The bus itself is a symmetric or
of data between them. With conventional asymmetric two wire circuit, which can be
systems, data is exchanged by means of either screened or unscreened. The electri-
dedicated signal lines, but this is becoming cal parameters of the physical transmission
increasingly difficult and expensive as con- are also specified in ISO 11898. Suitable bus
trol functions become ever more complex. In driver chips are available from a number of
the case of complex control systems (such manufacturers.
as Motronic) in particular, the number of con-
nections cannot be increased much further. The CAN protocol, which corresponds to the
data link layer in the ISO/OSI reference mo-
Moreover, a number of systems are being del, meets the real-time requirements of
developed which implement functions co- automotive applications. Unlike cable trees,
vering more than one control device. For in- the network protocol detects and corrects
stance, ASC requires the interplay of engine transmission errors caused by electromag-
timing and carburettor control in order to netic interference. Additional advantages of
reduce torque when drive wheel slippage such a network are the easy configurability of
occurs. Another example of functions span- the overall system and the possibility of cen-
ning more than one control unit is electronic tral diagnosis.
gearbox control, where ease of gearchan-
ging can be improved by a brief adjustment The purpose of using CAN in vehicles is to
to ignition timing. enable any station to communicate with any
other without putting too great a load on the
controller computer.
There are four main applications for serial and seat and mirror adjustment. Parti-
communication in vehicles, each having dif- cular importance has to be attached here
ferent requirements and objectives. to the cost of the components and wiring
requirements. Typical data rates are
! Networking controllers for engine timing, around 50 kbit/s.
transmission, chassis and brakes. The
data rates are in the range - typical of ! In the near future, serial communication
real-time systems of 200 kbit/s to will also be used in the held of mobile
1 Mbit/s. communication in order to link compo-
nents such as car radios, car telephones,
! Networking components of chassis elec- navigation aids etc. to a central, ergo-
tronics and electronics which make the nomically designed control panel. The
vehicle more comfortable. Examples of functions defined in the Prometheus pro-
such multiplex applications are lighting ject, such as vehicle-to-vehicle and vehi-
control, air-conditioning, central locking cle-to-infrastructure communication will
A comparison of the requirements for vehicle Users Group”, which in turn is a member of
bus systems and industrial field bus systems the international users and manufacturers
shows amazing similarities: low cost, oper- group ”CAN in Automation”. Similar require-
ability in a harsh electrical environment, high ments to those of the textile machinery are to
real-time capabilities and ease of use are be found in packaging machinery and machi-
equally desirable in both sectors. nery for paper manfacture and processing.
The standard use of CAN in Mercedes- In the USA a number of enterprises are
Benz‘s ”S”Class and the adoption of CAN by using CAN in production lines and machine
US commercial vehicle manufacturers for tools as an internal bus system for networ-
fast transmissions (up to 1 Mbit/s) has made king sensors and actuators within the line or
industrial users prick up their ears. Not only machine. Some users, for instance in the
manufacturers of mobile and stationary agri- medical engineering sector, decided in fa-
cultural and nautical machinery and equip- vour of CAN because they had particularly
ment have chosen to use CAN, it has also stringent safety requirements. Similar pro-
been the choice of manufacturers of medical blems are faced by other manufacturers of
apparatus, textile machines, special-purpose machinery and equipment with particular re-
machinery and elevator controls. The serial quirements with respect to safety (e.g. robots
bus system is particularly well suited to net- and transport systems).
working ”intelligend” I/O devices as well as
sensors and actuators within a machine or Apart from the high transmission reliability,
plant. the low connection costs per station are a
further decisive argument for CAN. In appli-
The textile machinery industry is one of the cations where price is critical it is of essen-
pioneers of CAN. One manufacturer equip- tial importance that CAN chips be available
ped his looms with modular control systems from a variety of manufacturers. The com-
communicating in real time via CAN net- pactness of other controller chips is also an
works as early as 1990. In the meantime se- important argument, for instance in the held
veral textile machinery manufacturers have of low-voltage switchgear.
joined together to form the ”CAN Textile
Principles of data exchange. ready”). This is all the CPU has to do to initi-
ate data exchange. The message is con-
When data are transmitted by CAN, no sta- structed and transmitted by the CAN chip. As
tions are addressed, but instead, the content soon as the CAN chip receives the bus allo-
of the message (e.g. rpm or engine tempe- cation (”Send Message”) all other stations on
rature) is designated by an identifier that is the CAN network become receivers of this
unique throughout the network. The identifier message (”Receive Message”). Each station
defines not only the content but also the pri- in the CAN network, having received the
ority of the message. This is important for message correctly, performs an acceptance
bus allocation when several stations are test to determine whether the data received
competing for bus access. are relevant for that station (”Select”). If the
data are of significance for the station con-
If the CPU of a given station wishes to send cerned they are processed (”Accept”), other-
a message to one or more stations, it passes wise they are ignored.
the data to be transmitted and their identi- A high degree of system and configuration
fiers to the assigned CAN chip (”Make flexibility is achieved as a result of the con-
A message in the standard format begins The ”ACK field”, comprises the ACK slot
with the start bit ”start of frame”, this is (1 bit) and the ACK delimiter (1 recessive
followed by the ”arbitration field”, which con- bit). The bit in the ACK slot is sent as a re-
tains the identifier and the ”RTR” (remote cessive bit and is overwritten as a dominant
transmission request) bit, which indicates bit by those receivers which have at this time
whether it is a data frame or a request frame received the data correctly (positive acknow-
without any data bytes (remote frame). ledgement). Correct messages are acknow-
ledged by the receivers regardless of the
The ”control field”contains the IDE (identifier result of the acceptance test. The end of the
Unlike other bus systems, the CAN protocol If one or more errors are discovered by at
does not use acknowledgement messages least one station (any station) using the
but instead signals any errors that occur. For above mechanisms, the current transmission
error detection the CAN protocol implements is aborted by sending an ”error flag”. This
three mechanisms at the message level: prevents other stations accepting the mes-
sage and thus ensures the consistency of
! Cyclic Redundancy Check (CRC) data throughout the network.
The CRC safeguards the information in
the frame by adding redundant check bits After transmission of an erroneous message
at the transmission end. At the receiver has been aborted, the sender automatically
end these bits are re-computed and re-attempts transmission (automatic repeat
tested against the received bits. If they do request). There may again be competition for
not agree there has been a CRC error. bus allocation. As a rule, retransmission will
be begun within 23 bit periods after error de-
! Frame check tection; in special cases the system recovery
This mechanism verifies the structure of time is 31 bit periods.
the transmitted frame by checking the bit
fields against the fixed format and the However effective and efficient the method
frame size. Errors detected by frame described may be, in the event of a defective
checks are designated ”format errors”. station it might lead to all messages (inclu-
ding correct ones) being aborted, thus
! ACK errors blocking the bus system if no measures for
As mentioned above, frames received self-monitoring were taken. The CAN proto-
are acknowledged by all recipients col therefore provides a mechanism for dis-
through positive acknowledgement. If no tinguishing sporadic errors from permanent
acknowledgement is received by the errors and localizing station failures (fault
transmitter of the message (ACK error) confinement). This is done by statistical as-
this may mean that there is a trans- sessment of station error situations with the
mission error which has been detected aim of recognizing a station‘s own defects
only by the recipients, that the ACK field and possibly entering an operating mode
has been corrupted or that there are no where the rest of the CAN network is not
receivers. negatively affected. This may go as far as
the station switching itself off to prevent
The CAN protocol also implements two messages erroneously recognized as
mechanisms for error detection at the bit incorrect from being aborted.
level.
Calculation of the residual error probability For example, if a CAN network operates at a
requires that the errors which occur be clas- data rate of 1 Mbit/s, at an average bus ca-
sified and that the whole transmission path pacity utilization of 50 percent, for a total
be described by a model. If we determine the operating life of 4000 hours and with an
residual error probability of CAN as a func- average message length of 80 bits, then the
tion of the bit error probability for message total number of messages transmitted is
lengths of 80 to 90 bits, for system configura- 9 x 1010. The statistical number of unde-
tions of, for instance, five or ten nodes and tected transmission errors during the opera-
with an error rate of 1/1000 (an error in one ting life is thus in the order of less than 10-2.
message in every thousand), then maximum Or to put it another way, with an operating
bit error probability is approximately 0.02 - in time of eight hours per day on 365 days per
the order of 10-13. Based on this it is possible year and an error rate of 0.7 s, one unde-
to calculate the maximum number of unde- tected error occurs every thousand years
tectable errors for a diven CAN network. (statistical average).
The SAE ”Truck and Bus” subcommittee extension (ID extension). Thus the CAN pro-
standardized signals and messages as well tocol allows the use of two message formats:
as data transmission protocols for various StandardCAN (Version 2.0A) and Extended-
data rates. lt became apparent that stanard- CAN (Version 2.0B). As the two formats
ization of this kind is easier to implement have to coexist on one bus it is laid down
when a longer identification field is available. which message has higher priority on the
bus in the case of bus access collisions with
To support these efforts, the CAN protocol dithering formats and the same base identi-
was extended by the introduction of a 29-bit fier: the message in standard always has
identifier. This identifier is made up of the ex- priority over the message in extended for-
isting 11-bit identifier (base ID) and an 18-bit mat.
Communication is identical for all implemen- ters allow a limited acceptance filtering
tations of the CAN protocol. There are differ- (8 MSB of the identifier). Suitable choice of
ences, however, with regard to the extent to these register values allows groups of identi-
which the implementation takes over mes- fiers or in borderline cases all ID‘s to be
sage transmission from the microcontrollers selected. If more than the 8 ID-MSB‘s are
which follow it in the circuit. necessary to differentiate between mes-
sages then the microcontroller following the
CAN controller in the circuit must comple-
CAN controller with intermediate buffer. ment acceptance filtering by software.
CAN controllers with intermediate buffer may
CAN controllers with intermediate buffer (for- place a strain on the microcontroller with the
merly called basicCAN chips) have imple- acceptance filtering, but they require only a
mented as hardware the logic necessary to small chip area and can therefore be pro-
create and verify the bitstream according to duced at lower cost. In principle they can
protocol. However, the administration of data accept all objects in a CAN network.
sets to be sent and received, acceptance fil-
tering in particular is carried out to only a
limited extent by the CAN controller. CAN controller with object storage.
Typically, CAN controllers with intermediate CAN objects consist mainly of three compo-
buffer have two reception and one transmis- nents: identifier, data length code and the
sion buffer. The 8-bit code and mask regis- actual useful data.
The data rates (up to 1 Mbit/s) necessitate a Integrated driver chips in accordance with
sufficiently steep pulse slope, which can be ISO 11898 are available from several com-
implemented only by using power elements. panies (Bosch, Philips, Siliconix and Texas
A number of physical connections are ba- Instruments). The international users and
sically possible. However, the users and manufacturers group (CiA) also specifies se-
manufacturers group CAN in Automation re- veral mechanical connections (cable and
commends the use of driver circuits in ac- connectors).
cordance with ISO 11898.
esd gmbh
Vahrenwalder Str. 205
D-30165 Hannover
Tel.: +49-511-37298-0
Fax: +49-511-37298-198
E-Mail: info@esd-electronics.com
Internet: http://www.esd-electronics.com