Download as pdf or txt
Download as pdf or txt
You are on page 1of 43

CAN BUS – A QUICK CHECK

CAN BUS

CAN Bus has been used in DL


machines for drilling control
already from 1990s

DD422 uses CAN Bus to enable


higher level of automation,
monitoring and modularity in
units

It is based on de-centralized
system, where there are several
main programmed units telling
what to do and what do they
hear
2
BASIC STRUCTURE OF CAN BUS
At 80s Bosch designed CAN Bus to reduce cabling at ABS
brakes, then things got out of hand and it expanded to its
current form. BMW 850 at 1980s was one of the first CAN
Bus users

There are several CAN based higher-layer protocols.


Automotive industry uses J1939 commonly, Sandvik
CANOpen, but physical principle remains the same, it
transfers data between Can nodes.

Protocols between different CANs are varying, but the


basic structure is the same. It could be compared for
example to different spoken languages where the
structures, letters and ways of speaking are same, but the
language itself is different.
BASIC STRUCTURE OF CAN BUS
These different protocols could be easily understood by
comparing them to languages

For example between English, German, French etc…

The letters and the physical part is the same, but the
language is different and so are the messages what they
are sending through
PLUS AND MINUS OF CAN BUS
+ -
Wide support from different No deterministic, reply times can only be
manufacturers quaranteed for highest priority messages

Fast, light & relatively easy to build For transferring big amounts of data
requires another protocol
Standardized
Lenght of the bus is limited
Relatively low price components
Optimizing the parameters of the bus
Good offering with different tools etc can be difficult

Reliable Multiple protocols and connector


standards causes multiple upkeeps for
Possible to do basic maintenance and component manufacturers
upkeep relatively easily
How to set up the priorization of the
messages ?
CENTRALIZED SYSTEM
Centralized system has a main computer/node which is controlling everything what is
happening and everything is behind central device

MASTER DEVICE DEVICES


- Is responsible for doing - For example hard wired
everything in software valves
- For example hard wired
buttons

Line between the boxes is hard wiring, so there is a direct control


from master device to other devices.
DECENTRALIZED SYSTEM

CAN bus systems can be seen as de-centralized system


Example of decentralized system:

CAN NODE 1 CAN NODE 3 VALVE BLOCK


- Calculates Boom movements - Follows command from - Actual valves responsible
and gives control commands CAN Node 1 to drive valves for the actions

CAN NODE 2 BUTTON NODE BUTTON PANEL


- Is responsible for receiving user - Is for example a button - Actual buttons responsible
commands and delivering the panel which sends for the actions
messages forward to other units messages CAN message if
button is pressed

Lines between the units are the CAN busses transferring data. They deliver
information between the units. Bit like Ethernet cable or WLAN from computer.
DECENTRALIZED SYSTEM
CAN bus systems can be seen as de-centralized system
Example of decentralized system:

CAN NODE 1 CAN NODE 3 VALVE BLOCK


- Calculates Boom movements - Follows command from - Actual valves responsible
and gives control commands CAN Node 1 to drive valves for the actions

CAN NODE 2 BUTTON NODE BUTTON PANEL


- Is responsible for receiving user - Is for example a button - Actual buttons responsible
commands and delivering the panel which sends for the actions
messages forward to other units messages CAN message if
button is pressed

NOTE! Units might have integrated functionalities. For example


button panel can have at the same time the physical buttons and
computers for CAN Communications.
IN SHORT CENTRALIZED VS DECENTRALIZED

In decentralized system it is possible to divide the brains to multiple locations of the


system
CAN BUS PHYSICAL CONSTRUCTION
NOTE! Sandvik UG
applications have always
external terminators

However there might be


applications where the
modules are having
internal end resistors.
Consists of nodes which are wired with ”droplines” to
two wires, and at end of the wires there are 120 ohm
resistors.
PHYSICAL CONSTRUCTION OF CAN BUS
CAN Bus systems can also
consist of 2 physically
separate busses

