Sie sind auf Seite 1von 18

THE OTOMOTIF COLLEGE

DAT 2603 Individual Assignment:


CANbus: Multiplexing, Topology, Protocol,
Application

Diploma in Automotive Technology

A Junid

Student ID: DAT 201509-02102

30 January 2018

Tutor: Mr Roland
Batch: 1602
DAT 2603 Individual Assignment – A Junid - DAT201509-02102

Table of Contents
Page

Introduction to CAN-bus systems............................................................. 2

1) Multiplexing….……………………………………....................................... 6

2) Cabling………….…..………………………………………………….……… 8

3) Network Topology……..……………………………………......................... 9

4) Communication Protocol and Arbitration……..…..................................... 11

5) Design Applications…………………………….......................................... 17

Diploma in Automotive Technology Student Number: DAT201509-02102


30 January 2018 Page 1 of 17
DAT 2603 Individual Assignment – A Junid - DAT201509-02102

Introduction to CAN-bus Systems:

A Controller Area Network (CAN) is a reliable bus network standard specified


in ISO-11898 for Control Units (i.e. microcontrollers and devices) to
communicate with each other in applications without a host computer.
CANbus was originally designed for multiplexed electrical wiring within
automobiles to save on copper, but is also used in many other contexts.

Originally introduced by Bosch in 1986, CAN’s reliability derives from its 2-


wire bus signalling method, where voltage swings on both buses are
compared, and common-mode interference signals rejected by line
controllers (transceivers):

Signals with common-mode interference are still readable

Automobile CAN applications typically have high-speed CAN buses for


critical systems like ABS, engine systems and transmission systems. High-
speed CAN clock speed goes up to 1Mbps with a 40m cable length limit.
This system is also known as CAN-C, or CAN-D for diagnostic buses.

Diploma in Automotive Technology Student Number: DAT201509-02102


30 January 2018 Page 2 of 17
DAT 2603 Individual Assignment – A Junid - DAT201509-02102

Note from the logic plot that dominant line voltage is read as a logic 0, and
recessive line voltage is read as a logic 1. This rule applies for both high and
low speed CAN systems.

High-speed CAN has ungrounded termination resistors connected across


each end of the CAN-h (CAN+) and CAN-l (CAN-) line:

High-speed CAN termination resistors

This makes high-speed CAN non-fault tolerant, i.e. a short or open in one
line makes the signal unreadable by Control Unit transceivers. Note the
highspeed CANbus voltage ranges are between 2.5-3.5V for CAN-h (CAN+)
and 2.5-3.5V for CAN-l (CAN-).

Low-speed CAN buses, known as CAN-B, are fault-tolerant due to isolated


termination resistors for both buses. Even is one bus is shorted to power to
ground, transceivers can still make a voltage comparison of dominant and
recessive voltages to read digital ones and zeros.

Lowspeed CAN baud rate is up to 125kbps, and voltage swing specifications


are also wider, e.g. 1V - 4V:

Diploma in Automotive Technology Student Number: DAT201509-02102


30 January 2018 Page 3 of 17
DAT 2603 Individual Assignment – A Junid - DAT201509-02102

Each Control Unit (Control Node) plugged into a CAN-bus has:


1) A microprocessor, which decides what the received messages mean
and what messages it wants to transmit. Sensors, actuators and
control devices can be connected to the host processor.
2) A CAN controller; often an integral part of the microcontroller which: (i)
stores received serial bits until an entire message is available, which
can then be fetched by the microprocessor (usually by the CAN
controller triggering an interrupt); and (ii) sends the transmit
message(s) to a CAN transceiver (line controller), which transmits the
bits serially onto the bus when the bus is free.
3) Transceiver: whose operation protocol is defined by ISO 11898-2/3.
This converts the data stream from CANbus levels to levels that the
CAN controller uses. It usually has protective circuitry to protect the
CAN controller. During outgoing transmission, it converts the data
stream from the CAN controller to CANbus levels.

Diploma in Automotive Technology Student Number: DAT201509-02102


30 January 2018 Page 4 of 17
DAT 2603 Individual Assignment – A Junid - DAT201509-02102

Note that the CAN controller is part of the datalink layer, i.e. is part of the
data filtering function, which is explained in the next section on multiplexing.

There is also a more recent CAN standard released by Bosch in 2012 called
CAN FD (Flexible Datarate), which is compatible with highspeed CAN-C and
goes up to 15Mbps with even shorter cabling constraints.

Diploma in Automotive Technology Student Number: DAT201509-02102


30 January 2018 Page 5 of 17
DAT 2603 Individual Assignment – A Junid - DAT201509-02102

1) MULTIPLEXING