Advantage of this is that the


CAN Bus can be divided to
smaller segments. In this way,
if one physical segment is
damaged, then other remains
functional.
CAN BUS SIGNAL EXAMPLE
At left signal picture of CAN Bus
how it looks on Oscilloscope in
good case

Main thing to note: When there is


voltage differece if 2 Volts between
2 Volt the lines, the bit being sent is 0

When the voltage difference is 0V,


the message is 1

CAN Bus is 0 dominant, that means


that if node writes 1 and second
1 bit node writes 0, then result is 0.
1 byte
BIT AND BYTE
NOTE! One bit is single 0 / 1
information sent for units. One byte
is 8 bits which can form up larger
number

Hex system has base number of


16, it is highest number what can
2 Volt be shown with 4 bits

1 bit

1 byte
CAN BUS SIGNAL EXAMPLE
Speed means practically frequency
how fastly the bus is being read and
at which rate the nodes try to change
the voltage in the bus

For example standard speed in CAN


Bus at Bedrock machines is 500 kbit/s

If 250 kbit/s is reading or writing the


signal from 500 kbit/s units, the
message is different
500 kbit/s
With 500 kbit/s CAN Bus, the voltage
1 0 1 1 250 kbit/s change is happening 500 000 times in
second
OTHER CHARACTERISTICS
Depending of the speed in the CAN Bus
network, the maximum lenght of the bus varies

With 1 Mbit/s speed  max 40 meters


With 500 kbit/s speed  100 meters
With 50 kbit/s speed  max 1000 meters

BUS speed is also defined from total system Effects on speed:


delay, which can cause the system to act Skin effects
slower than it is theorethically possible. Delay is Proximity to other circuts
formed also from the speed of electromagnetic Dielectric loss
fields passing by the wiring Radiation loss
Speed of Software
Amount of nodes in CAN Bus in certain cases
200
BAD CAN BUS SIGNAL
Terminology
Overshoot and ”what to
see” in
”zoomed” CAN
signal

Voltage change is not Disturbances in bus


Undershoot fast enough after voltage change
BAD CAN BUS SIGNAL
End resistor purpose:

Adds load to the bus and


negates capacitive and inductive
features of the bus. Enables
faster voltage changes and
prevents the signal reflections of
the CAN bus
CAN BUS TERMINATION WAYS
Most common termination is 120 ohm end
resistor, other choice is split termination with 60
ohm resistors and small capacitor to create
practically a RC-filter (low pass filter) in CAN
transmission line

It will short the higher frequence interferences to


the ground. Capacitive impedance for C can be
written as:

The impedance is frequency dependant, and by


sizing the C correctly, the interference
frequencies are reduced (C ~ 10…100 nF)
WHY 120 OHM RESISTORS ?
ISO standard 11898 decided to use 120 ohm
nominal impedance as standard.

CiA has defined some higher resistances as a


proposal for longer busses, but practically 120
ohm is the standard

Internal constructions of CAN Node tranceivers


are designed with 60 ohm impedance matching
to provide good signal quality.

So practically Tx and Rx impedances should be


matching in the internal construction of the bus
MEANING OF SIGNAL REFLECTION
When signal is transmitted along a cable, some of
the signal power will be reflected back to its origin
rather than being carried all the way along the
cable to the far end if there is no end termination

As the signal passes through the wiring it will reach


the end of the cables at some point. If there is no
load to eat the energy of the signal, then the
energy from signal is reflected back to transmitter

This creates inconstintency to signal and errors


MEANING OF SIGNAL REFLECTION
At right an example of square wave generator
connected to oscilloscope and to a long cable
without termination

As you see the wave changing, the cable


momentarily acts as a load and then as the signal
sent is dissipated, it drops back to zero

SWG

SCOPE
MEANING OF SIGNAL REFLECTION
If the ends of the cable is shorted, then signal form
changes

A brief pulse creates a momentarily voltage to the


lines, but then it levels down to 0 volts and this
pattern repeats

The width at the top or bottom of the screen is the


time that it takes for the signal to end up to the
short circuited part and then to reflect back
SWG
It could be used to calculate the lenght of the cable
in this example
SCOPE
MEANING OF SIGNAL REFLECTION
When resistance is installed to end of the cable
then signal type depends of the ohms

Ohms very low: Ohms too high

Ohms at optimal level

With too low ohms, the signal generator is not


SWG able to keep the signal shape up
With too high ohms, the signal takes time to rise
up and the system is not able to rise the voltage
SCOPE fast enough
IF TERMINATION IS IN MIDDLE OF THE CAN BUS
Center termination in CAN Bus will not affect if the
bus lenght is short

If the lenght of the CAN Bus increases, then


reflections in signal can happen at the end where
there is no ”load” from the resistor

At longer busses this can cause some amount of


error frames

It will also generate overshoots and undershoots

CAN CAN
NODE NODE
MEANING OF SIGNAL REFLECTION
In short: The energy of the signal from the
transmitting unit is reflected back to the sender and
the wave form suffers

The design of the CAN bus has been optimized to


2 pieces of 120 ohm end resistors and this creates
the optimal wave shape for the signal

Signal reflections can also happen due to the


imperfections in the cable when there is impedance
mismatches and changes in the cable
characteristics / connectors
SIGNAL REFLECTION – WORST CASE SCENARIO
If multiple dominant bits are simultaneously sent
from many nodes in the CAN bus

As the signal wave goes forward in the bus line


and arrives to the readily loaded section of the
bus, then mismatch in impedances causes
reflection for the voltage to backwards in the bus
TWISTED PAIRS IN COMMUNICATION LINES
Twisted pairs can be described as ”elegant
simplicity” of protecting the signal lines.

Invented to telephone use at 1881 by Bell, and


nowdays it is very common technique all
around

One could arque that women invented this


long time ago from the way they do their hair,
but this is significantly different if we compare
this by example at next slide
TWISTED PAIRS IN COMMUNICATION LINES
Womans way of doing their hairs requires 3
”set of hairs” which are twisted around each
other in certain order

So we can safely say that simple thing like


twisted pair in communication cable is not
invention of different hair working procedures

And besides, women are beautfiful, but


never simple  it is impossible that this
would be a invention made by a woman
INDUCTIVE NOISE TO CAN BUS LINE
Inductive interference could look like the
diagrams at right

Basic characteristic is beginning spike, which


is eaten off over time. If the signal lines are in
paraller, then the interference is not cancelled
out

If the wiring is done with twisted pairs, then the


inductive coupling is minimized
COMMUNICATION WITH DIFFERENTIAL SIGNAL
Differential signal means that the devices are
reading potential difference of Can High and
Low lines

By reading this in between signal, it is


possible to negate disturbances which are
generated to both lines simultaneously
Potential
differencies
Combined with other disturbance reducing
provide a robust
features the reliability gets better way to avoid
electric
disturbances.
DIFFERENCE OF CANOPEN AND J1939
Main Point:
Different message
structure
DIFFERENCE OF CANOPEN AND J1939
Main Point:
Different message
structure

Messages form up of
voltage changes

FILL

FILL

FILL
CAN MESSAGE TYPES
Data Frame
Most common message type, Error Frame
containing all the neede fields to form Error frame violates formatting rules of
up the message CAN messages. It is transmitted when
node detects error in a message, and
Remote Frame causes the other nodes to send an error
Intended purpose of remote frame is to frame as well. The original transmitter
request data from another node. will then retransmit the message. Error
Difference to Data frame is done by counter system tries to prevent the bus
recessive RTR bit in the arbitration field from overloading in case the node
and it does not contain any data. keeps on sending the messages that
don’t get through
Overload Frame
Similiar to error frame. It is transmitted At some situations if node goes to
by a node that becomes too busy. passive error state it can continue to
Primary using purpose is to provide for send 6 resessive bits, in this way it is
an extra delay between messages. not anymore affecting to the bus
communications.
CAN MESSAGE PRIORISATIONS
Priorisation message can be seen as logical
AND-function with 0 dominant