A multiplexer or mux is digital logic circuitry designed to transmit a length of


bits serially onto a bus. A CANbus-readable series of bits is batched into a
set of bits called a frame. A frame consists of several fields of bits, and in
CANbus, one of which is called the identifier field.

A demultiplexer or demux operates analogously to a mux but in reverse: it


reads the series of bits and reconstructs them to feed the CAN controller
parallelly. This operation of feeding a set of bits in series onto a bus and
reconstructing them into the original set of bits to feed in parallel to a
processor is called multiplexing.

All CUs in CANbus have multiplexing capability in transmitter circuitry, and


demultiplexing capability in receiving circuitry. Gateways are also
multiplexer-demultiplexer CUs. Multiplexing in CANbus and internet TCP-IP
is considered time-division multiplexing.

Note that for internet TCP/IP, frames have an address field, which allow
selective demuxing, i.e. filtering of what data is needed at the demux level,
via the address ports.

TDM (above left) and logic symbol for an 8x1 mux (above right)

In CANbus, both line interface transceiver and CAN controller act as


multiplexer circuitry. Unlike an internet TCP/IP mux/demux which has a
dynamic address port (S0 – S2 above), the line interface transceiver mux will
not have an address port, i.e. will mux/demux all data given based on
CANbus arbitration rules to deal with bus traffic. Mux filtering occurs at the
CAN controller receiving level. Analogous to an address port, a CAN
controller will have a permanent or programmable identifier port to allow only
applicable data frames to reach its microprocessor.

Note that for copper wire, both CANbus and internet TCP/IP networks
multiplex in the time domain. Multiplexing in the frequency domain is also
possible, e.g. for telephone, radio and television signals, and certain modes
of fibreoptic communication. For frequency domain multiplexing, instead of
reading addresses or identifiers, mux/demux devices tune to designer/user-
specified frequency ranges to read dynamic frequency data. Since

Diploma in Automotive Technology Student Number: DAT201509-02102


30 January 2018 Page 6 of 17
DAT 2603 Individual Assignment – A Junid - DAT201509-02102

frequency domain patterns and ranges are unique to each transmitter,


frequency-modulated data can be sent in parallel over a single medium,
readable by designer/user-tuned receivers. In effect, this enables total
bandwidth, i.e. data capacity, to be increased.

Diploma in Automotive Technology Student Number: DAT201509-02102


30 January 2018 Page 7 of 17
DAT 2603 Individual Assignment – A Junid - DAT201509-02102

2) CABLING

Typical cabling seen for networks, including CANbus, are shown below.

Coaxial cable

Optical fibre cable

Twisted pair cable

Types of network cabling

They include coaxial cable (top), fiberoptic cable (centre), and twisted pair
(bottom). The most common type seen in today’s vehicles are twisted pair
due to better flexibility i.e. smaller bending radius, and lower cost relative to
optical fiber and coaxial cable.

Pricier optical fiber and coax, due to better shielding and being less prone to
interference/noise, are used for higher frequency applications, for example
high speed internet and intranet computer networks.

Diploma in Automotive Technology Student Number: DAT201509-02102


30 January 2018 Page 8 of 17
DAT 2603 Individual Assignment – A Junid - DAT201509-02102

3) NETWORK TOPOLOGY

Network topology is the arrangement of the various elements (links, nodes,


etc.) of a communication network. Network topology may be depicted
physically or logically.

Physical topology is the placement of the various components of a network,


including device location and cable installation, while logical topology
illustrates how data flows within a network. Distances between nodes,
physical interconnections, transmission rates, or signal types may differ
between two networks, yet their topologies may be identical.

Logical topology is the way that the signals act on the network media, or the
way that the data passes through the network from one device to the next
without regard to the physical interconnection of the devices. A network's
logical topology is not necessarily the same as its physical topology. For
example, the original twisted pair Ethernet using repeater hubs was a logical
bus topology carried on a physical star topology. Token ring is a logical ring
topology, but is wired as a physical star from the media access unit. Logical
topologies are often closely associated with media access control methods
and protocols. Some networks can dynamically change their logical topology
through configuration changes to their routers and switches.

For general automotive applications, the study of network topology is usually


only physical, and recognizes the following basic topologies: ring, star, daisy-
chain and bus. These can be combined to form a hybrid network, depicted
as follows:

Ring, Star and Bus combined to form Hybrid network

Daisy-chain topologies are less popular in modern vehicles: one break


upstream breaks all communication downstream.

Diploma in Automotive Technology Student Number: DAT201509-02102


30 January 2018 Page 9 of 17
DAT 2603 Individual Assignment – A Junid - DAT201509-02102