So this means that all of the bits will need to Node 1


be 1 that the message would be 1, if the
Node 2
Node 3
& CAN Bus

message is 0, then end result is 0  0


dominant
Another way to see the structure:

+5V
For example 3 CAN Nodes which are sending +5V

messages with different priorities

+5V
CAN ERROR COUNTERS
CAN bus has error calculators which are calculating
the amount of errors in messages

The ways of calculations are:


Bit error
CRC-error
Stuff bit error
Ack error

Depending of the application, the error messages ERROR


can be built with different limits, with internal ACTIVE
up&down counters or just up counter

If amount of errors rises over certain treshold, CAN


Node can end up in BUS OFF state

ERROR
BUS OFF
PASSIVE Tx errors > XXX
CAN NODE INTERNAL CONSTRUCTION
Most of the CAN Controllers require 5 Volt control
supply, but in certain condtitions it is possible to use
3.3 Volt supplies

Smaller voltages in the nodes provides cheaper


applications, but is also not able to provide as high
energies for the bus as the higher voltage models
RELIABILITY FACTORS FOR CAN BUS
Differential signal

Twisted pair

Way how messages are built - check


sums&prioritisations

Error states for faulty modules

Standardized protocol

Simple cabling constructions, quite easy to fix


physical transmit lines

Basic fault finding can be done with the machines


own control system and multimeter + specialized
tools quite easily
CAN TOOLS AVAILABLE FROM SANDVIK
SGW Can bus analyzer

RLU Repeater Logger Unit

Multimeter

Measurement Adapters
BASIC PRINCIPLE– MOST COMMON TERMS
• Node Device attached to the bus. For example PLC, valve, computer or sensor.

• Node-ID Every device in bus has their own address which they are using to communicate in bus.
Bus cannot have two similiar Node-IDs or they will conflict.

• Bit rate Speed of the bus. Must be same with all the devices in the bus, for example 500 kbit/s.

• NMT Protocol which controls the state of the nodes. NMT-message can be used for example to
start or shut down a device in the bus.

• NMT-master Every bus must have an NMT-master. It has the responsobility of controlled start
of the devices in the bus and stopping the bus data transfers.

• Heartbeat Bus devices active status information, which sends a status of the node to the
bus ( running, stopped etc.)
BASIC FAULT FINDING WITH MULTIMETER
MOST COMMON FAULTS IN BUS
Connection problem outside the bus, for
Connector problem example with powering or groundings
- Water/moisture creates leakages - Lack of grounding of
- Corrosion powering for example due
to a connector failure etc.
Connection mistakes
- When making reconnections Broken component
“being one off” or not attached at all - Sometimes for some
reason, some things just
Node which isn't programmed, incorrectly get broken
programmed, or incorrectly configured
- When a new spare part is delivered Outside components which generate
and it is not configured or programmed high level of EMC faults for example
correctly - If something “out of normal”
is added to the machine, it
might cause unforeseen
consenquences
BASIC PRINCIPLES TO FOLLOW
Gold plated connectors everwhere where possible, not to be mixed with tin
ones

Protecting the connectors with Dow Corning DC4

Not adding excessive length to the bus

Avoiding of the “quick&dirty” repairs if possible, or if done, returned later to


the normal state
CAN BUS LOAD MEASUREMENT WITH MULTIMETER
True RMS multimeter can be used for rough
measurement of the Bus load against the ground

True RMS = Can show other AC voltages correctly


also than just sine wave

Also by measuring the differential voltage between


the Can High and Can Low lines must be under
under 1 Volt

TÄMÄ KALVO POIS KOKONAAN

You might also like