The following mesh network is also relatively rare, because its large amount
of cabling runs contrary to the intent of automotive CAN-bus networks, i.e. to
decrease the amount of cabling as much as possible.

Advantages and disadvantages of typical automotive electronics network


topologies are summarised as follows:

Topology Advantage Disadvantage


• A single break will • Control Units must
not disrupt the be configured to
network send messages in
• Relatively easier to both directions to
extend the network overcome ring
by adding CUs breaks
• Relatively fast due • May be difficult to
to shorter and expand unless
fewer physical master unit and/or
connection lengths gateway is
• A fault in a non- reconfigured with
master CU only additional output
affects one CU ports.
• A failed master CU
will stop network
communication
• Relatively easy to • A bus break can
extend the stop network
network. communication, so
• Relatively reliable, the bus length must
i.e. one failed CU be made as short
will not stop as possible to
network minimise risk of bus
communication breaks

Diploma in Automotive Technology Student Number: DAT201509-02102


30 January 2018 Page 10 of 17
DAT 2603 Individual Assignment – A Junid - DAT201509-02102

4) COMMUNICATION PROTOCOL AND ARBITRATION

Bit Frames, Bit Fields and Arbitration

A bit frame is a CU-readable block of bits in a CANbus system. A frame is


divided into several bit fields:

CAN has four frame types:

1) Data frame: Contains CU data for transmission


2) Remote Transmission Request (RTR) frame: Requests transmission
of a specific CU identifier
3) Error frame: Transmitted by any CU detecting an error
4) Overload frame: Injected as a delay between data or remote frame

All bit frames begin with a start-of-frame (SOF) bit that denotes the start of
the frame transmission. After the SOF bit, the Identifier field (Arbitration field)
follows. Since any CU having dominant transmission voltages affects the
whole bus, transmitted frames having Arbitration fields with the earliest
and longest continuous lengths of logical 0s (dominant voltages)
naturally dominate the bus and will have communication priority. Thus,
highest priority messages will be sent first until at least one receiving CU has
confirmed receipt via a dominant voltage (logical 0) placed on the bus in the
Ack slot bit.

CAN h
voltage

Diploma in Automotive Technology Student Number: DAT201509-02102


30 January 2018 Page 11 of 17
DAT 2603 Individual Assignment – A Junid - DAT201509-02102

Data frame format

A CAN network can be configured to work with two different message (or
"frame") formats: the standard or base frame format (described in CAN
2.0A and CAN 2.0B), and the extended frame format (only described by CAN
2.0 B).

CANbus base frame bit interpretation

The data frame is the only frame for actual data transmission. There are two
message formats:
• Base frame format: with 11 identifier bits
• Extended frame format: with 29 identifier bits

The only difference between base and extended formats is that the base
frame supports a length of 11 bits for the identifier, and the extended frame
supports a length of 29 bits for the identifier, made up of the 11-bit identifier
("base identifier") and an 18-bit extension ("identifier extension"). The
distinction between CAN base frame format and CAN extended frame format
is made by using the IDE bit, which is transmitted as dominant in case of an
11-bit frame, and transmitted as recessive in case of a 29-bit frame. CAN
controllers that support extended frame format messages are also able to
send and receive messages in CAN base frame format.

CANbus extended frame bit interpretation

The CAN standard requires that although CAN 2.0A cannot support
extended frame format, it must be able to tolerate the extended frame format,
i.e. at least partial functionality using data within the first 11-bits of the
identifier field should be possible.

Diploma in Automotive Technology Student Number: DAT201509-02102


30 January 2018 Page 12 of 17
DAT 2603 Individual Assignment – A Junid - DAT201509-02102

Remote Transmission Request (RTR) frame format

There are two differences between a Data Frame and a Remote Frame.
Firstly, the RTR-bit is transmitted as a dominant bit in the Data Frame and
secondly, in the Remote Frame there is no Data Field, i.e.,
• RTR = 0; DOMINANT in data frame
• RTR = 1; RECESSIVE in remote frame

In the event of a Data Frame and a Remote Frame with the same identifier
being transmitted at the same time, the Data Frame wins arbitration due to
the dominant RTR bit following the identifier.

Control field and data bytes

The control field informs how many data bytes to expect before CRC starts.

Error frame format

The error frame consists of two fields:


• Error Flag: 6–12 dominant or recessive bits contributed from different
stations.
• Error Delimiter: 8 recessive bits.

There are two types of error flags:


• Active Error Flag: six dominant bits – Transmitted by CU detecting an
error while in error state "error active".
• Passive Error Flag: six recessive bits – Transmitted by CU detecting an
error while in error state "error passive".

Overload frame format

The overload frame contains two fields:


• Overload Flag: six dominant bits. The overall form corresponds to that
of the active error flag. The overload flag’s form destroys the fixed form
of the intermission field. Consequently, all other stations also detect
an overload condition and on their part start transmission of an overload
flag.
• Overload Delimiter field: eight recessive bits. The overload delimiter is of
the same form as the error delimiter.

There are two kinds of overload conditions that trigger an overload flag:
1) A CU state of processing requires a delay of the next data frame or
remote frame. In this case, an overload frame is only allowed to be
started at the first bit time of an expected intermission
2) Detection of a single dominant bit during Intermission (i.e. Interframe
Spacing or IFS). In this case, an overload frame due to Case 2 starts one
bit after detecting the dominant bit. Exception: when the dominant bit is
detected during the third bit of the IFS. In this case, the receivers will
interpret this as a SOF. This reaction from each CU is an analogous
response to a “ping” command sent to internet servers.

Diploma in Automotive Technology Student Number: DAT201509-02102


30 January 2018 Page 13 of 17
DAT 2603 Individual Assignment – A Junid - DAT201509-02102

Bit patterns triggered by either a CRC or bit-stuffing error, followed by one or


more overload frames to allow time for resetting/resyncing of CUs are
depicted below:

Fields and protocols supporting data integrity

All frame formats also have the following field and bit pattern mechanisms to
ensure data transmission integrity:

1) Cyclic Redundancy Check (CRC) field: where each sending and


receiving CU will count the amount dominant (0) data frame or remote
frame bits preceding the CRC field and insert the count in the CRC
field. Any CU that detects an incorrect CRC field bitcount on the bus
will hard-trigger an Error Frame transmission resulting in a message
retransmit.

2) Acknowledge bit (ACK): When at least one CU reads the data frame
or remote frame and CRCs the CRC field correctly, the transmitting
CU will not interrupt with an Error frame, and allows the receiving CU
to place a dominant (0) bit in the Ack slot to confirm accurate data
receipt

3) Bit-stuffing: To ensure enough transitions to maintain


synchronization, a bit of opposite polarity is inserted after five
consecutive bits of the same polarity. This practice is called bit stuffing,
and is necessary due to the non-return to zero (NRZ1) coding used
with CAN. The stuffed data frames are destuffed by the receiver

Diploma in Automotive Technology Student Number: DAT201509-02102


30 January 2018 Page 14 of 17
DAT 2603 Individual Assignment – A Junid - DAT201509-02102

All fields in the frame are bit-stuffed except for the CRC delimiter, ACK
field and end of frame, error and overload frames which are a fixed
size and are not stuffed. In the fields where bit stuffing is used, six
consecutive bits of the same type (111111 or 000000) are considered
an error. An active error flag can be transmitted by a node when an
error has been detected. The active error flag consists of six
consecutive dominant bits and violates the rule of bit stuffing.

Bit stuffing means that data frames may be larger than one would
expect by simply enumerating the bits shown in the tables above.

Note: 1 In telecommunication, a non-return-to-zero (NRZ) line code is


a binary code in which ones are represented by one
significant condition, usually a positive voltage, while zeros
are represented by some other significant condition, usually a
negative voltage, with no other neutral or rest condition. The
pulses in NRZ have more energy than a return-to-zero (RZ)
code, which also has an additional rest state beside the
conditions for ones and zeros. NRZ is not inherently a self-
clocking signal, so some additional synchronization technique
must be used for avoiding bit slips

4) Interframe spacing (IFS, or Intermission field): Data frames and


remote frames are separated from preceding frames by a bit field
called interframe space. Interframe space consists of at least three
consecutive recessive (1) bits. Following that, if a dominant bit is
detected, it will be regarded as the "Start of frame" bit of the next
frame. Overload frames and error frames are not preceded by an
interframe space.

Diploma in Automotive Technology Student Number: DAT201509-02102


30 January 2018 Page 15 of 17
DAT 2603 Individual Assignment – A Junid - DAT201509-02102

Intermission field (IFS) following a CANbus data frame

Diploma in Automotive Technology Student Number: DAT201509-02102


30 January 2018 Page 16 of 17
DAT 2603 Individual Assignment – A Junid - DAT201509-02102

5) DESIGN APPLICATIONS

Typical CANbus applications involve communication between the following


CUs:
1) Engine Control Module (ECM)
2) Transmission Control Module (TCM)
3) Throttle Control Unit (TCU)
4) ABS CU
5) Door CUs
6) Boot CUs
7) Gateway CUs connecting highspeed (CAN-C) and lowspeed (CAN-B)
networks

Example of CANbus communication application in vehicles

Diploma in Automotive Technology Student Number: DAT201509-02102


30 January 2018 Page 17 of 17

Das könnte Ihnen auch gefallen