SlideShare a Scribd company logo
Industrial Automation
Automation Industrielle
Industrielle Automation
3 Industrial Communication Systems
Field Bus: principles
3.1 Bus de terrain: principes
Feldbusse: Grundlagen
Prof. Dr. H. Kirrmann
EPFL / ABB Research Center, Baden, Switzerland
CAN, DeviceNet, SDS, ASI-bus, Interbus-S
Ethernet, ControlNet
TCP - IP
Ethernet
Sensor Busses
simple switches etc.
Plant Network
Office
network
Fieldbus
intelligent field devices
FF, PROFIBUS, MVB, LON
2005 March, HK
3.1 Field bus principles
2/25
Industrial Automation
Field bus: principles
3.1 Field bus principles
Classes
Physical layer
3.2 Field bus operation
Centralized - Decentralized
Cyclic and Event Driven Operation
3.3 Standard field busses
3.1 Field bus principles
3/25
Industrial Automation
Sensor/
Actor
Bus
Field bus
Field bus
Programmable
Logic Controller
Process bus
SCADA level
Process Level
Field level
File
Edit
Network
Management
Operator 2
12
2
33
23
4
Location of the field bus in the plant hierarchy
direct I/O
3.1 Field bus principles
4/25
Industrial Automation
What is a field bus ?
A data network, interconnecting a control system, characterized by:
- transmission of numerous small data items (process variables) with bound delay (1ms..1s)
- harsh environment (temperature, vibrations, EM-disturbances, water, salt,…)
- robust and easy installation by skilled people
- high integrity (no undetected errors)
- high availability (redundant layout)
- clock synchronization (milliseconds down to a few microseconds)
- continuous supervision and diagnostics
- low attachment costs ( € 5.- / node)
- moderate data rates (50 kbit/s … 5 Mbit/s) but large distance range (10m .. 4 km)
- non-real-time traffic for commissioning (e.g. download) and diagnostics
- in some applications intrinsic safety (oil & gas, mining, chemicals,..)
3.1 Field bus principles
5/25
Industrial Automation
Expectations
- reduce cabling
- increased modularity of plant (each object comes with its computer)
- easy fault location and maintenance
- simplify commissioning (mise en service, IBS = Inbetriebssetzung)
- simplify extension and retrofit
- large number of off-the-shelf standard products to build “Lego”-control systems
- possibility to sell one’s own developments (if based on a standard)
3.1 Field bus principles
6/25
Industrial Automation
The original idea: save wiring
marshalling
bar
I/O
PLC
PLC
but: the number of end-points remains the same !
energy must be supplied to smart devices
dumb devices
field bus
(Rangierung,
tableau de brassage (armoire de triage)
COM
tray
capacity
3.1 Field bus principles
7/25
Industrial Automation
Marshalling (Rangierschiene, Barre de rangement)
The marshalling is the interface between
the PLC people and the instrumentation
people.
3.1 Field bus principles
8/25
Industrial Automation
Field busses classes
CAN, DeviceNet, SDS, ASI-bus, Interbus-S
Ethernet, ControlNet
TCP IP
Ethernet
Sensor Busses
simple switches etc.
Plant Network
Office
network
Fieldbus
intelligent field devices
FF, PROFIBUS PA, LON
The field bus depends on:
its function in the hierarchy
the distance it should cover
the data density it should gather
3.1 Field bus principles
9/25
Industrial Automation
Geographical extension of industrial plants
The field bus suits the physical extension of the plant
Control and supervision of large distribution networks:
• water - gas - oil - electricity - ...
Out of primary energy sources:
• waterfalls - coal - gas - oil - nuclear - solar - ...
Manufacturing and transformation plants:
• cement works - steel works - food silos - printing - paper
pulp processing - glass plants - harbors - ...
• locomotives - trains - streetcars - trolley buses - vans -
buses - cars - airplanes - spacecraft - ...
• energy - air conditioning - fire - intrusion - repair - ...
Transmission & Distribution
Power Generation
Industrial Plants
Vehicles
Building Automation
Manufacturing
flexible manufacturing cells - robots
50 m .. 3 km
1 km .. 5 km
1 km .. 1000 km
1 m .. 800 m
500m .. 2 km
1 m .. 1 km
3.1 Field bus principles
10/25
Industrial Automation
Networking busses: Electricity Network Control
houses
substation
Modicom
ICCP
control
center
Inter-Control Center Protocol
IEC 870-6
HV
MV
LV
High
Voltage
Medium
Voltage
Low
Voltage
SCADA
FSK, radio, DLC, cable, fiber,...
substation
RTU
RTU RTU
RTU
COM
RTU RTU RTU Remote Terminal Units
RTU
RTU
IEC 870-5 DNP 3.0 Conitel RP 570
control
center
control
center
low speed, long distance communication, may use power lines or telephone modems.
Problem: diversity of protocols, data format, semantics...
serial links (telephone)
3.1 Field bus principles
11/25
Industrial Automation
Substation (air isolated)
Node in the electricity grid
3.1 Field bus principles
12/25
Industrial Automation
Substations (indoor)
Gas Isolated high voltage medium voltage
consist of bays (départs, Abgang), interconnected by a buss bar (barre, Sammelschiene)
3.1 Field bus principles
13/25
Industrial Automation
Substation electrical busses
G
A
B
bussbars
switch position
and commands
current, voltage,
temperature
Generator
Bay
Bay
Bay
Transformer
isolator
(Trenner
Interrupteur)
circuit
breaker
(Schalter,
Disjoncteur)
Current Transformer
(measure)
3.1 Field bus principles
14/25
Industrial Automation
Substation data busses
IED 2
IED 1
IED 3
bay i
IED 2
IED 1
IED 3
bay 1
IED 2
IED 1
IED 3
bay n
gateway
workstation1
gateway
workstation2
logger
printer
station bus
the structure of the data busses reflects the substation structure
switch
control and
protection devices
3.1 Field bus principles
15/25
Industrial Automation
Fieldbus Application: wastewater treatment
Pumps, gates, valves, motors, water level sensors, flow meters, temperature sensors,
gas meters (CH4), generators, … are spread over an area of several km2
Some parts of the plant have explosive atmosphere.
Wiring is traditionally 4..20 mA, resulting in long threads of cable (several 100 km).
3.1 Field bus principles
16/25
Industrial Automation
Process Industry Application: Water treatment plant
S
M.C.C.
Control Room
Sub Station
SCADA
Bus Monitor
JB JB
Remote
Maintenance
System
Ethernet
Segment 1
Segment 2
Segment 3
Segment 4
FB Protocol
Converter
PLC
Digital Input/Output
PID
PID PID
PID
PID
H1 Speed Fieldbus
LAS
JB JB
AI AI AI AI AI
AI AI AI AI AI
AI AI AI
AI AI AI
AI
AO AO
AO
AO
AO
AO
DI
S S
S
S
AI
AO
AI
Japan
Malaysia
Numerous analog inputs (AI),
low speed (37 kbit/s) segments merged to 1 Mbit/s links.
source: Kaneka, Japan
3.1 Field bus principles
17/25
Industrial Automation
Data density (Example: Power Plants)
Acceleration limiter and prime mover: 1 kbit in 5 ms
Burner Control: 2 kbit in 10 ms
per each 30 m of plant: 200 kbit/s
Data are transmitted from the periphery or from fast controllers to higher level, but slower links to
the control level through field busses over distances of 1-2 km.
The control stations gather data at rates of about 200 kbit/s over distances of 30 m.
Fast controllers require at least 16 Mbit/s over distances of 2 m
The control room computers are interconnected by a bus of at least 10 Mbit/s,
over distances of several 100 m.
Planning of a field bus requires to estimate the data density per unit of length (or surface)
and the requirements in response time and throughput over each link.
3.1 Field bus principles
18/25
Industrial Automation
Distributed peripherals
Many field busses are just
extensions of the PLC’s Inputs
and Outputs,
field devices are data
concentrators.
Devices are only visible to the
PLC that controls them
relays and fuses
3.1 Field bus principles
19/25
Industrial Automation
Application: Building Automation
Source: Echelon
low cost, low data rate (78 kbit/s), may use power lines (10 kbit/s)
3.1 Field bus principles
20/25
Industrial Automation
Application: Field bus in locomotives
cockpit
motors
power electronics
brakes
power line
track signals
Train Bus
diagnosis
radio
data rate
delay
medium
number of stations
1.5 Mbit/second
1 ms (16 ms for skip/slip control)
twisted wire pair, optical fibers (EM disturbances)
up to 255 programmable stations, 4096 simple I/O
Vehicle Bus
cost engineering costs dominate
integrity very high (signaling tasks)
3.1 Field bus principles
21/25
Industrial Automation
Application: automobile
- 8 nodes
- 4 electromechanical wheel brakes
- 2 redundant Vehicle Control Unit
- Pedal simulator
- Fault-tolerant 2-voltage on-board power supply
- Diagnostic System
Bordnetz
ECU
Monitoring
und
Diagnose
Bremsen
ECU
4
redundantes
Bordnetz
12V und 48V
ECU
ECU
ECU
c
ECU
Betätigungs-
einheit
3.1 Field bus principles
22/25
Industrial Automation
Application: Avionics (Airbus 380)
3.1 Field bus principles
23/25
Industrial Automation
requires integration of power electronics and communication at very low cost.
The ultimate sensor bus
power switch and
bus interface
3.1 Field bus principles
24/25
Industrial Automation
Assessment
• What is a field bus ?
• How does a field bus supports modularity ?
• What is the difference between a sensor bus and a process bus ?
• Which advantages are expected from a field bus ?
lecture Instrumentation - Sensors and actorsPLC.pdf
2005 April, HK
Industrial Automation
Automation Industrielle
Industrielle Automation
3 Industrial Communication Systems
Field Bus Operation
3.2 Bus de terrain: mode de travail
Feldbus: Arbeitsweise
Prof. Dr. H. Kirrmann
ABB Research Center, Baden, Switzerland
3.2 Field bus operation
2
Industrial Automation
Fieldbus - Operation
3.1 Field bus types
Classes
Physical layer
3.2 Field bus operation
Data distribution
Cyclic Operation
Event Driven Operation
Real-time communication model
Networking
3.3 Standard field busses
3.2 Field bus operation
3
Industrial Automation
Objective of the field bus
Distribute to all interested parties process variables, consisting of:
•accurate process value and units
•source identification: requires a naming scheme
•quality indication: good, bad, substituted,
•time indication: how long ago was the value produced
•(description)
time
quality
value
source description
3.2 Field bus operation
4
Industrial Automation
Master or peer-to-peer communication
AP
all traffic passes by the master (PLC);
adding an alternate master is difficult
(it must be both master and slave)
input output
PLCs may exchange data,
share inputs and outputs
allows redundancy
and “distributed intelligence”
devices talk directly to each other
separate bus master from application master !
input output
PLC
PLC PLC PLC
PLC
central master: hierarchical
peer-to-peer: distributed
“slaves”
“master”
“slaves”
“masters”
alternate
master
communication in a control system is evolving from hierarchical to distributed
AP
AP
AP
AP
3.2 Field bus operation
5
Industrial Automation
application
processor
application
processor
application
processor
Broadcasts
A variable is read on the average in 1..3 different places
Broadcasting messages identified by their source (or contents) increases efficiency.
=
variable
instances
application
processor
plant
image
plant
image
plant
image
plant
image
=
distributed
data base
The bus refreshes the plant image in the background, it becomes an on-line database
Each station snoops the bus and reads the variables it is interested in.
Each device is subscribed as source or as sink for a number of process variables
Only one device may be source of a certain process data (otherwise, collision).
The replicated traffic memories can be considered as "caches" of the plant state
(similar to caches in a multiprocessor system), representing part of the plant image.
bus
3.2 Field bus operation
6
Industrial Automation
Data format
time
quality
value
source
In principle, the bus could transmit the process variable in clear text, possibly using XML.
However, this is quite expansive and only considered when the communication network
offers some 100 Mbit/s and a powerful processor is available to parse the message
More compact ways such as ASN.1 have been used in the past with 10 Mbit/s Ethernet.
Field busses are still slow (1Mbit/s ..12 Mbits/s) and therefore more compact
encodings are used.
3.2 Field bus operation
7
Industrial Automation
Datasets
wheel
speed
air
pressure
line
voltage
time
stamp
analog variables
Dataset
binary variables
all door closed
lights on
heat on
air condition on
bit offset
16 32 48
0 64 66 70
size
Field busses devices had a low data rate and transmit over and over the same variables.
It is economical to group variables of a device in the same frame as a dataset.
A dataset is treated as a whole for communication and access.
A variable is identified within a dataset by its offset and its size
Variables may be of different types, types can be mixed.
dataset
identifier
3.2 Field bus operation
8
Industrial Automation
Dataset extension and quality
To allow later extension, room is left in the datasets for additional variables.
Since the type of these future data is unknown, unused fields are filled with '1".
To signal that a variable is invalid, the producer overwrites the variable with "0".
Since both an "all 1" and an "all 0" word can be a meaningful combination, each
variable can be supervised by a check variable, of type ANTIVALENT2:
0 1 0 1 1 1 0 0 0 1
check
0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1
0 0
1 1
correct variable
error
undefined
variable value
A variable and its check variable are treated indivisibly when reading or writing
The check variable may be located anywhere in the same data set.
Dataset
var_offset
chk_offset
10 = substituted
00 = network error
01 = ok
11 = data undefined
3.2 Field bus operation
9
Industrial Automation
Decoupling Application and Bus traffic
sending: application writes data into memory
receiving: application reads data from memory
the bus controller decides when to transmit
bus and application are not synchronized
application
processor
bus
controller
traffic
memory
decoupled (asynchronous):
sending: application inserts data into queue
and triggers transmission,
bus controller fetches data from queue
receiving: bus controller inserts data into queue
and interrupts application to fetch them,
application retrieves data
application
processor
bus
controller
queues
coupled (event-driven):
events
(interrupts)
3.2 Field bus operation
10
Industrial Automation
Traffic Memory: implementation
Bus and Application are (de)coupled by a shared memory, the Traffic Memory,
where process variables are directly accessible to the application.
Ports (holding a dataset)
Application
Processor
Bus
Controller
Traffic Memory
Associative
memory
two pages ensure that read and
write can occur at the same time
(no semaphores !)
bus
an associative memory decodes
the addresses of the subscribed
datasets
3.2 Field bus operation
11
Industrial Automation
Freshness supervision
It is necessary to check that the data in the traffic memory is still up-to-date,
independently of a time-stamp (simple devices do not have time-stamping)
Applications tolerate an occasional loss of data, but no stale data.
To protect the application from using obsolete data, each Port in the traffic
memory has a freshness counter.
This counter is reset by writing to that port. It is incremented regularly,
either by the application processor or by the bus controller.
The application should always read the value of the counter before using
the port data and compare it with its tolerance level.
The freshness supervision is evaluated by each reader independently, some
readers may be more tolerant than others.
Bus error interrupts in case of severe disturbances are not directed to the
application, but to the device management.
3.2 Field bus operation
12
Industrial Automation
Process Variable Interface
Access of the application to variables in a traffic memory is very easy:
ap_get (variable_name, variable value, variable_status, variable_freshness)
ap_put (variable_name, variable value)
Rather than fetch and store individual variables, access is done by clusters
(predefined groups of variables):
ap_get (cluster_name)
ap_put_cluster (cluster_name)
The cluster is a table containing the names and values of several variables.
Note: Usually, only one variable is allowed to raise an interrupt when received: the one
carrying the current time (sent by the common clock)
The clusters can correspond to "segments" in the function block programming.
3.2 Field bus operation
13
Industrial Automation
Time-stamping and clock synchronisation
In many applications, such as disturbance logging and sequence-of-events,
the exact sampling time of a variable must be transmitted together with its value.
To this purpose, the devices are equipped with a clock that records the creation date of
the value (not the transmission time).
To reconstruct events coming from several devices, clocks must be synchronized.
considering transmission delays over the field bus (and in repeaters,....)
A field bus provides means to synchronize clocks in spite of propagation delays and
failure of individual nodes. Protocols such as IEEE 1588 can be used.
bus
input input input processing
t1 t2 t3 t4
t1 val1
3.2 Field bus operation
14
Industrial Automation
Transmission principle
The previous operation modes made no assumption, how data are transmitted.
The actual network can transmit data
cyclically (time-driven) or
on demand (event-driven),
or a combination of both.
3.2 Field bus operation
15
Industrial Automation
Cyclic and Event-Driven transmission
event-driven: send when value change by more than x% of range
limit update
frequency !,
limit hysteresis
cyclic: send value every xx milliseconds
nevertheless transmit:
- every xx as “I’m alive” sign
- when data is internally updated
- upon quality change (failure)
miss the peak
(Shannon!)
always the same,
why transmit ?
how much hysteresis ?
- coarse (bad accuracy)
- fine (high frequency)
time
individual
period
hysteresis
3.2 Field bus operation
16
Industrial Automation
Fieldbus: Cyclic Operation mode
3.1 Field bus types
Classes
Physical layer
3.2 Field bus operation
Data distribution
Cyclic Operation
Event Driven Operation
Real-time communication model
Networking
3.3 Standard field busses
3.2 Field bus operation
17
Industrial Automation
Cyclic Data Transmission
address
devices
(slaves)
Bus
Master
Individual period
2 x Tpd
N polls
time [µs]
read transfer
time [ms]
The duration of each poll is the sum of
the transmission time of address and
data (bit-rate dependent)
and of the reply delayof the signals
(independent of bit-rate).
plant
The master polls the addresses in a fixed sequence, according to its poll list.
1 2 3 4 5 6
address
(i)
data
(i)
address
(i+1)
10 µs/km
Poll
List
1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6
Individual period
44 µs .. 296 µs
3.2 Field bus operation
18
Industrial Automation
Cyclic operation principle
The delivery delay (refresh rate) is deterministic and constant.
No explicit error recovery needed since a fresh value will be transmitted in the next cycle.
Only states may be transmitted, not state changes.
To keep a low poll time, only small data items may be transmitted (< 256 bits)
Cyclic operation is used to transmit the state variables of the process.
These are called Process Data (or Periodic Data)
The bus is under control of a central master (or distributed time-triggered algorithm).
Data are transmitted at fixed intervals, whether they changed or not.
Cycle time is limited by the product of the number of data transmitted by the
duration of each poll (e.g. 100 µs / point x 100 points => 10 ms)
The bus capacity must be configured beforehand.
Determinism gets lost if the cycles are modified at run-time.
3.2 Field bus operation
19
Industrial Automation
Source-Addressed Broadcast
The bus master broadcasts the identifier of a variable to be transmitted:
Phase1:
Process Data are transmitted by source-addressed broadcast.
The device that sources that variable responds with a slave frame
containing the value, all devices subscribed as sink receive that frame.
Phase 2:
bus.
master
bus
subscribed devices
subscribed
device
subscribed
device
source sink sink
sink
variable value
bus
variable identifier
bus
master devices
(slaves)
source sink sink
subscribed devices
sink
device
device
devices
(slaves)
3.2 Field bus operation
20
Industrial Automation
Read And Write Transfers
turn-around
time
address
source
data
time
Most field busses operate with read cycles only.
read transfer: master
Write-No ack transfer
write transfer:
master (source)
address
next transfer
Read Transfer
Write Transfer With Ack
master (source)
arb
arb
turn-around
time
next transfer
address data address
arb
arb
data address
arb
address
arb ack
Local Area Networks operate with write-only transfers.
Their link layer or transport layer provides acknowledgements by another write-only transfer
next transfer
time
time
destination
Parallel busses use read and write-ack transfers
•
•
turn-around time may be
large compared with
data transfer time.
•
3.2 Field bus operation
21
Industrial Automation
Round-tip Delay
The
round-trip
delay limits
the extension
of a read-only
bus
master remotest data source
repeater
repeater
closest data sink
Master Frame
access delay
propagation delay
(t_pd = 6 µs/km)
t_source
distance
next Master Frame
t_ms
Slave Frame
T_m
T_m
T_s
T_m
t_repeat
t_repeat
(t_repeat < 3 µs)
t_repeat
t_sm
t_mm
3.2 Field bus operation
22
Industrial Automation
Optimizing Cyclic Operation
Solution: introduce sub-cycles for less urgent periodic variables:
Cyclic operation uses a fixed portion of the bus's time
The poll period increases with the number of polled items
The response time slows down accordingly
Cyclic polling need tools to configure the poll cycles.
The poll cycles should not be modified at run-time (non-determinism)
A device exports many process data (state variables) with different priorities.
If there is only one poll type per device, a device must be polled at the
frequency required by its highest-priority data.
To reduce bus load, the master polls the process data, not the devices
group with
period 1 ms
time
4a 8 16 1 4b 64
3
1 ms period
(basic period)
2 ms period
2 4a
4 ms period
1 ms 1 ms
1 1
1 2
3.2 Field bus operation
23
Industrial Automation
Cyclic Transmission and Application
Bus and applications are decoupled by a shared memory, the traffic memory,
which acts as distributed database actualized by the network.
The bus master scans the identifiers at its own pace.
The bus traffic and the application cycles are asynchronous to each other.
Traffic
Memory
cyclic
algorithms
cyclic
algorithms
cyclic
algorithms
cyclic
algorithms
port address
application
1
Ports Ports Ports
application
2
application
4
source
port
sink
port
port data
sink
port
cyclic
poll
bus
controller
bus
master
application
3
bus
Periodic
List
Ports
bus
controller
bus
controller
bus
controller
bus
controller
3.2 Field bus operation
24
Industrial Automation
Application Of Cyclic Bus
The principle of cyclic operation, combined with source-addressed
broadcast, has been adopted by most modern field busses
This method gives the network a deterministic behavior, at expenses of a reduced
bandwidth and geographical extension.
It is currently used for power plant control, rail vehicles, aircrafts, etc...
The poll scan list located in the central master (which may be duplicated for
availability purposes) determines the behavior of the bus.
It is configured for a specific project by a single tool, which takes into account
the transmission wishes of the applications.
This guarantees that no application can occupy more than its share of the bus
bandwidth and gives control to the project leader.
3.2 Field bus operation
25
Industrial Automation
Example: delay requirement
Worst-case delay for transmitting all time critical variables is the sum of:
Source application cycle time
Individual period of the variable
Sink application cycle time
8 ms
16 ms
8 ms
= 32 ms
subscribers application instances
device
publisher
application instance
bus instance
device device
applications
bus
3.2 Field bus operation
26
Industrial Automation
Example: traffic pattern in a locomotive
number of devices: 37 ( including 2 bus administrators)
37 of 16 bits
16 ms 32 ms 64 ms 128 256
49 frames of 256 bits
30 frames of 128 bits
1024
65 frames of 64 bits
18 of 32
period
% periodic time
occupancy is proportional to surface
total = 92%
3.2 Field bus operation
27
Industrial Automation
Fieldbus: Event-driven operation
3.1 Field bus types
Classes
Physical layer
3.2 Field bus operation
Data distribution
Cyclic Operation
Event Driven Operation
Real-time communication model
Networking
3.3 Standard field busses
3.2 Field bus operation
28
Industrial Automation
Event-driven Operation
Detection of an event is an intelligent process:
• Not every change of a variable is an event, even for binary variables.
• Often, a combination of changes builds an event.
• Only the application can decide what is an event, since only the application
programmer knows the meaning of the variables.
Events cause a transmission only when an state change takes place.
Bus load is very low on the average, but peaks under exceptional situations
since transmissions are correlated by the process (christmas-tree effect).
•
•
event-
reporting
station
event-
reporting
station
event-
reporting
station
plant
Multi-master bus: uses write-only transfers
intelligent
stations
sensors/
actors
3.2 Field bus operation
29
Industrial Automation
Bus interface for event-driven operation
Application
Processor
Bus
Controller
message (circular) queues
bus
driver
filter
application
Each transmission on the bus causes an interrupt.
The bus controller only checks the address and
stores the data in the message queues.
The driver is responsible for removing the messages
of the queue memory and prevent overflow.
The filter decides if the message can be processed.
interrupt
3.2 Field bus operation
30
Industrial Automation
Response of Event-driven operation
Interruption of server device at any instant can disrupt a time-critical task.
Buffering of events cause unbound delays
Gateways introduce additional uncertainties
Since events can occur anytime on any device, stations communicate by
spontaneous transmission, leading to possible collisions
Caller
Application
Called
Application
Transport
software
Transport
software
interrupt
request
indication
confirm
Bus
time
3.2 Field bus operation
31
Industrial Automation
Determinism and Medium Access In Busses
Although the moment an event occurs is not predictable, the communication
means should transmit the event in a finite time to guarantee the reaction delay.
Events are necessarily announced spontaneously: this requires a
multi-master medium like in a LAN.
The time required to transmit the event depends on the medium access
(arbitration) procedure of the bus.
Medium access control methods are either deterministic or not.
Non-deterministic
Collision
(Ethernet)
Deterministic
Central master,
Token-passing (round-robin),
Binary bisection,
Collision with winner.
3.2 Field bus operation
32
Industrial Automation
Events and Determinism
Although a deterministic medium access is the condition to guarantee delivery
time, it is not sufficient since events messages are queued in the devices.
The average delivery time depends on the length of the queues, on the bus
traffic and on the processing time at the destination.
Often, the computers limit far more the event delay than the bus does.
Real-time Control = Measurement + Transmission + Processing + Acting
bus
F F F F
F F F F
F F
F F
data packets
acknowledgements
input and
output queues
events
producers
& consumers
3.2 Field bus operation
33
Industrial Automation
Events Pros and Cons
In an event-driven control system, there is only a transmission or an operation
when an event occurs.
Advantages:
Drawbacks:
Can treat a large number of events - if not all at the same time
Supports a large number of stations
System idle under steady - state conditions
Better use of resources
Uses write-only transfers, suited for LANs with long propagation delays
Suited for standard (interrupt-driven) operating systems (Unix, Windows)
Requires intelligent stations (event building)
Needs shared access to resources (arbitration)
No upper limit to access time if some component not deterministic
Response time difficult to estimate, requires analysis
Limited by congestion effects: process correlates events
A background cyclic operation is needed to check liveliness
3.2 Field bus operation
34
Industrial Automation
Fieldbus: real-time communication model
3.1 Field bus types
Classes
Physical layer
3.2 Field bus operation
Centralized - Decentralized
Cyclic Operation
Event Driven Operation
Real-time communication model
Networking
3.3 Standard field busses
3.2 Field bus operation
35
Industrial Automation
Mixed Data Traffic
represent the state of the plant represent state changes of the plant
-> Periodic Transmission
of Process Variables
short and urgent data items
Since variables are refreshed periodically,
no retransmission protocol is needed to
recover from transmission error.
-> Sporadic Transmission of
Process Variables and Messages
infrequent, sometimes lengthy
messages reporting events, for:
• System: initialisation, down-loading, ...
Since messages represent state
changes, a protocol must recover lost data in
case of transmission errors
• Users: set points, diagnostics, status
Process Data Message Data
... motor current, axle speed, operator's
commands, emergency stops,...
periodic
phase
periodic
phase
event
sporadic
phase
time
basic period basic period
sporadic
phase
3.2 Field bus operation
36
Industrial Automation
Mixing Traffic is a configuration issue
Cyclic broadcast of source-addressed variables is the standard solution in field busses
for process control.
Cyclic transmission takes a large share of the bus bandwidth and should be reserved
for really critical variables.
The decision to declare a variable as cyclic or event-driven can be taken late in a
project, but cannot be changed on-the-fly in an operating device.
A message transmission scheme must exist alongside the cyclic transmission to carry
not-critical variables and long messages such as diagnostics or network management
An industrial communication system should provide both transmission kinds.
3.2 Field bus operation
37
Industrial Automation
Real-Time communication stack
The real-time communication model uses two stacks, one for time-critical variables
and one for messages
Logical Link
Control
time-critical
process variables
Management
Interface
time-benign
messages
Physical
Link (Medium Access)
Network (connectionless)
Transport (connection-oriented)
Session
Presentation
Application
7
6
Remote Procedure Call 5
4
3
2'
1
connectionless
connectionless
connection-oriented
medium access
implicit
implicit
Logical Link Control
2"
media
common
3.2 Field bus operation
38
Industrial Automation
Application Sight Of Communication
R4
Traffic
Memory
Periodic Tasks
R3
R2
R1
Message Data
(destination-oriented)
Process Data
(Broadcast)
E3
E2
E1
Event-driven Tasks
bus
Supervisory
Data
bus controller
Message Services
Variables Services
Queues
station
3.2 Field bus operation
39
Industrial Automation
Field - and Process bus
Fieldbus Process Bus
controlled by a central master
(redundant for availability)
cyclic polling
call/reply in one bus transfer
(read-cycle)
("fetch principle")
number of participants limited by
maximum period
cheap connection (dumb)
only possible over a limited
geographical extension
strictly deterministic
multi-master bus (Arbitration)
event-driven
call/reply uses two different messages.
both parties must become bus master
("bring - principle")
large number of participants
costly connection (intelligent)
also suited for open systems
deterministic arbitration -> Token
non - deterministic
3.2 Field bus operation
40
Industrial Automation
Cyclic or Event-driven Operation For Real-time ?
Data are transmitted at fixed intervals,
whether they changed or not.
Data are only transmitted when they
change or upon explicit demand.
cyclic operation event-driven operation
(aperiodic, demand-driven, sporadic)
(periodic, round-robin)
Worst Case is normal case Typical Case works most of the time
Non-deterministic: delivery time vary widely
Deterministic: delivery time is bound
All resources are pre-allocated Best use of resources
message-oriented bus
object-oriented bus
Fieldbus Foundation, MVB, FIP, .. Profibus, CAN, LON, ARCnet
The operation mode of the communication exposes the main approach to
conciliate real-time constrains and efficiency in a control systems.
3.2 Field bus operation
41
Industrial Automation
Fieldbus: Networking
3.1 Field bus types
Classes
Physical layer
3.2 Field bus operation
Data distribution
Cyclic Operation
Event Driven Operation
Real-time communication model
Networking
3.3 Standard field busses
3.2 Field bus operation
42
Industrial Automation
Networking field busses
Networking field busses is not done through bridges or routers,
because normally, transition from one bus to another is associated with:
- data reduction (processing, sum building, alarm building, multiplexing)
- data marshalling (different position in the frames)
- data transformation (different formats on different busses)
Only system management messages could be threaded through from end to end,
but due to lack of standardization, data conversion is today not avoidable.
3.2 Field bus operation
43
Industrial Automation
Networking: Printing machine (1)
B C D
E
PM
LS
LS
LS
PM
LS
LS
LS
PM
LS
LS
LS
PM
LS
LS
LS
MPS
Section Control
Line bus (AF100)
Section Busses (AF100)
Console,
Section Supervision
Reelstand bus (Arcnet)
Reelstand-Gateways
Operator bus (Ethernet)
Plant-bus (Ethernet)
Production
Reelstands
Printing Towers
RPE
RPD
RPC
RPB
SSC SSD SSE
SSB
multiplicity of field busses with different tasks, often associated with units.
main task of controllers: gateway, routing, filtering, processing data.
most of the processing power of the controllers is used to route data
3.2 Field bus operation
44
Industrial Automation
Networking: Printing Section (2)
Falz- und
Wendeturm-
steuerung
to production preparation
(Ethernet) bridge
PM
PM
standby
GW GW
standby
Section bus D
Line bus Rollenwechsler-
koppler A
Pressmasterbus (Ethernet)
Interbus-S
ARCnet
Rollen-
wechslerkoppler I
Sektions-
steuerung
MR93
KT94
IBG
V-Sercos
IBG
Interbus
AC160 AC160
H -steuerungen
Service-Arcnet
Turmsteuerung
Section bus B
Section bus C
H-Sercos
IBG
V-Sercos
IBG
Interbus
AC160
Turmsteuerung
IBG
V-Sercos
IBG
Interbus
AC160
Turmsteuerung
IBG
KT94
KT94
KT94
KT94
KT94
KT94
KT94
KT94
KT94
KT94
KT94
KT94
KT94
KT94
ODC
KT94
Oxydry-Arcnet
Oxydry
Sektions-
steuerung
AC160
Auro
Tower-ARCnet
LS LS LS
V-Sercos
Section bus C
3.2 Field bus operation
45
Industrial Automation
The worst-case delay for the transmission of all variables is the sum of 5 delays:
The actual delay is non-deterministic, but bounded
Transmission delay over a Trunk Bus (cyclic bus)
gateway
speed
stop
speed
stop
Feeder Bus Feeder Bus
Trunk Bus
gateway
copying,
filtering &
marshalling
delay
copying,
filtering &
marshalling
delay
• feeder bus delay
• gateway marshalling delay
• trunk bus delay
• gateway marshalling delay
• feeder bus delay
32 ms
16 ms
25 ms
10 ms (synchronized)
32 ms
= 100 ms
3.2 Field bus operation
46
Industrial Automation
Assessment
• What is the difference between a centralized and a decentralized industrial bus ?
• What is the principle of source-addressed broadcast ?
• What is the difference between a time-stamp and a freshness counter ?
• Why is an associative memory needed for source-addressed broadcast ?
• What are the advantages / disadvantages of event-driven communication ?
• What are the advantages / disadvantages of cyclic communication ?
• How are field busses networked ?
2004 June, HK
Industrial Automation
Automation Industrielle
Industrielle Automation
3 Industrial Communication Systems
Open System Interconnection (OSI) model
3.3.1 Modèle OSI d’interconnexion
OSI-Modell
Physical
Link
Network
Transport
Session
Presentation
6
5
4
3
2
1
Application
7
Prof. Dr. H. Kirrmann
ABB Research Center, Baden, Switzerland
2
2004 June, HK 3.3.1 OSI model
EPFL - Industrial Automation
The OSI model
• was developed to structure telecommunication protocols in the ‘70
(Pouzin & Zimmermann)
• standardized by CCITT and ISO as ISO / IEC 7498
• is a model, not a standard protocol, but a suite of protocols with the same name
has been standardized by UIT / ISO / IEC for open systems data interconnection
(but with little success)
• all communication protocols (TCP/IP, Appletalk or DNA) can be mapped to the
OSI model.
• mapping of OSI to industrial communication requires some additions
The Open System Interconnection (OSI) model is a standard way to
structure communication software that is applicable to any network.
3
2004 June, HK 3.3.1 OSI model
EPFL - Industrial Automation
OSI-Model (ISO/IEC standard 7498)
Physical
Link
Network
Transport
Session
Presentation
6
5
4
3
2
1
Application
7
"Transport"
protocols
"Application"
protocols
Definition and conversion of the data
formats (e.g. ASN 1)
All services directly called by the end user
(Mail, File Transfer,...) e.g. Telnet, SMTP
Management of connections
(e.g. ISO 8326)
End-to-end flow control and error recovery
(e.g. TP4, TCP)
Routing, possibly segmenting
(e.g. IP, X25)
Error detection, Flow control and error recovery,
medium access (e.g. HDLC)
Coding, Modulation, Electrical and
mechanical coupling (e.g. RS485)
4
2004 June, HK 3.3.1 OSI model
EPFL - Industrial Automation
OSI Model with two nodes
Physical
Link
Network
Transport
Session
Presentation
Application
Physical Medium
node 1 node 2
7
6
5
4
3
2
1
7
6
5
4
3
2
1
5
2004 June, HK 3.3.1 OSI model
EPFL - Industrial Automation
Repeater
repeater
Ethernet
server
Ethernet
server
To connect a workstation of
department A to the printer of
department B, the cable becomes too
long and the messages are corrupted.
workstations
department A
department B
Physically, there is only one bus carrying
both department’s traffic, only one node
may transmit at a time.
printer
The repeater restores signal
levels and synchronization.
It introduces a signal delay of
about 1..4 bits
500m
500m
500m
6
2004 June, HK 3.3.1 OSI model
EPFL - Industrial Automation
OSI model with three nodes (bridge)
7
6
5
4
3
2
1
2
1
physical medium (0)
2
1
7
6
5
4
3
2
1
Physical
Link
Network
Transport
Session
Presentation
Application
Node 1 bridge Node 2
The subnet on both sides of a bridge have:
• the same frame format (except header),
• the same address space (different addresses on both sides of the bridge)
• the same link layer protocol (if link layer is connection-oriented)
Bridges filter the frames on the base of their link addresses
physical medium (0)
e.g. Ethernet 100 MBit/s e.g. ATM
7
2004 June, HK 3.3.1 OSI model
EPFL - Industrial Automation
Bridge example
repeater
Ethernet
server
Ethernet
server
Bridge
Ethernet 1
server
Ethernet 2
In this example, most traffic is directed from the workstations to the department
server, there is little cross-department traffic
workstations
department A
department B
There is only one Ethernet which carries
both department’s traffic
department A
There are now two Ethernets and only the
cross-department traffic burdens both busses
printer
server
department B
printer
8
2004 June, HK 3.3.1 OSI model
EPFL - Industrial Automation
Networking with bridges
port
port
LAN
port
port
port
port
LAN
port
port
LAN
LAN
LAN
port
port
port
Spanning-tree-Algorithmen
avoid loops and ensures
redundancy
9
2004 June, HK 3.3.1 OSI model
EPFL - Industrial Automation
Switch
crossbar-
switch
(or bus)
queues
full-duplex
a switch is an extension of a hub that allows store-and-forward.
nodes
10
2004 June, HK 3.3.1 OSI model
EPFL - Industrial Automation
OSI Model with three nodes (router)
physical medium (0)
Frames in transit are handled in the network layer .
The router routes the frames on the base of their network address.
The subnets may have different link layer protocols
Node 1 Router Node 2
Physical
Link
Network
Transport
Session
Presentation
Application
3
2
1
2
1
7
6
5
4
3
2
1
7
6
5
4
3
2
1
11
2004 June, HK 3.3.1 OSI model
EPFL - Industrial Automation
Repeater, Bridge, Router, Gateway: Topography
same speed
same medium
access
same frames
Bridge
Router
backbone (e.g. FDDI)
segment
Repeater
subnet (LAN, bus, extended link)
end-to-end
transport protocol
gateway
application-
dependent
connects different speed,
different medium access
by store-and-forward
same frames and addresses
initially transparent in both ways.
can limit traffic by filtering
devices (nodes, stations) have different link addresses
devices (nodes, stations) have different physical addresses
different subnetworks,
same address space
same transport protocol,
segmentation/reassembly
routers are initially opaque
12
2004 June, HK 3.3.1 OSI model
EPFL - Industrial Automation
Repeaters, Bridges, Routers and Gateways: OSI model
Net
Trp
Ses
Pre
Apl
Trp
Ses
Pre
Apl
MDS
LLC
Net
Trp
Ses
Pre
Apl
MAC
10 Mbit/s coax
MIS
MDS
Layer 1
MDS
repeater
or hub
10 Mbit/s fibre
MDS
MIS
MDS
MIS
Layer 2
100 Mbit/s Ethernet
bridge
( "switch")
(store-and-forward)
MDS
MIS
LLC
MAC
Layer 3
MDS
MIS
LLC
MAC
ATM 155 Mbit/s
MDS
MIS
LLC
MAC
Net
Trp
Ses
Pre
Apl
MAC MAC
router
MDS
LLC
IP
TCP
RPC
gateway
intelligent linking devices can
do all three functions
(if the data rate is the same)
Fibre
13
2004 June, HK 3.3.1 OSI model
EPFL - Industrial Automation
To which level does a frame element belong ?
destination source final origin
preamble
physical link
bridge
LLC NC
network
router
TRP SES PRE APL
application
(gateway)
repeater, hub
CRC
A frame is structured according to the ISO model
ED
link
LLC
Network
Control
transport
session
presentation
application
phy
14
2004 June, HK 3.3.1 OSI model
EPFL - Industrial Automation
Encapsulation
Frame
Signal
Error detection
Flag Flag
Link-address
Link control
(Acknowledge, Token,etc.)
Network address
Transport header
size
User information
CRC
LinkAdr
LinkCrt
NetAdr
INFO
TrpCrt
Each layer introduces its own header and overhead
15
2004 June, HK 3.3.1 OSI model
EPFL - Industrial Automation
Example: OSI-Stack frame structure
>48
ISO 8473
connectionless network control
5
ISO 8073
class 4 transport control
MA. frame control
MA. destination
address
(6 octets)
MA. source
address
(6 octets)
L_destination SAP
L_source SAP
L_PDU
L_PDU = UI, XID, TEST
LI
TPDU
Protocol Identifier
Header Length
Version/Protocol ID (01)
Lifetime
DT/ER Type
SP MS ER
Checksum
PDU Segment Length
Destination Address
(18 octets)
Source Address
(18 octets)
ADDRESS
PART
Segmentation
(0 or 6 octets)
Options
(priority = 3 octets)
(CDT)
N(S)
ET
MAC_header LNK_hdr NET_header TRP_header
Destination
Reference
FIXED
PART
13 3
DATA
AFI = 49
IDI, Area ID
(7 octets)
PSI
Physical Address
(6 octets)
LSAP = FE
NSAP = 00
IDP
(initial
domain
part)
DSP
(domain
specific
part)
DATA (DT) TPDU
(normal format)
LSAP = DSAP
FE = network layer
18 = Mini-MAP Object
Dictionary Client
19 = Network Management
00 = own link layer
(81)
IEEE 802.4
token bus
ISO 8802
logical link control
address length
16
2004 June, HK 3.3.1 OSI model
EPFL - Industrial Automation
Protocol Data Units and Service Data Units
Protocol
Data Unit
(PDU)
N - Layer
N+1- Layer
N-1 Layer
Protocol
Data Unit
(PDU)
Service-
Data Unit
(SDU)
Service-
Data Unit
(SDU)
Layer N provides services to Layer N+1;
Layer N relies on services of Layer n-1
(n)-layer entity
(n)-layer entity
(n+1)-layer entity
(n+1)-layer entity
(n-1)-layer entity
(n-1)-layer entity
17
2004 June, HK 3.3.1 OSI model
EPFL - Industrial Automation
Service Access Points
user of
service N
user of
service N
provider of service (N-1)
provider of service (N)
functions in layer N
Service Access Points (SAP)
Service Access Points represent the interface to a service (name, address, pointer,...)
Service Access Points (SAP)
18
2004 June, HK 3.3.1 OSI model
EPFL - Industrial Automation
Address and SAPs in a device
Link
Network
Transport
z.B. TCP/IP z.B. ISO 8073
ISO 8473
ISO-stack
Transport-SAP
Physical Physical Address
Logical Address or link address
Network-SAP
(not Network address)
TSAP
NSAP
ASAP Application
(z.B. File transfer, Email,....)
PhSAP
LSAP
19
2004 June, HK 3.3.1 OSI model
EPFL - Industrial Automation
Procedure call conventions in ISO
Service User
confirm
(network)
Service Provider
(Network Transmission)
request
confirm
(local)
time
Service User
indication
response
confirm
(user)
20
2004 June, HK 3.3.1 OSI model
EPFL - Industrial Automation
OSI implementation
OSI should be considered as a model, not as an implementation guide
Even if many claim to have "OSI"-conformant implementation, it cannot be proven.
IEC published about 300 standards which form the "OSI" stack, e.g.:
OSI stack has not been able to establish itself against TCP/IP
Former implementations, which implemented each layer by an independent process,
caused the general belief that OSI is slow and bulky.
The idea of independent layers is a useful as a way of thinking, not the best implementation.
ISO/IEC 8327-1:1996 Information technology -- Open Systems
Interconnection -- Connection-oriented Session protocol: Protocol specification
ISO/IEC 8073:1997 Information technology -- Open Systems
Interconnection -- Protocol for providing the connection-mode transport service
ISO/IEC 8473-2:1996 Information technology -- Protocol for providing
the connectionless-mode network service --
ISO 8571-2:1988 Information processing systems -- Open Systems
Interconnection -- File Transfer, Access and Management
ISO/IEC 8649:1996 Information technology -- Open Systems
Interconnection -- Service definition for the Association Control Service Element
21
2004 June, HK 3.3.1 OSI model
EPFL - Industrial Automation
OSI protocols in industry
ISO-OSI standards should be used since they reduce specification and
conformance testing work and commercial components exist
the OSI model is a general telecommunication framework -
implementations considers feasibility and economics.
industrial busses use for real-time data a fast response access and
for messages a simplified OSI communication stack
the OSI model does not consider transmission of real-time data
the overhead of the ISO-OSI protocols (8073/8074) is not bearable
with low data rates under real-time conditions.
Communication is greatly simplified by adhering to conventions
negotiating parameters at run-time is a waste in closed applications.
the OSI-conformant software is too complex:
simple devices like door control or air-condition have limited power.
•
•
•
•
•
•
Theory:
Reality:
Therefore:
the devices must be plug compatible: there are practically no options.
•
22
2004 June, HK 3.3.1 OSI model
EPFL - Industrial Automation
TCP / IP structure
TCP UDP
IP routing ICMP
FTP SMTP HTTP
Files SNMP Applications
Transport
Network
Ethernet ATM radio
modem Link & Physical
The TCP/IP stack is lighter than the OSI stack, but has about the same complexity
TCP/IP was implemented and used before being standardized.
Internet gave TCP/IP a decisive push
23
2004 June, HK 3.3.1 OSI model
EPFL - Industrial Automation
Conclusions
The OSI model is the reference for all industrial communication
Even when some layers are skipped, the concepts are generally implemented
Real-Time extensions to OSI are under consideration
TCP/IP however installs itself as a competitor to the OSI suite, although some efforts are
made to integrate it into the OSI model
For further reading: Motorola Digital Data Communication Guide
TCP/IP/UDP is becoming the backbone for all non-time critical industrial communication
Many embedded controllers come with an integrated Ethernet controller, an the
corresponding real-time operating system kernel offers TCP/IP services
TCP/IP/UDP is quickly displacing proprietary protocols.
Like OSI, TCP protocols have delays counted in tens or hundred milliseconds,
often unpredictable especially in case of disturbances.
Next generation TCP/IP (V6) is very much like the OSI standards.
24
2004 June, HK 3.3.1 OSI model
EPFL - Industrial Automation
Assessment
1) Name the layers of the OSI model and describe their function
2) What is the difference between a repeater, a bridge and a router ?
3) What is encapsulation ?
4) By which device is an Appletalk connected to TCP/IP ?
5) How successful are implementations of the OSI standard suite ?
2004 June, HK
Industrial Automation
Automation Industrielle
Industrielle Automation
3. Industrial Communication Systems
Physical Layer
3.3.2 Niveau physique
Physische Schicht
3.3.2
Prof. Dr. H. Kirrmann
ABB Research Center, Baden, Switzerland
2
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Physical Layer Outline
2. Topology
3. Physical media
5. Optical Fibres
6. Modulation
8. Encoding
4. Electric Signal coupling
7. Synchronization
9. Repeaters
1. Layering
3
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
OSI Model - location of the physical level
Physical
Link
Network
Transport
Session
Presentation
Application
Transport
protocols
Application
protocols
All services directly called by the end user
(Mail, File Transfer,...)
Definition and conversion of the
data formats (e.g. ASN 1)
Management of connections
(e.g. ISO 8326)
End-to-end flow control and error recovery
(z.B. TP4, TCP)
Routing, possibly segmenting
(e.g. IP, X25)
Error detection, Flow control and error recovery,
medium access (e.g. HDLC)
Coding, Modulation, Electrical and
mechanical coupling (e.g. V24)
6
5
4
3
2
1
7
4
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Subdivisions of the physical layer
mechanical
specifications
electrical / optical
specifications
medium-dependent signalling
medium-independent signalling same for different media
(e.g. coax, fibre, RS485)
applies to one media
(e.g. optical fibres)
defines the mechanical interface
(e.g. connector type and pin-out)
applies to one media type
(e.g. 200µm optical fibres)
Physical
Layer
5
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Concepts relevant to the physical layer
Topology
Mechanical
Control Send, Receive, Collision
Interface Binary bit, Collision detection [multiple access]
Signal quality supervision, redundancy control
Modulation
Binary, NRZ, Manchester,..
Synchronisation Bit, Character, Frame
Flow Control Handshake
Medium
Channels
Coding/Decoding
Baseband, Carrier band, Broadband
Ring, Bus, Point-to-point
Connector, Pin-out, Cable, Assembly
signals, transfer rate, levels
Half-duplex, full-duplex, broadcast
6
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Example: RS-232 - Mechanical-Electrical Standard
DTE DCE DTE
DCE
2
Data
Terminal
Equipment
Data Communication
Equipment (Modem)
Telephone
lines
2
modem eliminator
cable
extension
Tip: Do not use
Modem cables,
only Extension
cables
Data
Terminal
Equipment
computer terminal
2
Mechanical
2
25
7
Electrical:
+12V
-12V
+3V
-3V
transmitter receiver
"1" Mark Off
"0" Space On
Topology:
Cabling rules
Originally developed for modem communication, now serial port in IBM-PCs
cable
extension
Modem Computer
Terminal
3
1
7
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Physical Layer Outline
2. Topology
3. Physical media
5. Optical Fibers
6. Modulation
8. Encoding
4. Electric Signal coupling
7. Synchronization
9. Repeaters
1. Layering
8
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Topology: Simplex, Half and Full Duplex
Full-duplex
Sender/
Receiver
Link (Point -To-Point)
Bus (Half-Duplex, except when using Carrier Frequency over multiple bands)
Ring (Half-Duplex, except double ring)
Terminator
Examples:
Ethernet, Profibus
Examples:
SERCOS, Interbus-S
Examples:
RS232
Half-duplex
Sender/
Receiver
Sender/
Receiver
Sender/
Receiver
consists of point-to-point links
Examples:
RS485
9
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Bus topologies
party-line
a bus is a broadcast medium (delays come from propagation and repeaters)
radio free topology
repeater
Terminator
Terminator
advantage: little wiring disadvantages: easy to disrupt, high attenuation and reflections, no fibres
hub
star
advantage: robust point-to-point links, can use fibres disadvantage: requires hub, more wiring
point-to-point
10
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
500m
Repeater
repeater
Ethernet
server
Ethernet
server
To connect a workstation of
department A to the printer of
department B, the cable becomes too
long and the messages are corrupted.
workstations
department A
department B
Physically, there is only one Ethernet
carrying both department’s traffic, only one
node may transmit at a time.
printer
500m
The repeater restores signal
levels and synchronization.
It introduces a signal delay of
about 1..4 bits
500m
11
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Bus: repeaters and hubs
partyline
point-to-point
link
repeaters
higher-level hub
hubs assemble point-to-point links to form a broadcast medium (bus)
partyline
12
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Party-line (bus) and star wiring
I/O
PLC
I/O I/O I/O I/O
PLC
wiring length = d • n,
increases linearly with number of devices
d
wiring length = d • n • n / 2 • 2
increases with square of number of devices
hub
Up to 32 devices
(more with repeaters)
Up to 16 devices
per hub
I/O I/O I/O I/O I/O
d = average distance between devices
does it fit into the
wiring tray ?
star wiring may more than offset the advantage of field busses (reduced wiring) and leads to
more concentration of I/O on the field devices.
party-line wiring is well adapted to the varying topography of control systems
13
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Rings
classical ring
ring in floor wiring
wiring
cabinet
The wiring amount is the same for a bus with hub or for a ring with wiring cabinet.
Since rings use point-to-point links, they are well adapted to fibres
a ring consists only of point-to-point links
Each node can interrupt the ring and introduce its own frames
14
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Physical Layer Outline
2. Topology
3. Physical media
5. Optical Fibres
6. Modulation
8. Encoding
4. Electric Signal coupling
7. Synchronization
9. Repeaters
1. Layering
15
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
twinax 8 0.9 0.2 3.5 very good
Media (bandwidth x distance)
200m 700m 2000m
twisted wire
Telephone cable
Transfer rate (Mbit/s)
0.2 0.1 0.05
Costs
(Fr/m)
0.2
good (crosstalk)
bad (foreign)
Electromagnetic
Compatibility
group shielding (UTP) 1 0.3 0.1 1 good (crosstalk)
regular (foreign)
individually
shielded (STP)
2 0.35 0.15 .5 very good
50 Ohm 20 8 1 1.2
75 Ohm TV 1/2" 12 2.5 1.0 2.2 good
93-100 Ohm 15 5 0.8 2.5
single mode 2058 516 207 5.5
multimode 196 49 20 6.5
good
very good
very good
good
coaxial cables
optical fibres
Radio bad
Infrared 0.02
1 1 1 -
-
0 0 good
others Power line carrier 1 0.05 0.01 - very bad
plastic 1 0.5 - 6.5 very good
ultrasound 0.01 -
0 0 bad
the bandwidth x distance is an important quality factor of a medium
16
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Physical Layer Outline
2. Topology
3. Physical media
5. Optical Fibres
6. Modulation
8. Encoding
4. Electric Signal coupling
7. Synchronization
9. Repeaters
1. Layering
17
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Electrical: Transmission media
Cost efficient wiring:
twisted pair (without
Coaxial cable
Unshielded twisted wire
screen shield
dielectric
Telephone
Shielded twisted wire
(Twinax)
flexible, cheap,
medium attenuation
~1 MHz..12 MHz
inflexible, costly,
low losses
10 MHz..100 MHz
Zw = 85Ω..120Ω
Zw = 50Ω ... 100Ω
core
very cheap,
very high losses and disturbances,
very low speed (~10 ..100 kbit/s)
numerous branches, not terminated,
except possibly at one place
Shield
very cheap,
sensible to perturbations
Uncommitted wiring
(e.g. powerline com.)
1) Classical wiring technology,
2) Well understood by electricians in the field
3) Easy to configure in the field
4) Cheap (depends if debug costs are included)
1) low data rate
2) costly galvanic separation (transformer, optical)
3) sensible to disturbances
4) difficult to debug, find bad contacts
5) heavy
twisting compensates disturbances
18
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Electrical: Twisted wire pair
characteristic impedance most used in industrial environment:
120 Ohm for bus, 150 Ohm for point-to-point.
Standard from the telecommunication world: ISO/IEC 11801
Cat 5 (class D): 100 MHz, RJ 45 connector
Cat 6 (class E): 200 MHz, RJ 45 connector
Cat 7 (class F): 600 MHz, in development
These are only for point-to-point links ! (no busses)
19
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Electrical: What limits transmission distance ?
Attenuation: copper resistance, dielectric loss.
Frequency dependent losses cause dispersion (edges wash-out):
Signal reflection on discontinuities (branches, connectors) cause self-distortions
Characteristic impedance
Attenuation
Linear resistance
Linear capacitance
Cross talk
Common-mode
Shield protection
All parameters are frequency-dependent
20
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Consider in cables
- characteristic impedance (Zw) (must match the source impedance)
- attenuation (limits distance and number of repeaters)
- bending radius ( layout of channels)
- weight
- fire-retardant isolation
L' R'
C'
L' R'
C'
L' R'
C'
L' R'
C'
G'
lumped line model
specific inductance (H/m)
specific resistance (W/m)
specific capacitance (F/m)
specific conductance (S/m)
Zw =
L'
C'
G' G' G'
21
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Electrical: Signal Coupling Types
Resistive direct coupling
driver on line without galvanic coupling
collision possible when several transmitters active
Wired-OR combination possible
Inductive transformer-coupling
galvanic separation
retro-action free
good electromagnetic compatibility (filter)
cheap as long as no galvanic separation is required (opto-coupler)
signal may not contain DC-components
bandwidth limited
Capacitive capacitor as coupler
weak galvanic separation
signal may not contain DC components
cheap
good efficiency
good efficiency
not efficient
22
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Electrical: Resistive (direct) coupling
Ru
Rd
Zw
Zw
+ Us
+ Us
- Us
Unipolar, unbalanced
Open Collector
(unbalanced)
Bipolar, unbalanced
Rt
Ut
Rt
Ut = 5 V (e.g.)
Bus line, characteristic impedance = Zw
Out In
device
Out In
device
Out In
device
Terminator and
Pull-up resistor
wired-OR behaviour
(“Low” wins over “High”
Coax
23
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Electrical: Balanced Transmission
Zw
Shield
(Data Ground)
Differential transmitter and receiver
+ good rejection of disturbances on the line and common-mode
- double number of lines
Differential amplifier
(OpAmp)
Used for twisted wire pairs (e.g. RS422, RS485)
Common mode rejection: influence of a voltage which is applied simultaneously on both
lines with respect to ground.
The shield should not be used as a data ground (inductance of currents into conductors)
UA UB
symmetrical line (Twisted Wire Pair) Rt
+Ub
100 ?
24
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Electrical: RS-485 as an example of balanced transmission
The most widely used transmission for busses over balanced lines (not point-to-point)
stub
tap
120?
A
B
Data-GND
A
100?
RxS
TxS
RxS
TxS
RxS
TxS
Terminator
segment length
• • •
Zw ˜ 120? , C' ˜ 100 pF/m
Ishort < 250 mA
Short-circuit limitation
needed
120?
multiple transmitter
allowed
25
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Electrical: RS-485 Distance x Baudrate product
20
50
100
200
500
1000
2000
5000
10000
10KBd 100KBd 1 MBd 10 MBd
limited by: Cable quality: attenuation, capacitive loading, copper resistance
Receiver quality and decoding method
distance
Signal/Noise ratio, disturbances
12
1200
Baudrate
limited by copper resistance
100? /km -> 6dB loss limit
limited by
frequency-dependent
losses ˜ 20 dB/decade
26
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Electrical: Transformer Coupling
Provides galvanic separation, freedom of retro-action and impedance matching
Sender/Receiver
Twisted Wire Pair
shield
Isolation transformer
isolation resistors
but: no DC-components may be transmitted.
cost of the transformer depends on transmitted frequency band (not center frequency)
Source: Appletalk manual
Sender/Receiver
27
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Electrical: MIL 1553 as an example of transformer coupling
Twisted Wire Pair
shield
Isolation transformer
isolation resistors
Direct Coupling
(short stub: 0.3 m)
short
stub
Sender/Receiver
shield
Isolation transformer
isolation resistors
long
stub
Double-Transformer
(long stub: 0.3 .. 6m)
Extract from: MIL-STD-1553
MIL 1553 is the standard field bus used in avionics since the years '60 - it is costly and obsolete
28
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Electrical: Free topology wiring
terminator
voltage
source
Free topology is used to connect scattered devices which are usually line-powered.
Main application: building wiring
Transmission medium is inhomogeneous, with many reflections and discontinuities.
Radio techniques such as echo cancellation, multiple frequency transmission
(similar to ADSL) phase modulation, etc... are used.
Speed is limited by the amount of signal processing required (typically: 10 kbit/s)
29
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Electrical: Power Line Carrier technology
HF-trap
A free-topology medium using the power lines as carrier.
Used for retrofit wiring (revamping old installations) and for minimum cabling
Problems with disturbances, switches, transformers, HF-traps, EMC,..
Low data rates ( < 10 kbit/s)
Proposed for voice communication over the last mile (ASCOM)
Difficult demodulation
Capacitive or inductive coupling, sometimes over shield
Applications: remote meter reading, substation remote control
220V
30
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Electrical: Mechanical Connecting devices to an electrical bus
some applications require live insertion (power plants, substations)
time-outs (causing emergency stop) limit disconnection time
short stub junction box
thread-through
2 connectors
no live insertion
1 connector
live insertion
(costly) junction box
1 connector
live insertion
Electrical wiring at high speed requires careful layout
(reflections due to device clustering or other discontinuities, crosstalk, EM disturbances)
stub
double-connector
2 connectors
live insertion
installation ?
installation or operational requirements may prohibit screws (only crimping)
31
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Practical solution to live insertion
Offers life insertion
but costs a lot
(also in place)
32
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Electrical: Connectors
Field busses require at the same time low cost and robust connectors.
The cheapest connectors come from the automobile industry (Faston clips)
and from telephony (RJ11, RJ 45)
However, these connectors are fragile. They fail to comply with:
- shield continuity
- protection against water, dust and dirt (IP68 standard)
- stamping-proof (during commissioning, it happens that workers and vehicles pass over cables)
The most popular connector is the sub-D 9 (the IBM PC's serial port),
which exists in diverse rugged versions.
Also popular are Weidmann
and Phoenix connectors.
33
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Electrical: Water-proof Connectors
connector costs can become the dominant cost factor…
34
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Physical Layer Outline
2. Topology
3. Physical media
5. Optical Fibers
6. Modulation
8. Encoding
4. Electric Signal coupling
7. Synchronization
9. Repeaters
1. Layering
35
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Fiber: Principle
Is
GaAs
LED
PIN
fotodiode
different refraction
coefficients
Cable
Transmitter
laser-diode (GaAsP, GaAlAs, InGaAsP)
Receiver
Wavelength
1300 nm-window (Monomode)
Transmitter, cable and receiver must be "tuned" to the same wavelength
850 nm (< 3,5 dB/km, > 400 MHz x km)
laser (power),
glass (up to 100 km) or plastic (up to 30 m).
PIN-diode
light does not travel faster than electricity in a fiber (refraction index).
3 components:
transmitter fibre receiver
36
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Fiber: Types
Multimodefibre
N(r)
50 - 300 µm 50 - 100 µm 2-10 µm
Monomode fibre
waveguide
total reflection gradual reflection
50 µm
Core
Clad
Refraction profile
Cross-section
Longitudinal section
5dB/km 3 dB/km 2,3 dB/km
800nm
(infra-red) 1300nm 0,6 dB/km 0,4 dB/km
20MHz·km 1 GHz·km 100 GHz·km
telecom - costly
50 or 62.5 µm LAN fibre
HCS (Hard-Clad Silica)
ø 200 µm, < 500m
(red) 650nm 10 dB/km
37
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Fibre: Use
Material plastic glass / plastic glass
distance 70m 400m 1km
Usage local networking remote networking telephone
Connector simple high-precision
Cost cheap medium medium
aging poor very good good
bending very good good poor
bandwidth poor good very good
Type POF HCS/PCF GOF
precision
in industry, fibers cost the same as copper - think about system costs !
POF: Plastic Optical Fibres
GOF: Glass Optical Fibres
HCS: silica fibre
38
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Fiber: building an optical bus
Passive coupler
Active star coupler
electrical segment (wired-or)
fibre pair
opto-electrical
transceiver
Every branch costs a
certain percentage of light
n% coupling losses
n% coupling losses
Passive star coupler
1
2
3
4
5
6
1
2
3
4
5
6
Fused zone
costly manufacturing (100 $ branches)
costly manufacturing
(100 $ / 4 branches)
39
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Fiber: building an optical ring and bridging
Powered unpowered
Double ring
Mechanical bridging is difficult
This is why optical fibers are mostly used in rings (FDDI, Sercos)
example of
solution
prism
spring
40
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Fiber: advantages
1 ) high bandwidth and data rate (400 MHz x km)
2 ) small, frequency-insensitive attenuation (ca. 3 dB/km)
4 ) immune against electromagnetic disturbances (great for electrical substations)
5 ) galvanic separation and potential-free operation (great for large current environment)
6 ) tamper free
7 ) may be used in explosive environments (chemical, mining)
8 ) low cable weight (100 kg/km) and diameter, flexible, small cable duct costs
10) standardized
3 ) cover long distances without a repeater
9 ) low cost cable
41
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Fiber: Why are fibres so little used ?
1) In process control, propagation time is more important than data rate
2) Attenuation is not important for most distances used in factories (200m)
3) Coaxial cables provide a sufficiently high immunity
5) Galvanic isolation can be achieved with coaxial cables and twisted pairs through opto-couplers
6) Tapping is not a problem in industrial plants
8) In explosive environments, the power requirement of the optical components hurts.
9) Installation of optical fibres is costly due to splicing
4) Reliability of optical senders and connections is insufficient (MTTF ≈ 1/power).
7) Optical busses using (cheap) passive components are limited to a few branches (16)
10) Topology is restricted by the star coupler (hub) or the ring structure
42
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Radio Transmission
Radio had the reputation to be slow, highly disturbed and range limited.
Mobile radio (GSM, DECT) is able to carry only limited rate of data (9.6 kbit/s) at high costs,
distance being limited only by ground station coverage.
IEEE 802.11 standards developed for computer peripherals e.g. Apple’s AirPort
allow short-range (200m) transmission at 11 Mbit/s in the 2.4 GHz band with 100mW.
Bluetooth allow low-cost, low power (1 mW) links in the same 2.4 GHz band, at 1 Mbit/s
Modulation uses amplitude, phase and multiple frequencies (see next Section)
Higher-layer protocols (WAP, …) are tailored to packet radio communication.
Radio == mobile -> power source (batteries) and low-power technologies.
bluetooth module
43
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Wireless Field busses
short distance,
limited bandwidth,
area overlap and frequency limitations
not tamper-free,
difficult to power the devices
costs of base station
but: who changes the batteries ?
no wiring,
mobile,
easy to install
44
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Redundancy at the physical layer
cable come together at each device
centralized wiring
star coupler B
Star topology
Party-Line
decentralized wiring both cables can run in the same conduct where
common mode failure acceptable
Terminator
Terminator
star coupler A
common mode failures cannot be excluded since wiring has to come together at each device
star couplers should be separately powered
45
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Physical Layer Outline
2. Topology
3. Physical media
5. Optical Fibers
6. Modulation
8. Encoding
4. Electric Signal coupling
7. Synchronization
9. Repeaters
1. Layering
46
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Modulation
Base band
Carrier band
Broadband
Signals may be modulated on a carrier frequency
(e.g. 300MHz-400MHz, in channel of 6 MHz)
Signal transmitted as a sequence of frequencies,
several at the same time.
Signal transmitted as a sequence of binary
states, one at a time (e.g. Manchester)
Signal transmitted as a sequence of frequencies,
one at a time
(e.g. FSK = frequency shift keying = 2-phase
Modulation.
Frequency
5-108
MHz
162-400
MHz
Backward
channel
Forward-
channel
47
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Physical Layer Outline
2. Topology
3. Physical media
5. Optical Fibres
6. Modulation
8. Encoding
4. Electric Signal coupling
7. Synchronization
9. Repeaters
1. Layering
48
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Synchronisation: where does it take place ?
"determine the beginning and the end of a data stream"
Bit synchronisation Recognize individual bits
Frame synchronisation Recognize a sequence of bits transmitted as a whole
Message synchronisation Recognize a sequence of frames
Session synchronisation Recognize a sequence of messages
Clock
+NRZ Data
+Framing
Data in Manchester II
Start-sync
(Violation)
Stop-sync
(Violation)
= Line Signal
Example: Frame synchronisation using Manchester violation symbols
Character synchronisation Recognize groups of (5,7,8,9,..) bits
1 1 0 1 0 0 0 1
Data
49
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Frames: Synchronization
character-synchronous
(e.g. bisync)
A character is used as synchronisation character
If this character appears in the data stream, it is duplicated
The receiver removes duplicated synchronisation characters
delimiter
(e.g. IEC 61158)
A symbol sequence is used as delimiter, which includes non-data symbols
bit-synchronous
(e.g. HDLC)
A bit sequence is used as a flag (e.g. 01111110).
To prevent this sequence in the bit-stream, the transmitter inserts a "0" after
each group of 5 consecutive "1", which the receiver removes.
Delimiter (not Manchester)
"1" "1" "0" "0" "1" "1"
Manchester symbols
1 1 1 0 0 0 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0
0 1 0
Data
Signal 1 1 1 0 0 0 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0 1 1 1 1 1
0 1 1 1 1 1 10 0
0
Bit-stuffing
flag
SYN A B C SYN SYN D E F G SYN
Byte-stuffing
A B C SYN D E F G
Data
Signal
flag flag
Signal
50
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Physical Layer Outline
2. Topology
3. Physical media
5. Optical Fibers
6. Modulation
8. Encoding
4. Electric Signal coupling
7. Synchronization
9. Repeaters
1. Layering
51
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Encoding: popular DC-free encodings
1 1 0 1 1 0 0 0
Manchester
1: falling edge at midpoint
0: rising edge at midpoint
DC-free, memoryless*
Miller (MFM)
centre frequency halved
not completely DC-free
memory: two bits
(sequence 0110)
Differential Manchester
always transition at midpoint
1: no transition at start point
0: transition at start point
(polarity-insensitive, DC-free,
memoryless)
Xerxes
replaces “101” sequence
by DC-balanced sequence
DC-free, memory: two bits
Ethernet, FIP
IEC 61158,
MVB, MIL 1553
High-density
diskettes
LON
FlexRay
memoryless*: decoding does not depend on history
user
52
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Encoding: DC-free coding for transformer coupling
DC-free encoding is a necessary, but not sufficient condition
The drivers must be carefully balanced (positive and negative excursion |+U| = |-U|)
Slopes must be symmetrical, positive and negative surfaces must be balanced
Preamble, start delimiter and end delimiter must be DC-free
(and preferably not contain lower-frequency components)
Transformer-coupling requires a lot of experience.
Many applications (ISDN…) accept not completely DC-free codes, provided that
the DC component is statistically small when transmitting random data, but have to
deal with large interframe gaps.
effect of unbalance
(magnetic discharge)
53
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Decoding base-band signals
Zero-crossing detector
Sampling of signal
needs Phase-Locked Loop (PLL) and preamble (? delimiter)
Signal Frequency Analysis
requires Signal Processor, Quadrature/Phase analysis
decoding depends on the distance between edges
1 0 1 0 1 0 1 0 1 N+ N- 1 0 N-N+ 0 1 1 1
Preamble Delimiter
RxS
Uh+
Uh-
idle level
active
idle
Daten
Dynamic: 10 dB
Dynamic: 32 dB
Dynamic: 38 dB
histeresis
unipolar signal
time
Uh+
Uh-
line
bipolar signal
Dynamic: 18 dB
54
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Encoding: Physical frame of IEC 61158-2
Start delimiter (8 bit times)
1 N+ N- 1 0 N- N+ 0
1 N+ N- N+ N- 1 0 1
1 0 1 0 1 0 1 0
+U
-U
end delimiter
payload
0V
defines end of frame
needed since preamble
is variable length
start
preamble
1 0 0 1 1 0 1 1
Payload (variable length)
Preamble (variable) for PLL synchronisation
End delimiter (8 bit times)
55
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Encodings: Multi-frequency
frequency
54
kHz
49,5 kHz
45 kHz
40,5 kHz
36
kHz
31,5 kHz
27 kHz
22,5 kHz
90 kHz
85,5 kHz
81 kHz
76,5 kHz
72
kHz
67,5 kHz
63
kHz
58,5 kHz
"0"
"SB1"
"1" "0" "1" "0" "1" "0" "1" "0" "1" "0" "1" "0" "1" "0" "1"
"SB2" "SB3" "SB8"
"SB4" "SB5" "SB6" "SB7"
unused
power
Best use of spectrum
Adaptive scheme (frequency-hopping, avoid disturbed frequencies, overcome bursts)
Base of ADSL, internet-over-power lines, etc...
Requires digital signal processor
Limited in frequency
EMC considerations
56
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Bandwidth and Manchester Encoding
" 0 " " 0 " " 0 " " 1 " " 0 "
" 1 " " 1 "
2-step
Delimiter
3-step
Non-data symbols may introduce a lower-frequency component
which must go through a transformer.
The transformer must be able to transmit frequencies in a 1:20 ratio
3-step
57
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Encoding: qualities
1) Self-clocking, Explicit clocking or asynchronous
Clocked: separate clock channel
Self-clocking: clock channel multiplexed with signal
Asynchronous: requires synchronisation at next higher level.
Code such as HDB3 insert "Blind Bits" to synchronize a random sequence.
2) Spectral efficiency
Which frequency components can be found in a random data sequence ?
especially: is there a DC-component ?
(Important for transformer and transceiver coupling)
Pseudo-DC-free codes such as AMI assume that "1" and "0" are equally frequent.
3) Efficiency: relation of bit rate to Baudrate
Bitrate = Information bits per second
Baudrate = Signal changes per second
4) Decoding ease
Spectral-efficient codes are difficult to decode
This is especially the case with memory-codes (value depends on former symbols)
(e.g. Miller, differential Manchester).
5) Integrity
For error detection, the type of error which can occur is important, and especially if a single
disturbance can affect several bits at the same time (Differential Manchester).
6) Polarity
A polarity-insensitive electrical wiring simplifies installation
58
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Physical Layer Outline
2. Topology
3. Physical media
5. Optical Fibres
6. Modulation
8. Encoding
4. Electric Signal coupling
7. Synchronization
9. Repeaters
1. Layering
59
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Repeater
The repeater:
• decodes and reshapes the signal (knowing its shape)
• recognizes the transmission direction and forward the frame
• detects and propagates collisions
A repeater is used at a transition from one medium to another within the same subnet.
repeater
segment 2
decoder
encoder
decoder
encoder
segment 1
(RS 485) (transformer-coupled)
node node node node node
node
60
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Repeater and time skew
Repeaters introduce an impredictable delay in the transmission since they need some time
to synchronize on the incoming signal and resolve collisions.
61
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Star coupler (hub)
wired-or electrical media
fibre pair
opto-electrical
transceiver
to other device
or star coupler
to other device
or star coupler
device
device device device
A star coupler is a collection of repeaters that connect point-to-point links into a bus
(e.g. for optical fibres). it is called "hub" in the Ethernet standard.
It is a star topology, but a bus structure
62
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
To probe further
Henri Nussbaumer, Téléinformatique 1, Presses polytechniques romandes
Fred Halsall, Data Communications, Computer Networks and Open Systems, Addison-Wesley
EIA Standard RS-485
B. Sklar , “Digital Communications,” Prentice Hall, Englewood Cliffs, 1988
63
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
Assessment
What is the function of the physical layer ?
What is the difference between a bus and a ring ?
How is a bus wired ?
Which electrical media are used in industry ?
How is the signal coupled to an electrical media ?
How is the signal decoded ?
What is an open-collector (open-drain) electrical media ?
What are the advantages and disadvantages of transformer coupling ?
What limits the distance covered by electrical signals and how is this to overcome ?
What are the advantages and disadvantages of optical fibres ?
When are optical fibers of 240 mm used rather than 62.5 mm ?
What is a broadband medium ?
What is DSL ?
What is the purpose of modulation ?
What is the purpose of encoding ?
What is the difference between bit rate and Baudrate and what does it say about efficiency?
What limits the theoretical throughput of a medium ?
What is the difference between Manchester encoding, Miller and differential Manchester ?
Which are the qualities expected from an encoding scheme ?
64
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
65
2004 June, HK 3.3.2 Field busses - Physical Layer
EPFL - Industrial Automation
2004 June, HK
Industrial Automation
Automation Industrielle
Industrielle Automation
3. Industrial Communication Systems
Link Layer and Medium Access
3.3.3 Niveau de liaison et accès au médium
Verbindungsschicht und Mediumzugriff
Prof. Dr. H. Kirrmann
ABB Research Center, Baden, Switzerland
2
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Link Layer Outline
Link Layer in the OSI model
Stacks
HDLC as example
Frame sub-layer
Error detection
Error correction
Medium Access control
Logical Link Control
Connection-Oriented and connectionless
Error recovery
Flow control
HDLC
Quality Criteria
Single Master
Rings
Ethernet
Collision with winner
Token Passing
Comparison
3
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Link Layer function
1) Data integrity
2) Medium Access
3) Logical Link Control
The link layer implements the protocols used to communicate within the same subnet.
(subnet: same medium access, same bit rate)
- but different media may be interconnected by (bit-wise) repeaters
Tasks of the link layer:
4) Link Layer Management
4
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Link Layer in the OSI Model
Functions
addressing
frame format
integrity control
medium allocation
(master redundancy)
connection establishment
flow Control
error handling
Medium Access
Control
(MAC)
Logical Link
Control
(LLC)
Network
Frame
Physical
Medium
Physical
Signaling
Physical
Link
Network
Transport
Session
Presentation
6
5
4
3
2
1
Application
7
Subnet (Bus or Ring)
bridge control store-and-forward
address discovery
5
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
OSI model with two nodes
Physical
Link
Network
Transport
Session
Presentation
Application
Physical Medium
Node 1 Node 2
7
6
5
4
3
2
1
7
6
5
4
3
2
1
6
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
OSI model with repeater (physical layer connection)
Physical
Link
Network
Transport
Session
Presentation
Application 7
6
5
4
3
2
1 1
physical medium (0)
Node 1 repeater
1
7
6
5
4
3
2
1
Node 2
The two segments on each side of a repeater form a single subnet, identified by
• same speed (medium, modulation may differ)
• same frame format (except fringe effects)
• same medium access
• same address space (transparent on both side of the repeater)
Repeaters introduce a delay in the order of a few bit time.
physical medium (1)
7
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
OSI model with three nodes (bridge): link layer connection
Physical
Link
Network
Transport
Session
Presentation
Application 7
6
5
4
3
2
1
2
1
physical medium (0)
Node 1 bridge
2
1
7
6
5
4
3
2
1
Node 2
The subnet on both sides of a bridge have:
• the same frame format (except header),
• the same address space (different addresses on both sides of the bridge)
• the same link layer protocol (if link layer is connection-oriented)
Bridges filter the frames on the base of their link addresses
physical medium (0)
8
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Link Layer Outline
Link Layer in the OSI model
Stacks
HDLC as example
Frame sub-layer
Error detection
Error correction
Medium Access control
Logical Link Control
Connection-Oriented and connectionless
Error recovery
Flow control
HDLC
Quality Criteria
Single Master
Rings
Ethernet
Collision with winner
Token Passing
Comparison
9
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
HDLC as example of a link layer protocol
Function
Standard
Address
Flag CRC
Data
Control
8 bit
01111110 16 bit
(n · 8)
8 bit
Flag
01111110
Integrity Check
Error recovery
Medium Access
Objects
16-bit Cyclic Redundancy Check
Master/Slave, (with slave initiative possible)
positive acknowledgement and retry
7-frames (127 frames) credit system
Flow control
Reliable transmission between devices of a subnet
HDLC (High Level Data Link)
Frame structure according to ISO 3309.
10
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
HDLC Topology
Primary
(Mainframe)
Secondary
(Terminal)
Secondary
(Terminal)
Secondary
(Terminal)
Secondary
(Terminal)
Secondary
(Terminal)
full-duplex
or
half-duplex
medium
The Primary (Master) is connected with the Secondaries (Slaves) over a
multidrop bus (e.g. RS 485) or over point-to-point lines
Secondary
(Terminal)
Secondary
(Terminal)
Secondary
(Terminal)
HDLC bases physically on a bus, but is logically a star network
11
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
HDLC - Full- and Half duplex operation
Command/Data
Sender/Receiver
Responder/
Secondary
Sender/Receiver
Requester/
Primary
Acknowledgement
Command/Acknowledgement
Sender/Receiver
Responder/
Secondary
Sender/Receiver
Requester/
Primary
Data
Sender/Receiver
Responder/
Secondary
Sender/Receiver
Requester/
Primary
Half-Duplex
Full-Duplex
The Primary switches the Secondary to send mode, the Secondary sends until it returns control
12
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Link Layer Outline
Link Layer in the OSI model
Stacks
HDLC as example
Frame sub-layer
Error detection
Error correction
Medium Access control
Logical Link Control
Connection-Oriented and connectionless
Error recovery
Flow control
HDLC
Quality Criteria
Single Master
Rings
Ethernet
Collision with winner
Token Passing
Comparison
13
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Frame Sublayer
The frame layer is concerned with the correct frame format and contents,
with (practically) no consideration of the medium or speed.
sublayer
Medium Access
Control
(MAC)
Logical Link
Control
(LLC)
Network
Frame
Physical
Medium
Physical
Signaling
Medium Access
Control
(MAC)
Logical Link
Control
(LLC)
Network
Frame
Physical
Medium
Physical
Signaling
14
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Error Handling
Industry imposes high standards regarding data integrity
Transmission quality is not very high , but consequences are severe.
Errors not detected at the link layer are very difficult to catch at higher layers
Error detection
Frame data are protected by redundant information, such as parity bits,checksum,
CRC (Cyclic Redundancy Check)
Error recovery
Except when medium is very poor (Power Line Carrier, radio), error correcting
Erroneous frames are ignored, the potential sender of the error is not informed
(the address of the sender is unknown if the frame is damaged)
The sender is informed of the lack of response when it does not receive the
expected acknowledgement within a time-out.
Definition of the time-out has a strong impact on real-time behaviour
codes are not used.
15
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Link Layer Outline
Link Layer in the OSI model
Stacks
HDLC as example
Frame sub-layer
Error detection
Error correction
Medium Access control
Logical Link Control
Connection-Oriented and connectionless
Error recovery
Flow control
HDLC
Quality Criteria
Single Master
Rings
Ethernet
Collision with winner
Token Passing
Comparison
16
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Error Detection
Error detection require redundancy in the transmitted information.
Signal redundancy: Signal quality supervision (squelch, jamming,..)
Coding redundancy: Timing-violations in decoder
Data redundancy: error detecting code
k data bits r check bits
n-bit codeword = (n,k) block code
• Code efficiency: CEF = k/n
• Hamming-Distance
Quality criteria
• Residual Error Rate
17
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Hamming Distance
The Hamming Distance between two words is the number of bits in which they differ:
Word 1: 01100110
Word 2: 00101001 -> Hamming-Distance = 5
The Hamming Distance of a code is the minimum number of bits which need to be tilted
in a valid codeword to produce another valid (but erroneous) codeword
00000 00001 00011 00111 01111
code word code word
m = 4
Number of detectable bit errors: ZD = HD – 1
Numbers of correctable bit errors: ZC = (HD–1)/2
Example: HD = 4: ZD = 3, ZC = 1
Example
1st error 2nd error 3rd error 4th error
18
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Hamming distance in 3 dimensions: parity
000
001
101
111
110
010
011
100
legal
illegal
Odd parity: sum Modulo-2 of all "1" in the codeword (including the parity bit) is odd
1 0 1 1 0 0 0 0
par D7 D6 D5 D4 D3 D2 D1
1
D0
The parity bit is the last transmitted bit (->LSB first, a matter of convention)
19
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Error Detection through CRC
The data stream consists of a sequence of n "0" and "1"
This sequence is treated as a polynomial of degree n.
This polynomial is divided by a Generator polynomial of degree m, m<n,
The rest of this division (which has (m-1) bits) is appended to the data stream.
(Cyclic Redundancy Check)
rest
/
At reception, the data stream is divided through the same generator-polynomial,
the rest of that division should be identical to the transmitted rest.
To simplify the receiver circuit, the rest is also divided by the generator polynomial,
the result should then be a known constant if the transmission was error-free.
The Generator Polynomial is chosen according to the expected disturbances:
burst or scattered errors, and the channel error model (bit inversion)
Principle
data (dividend)
GP(divisor)
20
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Residual Error Rate, Parity
Hamming Distance
R
e r
= 1 - (1- E
r
)
n
- n · E
r
· (1- E
r
)
n -1
Residual error rate
exactly one error
no error
E
r
Bit error probability
Rer for two word length:
E
r
= 10
-5
n = 9 bit R
er
= 72 · 10
-10
E
r
= 10
-5 n = 513 bit R
er
= 2.6· 10
-5
2
quite useless ...
quite efficient….
Rer = Probability of occurrence of an undetected error in spite of an error detecting
code as a function of the bit error probability
Example:
21
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Integrity classes and bit error rate
Residual Error Rate
10 -16
10 -14
10 -12
10 -10
10 - 8
10 - 6
10 - 4
10 - 2
10 0
Integrity class I1
I
n
t
e
g
r
i
t
y
c
l
a
s
s
I
2
Integrity class I3
FT2
FT1.2
10-5 10-4 10-3 10-2 10-1 10 0
Bit error rate
The standard IEC 61870-5 (protocols for remote control of substations)
defines several classes of robustness in function of the bit error rate (bad/good bits)
22
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Synchronization Errors
01111110 01111110
flag flag
FCS
HDLC-frame
01111110 01111110
flag flag
FCS
01111110
"FCS"
discarded
false
flag
1 Chance in 65536,
that the random data
form a correct CRC
disturbance
HDLC-frame with error
A single error can falsify a frame -> HD = 1
It is uninteresting how likely this case is, the fact is, that it can occur.
The synchronization should have a higher Hamming distance than the data itself.
Because of this bug, HDLC when used in industry require additional error checks.
precisely 1111110 is the most frequent sequence in a
random bit stream because of bit-stuffing.
any data
Frame Check Sequence
(CRC)
23
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Link Layer Outline
Link Layer in the OSI model
Stacks
HDLC as example
Frame sub-layer
Error detection
Error correction
Medium Access control
Logical Link Control
Connection-Oriented and connectionless
Error recovery
Flow control
HDLC
Quality Criteria
Single Master
Rings
Ethernet
Collision with winner
Token Passing
Comparison
24
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Error Correcting Codes
Error correcting codes are used where the probability of disturbances is high (e.g. power
line communication) and the time to retransmit is long (e.g. space probe near Jupiter).
In industry, error correcting codes are normally directly embedded in the physical layer,
e.g. as part of a multitone transmission (ADSL) or of a radio protocol (Bluetooth).
Error correction necessarily decreases the data integrity, i.e. the probability of accepting
wrong data, since the redundancy of correction is taken from the code redundancy.
It is much more important to reject erroneous data (low residual error rate) than to try to
correct transmission.
However, when the medium is very bad (radio), error correction is necessary to
transmit even short messages.
Assigning bits for error detection and correction is a tradeoff between integrity and
availability.
25
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Link Layer Outline
Link Layer in the OSI model
Stacks
HDLC as example
Frame sub-layer
Error detection
Error correction
Medium Access control
Logical Link Control
Connection-Oriented and connectionless
Error recovery
Flow control
HDLC
Quality Criteria
Single Master
Rings
Ethernet
Collision with winner
Token Passing
Comparison
26
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Medium Access Control
Medium Access Control gives the right to send in a multi-master bus
Network
Logical Link
Control
(LLC)
Network
Frame
Physical
Medium
Physical
Signaling
Logical Link
Control
(LLC)
Frame
Physical
Medium
Physical
Signaling
Network
Medium Access
Control
(MAC)
Medium Access
Control
(MAC)
Medium Access
Control
(MAC)
Logical Link
Control
(LLC)
Frame
Physical
Medium
Physical
Signaling
27
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Link Layer Outline
Link Layer in the OSI model
Stacks
HDLC as example
Frame sub-layer
Error detection
Error correction
Medium Access control
Logical Link Control
Connection-Oriented and connectionless
Error recovery
Flow control
HDLC
Quality Criteria
Single Master
Rings
Ethernet
Collision with winner
Token Passing
Comparison
28
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Medium Access Control - quality criteria
Fairness all requesters will eventually be allowed to transmit
Timelyness all requesters will be allowed to transmit within a certain
time, depending on their priority.
Robustness communication errors or the permanent failure of
one component does not prevent the others to
access the medium.
Determinism all requesters will be allowed to transmit within a finite time
29
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Link Layer Outline
Link Layer in the OSI model
Stacks
HDLC as example
Frame sub-layer
Error detection
Error correction
Medium Access control
Logical Link Control
Connection-Oriented and connectionless
Error recovery
Flow control
HDLC
Quality Criteria
Single Master
Rings
Ethernet
Collision with winner
Token Passing
Comparison
30
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
MAC single master (e.g. Profibus DP)
bus
bus
master
devices
(slaves)
slave
slave slave
command reply command ack command reply
the bus master allocates time slots to each slave
it may assign priorities (or no priority: round-robin, all are treated equally)
the master may be the source and the destination of data
+ strictly deterministic, complete and flexible control
- polling takes time, since devices which have nothing to transmit must be polled
improvement: “ look-at-me ” (short poll frame allowing slave to request poll of a longer frame)
= "slave initiative" used in Profibus DP
time
read write with ack
command
write no ack read & write
- the master has little knowledge about data importance
31
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Link Layer Outline
Link Layer in the OSI model
Stacks
HDLC as example
Frame sub-layer
Error detection
Error correction
Medium Access control
Logical Link Control
Connection-Oriented and connectionless
Error recovery
Flow control
HDLC
Quality Criteria
Single Master
Rings
Ethernet
Collision with winner
Token Passing
Comparison
32
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
MAC Rings (1): register insertion principle
devices
output output
output
shift register
input input
input
master
Devices are connected by point-to-point links (no bus!), there is one sender per segment.
The operation is similar to a large shift register.
The master sends a long frame with the output data to the first device in the ring.
Each device reads the data intended for it, inserts its data instead and
passes the frame to the next device.
The last device gives the frame back to the master.
application memory
time
time
data
data
33
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
MAC Rings (2): pros and cons
Two major field busses use the ring topology, Interbus-S and SERCOS
and the register-insertion principle described.
the position of the bit in the frame corresponds to the position of the device in the ring,
there are no device addresses - easy to use, but prone to misconfiguration.
each device introduces a delay at least equal to a few bits
+ deterministic access, good usage of capacity, addresses are given by device sequence
on the ring, only point-to-point links
- long delays (some µs per device)
34
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Link Layer Outline
Link Layer in the OSI model
Stacks
HDLC as example
Frame sub-layer
Error detection
Error correction
Medium Access control
Logical Link Control
Connection-Oriented and connectionless
Error recovery
Flow control
HDLC
Quality Criteria
Single Master
Rings
Ethernet
Collision with winner
Token Passing
Comparison
35
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
MAC Ethernet (1): CSMA-CD principle (stochastic)
improvement 2:
(Binary Backoff)
Every station sends as it pleases
if no acknowledgement comes, it retransmit
No upper limit to the waiting time, mean waiting time depends
on the arrival rate of frames and on their average length.
(pure Aloha)
Advantage:
retry after a random time,
doubled after each collision, max 15 times
be aware that you are jammed
improvement 1:
improvement 3:
(Carrier Sense)
(Collision Detection)
Principle
do not send when the medium is occupied
Arbitration does not depend on number or on address of the stations
Drawback:
The medium access is not deterministic,
but for light traffic (<1%) there is no noticeable delay.
36
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
MAC Ethernet (2): collision conditions
repeater
Station A must
detect that its
frame collided
while it is still
transmitting its
frame
at 10 Mbit/s, limits radius to about 2500 m
Ethernet minimum frame size = 64 Bytes, or 51,2 ms @ 10 Mbit/s
A B
minimum
frame size
= 64 Bytes
preamble
= 8 Bytes
collision
at 100Mbit/s, limits radius to about 250 m
(2 x 7.5 s/km+ 2
repeaters)
Tpd
Station B started
transmission just
before receiving
A’s frame.
it nevertheless
transmits its
header completely
time
37
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
MAC Ethernet (3): propagation conditions and bus diameter
The frame must be long enough to allow all stations to detect a collision while the frame is
being transmitted.
500 m
2 x Tpd = 2 x propagation time (@10Mbit/s Ethernet: 51,2 µs)
500 m
Collisions can only be detected reliably when the frame size is longer than the
propagation delay -> padding to a minimum size (512 bits = 64 Bytes)
The "diameter" of the network is limited to 2,5 km
Since a station which expects a collision must wait one slot time before transmitting,
the maximum frame throughput on Ethernet is limited by the slot time.
38
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
MAC Ethernet (4): collision probability and simultaneous transmitters
previous frame 0 1 2 3 4 5 • • • time
After the end of a frame, a transmitter chooses a slot at random from a fixed number of slots
Ethernet is not efficient for small frame size and large number of simultaneous transmitters
Ethernet is considered to enter overload when reaching 10%-18% load
0
0.2
0.4
0.6
0.8
1
1 2 3 4 5 10 32 64 128 256
4096
1024
512
48
utilisation 100%
number of transmitters
frame size
39
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
MAC Ethernet (5): when collisions can't be detected
A small number of simultaneous transmitters causes a high probability loss of a packet .
LON can retry up to 255 times: probability of lost message is low, but delay is long
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
without collision detection
with collision detection
number of simultaneous transmitters
probability of loosing a packet source: P. Koopman, CMU
LON uses a p-persistent MAC with 16-slot collision avoidance (p = 1/16)
It is not always possible to detect collisions.
40
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Link Layer Outline
Link Layer in the OSI model
Stacks
HDLC as example
Frame sub-layer
Error detection
Error correction
Medium Access control
Logical Link Control
Connection-Oriented and connectionless
Error recovery
Flow control
HDLC
Quality Criteria
Single Master
Rings
Ethernet
Collision with winner
Token Passing
Comparison
41
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
MAC CAN (1): Deterministic Arbitration
Such a medium allows a bit-wise "Wired-OR" operation
When several transmitters are simultaneously active, the dominant state wins
over the recessive state if there is at least one transmitter sending the dominant state
(dominant is “Low” in open collector, "Bright" in an optical fiber, or a collision on a medium
that allows collisions).
A device is capable to know if the signal it puts on the line is disturbed (XOR).
Terminator and
pull-up resistor
Bus line
Rt
Ut
Rt
Ut
The CAN fieldbus uses media with a dominant and a recessive state
Example:
open-collector:
Terminator and
pull-up resistor
device 1 device 2 device 3 device 4
Jam
Out In
XOR
Jam
Out In
XOR
Jam
Out In
XOR
Jam
Out In
XOR
42
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
MAC CAN (2): Collision with Winner
• Each station has a different identity (in this example: 4 bit ID)
• Each station listens before sending and can detect collisions
• Competing stations start transmitting at the same time (1st bit is a SYNC-sign)
• Each station begins its transmission with its identity, bit by bit
• In case of collision, "1" wins over "0" ("1" = Low, bright, dominant).
• A station, whose "0" bit was transformed into a “1" retires immediately
• The winning station has not been disturbed and transmits.
• Loosing stations await the end of the ongoing transmission to start again.
Station 10 (wins)
slot time
1 0 1 0
1 0 0 (1)
Station 09
1 0 1 0
0 (1) (1) (0)
Station 06
Bus signal
Also known as "Urn" or "binary bisection" method
Advantage: deterministic arbitration (assumes fairness), good behavior under load
the size of the unique ID defines arbitration time,
transmission delay defines slot time -> 40m @ 1 Mbit/s, 400m @ 100 kbit/s
Drawback:
43
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
MAC CAN (3): Deterministic Arbitration
Advantage: deterministic arbitration (assumes fairness, I.e. a device only transmits
again when all losers could), good behavior under load.
the slot time (one bit time) must be long enough so that every station can
detect if it has been disturbed - I.e. twice as long as the propagation time
from one end of the bus to the other ( signal speed = 5 ns / m).
Therefore, the bit rate is dependent on the bus extension:
40m @ 1 Mbit/s, 400m @ 100 kbit/s
the size of the unique ID defines arbitration time.
Drawback:
44
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Link Layer Outline
Link Layer in the OSI model
Stacks
HDLC as example
Frame sub-layer
Error detection
Error correction
Medium Access control
Logical Link Control
Connection-Oriented and connectionless
Error recovery
Flow control
HDLC
Quality Criteria
Single Master
Rings
Ethernet
Collision with winner
Token Passing
Comparison
45
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
MAC Profibus (1): Token principle
All stations form a logical ring
Each station knows the next station in the ring (and the overnext)
Each station delegates the right to send to the next station in the ring,
(in the form of a token frame or as an appendix to a data frame).
z.B.: Token Bus (IEEE 803.4), Profibus (IEC 61158)
Variants Token with Priority (back to the station with the highest priority)
Problems: Loss or duplication of token, initialization
do not confuse with token ring !
46
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
MAC Profibus (2): Token passing
active stations
(potential masters)
AS AS AS
passive stations
(slaves)
12 25 31
logical ring
current bus
master
Active Stations (AS) can become master if they own the token,
for a limited duration (one frame only).
After that time, the master passes the token to a station with a higher address
or, if it has the highest address, to the station with the lowest address.
A station must send at least one frame (data or token) when it gets its turn.
station address
47
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
MAC Profibus (3): Token passing algorithm
Each station holds a List of Active Stations (LAS)
Previous
Station
Next
Station
This
Station
PS TS NS AS
GAP
AS AS
When the current master has no more data to send, or when its turn expires, it
sends a token frame to the Next Station (NS) in the ring.
NS acknowledges reception of the token.
If the master does not receive an acknowledgement for two consecutive trials,
the master removes the station from the LAS and declares the overnext
active station (OS) as NS.
This station accepts the token only if it receives it twice.
The master tests at regular intervals with a "Request FDL-Status" for the
presence of further stations in the gap between itself and NS.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 .. 30 32
Active
Station
Overnext
Station
48
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
MAC Profibus (4): Token initialization
A starting station listens to the bus before trying to send.
If it senses traffic, a station records the token frames and builds a list of active stations (LAS).
In particular, it observes if a station with the same name as itself already exists.
If a station does not register any traffic during a certain time, it sends a token frame to itself.
It sends the first token frame to itself, to let other starting stations register it.
Only when it detects no other station does a station begin with a systematic
poll of all addresses, to build the LAS.
When a master checks the gap, the station will receive a token offer.
49
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Link Layer Outline
Link Layer in the OSI model
Stacks
HDLC as example
Frame sub-layer
Error detection
Error correction
Medium Access control
Logical Link Control
Connection-Oriented and connectionless
Error recovery
Flow control
HDLC
Quality Criteria
Single Master
Rings
Ethernet
Collision with winner
Token Passing
Comparison
50
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Comparison of Medium Access Control Methods
optimistic
stochastic
pessimistic
deterministic
central master
token passing
collision with winner
carrier sense
collision detection
p-persistent collision
51
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Link Layer Outline
Link Layer in the OSI model
Stacks
HDLC as example
Frame sub-layer
Error detection
Error correction
Medium Access control
Logical Link Control
Connection-Oriented and connectionless
Error recovery
Flow control
HDLC
Quality Criteria
Single Master
Rings
Ethernet
Collision with winner
Token Passing
Comparison
52
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Logical Link Control Sublayer
Two Link services:
- unacknowledged connectionless service and
- connection oriented services
Network
Medium Access
Control
(MAC)
Logical Link
Control
(LLC)
Network
Frame
Physical
Medium
Physical
Signaling
Medium Access
Control
(MAC)
Logical Link
Control
(LLC)
Frame
Physical
Medium
Physical
Signaling
53
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Connection-Oriented and Connection-Less communication
Connectionless mode
(Datagram ≈ letter)
Each packet (Datagram) contains all
information needed to forward it to its final
destination over the network, including the
path back to the sender.
The network assumes no responsibility for
the ordering of packets and does not try to
recover damaged datagrams.
The burden of flow control and error recovery
is shifted to the application.
Connection-Oriented mode
(Virtual Circuit ≈ telephone)
A connection is first established between sender
and receiver.
Information packets are identified by their
connection identifier and by their sequence
number within that connection.
The network cares for opening and closing
connections and ensures that packets are received
in same order as they are sent, recovering lost
packets and controlling the flow.
Applications see the network as a reliable pipe.
Connection is closed after use (and reused)
Semantic of CO-transmission
Open_Channel(Node, Task, Channel_Nr);
Send_Message (Channel_Nr, Msg1);
Send_Message (Channel_Nr, Msg2);
Close(Channel_Nr);
Msg1 will be received before Msg2, sequence is maintained.
Semantic of CL-transmission
Send_Packet (source, destination, Packet1);
these considerations apply to all levels of the OSI model
Send_Packet (source, destination, Packet2);
54
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Connection-Oriented Link Service
Connection establishment and disconnection
Send and receive frames
Flow Control (Buffer control)
Retry in case of error
REQUEST
INDICATION
CONFIRM
service
user
service
provider
service
user
RESPONSE
Task: Flow Control and Error Recovery
55
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Flow Control
"Adapt the speed of the sender to that of the receiver"
( = synchronization at the link layer)
Methods
Use Acknowledgements: do not send until an acknowledgement is received
(acknowledgements have two purposes: error recovery and flow control !)
Credit: the receiver indicates how many frames it can accept
(sliding Window protocol). Improvement: variable window size.
Explicit braking (CTRL-S/ CRTL-Q)
•
•
•
Upper Window
Edge
Lower Window
Edge
sent but not yet
acknowledged
sent and
acknowledged
can be sent may not
be sent
12
6 7 8 9 11
10
packets
time
56
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Simple transfer with window size = 1
LLC
DATA (0)
ACK (1)
DATA (1)
DATA ( last)
ACK (last)
ACK (2)
LLC Consumer
alive
time-out
connect
timer
ack
timer
late
acks
Connect Request
Connect Confirm
i
Producer
nm_message_ind
nm_connect.ind
tm_message.req
nm_message.cnf
Connection
Transfer
Disconnection
Bus
nm_connect.cnf
Every packet takes at least two propagation times
time
57
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Error Recovery
General rule: Erroneous information frames are repeated
(error correcting codes belong to physical layer)
1) In cyclic transmission, information is not explicitly repeated in case of loss,
the receiver will receive a fresh information in the next cycle.
A freshness control supervises the age of the data in case communication ceases.
The sender of information frames expects acknowledgement of the
receiver, indicating which information it received.
To distinguish repetitions from new information, each packet receives
a sequence number (in the minimum odd/even).
The sender repeats the missing information a number of times, until it
receives an acknowledgement or until a time-out expires.
3) In broadcast transmission, it is relatively difficult to gather acknowledgements
from all possible receivers, so in general unacknowledged broadcast is used.
The receiver is expected to protest if it does not receive the information.
2) In event-driven transmission, no information may be lost, a repetition is explicit:
a)
c)
b)
The receiver acknowledges repetitions even if it already received the
information correctly.
d)
58
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Link Layer Outline
Link Layer in the OSI model
Stacks
HDLC as example
Frame sub-layer
Error detection
Error correction
Medium Access control
Logical Link Control
Connection-Oriented and connectionless
Error recovery
Flow control
HDLC
Quality Criteria
Single Master
Rings
Ethernet
Collision with winner
Token Passing
Comparison
59
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Example: HDLC
HDLC (High-level Data Link Control is derived from IBM's SDLC
(Synchronous Data Link Control)
These protocols were developed for connection of point-of-sale terminals to a
one mainframe computer.
HDLC is the most frequently used link layer protocol.
It is the base for the CCITT-standard X25 (Telenet, Datex-P, Telepac) and used in Bitnet,
Appletalk, etc...
The HDLC protocol is implemented in the hardware of numerous
microcontrollers (e.g. Zilog 80C30, Intel, Siemens 82525,... and in some
microprocessors (e.g. 68360).
HDLC is the base for the Local Area Network protocol IEEE 802.2
60
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
HDLC Control Field (ISO 4335)
Control Field Bits
Control Field Format for:
1 2 3 4 5 6 7 8
0 N(S) P/F N(R)
Information Transfer
Command/Response
(I-Format PDU)
1 0 S P/F N(R)
1 1 M P/F M
Supervisory
Commands/Responses
(S-Format PDUs)
Unnumbered
Commands/Response
(U-Format PDUs)
16
8
FCS
adr control
8
8
01111110 01111110
flag flag
8
any data
physical address of Secondary
(for command and response)
N(S) = Sequence number of
sender
N(R) = Sequence number of
receiver
S = Supervisory
P/F = Poll/Final (Please respond/Final in sequence)
61
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
HDLC Connection Types
The sender includes the sequence number in each packet.
The receiver indicates which packet it expects next, either through a special frame
( Receiver Ready N(R) ) or within its information frames (I-Frame, N(R))
At the same time, this sequence number acknowledges all previously received
frames with number N(R) -1.
Traffic is divided intopackets (= information frame)each receiving a sequence
number (Modulo 8).
LAP (link access procedure): assymetric Primary/Secondary;
NRM (normal response mode): only one station as primary;
ARM (asynchronous response Mode): spontaneous transmission of secondary;
LAPB (LAP-balanced): every station can become primary and start transmitting
(if medium access allows).
HDLC provides different connection types:
62
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
HDLC Exchange (NMR in ISO 4335)
set normal response
mode, poll
UA,F
SNRM, P I0,0 I1,0 I2,0P
RR3,F
I3,0
Primary
(Commander)
Secondary
(Responder)
time
information packets
receiver
ready, expects 3
please confirm
accept
connection,
final
Send Sequence
accept
connection, final
set normal response
mode, poll
UA;F
SNRM; P
I0,0 I1,0 I2,0;F
RR0;P RR3;P
time
several
information packets
receiver
ready, expects 0
last frame
I3,0
receiver
ready, expects 3
Receive Sequence
Primary
(Commander)
Secondary
(Responder)
The data transmission takes place under control of the Primary.
Therefore, both "Send Frame" and "Receive Frame" are supported
63
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Clocks
In a fieldbus, devices must be synchronized to a common clock to time-stamp
their transmissions.
64
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Time Distribution in a single master system
At fixed intervals, the Master broadcasts the exact time as a periodic variable.
When receiving this variable, the bus controllers generate a pulse which can
resynchronize a slave clock or generate an interrupt request.
application
processor 1
bus master
PORTS
BUS
bus
controller
pulse
master
clock
time variable
int
req
pulse
int
req
bus
controller
PORTS
application
processor 2
pulse
int
req
bus
controller
PORTS
application
processor 3
slave
clock
65
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Clock compensation for transmission delays
slave clocks
master
1
other master
synchronizer
slave
clock
MVB 1 other MVB
master clock
device
with clock
The clock does not need to be generated by the Master, but the master must poll the clock
The clock can synchronize sampling within a few µs across several bus segments.
66
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
IEEE 1588 PTP Clock Synchronization
IEEE 1588 defines the Precision Time Protocol, a clock synchronization that assumes that
two consecutive frames have the same delay, but the moment of sending suffers jitter.
The clock device (possibly coupled to a radio signal) sends the first frame with an coarse
time stamp, but registers in hardware the exact moment when the frame was sent.
It then sends a second frame with the exact time at which the first frame was sent.
Bridges and switches are responsible to compensate for their internal delays and send a
corrected time frame.
67
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
High precision clock synchronization
In some application, even the PTP protocol is insufficient.
In this case, either the clock is distributed by a separate, dedicated medium
(as in railways signalling and electrical substations.
Alternatively, all devices receive a radio signal from GPS to recalibrate their internal clocks.
68
2004 June, HK 3.3.3 Field busses - Link Layer
EPFL - Industrial Automation
Assessment
What is the purpose of the link layer ?
Which is the role of the three sublayers in the link layer ?
What is the Hamming Distance ?
What is the Residual Error Rate ?
What is the code efficiency ?
Where are error-correcting codes used ?
What is the formal of an HDLC frame ?
What is the purpose of medium access control ?
Which medium access does not require an arbitration ?
Which kinds of arbitration exist ?
How does the CAN arbitration works and what is its assumption on the medium ?
How does the Ethernet arbitration works ?
What is the influence of collision detection in a LON arbitration ?
Which medium access are deterministic ?
What is the difference between connection oriented and connectionless transmission ?
How are error corrected by the logical link control in cyclic transmission ?
How are error corrected by the logical link control in event-driven transmission ?
How does a sliding window protocol works ?
How does a transmission in HDLC work ?
How are clocks synchronized ?
Prof. Dr. Hubert Kirrmann
ABB Ltd, Baden, Switzerland
3.3.4
OSI Upper Layers - Presentation Layer, ASN.1 and data types
Niveaux supérieurs OSI - couche de présentation, ASN.1 et types de données
Obere OSI-Schichten – Darstellungsschicht, ASN.1 und Datentypen
Industrial Automation
Automation Industrielle
Industrielle Automation
PersonnelRecord ::= [APPLICATION 0] IMPLICIT SET {
name Name,
title [0] VisibleString,
number EmployeeNumber,
dateOfHire [1] Date,
nameOfSpouse [2] Name,
children [3] IMPLICIT
SEQUENCE OF ChildInformation
DEFAULT {}
2005, May, HK
3.0.3 Presentation Layer
2005 May, HK
2
Industrial Automation
Presentation layer in the OSI-Model (ISO/IEC standard 7498)
Transport
protocols
Application
protocols
All services directly called by the end user
(Mail, File Transfer,...)
Definition and conversion of the
data formats (e.g. ASN 1)
Management of connections
(e.g. ISO 8326)
End-to-end flow control and error recovery
(e.g. TP4, TCP)
Routing, possibly segmenting
(e.g. IP, X25)
Error detection, Flow control and error recovery,
medium access (e.g. 802.2, HDLC)
Coding, Modulation, Electrical and
mechanical coupling (e.g. Ethernet)
Physical
Link
Network
Transport
Session
Presentation
6
5
4
3
2
1
Application
7
3.0.3 Presentation Layer
2005 May, HK
3
Industrial Automation
Presentation Layer
The presentation layer is responsible that all communication
partners agree on the format of the data
3.0.3 Presentation Layer
2005 May, HK
4
Industrial Automation
Transfer Syntax: describe what is in a frame ?
Role: how to define formally the format and meaning of the transmitted data
>48
ISO 8473
connectionless network control
5
ISO 8073
class 4 transport control
L_destination SAP
L_source SAP
L_PDU
L_PDU = UI, XID, TEST
LI
TPDU
Protocol Identifier
Header Length
Version/Protocol ID (01)
Lifetime
DT/ER Type
SP MS ER
PDU Segment Length
Address
Part
(CDT)
N(S)
ET
MAC_header LNK_hdr NET_header TRP_header
Destination
Reference
FIXED
PART
13 3
DATA
AFI = 49
PSI
Physical Address
(6 octets)
LSAP = FE
NSAP = 00
IDP
(initial
domain
part)
DSP
(domain
specific
part)
DATA (DT) TPDU
(normal format)
LSAP = DSAP
FE = network layer
18 = Mini-MAP Object
Dictionary Client
19 = Network Management
00 = own link layer
(81)
IEEE 802.4
token bus
ISO 8802
logical link control
address length
IDI, Area ID
(7 octets)
MA. frame control
address
(6 octets)
MA. source
(6 octets)
MA. destination
address
Checksum
Destination Address
(18 octets)
Source Address
(18 octets)
Segmentation
(0 or 6 octets)
Options
(priority = 3 octets)
3.0.3 Presentation Layer
2005 May, HK
5
Industrial Automation
ASN.1 justification
Why do we need ASN.1 ( or a similar notation)
3.0.3 Presentation Layer
2005 May, HK
6
Industrial Automation
Semantic Levels of Data Representation
Transmission
Specification
Language and
Encoding Rules
Traffic Memory format
Application Storage format
(Assembly language)
Bus Transmission Format
Application Memory
Traffic Memory
time
Storage format
SEQUENCE {
item1 INTEGER16,
item2 INTEGER4,
count UNSIGNED8;
}
D15 D00
Bus Controller
Application Language format
Semantic format
Application
Processor
struct {
unsigned count;
int item2:8;
int item1:4;
int dummy:4;
}
154,5 Vrms
Parallel Bus Format
(8 bit, 16 bit, 32 bits)
(16-bit oriented)
3.0.3 Presentation Layer
2005 May, HK
7
Industrial Automation
Bit Transmission Order
time
0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0
UART, HDLC, Ethernet FDDI, FIP, CAN, MVB
LSB MSB MSB LSB
first
Most data links are byte-oriented (transmit 8 bit as an indivisible unit)
The order of bit transmission within a byte (octet) is dependent on the link.
It does not matter as long as all bus participants use the same scheme
There is no relation between the bit and the byte ordering scheme
Who says which bit is really transmitted first ?
(FDDI: multi-bit symbol transmission, multi-bit
transmission with interleaving)
first
Legacy of the old telex
octet in octet out
Convention: only consider octet streams
3.0.3 Presentation Layer
2005 May, HK
8
Industrial Automation
Integer representation in memory: Big-Endian vs Little Endian
x0000
address
0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0
7 6 5 4 3 2 1 0
x0001
x0002
x0003
x0004
Intel Motorola
= 2 = 2
INTEGER8
INTEGER16 = 1 = 256
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
x0005
x0006
INTEGER32 = 1 = 16777216
IBM, TCP/IP,
Unix, RISC
DEC
MSB LSB
B7B6B5B4B3B2B1B0
0 1 2 3 4 5 6 7
1 2 3 4 5 6 7 8
Processor
TCP/IP
(bit position)
(bit offset)
(bit name)
LE BE
Memory contents
Profibus
three different naming schemes !
3.0.3 Presentation Layer
2005 May, HK
9
Industrial Automation
How are sequence of octets transmitted ?
0 1 2 3
INTEGER32
Most Significant First ?
Transmission Order on the bus ?
how to name bits ?
time
The standard in network protocols is always:
Most Significant Octet first (Big-Endian)
3.0.3 Presentation Layer
2005 May, HK
10
Industrial Automation
So, how to respect network byte ordering ?
Since network protocols require a “most significant octet first” transmission
(NBO =Network Byte Ordering), all little-endian processors must convert their data before
putting them into the transmission buffer, pipe or socket, by calling the Unix functions:
Function Name Description
htons Host order to network order, short (2 bytes, 16 bits)
htonl Host order to network order, long (4 bytes, 32 bits)
ntohs Network order to host order, short (2 bytes, 16 bits)
ntohl Network order to host order, long (4 bytes, 32 bits)
All data "seen" by the sockets layer and passed on to the network must be in network order
struct sockaddr_in s;
/* WRONG */
s.sin_port = 23;
/* RIGHT */
s.sin_port = htons(23);
- Extremely error prone
3.0.3 Presentation Layer
2005 May, HK
11
Industrial Automation
Inconsistency: Token-bus frame (IEEE 802.4)
N N 0 N N 0 0 0
F F M M M P P P
I/G L/U lsb
msb
Destination Address
first MAC
symbol
preamble
remaining 44 bits of address
I/G L/U lsb
msb
remaining 44 bits of address
lsb
msb
Frame Check Sequence
N N 1 N N 1 I E
first octet
lsb msb
Source Address
last data octet
lsb msb
Addresses are transmitted least significant bit first
Data are transmitted least significant bit first within
an octet, but most significant octet first within a
word (imposed by higher layers)
Checksum is transmitted most significant bit first
read this picture from left to right,
then top to bottom
3.0.3 Presentation Layer
2005 May, HK
12
Industrial Automation
How to specify transmitted data
stationID
functionID
snu gni nodeID or groupID
protocolID
command
parameter
offset 0
CommandPDU :== SEQUENCE
{
BOOLEAN1 snu -- system
BOOLEAN1 gni -- group
CHOICE (gni)
{
Group : ENUM6 groupID;
Individual: ENUM6 nodeID;
}
ENUM8 stationID;
...
intuitive formal
time
offset
0 1 2 3 4 5 6 7
first: agree on a bit and byte ordering
scheme: {0,0} scheme recommended.
second: describe the data stream
formally (machine-readable)
0
1
2
3
4
i
i+1
3.0.3 Presentation Layer
2005 May, HK
13
Industrial Automation
Can a “C”-declaration serve as an encoding syntax ?
how is size given?
to which structure does it point?
typedef struct {
char location[ LOCATION_LEN ];
unsigned long object_id;
alarm_type_t alarm_type;
priority_level_t priority_level;
unsigned long index_to_SNVT;
unsigned value[ 4 ];
unsigned long year;
unsigned short month;
unsigned short day;
unsigned short hour;
unsigned short minute;
unsigned short second;
unsigned long millisecond;
unsigned alarm_limit[ 4 ];
} SNVT_alarm;
allowed values in enum ?
is "short" a byte ?
is “unsigned” 16 bits or 32 bits ?
Such a machine-dependent syntax is only valid if all applications use the same syntax on
the same machine with the same compiler, it is not suited to describe the bus traffic.
3.0.3 Presentation Layer
2005 May, HK
14
Industrial Automation
Abstract Syntax Notation Number 1 (ASN.1)
• The IEC/ISO define a standard notation in IEC 8824 (ASN.1), allowing to define
simple types (primitive) and constructed types.
• Data structures can take forms not usually found in programming languages.
• Each data structure is identified during transmission by a tag.
• In principle, ASN.1 only defines data structures to be transmitted, but not how
they are encoded for transmission.
• One possible coding of the primitive and constructed data types is defined in
ISO/IEC 8825 as "Basic Encoding Rules“ (BER) defined in ISO 8825.
• More efficient encodings (PER,…) also exist.
• ASN.1 can be used for defining memory contents, file contents or communication
data, and in general any exchanged information.
• ASN.1 has the same role as XML, but it is far more efficient.
3.0.3 Presentation Layer
2005 May, HK
15
Industrial Automation
ASN.1 Syntax Example
Name:
Title:
Employee Number:
Date of Hire:
Name of Spouse:
Number of
Children:
Child Information
Name:
Date of Birth
Child Information
Name:
Date of Birth
John P Smith
Director
51
17 September 1971
Mary T Smith
2
Ralph T Smith
11 November 1957
Susan B Jones
17 July 1959
PersonRecord ::= [APPLICATION 0] SEQUENCE {
name Name
title [0] VisibleString,
number EmployeeNumber,
dateOfHire [1] Date,
nameOfSpouse [2] Name,
children [3] SEQUENCE OF
Childinformation DEFAULT {} }
Name ::= [APPLICATION 1] SEQUENCE {
givenName VisibleString,
initial VisibleString,
familyName VisibleString}
EmployeeNumber ::= [APPLICATION 2] INTEGER
ChildInformation ::= SEQUENCE {
name Name,
dateOfBirth [0] Date}
Date ::= [APPLICATION 3] VisibleString -- YYYYMMDD
Informal ASN.1
3.0.3 Presentation Layer
2005 May, HK
16
Industrial Automation
Abstract syntax and transfer syntax
An abstract syntax describes the elements of information without considering their
encoding (i.e. how they are represented in memory or on a bus)
E.g. A transfer syntax defines the name of the structures and elements, their value range
[e.g. 0..15], ….
ASN.1 is defined in the standard ISO 8824-1.
A transfer syntax describes how the structures and elements are effectively
encoded for storing and transmission, so that the receiver can fully decode the
transmitted
information. At transmission time, only the transfer syntax is visible, it cannot be
interpreted
without knowing the abstract syntax.
E.g. A transfer syntax defines that an array of 33 Unicode characters is transmitted.
The receiver knows from the abstract syntax that this is a person’s name.
The basic encoding rules for ASN.1 are defined in the standard ISO 8825-1.
3.0.3 Presentation Layer
2005 May, HK
17
Industrial Automation
ASN.1 encoding: TLV
ASN.1 does not say how data are stored nor transmitted, but it assumes that the
transmission format consists for each item of: a tag, a length and a value (TLV)
(recursive)
length value
tag
length
tag value
tag length
tag
length
The value may be itself a structured object:
value
the tag specifies the data type of the value that follows, implicitly or explicitly.
3.0.3 Presentation Layer
2005 May, HK
18
Industrial Automation
ASN.1 Data Types
BOOLEAN
INTEGER
BITSTRING
OCTETSTRING
NULL
OBJECT_ID
OBJECT_DESC
EXTERNAL
REAL
ENUMERATED
ANY
SEQUENCE ordered sequence of types (record)
SEQUENCE OF ordered sequence of same type (array)
CHOICE one of an unordered, fixed sequence of
different types.
SET unused
SET OF unused
UNIVERSAL
APPLICATION
CONTEXT_SPECIFIC
PRIVATE
Constructed Types
Basic Types
Open arrays (dynamic size) and pointers are not allowed
four Tag Types
3.0.3 Presentation Layer
2005 May, HK
19
Industrial Automation
ASN.1: The Type SEQUENCE
An ASN.1 SEQUENCE is similar to a “C”-struct:
Example: PersonRecord ::= SEQUENCE {
person VisibleString
chief VisibleString
title VisibleString,
number INTEGER,
dateOfHire UniversalTime }
This notation assumes that all elements in the sequence are present and are transmitted
in the specified order.
person chief title number dateOfHire
INTEGER UniversalTime
VisibleString
PersonRecord
3.0.3 Presentation Layer
2005 May, HK
20
Industrial Automation
Tagging
PersonRecord ::= [APPLICATION 1] SEQUENCE {
person [1] VisibleString,
chief [2] VisibleString,
title [3] VisibleString,
number [4] INTEGER,
dateOfHire [5] UniversalTime }
When elements of a sequence may be missing, it is necessary to tag the items,
i.e. identify the items by an integer.
Of course, if all types would be different, it would be sufficient to specify the type,
but this practice (called EXPLICIT tagging) should not be followed.
Structured types need in any case a tag, otherwise they cannot be distinguished
from another structured type (note how “PersonRecord” is identified)
person title
number dateOfHire
A4 A5
A1
A1 A3
tags
3.0.3 Presentation Layer
2005 May, HK
21
Industrial Automation
ASN.1: The CHOICE type
A choice selects exactly one alternative of several.
There is normally a distinct tag for each choice, but the type can
also be used as tag, as long as all types are distinct:
Quantity ::= CHOICE {
[0] units INTEGER16,
[1] millimetres INTEGER32,
[2] kilograms FLOAT
}
2 4 1.2 E 03
quantity in millimeters
kilograms, IEEE format
1 2 1234
quantity in millimeters
0 2 1234 quantity in units
3.0.3 Presentation Layer
2005 May, HK
22
Industrial Automation
Difference between ASN.1 and “C”* or XML/XDR
ASN.1 is a format for data exchange, “C” is a compiler-dependent format for storage in RAM.
The basic data types are defined differently.
ASN.1 types may have a variable size (INTEGER may be 8, 16, 32, 64 bits).
ASN.1 SEQUENCE differs from a “C” struct since not all elements must be transmitted, nor is
their order to be maintained (if tagging is used).
ASN.1 CHOICE differs from a “C” union since the length depends on the chosen item,
and the contents differ.
ASN.1 has the same role as XML. XML is however both an abstract and a transfer syntax, it is
sent in clear text.
Unix systems use XDR (Sun's external data representation) that is 32-bit oriented, not efficient
for small data items, also a mixture of abstract and transfer syntax.
3.0.3 Presentation Layer
2005 May, HK
23
Industrial Automation
Explicit and implicit tagging
ASN.1 can assign automatically a tag to elements of a sequence.
This practice is dangerous, because another encoding (PER) could use other
tag numbers.
It is preferable to make tags explicit everywhere that is needed.
3.0.3 Presentation Layer
2005 May, HK
24
Industrial Automation
Transfer Syntax: Basic Encoding Rules (BER)
0 2 02
length = 2 octets
12 34
type = UNIVERSAL Integer
value = 1234
Example:
BER supports all ASN.1 structures.
Exception: if size is 0, there is no value field (== NULL)
A companion to ASN1, BER (ISO 8825-1) defines encoding rules for ASN.1 data types
BER tags all data, either implicitly or explicitly
Type, Tag and size are transmitted before every value or structured data
(tag included in basic types)
3.0.3 Presentation Layer
2005 May, HK
25
Industrial Automation
BER – Tag/Type field
(for universal class only):
00 = null (size = 0, no value)
01 = Boolean type
02 = Integer type
03 = Bitstring type
04 = Octetstring type
05 = Null type
06 = Object Identifier type
07 = Object Descriptor type
16 = Sequence and Sequence_Of types
17 = Set and Set_Of types
18-22 = Character strings (numeric, printable, …)
23-24 = Time types
25 = Graphic string
26 = VisibleString (ISO646)
> 28 = reserve and escape: use a second octet.
Tag
Primitive
{0}
or
Constructed
{1}
00 = UNIVERSAL
01 = APPLICATION
10 = CONTEXT_SPECIFIC
11 = PRIVATE
Class
Example: 00000010 = UNIVERSAL INTEGER
10100001 = [CONTEXT_SPECIFIC 1] SEQUENCE
P: after the size comes a value -
C: after the size comes a tag
3.0.3 Presentation Layer
2005 May, HK
26
Industrial Automation
Example ASN.1 and BER
1
high_prio
2
1
command
2
reference (MSB)
reference (LSB)
0
1
4
caller (MSB)
caller (LSB)
3
2
2
P
P
P
P
P
CS
CS
CS
CS
UN
high_prio
command
reference
caller
7
C
AP
16
8 1
(useful information)
CallerRef :== [APPLICATION 7] SEQUENCE {
priority [2] INTEGER,
command [0] INTEGER,
reference [1] INTEGER,
caller INTEGER}
3.0.3 Presentation Layer
2005 May, HK
27
Industrial Automation
Examples
Tag/Type:
• 1000’0000 Context Specific, not constructed, implicit, tag = [0]
• 0110’0001 Application Specific, constructed, implicit, tag = [1]
AB 1010’1101 Context Specific, constructed, implicit, tag = [11]
01 0000’0001 Basic Type, not constructed, boolean
decoding the first digit:
0,1: Universal, not constructed
2,3: Universal, constructed
4,5: Application Specific, not constructed [APPLICATION 1]
6,7: Application Specific, constructed
8,9: Context Specific, not constructed [6]
A,B: Context Specific, constructed
constructed means: the next octet is not
a value, but a type/tag !
3.0.3 Presentation Layer
2005 May, HK
28
Industrial Automation
Examples
A0 0E 02 01 0A A1 09 A0 03 80 01 00 A1 02 80 00
A1 67 02 01 0A A1 62 A0 5D 1A 0B 54 65 6D 70 65
72 61 74 75 72 65 1A 0C 54 65 6D 70 65 72 61 74
75 72 65 31 1A 07 61 72 72 61 79 5F 35 1A 04 62
6F 6F 6C 1A 0F 66 65 65 64 65 72 31 5F 33 5F 70
68 61 73 65 1A 05 66 6C 6F 61 74 1A 0F 68 65 72
62 73 5F 74 65 73 74 5F 74 79 70 65 1A 08 75 6E
73 69 67 6E 65 64 81 01 00
--
A0 18 02 01 0B A6 13 A0 11 80 0F 66 65 65 64 65
72 31 5F 33 5F 70 68 61 73 65
A1 34 02 01 0B A6 2F 80 01 00 A1 16 81 14 66 65
65 64 65 72 31 5F 33 5F 70 68 61 73 65 24 41 64
64 72 A2 12 A2 10 A1 0E 30 05 A1 03 85 01 10 30
05 A1 03 85 01 10
--
A0 1E 02 01 0C A4 19 A1 17
green: tag / type
red: size
black: value
null
3.0.3 Presentation Layer
2005 May, HK
29
Industrial Automation
Beyond ASN.1 and BER
ASN.1 / BER could not impose themselves in field busses because
of the high overhead involved (32 bits for a single boolean !)
ISO / UIT developed more efficient encodings, such as
ISO/IEC 8825-2: Packed Encoding Rules (PER), that
exists in two versions: aligned (on an 8-bit boundary) or not aligned (bit stream)
In low speed busses such as fieldbus, this is still too much overhead.
IEC 61158-6 (Fieldbus) offers 3 encodings:
Traditional Encoding Rules (Profibus)
Compact Encoding Rules (for FAL)
Buffer Encoding Rules (FIP)
100 MBit/s Ethernet has sufficient bandwidth, but the burden is shifted to the processors
(Data compression gives variables length messages, costs a lot in compression
& decompression)
3.0.3 Presentation Layer
2005 May, HK
30
Industrial Automation
ROSIN Compact – Retrofit Encoding
The railways operators needed to define formally the exchange rules for
data of already existing devices, of different manufacturers and vintage.
Therefore, a notation was developed (ROSIN notation) to describe any data transfer,
on a bit rather than a byte-orientation. It also allows to cope with alignment
(data should be transmitted at an offset that is a multiple of their size to reduce
processor load)
Indeed, since these devices already communicate using a proprietary protocol,
transmission must already be unambiguous.
Each data type is specified, e.g. Integer32 differs from Integer32_LE (Little Endian)
The ROSIN notation uses the ASN.1 meta-syntax, but it does not imply a TLV scheme.
- the length can be deduced from the type or position,
- typing information is inserted explicitly when:
• a choice exists among several alternative types (e.g. depends on success/failure)
• types have a (large) variable size (e.g. text strings, files)
• sequences have optional fields and out-of-sequence fields (occurs too often).
3.0.3 Presentation Layer
2005 May, HK
31
Industrial Automation
ROSIN - Retrofit encoding rules example
0 7
snu gni node_id
parameter1
parameter2
parameter3 par4
parameter5
Type_InfoMessage ::= RECORD {
parameter1 INTEGER8 -- octet.
parameter2 INTEGER16, -- 16-bit word, MSB first
parameter3 UNSIGNED6, -- 6- bit value
par4 ANTIVALENT2, -- 2 bits for par4, e.g. check variable.
parameter5 Parameter5, -- parameter5 has a structured type
parameter6 STRING32, -- an array of up to 32 8-bit characters.
-- trailed if shorter with “0” characters.
snu ENUM1 {
USER (0), -- 0 = user
SYSTEM (1) -- 1 = system
},
gni ENUM1 { -- could also be expressed as BOOLEAN1
INDIV (0), -- individual function addressing
GROUP (1), -- group addressing.
},
node_id UNSIGNED6, -- 6-bit unsigned integer
sta_or_func ONE_OF [snu] { -- meaning depends on ‘snu’
function [USER] UNSIGNED8, -- if snu = user, function identifier
station [SYSTEM] UNSIGNED8 -- if snu = system, station identifier
},
next_station_id UNSIGNED8, -- next station or ‘FF’H if unknown
tv BOOLEAN1, -- TRUE if 1
res1 BOOLEAN1 (=0), -- 0 (place holder)
topo_counter UNSIGNED6, -- 6-bit unsigned integer
tnm_code ENUM8 { -- has only two defined values
FIRSTCASE (‘1E’H) -- one of two defined values
SECONDCASE (‘84’H) -- the other defined value
},
action_code Action_Code, -- this type is used several times
}
parameter6
CHARACTER8
sta_or_func
next_station_id
tv d1 top_counter
tnm_code
action_code
0
1
2
3
4
5
6
7
39
40
41
42
43
44
3.0.3 Presentation Layer
2005 May, HK
32
Industrial Automation
Comparing Coding Efficiency
Boolean
BER
24
XDR
16
A-PER
5
U-PER
5
FER BuER
16 8 1
ROSIN
Integer8 24 16 16 12 16 16 8
Unsigned8 24 16 11 11 16 16 8
Integer16 32 24 24 20 24 24 16
Unsigned 16 32 24 24 19 24 24 16
Integer32 48 40 24..48 36 40 40 32
Unsigned32 48 40 24..48 35 40 40 32
String [32] 272 272 272 272 272 272 256
(FIP)
(Profibus)
(SUN) (UIT)
(ISO)
encoding/decoding highly packed data may cost more than is won by shorter transmission
3.0.3 Presentation Layer
2005 May, HK
33
Industrial Automation
Engineering Units
Many process variables represent analog, physical values of the plant.
Data presentation (e.g. integer) is insufficient to express the meaning of the variable.
Therefore, it is necessary to allocate to each variable a data type in engineering units.
"A unit of measure for use by operating/maintenance personnel usually
provided by scaling the input quantity for display (meter, stripchart or CRT)"
IEEE
Scaling (determined the possible range of a variable) is necessary for analog displays.
It requires the definition of the possible range of values that the variable may take.
3.0.3 Presentation Layer
2005 May, HK
34
Industrial Automation
SI Units
-2
3
3
time s
current A
angle rad
force N
torque Nm
power W
frequency s-1
angular velocity rad/s
mass kg
pressure Pa
flow m /s
mass flow kg/s
tension V
reactive power var
impedance W
temperature K
volume m
energy J
position, distance m
angular acceleration rad s
All physical variables should be restricted to SI Units (NIST 330-1991, IEEE 268A-1974)
or refered directly to them
For instance:
•
variable unit
variable unit
•
angles shall be represented in radian rather than degree or grad.
speeds shall be expressed in meter/second, not in km/h or in miles/hour
3.0.3 Presentation Layer
2005 May, HK
35
Industrial Automation
Why floating point ?
Floating point format is the only safe representation of a physical variable.
Exception:
In special applications (e.g. GPS data), an ASCII representation may be more
appropriate, albeit not efficient. In this case, data can also be processed as BCD
(as in pocket calculators)
Floating point format (IEEE Std 254)
- require twice the place (32 bits vs 16 bits),
- adds about 50% to traffic (analog values are only 10% of total),
- cost more to process (floating point unit)
but
- removes all ambiguities, rounding errors, overflow and underflow.
Therefore, devices shall indicate their exported and imported variables as REAL32.
Internally, devices can use other formats.
Variables, whose precision do not depend on their absolute value:
time, elapsed distance (odometer), energy, money, countable objects
3.0.3 Presentation Layer
2005 May, HK
36
Industrial Automation
Fractionals
0
e.g. offset = 0,0 m/s, span = 100,0 m/s, base unit = UNSIGNED16
means: 0 = 0,0 m/s, 65536 == 100,0 m/s
e.g. offset = - 32,768 V, span = 65,536 V, base unit = INTEGER16
means: 0 = -32,768 m/s, 65536 == 32,767 V
A device can indicate the format of a fractional analog variable by
specifying (as a REAL32) the span and the offset to be applied to the base unit:
offset value
physical variable
65535
-32768 +32767
span value
UNSIGNED16
INTEGER16
0
3.0.3 Presentation Layer
2005 May, HK
37
Industrial Automation
Scaled Variables
Process Variables are often transmitted and processed as fractionals:
Fractional format expresses analog values as integer multiples of the resolution
e.g.:
Some standards provides a bipolar or unipolar analog data format:
e.g. :
fractionals require producer and consumer to agree on range and resolution:
e.g. resolution 0.5 V, range 6553.5 V
distance = 0..65535 x 0.1 m (resolution) --> 0 .. 65535 (UNSIGNED16)
distance = -32768..+32767 x 0.1 m --> -32768 .. 32768
speed = 0.. 6553,5 m/s, resolution = 0.1 m/s --> 0 .. 65535 (UNSIGNED16)
speed = 0.. 6.5535 m/s, resolution = 0,0001 m/s --> 0 .. 65535 (UNSIGNED16)
0..200% of physical variable == 0..65536 (UNSIGNED16)
-200%..+200%-e of 10 kV == -32768 .. 32768
fractionals are easy to process but error prone (overflow, underflow)
A conversion from fractional to floating point did cost over 5 Mia € (Ariane 501 accident)
(INTEGER16)
(INTEGER16)
The resolution is often a decimal fraction of a unit !
3.0.3 Presentation Layer
2005 May, HK
38
Industrial Automation
Constructed Application Data Types
Circuit Breaker command:
DoubleCommand
not permitted
OFF
ON
not permitted
Persistent
Regulating Command
not permitted
Lower
Higher
not permitted
RegulatingStep
Command
not permitted
Next Step Lower
Next Step Higher
not permitted
Double-Point
Information
indeterminate
determined OFF
determined OFF
not permitted
Code
00
01
10
11
Time-Stamped Variable:
value
time
status
3.0.3 Presentation Layer
2005 May, HK
39
Industrial Automation
Application Data Types
Structured Text:
RTF - Microsoft Word Native Format
HTTP - Hypermedia data presentation
Some standards for video:
QuickTime -- an Apple Computer specification for video and audio.
Motion Picture Experts Group (MPEG) -- video compression and coding.
Some graphic image formats:
Graphics Interchange Format (GIF) -- compression and coding of graphic images.
Joint Photographic Experts Group (JPEG) -- compression and coding for graphic images.
Tagged Image File Format (TIFF) -- coding format for graphic images.
14
3.0.3 Presentation Layer
2005 May, HK
40
Industrial Automation
Presentation Layer in the application
Coding and conversion functions to application layer data cannot be done in the
presentation layer due to the lack of established rules
These functions ensure that information sent from the application layer of one system will
be readable by the application layer of another system.
Examples of presentation layer coding and conversion schemes in the application:
Common data representation formats -- The use of standard image, sound, and video
formats allow the interchange of application data between different types of computer
Conversion of character representation formats -- Conversion schemes are used to
exchange information with systems using different text and data representations (such as
ASCII and Unicode).
Common data compression schemes -- The use of standard data compression schemes
allows data that is compressed at the source device to be properly decompressed at the
destination (compression can take place at different levels)
Common data encryption schemes -- The use of standard data encryption schemes allows
data encrypted at the source device to be properly unencrypted at the destination.
3.0.3 Presentation Layer
2005 May, HK
41
Industrial Automation
Gateway
When devices share no common transport layer protocol, gateways act as protocol
converters and application layer protocols must ensure end-to-end control.
Protocol Conversion is costly in development and real time, since protocols are in
general insufficiently specified, custom-designed, and modified without notice.
Protocol Conversion requires at least an semantical equivalent of the objects on both
sides of the gateway, so that one command can be converted into another - if possible.
bus type 2
bus type 1
network
transport
session
presentation
gateway
application
Real-Time
Protocols
link
physical
link
PD-marshalling
link
MSG
network
transport
session
presentation
PV
link
application
physical
PV
physical physical
3.0.3 Presentation Layer
2005 May, HK
42
Industrial Automation
To probe further
http://www.isi.salford.ac.uk//books/osi/all.html - An overview of OSI
http://www.oss.com/ - Vendor of ASN.1 tools
http://www-sop.inria.fr/rodeo/personnel/hoschka/347.txt - List of ASN.1 tools
http://lamspeople.epfl.ch/kirrmann/mms/OSI/osi_ASN1products.htm - ASN.1 products
3.0.3 Presentation Layer
2005 May, HK
43
Industrial Automation
Assessment
which are the “upper layers”?
which is the function of the network level ?
what is the difference between repeater, bridge, router and gateway ?
what is the difference between hierarchical and logical addressing ?
what is the role of the transport layer ?
when is it necessary to have a flow control at both the link and the transport layer ?
what is the role of the session layer in an industrial bus ?
which service of the session layer is often used in industrial networks ?
what is the role of the presentation layer ?
what is ASN.1 ?
what is the difference between an abstract syntax and a transfer syntax ?
why is ASN.1 not often used in industrial networks and what is used instead ?
what is the ROSIN notation for and how is a data structure represented ?
how should physical (analog) variables be represented ?
lecture Instrumentation - Sensors and actorsPLC.pdf
1 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
Prof. Dr. H. Kirrmann
ABB Research Center, Baden, Switzerland
3.4 MVB: a fieldbus case study
Industrial Automation
Automation Industrielle
Industrielle Automation
2 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Outline
1. Applications in rail vehicles
2. Physical layer
1. Electrical RS 485
4. Frames and Telegrams
5. Medium Allocation
7. Fault-tolerance concept
8. Integrity Concept
2. Middle-Distance
3. Fibre Optics
9. Summary
3. Device Classes
6. Clock Synchronization
3 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
standard communication interface for all kind of on-board equipment
data rate
delay
medium
number of stations
> 600 vehicles in service in 1998
status
up to 4095 simple sensors/actuators
1'500'000 bits/second
0,001 second
twisted wire pair, optical fibres
up to 255 programmable stations
Multifunction Vehicle Bus in Locomotives
cockpit
power line
diagnosis
radio
Train Bus
motor control
power electronics
brakes track signals
Vehicle Bus
4 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
Multifunction Vehicle Bus in Coaches
covered distance: > 50 m for a 26 m long vehicle
< 200 m for a train set
diagnostics and passenger information require relatively long, but infrequent messages
brakes
air conditioning
doors
power
light
passenger
information
seat reservation
Vehicle Bus
Train Bus
5 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Physical Media
• OGF
• EMD
• ESD
Media are directly connected by repeaters (signal regenerators)
All media operate at the same speed of 1,5 Mbit/s.
(2000 m)
(200 m)
(20 m)
optical fibres
shielded, twisted wires with transformer coupling
wires or backplane with or without galvanic isolation
twisted wire segment sensors
optical links
rack
optical links
rack
star coupler
devices
6 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Covered Distance
The MVB can span several vehicles in a multiple unit train configuration:
The number of devices under this configuration amounts to 4095.
MVB can serve as a train bus in trains with fixed configuration, up to a distance of:
> 200 m (EMD medium or ESD with galvanic isolation) or
> 2000 m (OGF medium).
Train Bus
devices
node
devices with short distance bus
repeater
MVB
7 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Topography
all MVB media operate at same speed, segments are connected by repeaters.
Device
Device
Device Device
Terminator
Train Bus
OGL link
Repeater
Repeater
Repeater
Device Device Device Device
Bus
Administrator
EMD Segment
section
ESD Segment
ESD Segment
Node
Device Device
Device
8 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Outline
1. Applications in vehicles
2. Physical layer
1. ESD (Electrical, RS 485)
4. Frames and Telegrams
5. Medium Allocation
7. Fault-tolerance concept
8. Integrity Concept
2. EMD (Transformer-coupled)
3. OGF (Optical Glass Fibres)
9. Summary
3. Device Classes
6. Clock Synchronization
9 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
ESD (Electrical Short Distance) RS485
Interconnects devices over short distances (- 20m) without galvanic separation
Based on proven RS-485 technology (Profibus)
Main application: connect devices within the same cabinet.
terminator/
biasing
+ 5 V
GND
Ru
(390W)
Rm
(150 W)
Rd
(390 W)
terminator/
biasing
segment length
device 1 device N
device 2.. n-1
RxS
TxS
RxS
TxS
RxS
TxS
• • •
equipotential line
Data_N
Data_P
Bus_GND
Ru
(390W)
Rm
(150 W)
Rd
(390 W)
+ 5 V
10 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
ESD Device with Galvanic Isolation
1
power
protection
circuit
RS 485
transceiver
Data
GND
galvanic
barrier
RxS'
TxS'
TxF'
RxS
TxS
TxF
+5V
cable
female
male
shield connected to
connector casing
shield connected to
connector casing
opto-
couplers
DC/DC
converter
1
device casing
connected to
supply ground
protective
earth
0V
el
+5V
el
+Vcc
11 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
ESD Connector for Double-Line Attachment
9
8
7
6
cable
Line_A
Line_B
Line_A
Line_B
10
4 5
2
1 3 2 1
4
5 3
female
male
9 8 7 6
cable
Line_A
Line_B
Line_A
Line_B
reserved
(optional TxE)
B.Data_P
A.Data_P
A.Data_N
B.Data_N
B.Bus_5V
A.Bus_5V
A.Bus_GND
B.Bus_GND
12 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
EMD (Electrical Medium Distance) - Single Line Attachment
• Connects up to 32 devices over distances of 200 m.
• Transformer coupling to provide a low cost, high immunity galvanic isolation.
• Standard 120 Ohm cable, IEC 1158-2 line transceivers can be used.
• Main application: street-car and mass transit
• 2 x 9-pin Sub-D connector
transceiver
bus section 2
device
bus section 1
bus
controller
shield
transformer
13 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
EMD Device with Double Line Attachment
Carrying both redundant lines in the same cable eases installation
it does not cause unconsidered common mode failures in the locomotive environment
(most probable faults are driver damage and bad contact)
1
B1. Data_P
B1. Data_N B2. Data_P
B2. Data_N
transceiver A
B2
transceiver B
Connector_2
A.Data_P A.Data_N B.Data_P B.Data_N
Bus_Controller
device
Line_B
Line_A
A1. Data_P
A1. Data_N
1
B1
A1
Connector_1
Line_B
Line_A
A1. Data_P
A1. Data_N
1
A2
14 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
EMD Connectors for Double-Line Attachment
4
5
2
1
3
7
6
9
8
terminator connector
3
4
5
Connector_1 (female)
2
1
Line_B
7
6
9
8
Line_A
B1.Data_N
B1. Data_P
A1. Data_N
A1. Data_P
A.Term_P
B.Term_N
Line_B
Line_A
B.Term_P
A.Term_N
Zt.A
female
cable
3
4
5
Connector_1 (male)
2
1
Line_B
7
6
9
8
male
Line_A
B1.Data_N
B1. Data_P
A1. Data_N
A1. Data_P
shields contacts case
Zt.B
15 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
EMD Shield Grounding Concept
Shields are connected directly to the device case
Device cases should be connected to ground whenever feasible
device device
inter-section
connectors
terminator terminator
device
device ground
shield
possible shield
discontinuity
device ground
inter-device
impedance
inter-device
impedance
16 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
OGF (Optical Glass Fibre)
Covers up to 2000 m
Proven 240µm silica clad fibre
Main application: locomotive and critical EMC environment
wired-or electrical media
fibre pair
device device
device
Rack
opto-electrical
transceiver
Star Coupler
to other device
or star coupler
to other device
or star coupler
device
device device
ESD segment
17 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
OGF to ESD adapter
Double-line ESD devices can be connected to fibre-optical links by adapters
to star coupler B
from star coupler B
A.Data_P
to star coupler A
from star coupler A
A.5V
TxE
TxD
RxDA
1
RxDB
1
B.0V
B.5V
A.Data_P
5
3 3
fibre-optical transceivers
RS-485 transceiver
MVBC
A.0V
18 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Repeater: the Key Element
(redundant)
bus
administrator
The repeater:
• decodes and reshapes the signal (knowing its shape)
• recognizes the transmission direction and forward the frame
• detects and propagates collisions
A repeater is used at a transition from one medium to
another.
repeater
EMD segment
decoder
encoder
decoder
encoder
ESD segment
(RS 485) (transformer-coupled)
bus
administrator slave slave slave slave
19 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Repeater
duplicated segment
Line_A Line_B
direction
recogniser
decoder
repeater
decoder
encoder
decoder
decoder
encoder
Line_A
(single-thread
optical link)
Line_B
(unused for single-
thread)
recognize the transmission direction and forward the frame
decode and reshape the signal (using a priori knowledge about ist shape)
jabber-halt circuit to isolate faulty segments
detect and propagate collisions
increase the inter-frame spacing to avoid overlap
can be used with all three media
appends the end delimiter in the direction fibre to transformer, remove it the opposite way
handles redundancy (transition between single-thread and double-thread)
20 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Outline
1. Applications in vehicles
2. Physical layer
1. Electrical RS 485
4. Frames and Telegrams
5. Medium Allocation
7. Fault-tolerance concept
8. Integrity Concept
2. Middle-Distance
3. Fibre Optics
9. Summary
3. Device Classes
6. Clock Synchronization
21 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Class 1 Device
Class 1 or field devices are simple connections to sensors or actuators.
They do not require a micro-controller.
The Bus Controller manages both the input/output and the bus.
They do not participate in message data communication.
MVB
redundant
bus pairs
(ESD)
analog
or
binary
input/
output
board bus
(monomaster)
device
address
register
RS 485
drivers/
receivers
bus
controller
device
status
A B
22 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Class 2-3 Device
Class 2 and higher devices have a processor and may exchange messages.
Class 2 devices are configurable I/O devices (but not programmable)
The Bus Controller communicates with the Application Processor through a
shared memory, the traffic store, which holds typically 256 ports.
•
•
•
MVB
redundant
bus pairs
(ESD)
application
processor
shared
local RAM
private
RAM
local
input/
output
EPROM
RS 485
drivers/
receivers
Bus
Controller
traffic store
device
status
A B
23 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Class 4-5 Device
Class 4 devices present the functionality of a Programming and Test station
To this effect, they hold additional hardware to read the device status of the
other devices and to supervise the configuration.
They also have a large number of ports, so they can supervise the process
data transmission of any other device.
Class 5 devices are gateways with several link layers (one or more MVB, WTB).
Class 4 devices are capable of becoming Bus Administrators.
The device classes are distinguished by their hardware structure.
24 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVBC - bus controller ASIC
12 bit device address
CPU parallel bus
to traffic store
duplicated
electrical or optical
transmitters
duplicated electrical or
optical receivers
A19..1
D15..0
address
A
B
A
B
Manchester
and CRC
encoder
16x16
Tx buffer
16x16
Rx buffer Traffic Store
Control
& Arbiter
Main
Control
Unit
Class 1
logic
data
control
Clock,
Timers &
Sink Time
Supervision
• Bus administrator functions
• Bookkeeping of communication errors
• Hardware queueing for message data
• Supports 8 and 16-bit processors
• Supports big and lirttle endians
• 24 MHz clock rate
• HCMOS 0.8 µm technology
• 100 pin QFP
• Automatic frame generation and analysis
• Adjustable reply time-out
• Up to 4096 ports for process data
• 16KByte.. 1MByte traffic store
• Freshness supervision for process data
• In Class 1 mode: up to 16 ports
• Bit-wise forcing
• Time and synchronization port
DUAL
Manchester
and CRC
decoders
JTAG
interface
25 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Bus Interface
Application
processor
2 message ports
MVB
bus
controller
Traffic Store
0..4095
Logical Ports
(256 typical)
for Process
data
6 bus
management
ports
8 physical
ports
The interface between the bus and the application is a shared memory, the
Traffic Memory , where Process Data are directly accessible to the application.
messages packets
and
bus supervision
process data
base
26 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Outline
1. Applications in vehicles
2. Physical layer
1. Electrical RS 485
4. Frames and Telegrams
5. Medium Allocation
7. Fault-tolerance concept
8. Integrity Concept
2. Middle-Distance
3. Fibre Optics
9. Summary
3. Device Classes
6. Clock Synchronization
27 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Manchester Encoding
1 1 0 1 0 0 0 1 0 1 1 1 1 1 0 1
data
clock
frame
signal
9-bit Start Delimiter frame data 8-bit check
sequence
The Manchester-coded frame is preceded by a Start Delimiter containing
non-Manchester signals to provide transparent synchronization.
1 2 3 4 5 6 7 8
0
end
delimiter
28 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Frame Delimiters
0 8
1 2 3 4 5 6 7
active state
idle state
active state
idle state
0
Different delimiters identify master and slave frames:
This prevents mistaking the next master frame when a slave frame is lost.
Master Frame Delimiter
Slave Frame Delimiter
8
1 2 3 4 5 6 7
start bit
start bit
29 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Frames Formats
F address
9 bits 4 12 8
9 16 bits
slave frames sent in response to master frames
8
CS
9 32 bits 8
9 64 bits 8
master frames issued by the master
MSD
16
(33)
16
(33)
32
(49)
64
(81)
MSD = Master Start Delimiter (9 bits)
CS = Check Sequence (8 bits)
SSD = Slave Start Delimiter (9
bits)
useful (total) size in bits
F = F_code (4 bits)
data CS
SSD
data
SSD CS
data
SSD CS
9 64 bits 8
data
SSD CS
128
(153)
9 64 bits 8
data
SSD CS
256
(297)
64 bits
data
8
CS
data
8
CS
64 bits
data
8
CS
64 bits
data
8
CS
64 bits
The MVB distinguishes two kinds of frames:
30 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Distance Limits
master frame
master
time
distance
next master frame
t_sm
t_ms < 42,7µs
slave frame
t_s
The reply delay time-out can be
raised up to 83,4 µs for longer
distances
(with reduced troughput).
t_source
The distance is limited by the maximum allowed reply delay of 42,7 µs
between a master frame and a slave frame.
max
repeater
delay
repeater
delay
repeater
delay
t_ms
remotest
data source
propagation delay
(6 µs/km)
repeater repeater
31 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Telegrams
message
tranport
control
final function
origin node
origin function
Process Data
Message Data
16, 32, 64, 128 or 256 bits of Process Data
4 bits 12 bits
F =
0..7
Master Frame (Request) Slave Frame (Response)
dataset
time
256 bits of Message Data
source
device
destination
device
prot
ocol size
time
FN FF ON OF MTC
Master Frame
final node
4 bits 12 bits
F =
8-15
Master Frame
16 bits
Slave Frame
Supervisory Data
time
port
address
port
address
4 bits 12 bits
F =
12
source
device
decoded
by
hardware
Telegrams are distinguished by the F_code in the Master Frame
transport data
32 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
Source-addressed broadcast
The device which sources that variable responds with a slave frame
containing the value, all devices subscribed as sink receive that frame.
The bus master broadcasts the identifier of a variable to be transmitted:
Phase1:
Phase 2:
devices
(slaves)
bus
master
bus
subscribed devices
subscribed
device
subscribed
device
source sink sink
sink
variable value
bus
bus
master devices
(slaves)
source sink sink
subscribed devices
sink
subscribed
device
subscribed
device
variable identifier
33 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
Traffic Memory
bus
The bus and the application are (de)coupled by a shared memory, the
Traffic Memory, where process variables are directly accessible to the application.
Process Data
Base
Application
Processor
Bus
Controller
Traffic Memory
Associative
memory
two pages ensure that read and
write can occur at the same time
34 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
Restriction in simultaneous access
page 1 becomes valid
t2
t1
writer
reader 1
page0
page1
(slow) reader 2
page 0 becomes valid
time
• there may be only one writer for a port, but several readers
• a reader must read the whole port before the writer overwrites it again
• there may be no semaphores to guard access to a traffic store (real-time)
traffic store
starts
ends
error !
• therefore, the processor must read ports with interrupt off.
35 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
Operation of the traffic memory
In content-addressed ("source-addressed") communication, messages are broadcast,
the receiver select the data based on a look-up table of relevant messages.
For this, an associative memory is required.
Since address size is small (12 bits), the decoder is implemented by a memory block:
0
1
2
4
5
6
7
voids
4091
4092
4093
4094
4095
0
0
0
1
2
0
0
voids
0
4
0
3
0
12-bit Address
data(4)
data(5)
data (4094)
storage
bus
processor
data(4092)
port index table
0
data(4)
data(5)
data (4094)
data(4092)
0
page 0 page 1
36 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB F_code Summary
F_code
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
address
logical
all devices
device
device
device
device
group
device
device
request
Process_Data
reserved
reserved
reserved
Master_Transfer
General_Event
reserved
reserved
Message_Data
Group_Event
Single_Event
Device_Status
source
single
device
subscribed
as
source
Master
>= 1devices
-
-
single device
>= 1devices
single device
single device
size
16
32
64
128
256
-
-
-
16
16
-
-
256
16
16
16
response
Process_Data
(application
-dependent)
Master_Transfer
Event_Identifier
Message_Data
Event_Identifier
Event_Identifier
Device_Status
destination
all
devices
subscribed
as
sink
Master
Master
selected device
Master
Master
Master or monitor
Master Frame Slave Frame
37 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Outline
1. Applications in vehicles
2. Physical layer
1. Electrical RS 485
4. Frames and Telegrams
5. Medium Allocation
7. Fault-tolerance concept
8. Integrity Concept
2. Middle-Distance
3. Fibre Optics
9. Summary
3. Device Classes
6. Clock Synchronization
38 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
Master Operation
The Master performs four tasks:
1) Periodic Polling of the port addresses according to its Poll List
2) Attend Aperiodic Event Requests
3) Scan Devices to supervise configuration
4) Pass Mastership orderly (last period in turn)
The Administrator is loaded with a configuration file before becoming Master
SD
periodic
phase
time
event
phase
guard phase
1 2 3 4 5 6 1 2 9
8 1 2
? ? ? ? ? ? ? ? EV
7
guard phase
super-
visory
phase
SD
basic period basic period
periodic
phase
event
phase
super-
visory
phase
sporadic phase
sporadic phase
39 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
Bus Traffic
State of the Plant
Response in 1..200 ms
Spurious data losses will be
compensated at the next cycle
event
Sporadic Data
time
On-Demand Transmission
Events of the Plant
Response at human speed: > 0.5 s
• Initialisation, calibration
Flow control & error recovery
protocol for catching all events
• Diagnostics, event recorder
Basic Period Basic Period
State Variable Messages
... commands, position, speed
Periodic Transmission
Periodic Data
40 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Medium Access
Between periodic phases, the Master continuously polls the devices for events.
A basic period is divided into a periodic and a sporadic phase.
During the periodic phase, the master polls the periodic data in sequence.
Since more than one device can respond to an event poll, a resolution procedure
selects exactly one event.
Periodic data are polled at their individual period (a multiple of the basic period).
periodic
phase
?
time
sporadic
phase
1 2 3 4 5 6
guard
time
7 8 9 10
basic period
periodic
phase
?
basic period
1 2
sporadic
phase
!
events ? events ? event
data
guard
time
? ? ? ? ? 1 2 3
individual period
41 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Bus Administrator Configuration
The Poll List is built knowing:
the list of the port addresses, size and individual period
the reply delay of the bus
the list of known devices (for the device scan
the list of the bus administrators (for mastership transfer)
•
•
•
•
1 1 1 1 1
2.0 2.0 2.0
4.0
4 ms
time
8.2 4.0
period 0 period 1 period 2 period 3
begin of turn
Tspo Tspo
2.1 2.1
4.1
cycle 2
period 4
Tspo Tspo
1 ms 1 ms 1 ms 1 ms
2 ms
2 ms
42 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Poll List Configuration
The algorithm which builds the poll table spreads the cycles evenly over the macroperiod
1
8.1
1
2
3
4
5
6
7
1
7
1 1
4.2
1 1 1 1 1 1
4.0
1
basic
period
period
period
period
period
period
period
period
period
T_spo
1
2.0
8.1
0
2.1
0
2.0
2.1 2.0
2.1 2.0
2.1 2.0
2.1 2.1
4.2
4.0 4.0
period
macroperiod (8 T_bp shown, in reality 1024 T_bp)
guard
1 BP datasets
2 BP datasets
2 BP datasets
>350µs
43 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Event Resolution (1)
To scan events, the Master issues a General Event Poll (Start Poll) frame.
A device with a pending event returns an Event Identifier Response.
The Master returns that frame as an Event Read frame to read the event data
If only one device responds, the Master reads the Event Identifier (no collision).
If no device responds, the Master keeps on sending Event Polls until a device
responds or until the guard time before the next periodic phase begins.
Start Event Poll
(parameters and
setup)
Event Identifier
Response
from slave
CS
Event Identifier
returned as master
frame
Event data
12 1234
Event Poll telegram Event Read telegram
xxxx
time
SSD CS
MSD xxxx
9 EMET - CS
MSD 12 1234 CS
SSD
44 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Event Resolution (2)
The devices are divided into groups on the base of their physical addresses.
The Master first asks the devices with an odd address if they request an
event.
• If only one response
comes, the master returns
that frame to poll the event.
If several devices respond to an event poll, the Master detects the collision and
starts event resolution
• If collision keeps on, the
master considers the 2nd
bit of the device address.
• If there is no response,
the master asks devices
with an even address.
C
event
reading
any? xxx1 xx11 N x101 0101 A
time
group poll
collision silence
individual
poll
valid event frame
start poll and
parameter
setup
A D
collision
arbitration round
C C
telegram
45 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Event Resolution (3)
000 100 010 110 001 101 011 111
x00 x10 x01 x11
xx0 xx1
silence
collision
n = 0
n = 1
width of
group
address
no event
individual poll
collision
silence
event read
n = 2
odd devices
even devices
EA EA EA EA EA EA EA EA
time
collision
silence
collision
xxx
silence
Example with a 3-bit device address: 001 and 101 compete
general poll
start arbitration
46 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Time Distribution
At fixed intervals, the Master broadcasts the exact time as a periodic variable.
When receiving this variable, the bus controllers generate a pulse which can
resynchronize a slave clock or generate an interrupt request.
Bus controller
Sync port address
Bus master
Periodic
list
Sync port variable
Master
clock
Bus controller
Slave
clock
Ports
Int Req
Application
processor 2
Bus controller
Slave
clock
Ports
Int Req
Application
processor 3
Bus controller
Ports
Int Req
Application
processor 1
Slave
clock
MVB
47 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Slave Clock Synchronization
Slave clocks
Bus
administrator 1
Bus
administrator 2
Synchronizer
Slave clock
MVB 1
Master
clock
Slave devices
Slave clocks
The clock does not need to be generated by the Master.
The clock can synchronize sampling within 100 µs across several bus segments.
MVB 2
48 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Outline
1. Applications in vehicles
2. Physical layer
1. Electrical RS 485
4. Frames and Telegrams
5. Medium Allocation
7. Fault-tolerance concept
8. Integrity Concept
2. Middle-Distance
3. Fibre Optics
9. Summary
3. Device Classes
6. Clock Synchronization
49 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Fault-tolerance Concept
Transmission Integrity
MVB rather stops than provides false data.
The probability for an undetected transmission error (residual error rate)
is low enough to transmit most safety-critical data.
This is achieved through an extensive error detection scheme
Transmission Availability
MVB continues operation is spite of any single device error. In
particular, configurations without single point of failure are possible.
Graceful Degradation
The failure of a device affects only that device, but not devices which
do not depend on its data (retro-action free).
Configurability
Complete replication of the physical layer is not mandatory.
When requirements are slackened, single-thread connections may
be used and mixed with dual-thread ones.
This is achieved through a complete duplication of the physical layer.
50 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Basic Medium Redundancy
The bus is duplicated for availability (not for integrity)
One frame may go lost during switchover
A frame is transmitted over both channels simultaneously.
The receiver receives from one channel and monitors the other.
Switchover is controlled by signal quality and frame overlap.
decoder
receivers
transmitters
bus line A
bus line B
bus controller
encoder selector
address data
parallel bus logic
send register receive register
A B A B
decoder
control
signal quality report
51 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Medium Redundancy
The physical medium may be fully duplicated to increase availability.
Duplicated and non-duplicated segments may be connected
Principle: send on both, receive on one, supervise the other
repeater
repeater
A
B
device
electrical segment X
optical link A
optical link B
electrical segment Y
device
A B
device
device
repeater
repeater
52 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Double-Line Fibre Layout
A
B
A
B
star coupler B
Bus Administrator
opto links A
opto links B
star coupler A
copper bus A
copper bus B
redundant
Bus
Administrator
The failure of one device cannot prevent other devices from communicating.
Optical Fibres do not retro-act.
device
rack
53 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Master Redundancy
To increase availability, the task of the bus master may be assumed by one of
several Bus Administrators
If a bus administrator detects no activity, it enters an arbitration procedure. If
it wins, it takes over the master's role and creates a token.
token passing
Bus
current bus
master
bus
administrator
1
slave
device
slave
device
slave
device
slave
device
slave
device
slave
device
slave
device
bus
administrator
2
bus
administrator
3
A centralized bus master is a single point of failure.
The current master is selected by token passing:
To check the good function of all administrators, the current master offers
mastership to the next administrator in the list every 4 seconds.
54 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Outline
1. Applications in vehicles
2. Physical layer
1. Electrical RS 485
4. Frames and Telegrams
5. Medium Allocation
7. Fault-tolerance concept
8. Integrity Concept
2. Middle-Distance
3. Fibre Optics
9. Summary
3. Device Classes
6. Clock Synchronization
55 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
BT0.5
MVB Transmission Integrity (1)
Manchester II encoding
Double signal inversion necessary to cause an undetected error, memoryless code
Clock
Data
Frame
Manchester II symbols
Line Signal
1 1 0 1 0 0 0 1
violations
2) Signal quality supervision
Adding to the high signal-to-noise ratio of the transmission, signal quality
supervision rejects suspect frames.
time
BT = bit time = 666
ns
reference
edge
125ns
125ns 125ns
1)
Start Delimiter
BT1.0
BT1.5
56 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Transmission Integrity (2)
F address
9 4 12 8
9 16
2 bytes
8
CS
size in bits
repeat 1, 2 or 4 x
CS
9 32
4 bytes
8
CS
9 64
8 bytes DATA
64
8
CS
Master Frame
MSD
SSD
SSD
SSD
16 (33)
16 (33)
32 (49)
64 (81)
128 (153)
256 (297)
MD = Master frame Delimiter
CS = Check Sequence 8 bits
SD = Slave frame Delimiter
useful (total)
size in bits
3) A check octet according to TC57 class FT2 for each group of up to 64 bits,
provides a Hamming Distance of 4 (8 if Manchester coding is considered):
Slave Frame
(Residual Error Rate < 10 under standard disturbances)
-15
57 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
mm
MVB Transmission Integrity (3)
MSD ADDRESS a ADDRESS b DATA (b)
MSD SSD
accept if 0.5µs < t_mm < 42.7 µs
time
CS DATA (a)
SSD CS CS CS
5) Response time supervision against double frame loss:
MSD ADDRESS a DATA (a)
SSD
respond within
1.3 µs < t < 4.0 µs
ms
CS CS MSD ADDRESS b CS
respond within
4 µs < t <1.3 ms
sm
time
1,3 ms
4) Different delimiters for address and data against single frame loss:
6) Configuration check: size at source and sink ports must be same as frame size.
> 22 µs > 22 µs
t
58 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Safety Concept
Very high data integrity, but nevertheless insufficient for safety applications
(signalling)
Increasing the Hamming Distance further is of no use since data falsification
becomes more likely in a device than on the bus.
• critical data transmitted periodically to guarantee timely delivery.
Data Transfer
Redundant plant inputs A and B transmitted by two independent devices.
Device Redundancy
Availability
Data Integrity
Availability is increased by letting the receiving devices receive both A and
B. The application is responsible to process the results and switchover to the
healthy device in case of discrepancy.
Diverse A and B data received by two independent devices and compared.
The output is disabled if A and B do not agree within a specified time.
• obsolete data are discarded by sink time supervision.
• error in the poll scan list do not affect safety.
59 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Integer Set-up
redundant vehicle bus
(for availability only)
input
devices
redundant input
fail-safe
comparator
and enabling
logic
redundant, integer output
°
A B A B
poll
time
individual period
spreader device
(application
dependent)
output
devices
confinement
A B
A B
application
responsibility
Bus
Administrator
60 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Integer and Available Set-up
redundant vehicle bus
(for availability)
redundant input
B
A
comparator
and enabling
logic
A B
available and integer output
switchover logic or
comparator
(application
dependent)
A B A B
poll
time
individual period
spreader device
(application
dependent)
output
devices
confinement
B
A B
A
input
devices
A B
C C
redundant
bus
administrator
redundant
bus
administrator
61 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Outline
1. Applications in vehicles
2. Physical layer
1. Electrical RS 485
4. Frames and Telegrams
5. Medium Allocation
7. Fault-tolerance concept
8. Integrity Concept
2. Middle-Distance
3. Fibre Optics
9. Summary
3. Device Classes
6. Clock Synchronization
62 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Summary
Topography:
Medium:
Covered distance: OGF: 2000 m, total 4096 devices
Communication chip
Processor participation none (class 1), class 2 uses minor processor capacity
Interface area on board
Additional logic RAM, EPROM , drivers.
Medium redundancy: fully duplicated for availability
Signalling: Manchester II + delimiters
Gross data rate
Response Time
Address space
Frame size (useful data)
bus (copper), active star (optical fibre)
copper: twisted wire pair
optical: fibres and active star coupler
EMD: 200 m copper with transformer-coupling
dedicated IC available
20 cm2 (class 1), 50 cm2 (class 2)
1,5 Mb/s
typical 10 µs (<43 µs)
4096 physical devices, 4096 logical ports per bus
16, 32, 64, 128, 256 bits
Integrity CRC8 per 64 bits, HD = 8, protected against sync slip
ESD: 20 m copper (RS485)
63 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Link Layer Interface
telegram
handling
Lower Link
Layer
message
data
supervisory
data
Traffic Store
process
data
LP LM LS
Upper Link Layer
Real-Time Protocols
Physical Layer
master
polling
arbitration
mastership transfer
station
management
Link Layer Interface
slave
Process Data
Message Data
Supervisory Data
frame coding
64 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Components
Bus Controllers:
BAP 15 (Texas Instruments, obsolete)
MVBC01 (VLSI, in production, includes master logic
MVBC02 (E2S, in production, includes transformer coupling)
Medium Attachment Unit:
ESD: fully operational and field tested (with DC/DC/opto galvanic separation)
OGF: fully operational and field tested (8 years experience)
EMD: lab tested, first vehicles equipped
Stack:
Link Layer stack for Intel 186, i196, i960, 166, 167, Motorola 68332, under
DOS, Windows, VRTX,...
Bus Administrator configurator
Tools:
Bus Monitor, Download, Upload, remote settings
Repeaters:
REGA (in production)
MVBD (in production, includes transformer coupling)
65 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB Throughput (raw data)
32
16 48 64 80 96 112 128 144 160 176 192 208 224 240 256
MVB @ 1,5 Mbit/s
IEC Fieldbus @ 1,0 Mbit/s
IEC Fieldbus @ 2,5 Mbit/s
dataset size in bits
transmission delay [ms]
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
0.1
66 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation
MVB & IEC 61158-2 Frames
Preamble Start Delimiter
Data
1 N+N- 1 0 N+ N- 0 1 N+N- N+N- 1 0 1
0 N-N+ 1 N- N+ 1 1 1
1 0 1 0 1 0 1 0
End Delimiter
Data
v v v v
Spacing
v v
0 0 0 0 N+ N- 0 N+N- Data v v
Master Frame
Slave Frame
PhSDU
FCS
FCS
FCS
IEC 61158-2 frame
MVB frame
8 bits
16 bits
IEC65 frames have a lesser efficiency (-48%) then MVB frames
To compensate it, a higher speed (2,5 Mbit/s) would be needed.
End Delimiter
Start Delimiter
67 3.4 MVB case study
2003 July, HK
EPFL - Industrial Automation

More Related Content

Similar to lecture Instrumentation - Sensors and actorsPLC.pdf (20)

PPT
FE_Technologies_PLC.ppt
luisvillanueva16463
 
PPT
Asi presentation 08
manojchandrasekharan
 
PDF
IRJET- Power Line Carrier Communication
IRJET Journal
 
PDF
scada
edzam
 
PPT
Data Acquisition PCU400 Network Manager rel1.ppt
ZahidNawazAdil
 
PPT
What is Can bus in automotive Ecu car.ppt
rahulchaure14
 
PPT
Genesys System - 8dec2010
Agora Group
 
PDF
C1 profinet design, pete brown
PROFIBUS and PROFINET InternationaI - PI UK
 
PPT
Basics Of Minilink Microwave Networks
Atif Mahmood
 
PDF
Ls catalog thiet bi tu dong master rtu e_dienhathe.vn
Dien Ha The
 
PDF
No limits.eng.aug'11.corr
MicroMax Computer Intelligence
 
PDF
Ifm Technology for Mining Industries English 2013
ifm electronic gmbh
 
PDF
10. IO-Link technology - russell smith
PROFIBUS and PROFINET InternationaI - PI UK
 
PPTX
CENTUM CS 3000 R3.pptx
EngrSaeedKhan2
 
PDF
Epma 013
Lecturer
 
PPTX
Controller Area Network (Basic Level Presentation)
Vikas Kumar
 
PPT
Fundamentals and Basics
Belden Incorporated
 
PDF
Mobile robotic platform to gathering real time sensory data in wireless perso...
Alexander Decker
 
PDF
Automotive Networks : A Review
IJAEMSJORNAL
 
PPTX
Accident avoidanve using controller area network protocol
Madhuri Apar
 
FE_Technologies_PLC.ppt
luisvillanueva16463
 
Asi presentation 08
manojchandrasekharan
 
IRJET- Power Line Carrier Communication
IRJET Journal
 
scada
edzam
 
Data Acquisition PCU400 Network Manager rel1.ppt
ZahidNawazAdil
 
What is Can bus in automotive Ecu car.ppt
rahulchaure14
 
Genesys System - 8dec2010
Agora Group
 
C1 profinet design, pete brown
PROFIBUS and PROFINET InternationaI - PI UK
 
Basics Of Minilink Microwave Networks
Atif Mahmood
 
Ls catalog thiet bi tu dong master rtu e_dienhathe.vn
Dien Ha The
 
No limits.eng.aug'11.corr
MicroMax Computer Intelligence
 
Ifm Technology for Mining Industries English 2013
ifm electronic gmbh
 
10. IO-Link technology - russell smith
PROFIBUS and PROFINET InternationaI - PI UK
 
CENTUM CS 3000 R3.pptx
EngrSaeedKhan2
 
Epma 013
Lecturer
 
Controller Area Network (Basic Level Presentation)
Vikas Kumar
 
Fundamentals and Basics
Belden Incorporated
 
Mobile robotic platform to gathering real time sensory data in wireless perso...
Alexander Decker
 
Automotive Networks : A Review
IJAEMSJORNAL
 
Accident avoidanve using controller area network protocol
Madhuri Apar
 

More from kghanem2 (20)

PDF
2-gear-force-stress_2-compatibility-mode.pdf
kghanem2
 
PPTX
vvvvvvvvvvvkkkkkkkDESign of Spur & Helical Gears.pptx
kghanem2
 
PPT
vvvvvvvvv machine designTHICK CYLINDERS.ppt
kghanem2
 
PPTX
Clutches, Brakes, Couplings, and Flywheels14176020.pptx
kghanem2
 
PDF
02_Worked_Examples(1) uncertanity analysis.pdf
kghanem2
 
PDF
500948562term 1123-كتاب-رسم-هندسى-س1.pdf
kghanem2
 
PDF
technical engineering drawing lecturenotes.pdf
kghanem2
 
PDF
Chapter 7 - Strain Hardening and Annealing.pdf
kghanem2
 
PDF
Chapter 8 - Solid Solutions and Phase Equilibrium.pdf
kghanem2
 
PDF
Chapter 6 - Mechanical Properties and Behavior.pdf
kghanem2
 
PDF
Chapter 6 - Ferrous and non ferrousAlloys.pdf
kghanem2
 
PDF
Chapter 5 - Heat Treatments of Steels.pdf
kghanem2
 
PDF
Chapter 5 - Atom and Ion Movements in Materials.pdf
kghanem2
 
PDF
Chapter 4 - Dispersion Strengthening by Phase Transformations and Heat Treatm...
kghanem2
 
PDF
Chapter 4 - Imperfections in the Atomic and Ionic Arrangements.pdf
kghanem2
 
PDF
Chapter 3 - Atomic and Ionic Arrangements.pdf
kghanem2
 
PDF
Chapter 2 - Strain Hardening and Annealing.pdf
kghanem2
 
PDF
Chapter 2 - Atomic Structure and bondings.pdf
kghanem2
 
PDF
Chapter 1 - Introduction to Materials Science and Engineering.pdf
kghanem2
 
PPT
lecture 11-equity for product design.ppt
kghanem2
 
2-gear-force-stress_2-compatibility-mode.pdf
kghanem2
 
vvvvvvvvvvvkkkkkkkDESign of Spur & Helical Gears.pptx
kghanem2
 
vvvvvvvvv machine designTHICK CYLINDERS.ppt
kghanem2
 
Clutches, Brakes, Couplings, and Flywheels14176020.pptx
kghanem2
 
02_Worked_Examples(1) uncertanity analysis.pdf
kghanem2
 
500948562term 1123-كتاب-رسم-هندسى-س1.pdf
kghanem2
 
technical engineering drawing lecturenotes.pdf
kghanem2
 
Chapter 7 - Strain Hardening and Annealing.pdf
kghanem2
 
Chapter 8 - Solid Solutions and Phase Equilibrium.pdf
kghanem2
 
Chapter 6 - Mechanical Properties and Behavior.pdf
kghanem2
 
Chapter 6 - Ferrous and non ferrousAlloys.pdf
kghanem2
 
Chapter 5 - Heat Treatments of Steels.pdf
kghanem2
 
Chapter 5 - Atom and Ion Movements in Materials.pdf
kghanem2
 
Chapter 4 - Dispersion Strengthening by Phase Transformations and Heat Treatm...
kghanem2
 
Chapter 4 - Imperfections in the Atomic and Ionic Arrangements.pdf
kghanem2
 
Chapter 3 - Atomic and Ionic Arrangements.pdf
kghanem2
 
Chapter 2 - Strain Hardening and Annealing.pdf
kghanem2
 
Chapter 2 - Atomic Structure and bondings.pdf
kghanem2
 
Chapter 1 - Introduction to Materials Science and Engineering.pdf
kghanem2
 
lecture 11-equity for product design.ppt
kghanem2
 
Ad

Recently uploaded (20)

PPTX
Biosensors, BioDevices, Biomediccal.pptx
AsimovRiyaz
 
PDF
William Stallings - Foundations of Modern Networking_ SDN, NFV, QoE, IoT, and...
lavanya896395
 
PPTX
MODULE 03 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
PPTX
Distribution reservoir and service storage pptx
dhanashree78
 
PPTX
Fundamentals of Quantitative Design and Analysis.pptx
aliali240367
 
PPTX
Water Resources Engineering (CVE 728)--Slide 4.pptx
mohammedado3
 
PPTX
Final Major project a b c d e f g h i j k l m
bharathpsnab
 
PDF
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
PDF
Artificial Neural Network-Types,Perceptron,Problems
Sharmila Chidaravalli
 
PPTX
fatigue in aircraft structures-221113192308-0ad6dc8c.pptx
aviatecofficial
 
PDF
20ES1152 Programming for Problem Solving Lab Manual VRSEC.pdf
Ashutosh Satapathy
 
PDF
Submit Your Papers-International Journal on Cybernetics & Informatics ( IJCI)
IJCI JOURNAL
 
PPTX
Knowledge Representation : Semantic Networks
Amity University, Patna
 
PDF
Electrical Machines and Their Protection.pdf
Nabajyoti Banik
 
PDF
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
 
PDF
aAn_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
PDF
Digital water marking system project report
Kamal Acharya
 
PPTX
Unit_I Functional Units, Instruction Sets.pptx
logaprakash9
 
PPTX
Numerical-Solutions-of-Ordinary-Differential-Equations.pptx
SAMUKTHAARM
 
PDF
Module - 5 Machine Learning-22ISE62.pdf
Dr. Shivashankar
 
Biosensors, BioDevices, Biomediccal.pptx
AsimovRiyaz
 
William Stallings - Foundations of Modern Networking_ SDN, NFV, QoE, IoT, and...
lavanya896395
 
MODULE 03 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
Distribution reservoir and service storage pptx
dhanashree78
 
Fundamentals of Quantitative Design and Analysis.pptx
aliali240367
 
Water Resources Engineering (CVE 728)--Slide 4.pptx
mohammedado3
 
Final Major project a b c d e f g h i j k l m
bharathpsnab
 
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
Artificial Neural Network-Types,Perceptron,Problems
Sharmila Chidaravalli
 
fatigue in aircraft structures-221113192308-0ad6dc8c.pptx
aviatecofficial
 
20ES1152 Programming for Problem Solving Lab Manual VRSEC.pdf
Ashutosh Satapathy
 
Submit Your Papers-International Journal on Cybernetics & Informatics ( IJCI)
IJCI JOURNAL
 
Knowledge Representation : Semantic Networks
Amity University, Patna
 
Electrical Machines and Their Protection.pdf
Nabajyoti Banik
 
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
 
aAn_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
Digital water marking system project report
Kamal Acharya
 
Unit_I Functional Units, Instruction Sets.pptx
logaprakash9
 
Numerical-Solutions-of-Ordinary-Differential-Equations.pptx
SAMUKTHAARM
 
Module - 5 Machine Learning-22ISE62.pdf
Dr. Shivashankar
 
Ad

lecture Instrumentation - Sensors and actorsPLC.pdf

  • 1. Industrial Automation Automation Industrielle Industrielle Automation 3 Industrial Communication Systems Field Bus: principles 3.1 Bus de terrain: principes Feldbusse: Grundlagen Prof. Dr. H. Kirrmann EPFL / ABB Research Center, Baden, Switzerland CAN, DeviceNet, SDS, ASI-bus, Interbus-S Ethernet, ControlNet TCP - IP Ethernet Sensor Busses simple switches etc. Plant Network Office network Fieldbus intelligent field devices FF, PROFIBUS, MVB, LON 2005 March, HK
  • 2. 3.1 Field bus principles 2/25 Industrial Automation Field bus: principles 3.1 Field bus principles Classes Physical layer 3.2 Field bus operation Centralized - Decentralized Cyclic and Event Driven Operation 3.3 Standard field busses
  • 3. 3.1 Field bus principles 3/25 Industrial Automation Sensor/ Actor Bus Field bus Field bus Programmable Logic Controller Process bus SCADA level Process Level Field level File Edit Network Management Operator 2 12 2 33 23 4 Location of the field bus in the plant hierarchy direct I/O
  • 4. 3.1 Field bus principles 4/25 Industrial Automation What is a field bus ? A data network, interconnecting a control system, characterized by: - transmission of numerous small data items (process variables) with bound delay (1ms..1s) - harsh environment (temperature, vibrations, EM-disturbances, water, salt,…) - robust and easy installation by skilled people - high integrity (no undetected errors) - high availability (redundant layout) - clock synchronization (milliseconds down to a few microseconds) - continuous supervision and diagnostics - low attachment costs ( € 5.- / node) - moderate data rates (50 kbit/s … 5 Mbit/s) but large distance range (10m .. 4 km) - non-real-time traffic for commissioning (e.g. download) and diagnostics - in some applications intrinsic safety (oil & gas, mining, chemicals,..)
  • 5. 3.1 Field bus principles 5/25 Industrial Automation Expectations - reduce cabling - increased modularity of plant (each object comes with its computer) - easy fault location and maintenance - simplify commissioning (mise en service, IBS = Inbetriebssetzung) - simplify extension and retrofit - large number of off-the-shelf standard products to build “Lego”-control systems - possibility to sell one’s own developments (if based on a standard)
  • 6. 3.1 Field bus principles 6/25 Industrial Automation The original idea: save wiring marshalling bar I/O PLC PLC but: the number of end-points remains the same ! energy must be supplied to smart devices dumb devices field bus (Rangierung, tableau de brassage (armoire de triage) COM tray capacity
  • 7. 3.1 Field bus principles 7/25 Industrial Automation Marshalling (Rangierschiene, Barre de rangement) The marshalling is the interface between the PLC people and the instrumentation people.
  • 8. 3.1 Field bus principles 8/25 Industrial Automation Field busses classes CAN, DeviceNet, SDS, ASI-bus, Interbus-S Ethernet, ControlNet TCP IP Ethernet Sensor Busses simple switches etc. Plant Network Office network Fieldbus intelligent field devices FF, PROFIBUS PA, LON The field bus depends on: its function in the hierarchy the distance it should cover the data density it should gather
  • 9. 3.1 Field bus principles 9/25 Industrial Automation Geographical extension of industrial plants The field bus suits the physical extension of the plant Control and supervision of large distribution networks: • water - gas - oil - electricity - ... Out of primary energy sources: • waterfalls - coal - gas - oil - nuclear - solar - ... Manufacturing and transformation plants: • cement works - steel works - food silos - printing - paper pulp processing - glass plants - harbors - ... • locomotives - trains - streetcars - trolley buses - vans - buses - cars - airplanes - spacecraft - ... • energy - air conditioning - fire - intrusion - repair - ... Transmission & Distribution Power Generation Industrial Plants Vehicles Building Automation Manufacturing flexible manufacturing cells - robots 50 m .. 3 km 1 km .. 5 km 1 km .. 1000 km 1 m .. 800 m 500m .. 2 km 1 m .. 1 km
  • 10. 3.1 Field bus principles 10/25 Industrial Automation Networking busses: Electricity Network Control houses substation Modicom ICCP control center Inter-Control Center Protocol IEC 870-6 HV MV LV High Voltage Medium Voltage Low Voltage SCADA FSK, radio, DLC, cable, fiber,... substation RTU RTU RTU RTU COM RTU RTU RTU Remote Terminal Units RTU RTU IEC 870-5 DNP 3.0 Conitel RP 570 control center control center low speed, long distance communication, may use power lines or telephone modems. Problem: diversity of protocols, data format, semantics... serial links (telephone)
  • 11. 3.1 Field bus principles 11/25 Industrial Automation Substation (air isolated) Node in the electricity grid
  • 12. 3.1 Field bus principles 12/25 Industrial Automation Substations (indoor) Gas Isolated high voltage medium voltage consist of bays (départs, Abgang), interconnected by a buss bar (barre, Sammelschiene)
  • 13. 3.1 Field bus principles 13/25 Industrial Automation Substation electrical busses G A B bussbars switch position and commands current, voltage, temperature Generator Bay Bay Bay Transformer isolator (Trenner Interrupteur) circuit breaker (Schalter, Disjoncteur) Current Transformer (measure)
  • 14. 3.1 Field bus principles 14/25 Industrial Automation Substation data busses IED 2 IED 1 IED 3 bay i IED 2 IED 1 IED 3 bay 1 IED 2 IED 1 IED 3 bay n gateway workstation1 gateway workstation2 logger printer station bus the structure of the data busses reflects the substation structure switch control and protection devices
  • 15. 3.1 Field bus principles 15/25 Industrial Automation Fieldbus Application: wastewater treatment Pumps, gates, valves, motors, water level sensors, flow meters, temperature sensors, gas meters (CH4), generators, … are spread over an area of several km2 Some parts of the plant have explosive atmosphere. Wiring is traditionally 4..20 mA, resulting in long threads of cable (several 100 km).
  • 16. 3.1 Field bus principles 16/25 Industrial Automation Process Industry Application: Water treatment plant S M.C.C. Control Room Sub Station SCADA Bus Monitor JB JB Remote Maintenance System Ethernet Segment 1 Segment 2 Segment 3 Segment 4 FB Protocol Converter PLC Digital Input/Output PID PID PID PID PID H1 Speed Fieldbus LAS JB JB AI AI AI AI AI AI AI AI AI AI AI AI AI AI AI AI AI AO AO AO AO AO AO DI S S S S AI AO AI Japan Malaysia Numerous analog inputs (AI), low speed (37 kbit/s) segments merged to 1 Mbit/s links. source: Kaneka, Japan
  • 17. 3.1 Field bus principles 17/25 Industrial Automation Data density (Example: Power Plants) Acceleration limiter and prime mover: 1 kbit in 5 ms Burner Control: 2 kbit in 10 ms per each 30 m of plant: 200 kbit/s Data are transmitted from the periphery or from fast controllers to higher level, but slower links to the control level through field busses over distances of 1-2 km. The control stations gather data at rates of about 200 kbit/s over distances of 30 m. Fast controllers require at least 16 Mbit/s over distances of 2 m The control room computers are interconnected by a bus of at least 10 Mbit/s, over distances of several 100 m. Planning of a field bus requires to estimate the data density per unit of length (or surface) and the requirements in response time and throughput over each link.
  • 18. 3.1 Field bus principles 18/25 Industrial Automation Distributed peripherals Many field busses are just extensions of the PLC’s Inputs and Outputs, field devices are data concentrators. Devices are only visible to the PLC that controls them relays and fuses
  • 19. 3.1 Field bus principles 19/25 Industrial Automation Application: Building Automation Source: Echelon low cost, low data rate (78 kbit/s), may use power lines (10 kbit/s)
  • 20. 3.1 Field bus principles 20/25 Industrial Automation Application: Field bus in locomotives cockpit motors power electronics brakes power line track signals Train Bus diagnosis radio data rate delay medium number of stations 1.5 Mbit/second 1 ms (16 ms for skip/slip control) twisted wire pair, optical fibers (EM disturbances) up to 255 programmable stations, 4096 simple I/O Vehicle Bus cost engineering costs dominate integrity very high (signaling tasks)
  • 21. 3.1 Field bus principles 21/25 Industrial Automation Application: automobile - 8 nodes - 4 electromechanical wheel brakes - 2 redundant Vehicle Control Unit - Pedal simulator - Fault-tolerant 2-voltage on-board power supply - Diagnostic System Bordnetz ECU Monitoring und Diagnose Bremsen ECU 4 redundantes Bordnetz 12V und 48V ECU ECU ECU c ECU Betätigungs- einheit
  • 22. 3.1 Field bus principles 22/25 Industrial Automation Application: Avionics (Airbus 380)
  • 23. 3.1 Field bus principles 23/25 Industrial Automation requires integration of power electronics and communication at very low cost. The ultimate sensor bus power switch and bus interface
  • 24. 3.1 Field bus principles 24/25 Industrial Automation Assessment • What is a field bus ? • How does a field bus supports modularity ? • What is the difference between a sensor bus and a process bus ? • Which advantages are expected from a field bus ?
  • 26. 2005 April, HK Industrial Automation Automation Industrielle Industrielle Automation 3 Industrial Communication Systems Field Bus Operation 3.2 Bus de terrain: mode de travail Feldbus: Arbeitsweise Prof. Dr. H. Kirrmann ABB Research Center, Baden, Switzerland
  • 27. 3.2 Field bus operation 2 Industrial Automation Fieldbus - Operation 3.1 Field bus types Classes Physical layer 3.2 Field bus operation Data distribution Cyclic Operation Event Driven Operation Real-time communication model Networking 3.3 Standard field busses
  • 28. 3.2 Field bus operation 3 Industrial Automation Objective of the field bus Distribute to all interested parties process variables, consisting of: •accurate process value and units •source identification: requires a naming scheme •quality indication: good, bad, substituted, •time indication: how long ago was the value produced •(description) time quality value source description
  • 29. 3.2 Field bus operation 4 Industrial Automation Master or peer-to-peer communication AP all traffic passes by the master (PLC); adding an alternate master is difficult (it must be both master and slave) input output PLCs may exchange data, share inputs and outputs allows redundancy and “distributed intelligence” devices talk directly to each other separate bus master from application master ! input output PLC PLC PLC PLC PLC central master: hierarchical peer-to-peer: distributed “slaves” “master” “slaves” “masters” alternate master communication in a control system is evolving from hierarchical to distributed AP AP AP AP
  • 30. 3.2 Field bus operation 5 Industrial Automation application processor application processor application processor Broadcasts A variable is read on the average in 1..3 different places Broadcasting messages identified by their source (or contents) increases efficiency. = variable instances application processor plant image plant image plant image plant image = distributed data base The bus refreshes the plant image in the background, it becomes an on-line database Each station snoops the bus and reads the variables it is interested in. Each device is subscribed as source or as sink for a number of process variables Only one device may be source of a certain process data (otherwise, collision). The replicated traffic memories can be considered as "caches" of the plant state (similar to caches in a multiprocessor system), representing part of the plant image. bus
  • 31. 3.2 Field bus operation 6 Industrial Automation Data format time quality value source In principle, the bus could transmit the process variable in clear text, possibly using XML. However, this is quite expansive and only considered when the communication network offers some 100 Mbit/s and a powerful processor is available to parse the message More compact ways such as ASN.1 have been used in the past with 10 Mbit/s Ethernet. Field busses are still slow (1Mbit/s ..12 Mbits/s) and therefore more compact encodings are used.
  • 32. 3.2 Field bus operation 7 Industrial Automation Datasets wheel speed air pressure line voltage time stamp analog variables Dataset binary variables all door closed lights on heat on air condition on bit offset 16 32 48 0 64 66 70 size Field busses devices had a low data rate and transmit over and over the same variables. It is economical to group variables of a device in the same frame as a dataset. A dataset is treated as a whole for communication and access. A variable is identified within a dataset by its offset and its size Variables may be of different types, types can be mixed. dataset identifier
  • 33. 3.2 Field bus operation 8 Industrial Automation Dataset extension and quality To allow later extension, room is left in the datasets for additional variables. Since the type of these future data is unknown, unused fields are filled with '1". To signal that a variable is invalid, the producer overwrites the variable with "0". Since both an "all 1" and an "all 0" word can be a meaningful combination, each variable can be supervised by a check variable, of type ANTIVALENT2: 0 1 0 1 1 1 0 0 0 1 check 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 1 1 correct variable error undefined variable value A variable and its check variable are treated indivisibly when reading or writing The check variable may be located anywhere in the same data set. Dataset var_offset chk_offset 10 = substituted 00 = network error 01 = ok 11 = data undefined
  • 34. 3.2 Field bus operation 9 Industrial Automation Decoupling Application and Bus traffic sending: application writes data into memory receiving: application reads data from memory the bus controller decides when to transmit bus and application are not synchronized application processor bus controller traffic memory decoupled (asynchronous): sending: application inserts data into queue and triggers transmission, bus controller fetches data from queue receiving: bus controller inserts data into queue and interrupts application to fetch them, application retrieves data application processor bus controller queues coupled (event-driven): events (interrupts)
  • 35. 3.2 Field bus operation 10 Industrial Automation Traffic Memory: implementation Bus and Application are (de)coupled by a shared memory, the Traffic Memory, where process variables are directly accessible to the application. Ports (holding a dataset) Application Processor Bus Controller Traffic Memory Associative memory two pages ensure that read and write can occur at the same time (no semaphores !) bus an associative memory decodes the addresses of the subscribed datasets
  • 36. 3.2 Field bus operation 11 Industrial Automation Freshness supervision It is necessary to check that the data in the traffic memory is still up-to-date, independently of a time-stamp (simple devices do not have time-stamping) Applications tolerate an occasional loss of data, but no stale data. To protect the application from using obsolete data, each Port in the traffic memory has a freshness counter. This counter is reset by writing to that port. It is incremented regularly, either by the application processor or by the bus controller. The application should always read the value of the counter before using the port data and compare it with its tolerance level. The freshness supervision is evaluated by each reader independently, some readers may be more tolerant than others. Bus error interrupts in case of severe disturbances are not directed to the application, but to the device management.
  • 37. 3.2 Field bus operation 12 Industrial Automation Process Variable Interface Access of the application to variables in a traffic memory is very easy: ap_get (variable_name, variable value, variable_status, variable_freshness) ap_put (variable_name, variable value) Rather than fetch and store individual variables, access is done by clusters (predefined groups of variables): ap_get (cluster_name) ap_put_cluster (cluster_name) The cluster is a table containing the names and values of several variables. Note: Usually, only one variable is allowed to raise an interrupt when received: the one carrying the current time (sent by the common clock) The clusters can correspond to "segments" in the function block programming.
  • 38. 3.2 Field bus operation 13 Industrial Automation Time-stamping and clock synchronisation In many applications, such as disturbance logging and sequence-of-events, the exact sampling time of a variable must be transmitted together with its value. To this purpose, the devices are equipped with a clock that records the creation date of the value (not the transmission time). To reconstruct events coming from several devices, clocks must be synchronized. considering transmission delays over the field bus (and in repeaters,....) A field bus provides means to synchronize clocks in spite of propagation delays and failure of individual nodes. Protocols such as IEEE 1588 can be used. bus input input input processing t1 t2 t3 t4 t1 val1
  • 39. 3.2 Field bus operation 14 Industrial Automation Transmission principle The previous operation modes made no assumption, how data are transmitted. The actual network can transmit data cyclically (time-driven) or on demand (event-driven), or a combination of both.
  • 40. 3.2 Field bus operation 15 Industrial Automation Cyclic and Event-Driven transmission event-driven: send when value change by more than x% of range limit update frequency !, limit hysteresis cyclic: send value every xx milliseconds nevertheless transmit: - every xx as “I’m alive” sign - when data is internally updated - upon quality change (failure) miss the peak (Shannon!) always the same, why transmit ? how much hysteresis ? - coarse (bad accuracy) - fine (high frequency) time individual period hysteresis
  • 41. 3.2 Field bus operation 16 Industrial Automation Fieldbus: Cyclic Operation mode 3.1 Field bus types Classes Physical layer 3.2 Field bus operation Data distribution Cyclic Operation Event Driven Operation Real-time communication model Networking 3.3 Standard field busses
  • 42. 3.2 Field bus operation 17 Industrial Automation Cyclic Data Transmission address devices (slaves) Bus Master Individual period 2 x Tpd N polls time [µs] read transfer time [ms] The duration of each poll is the sum of the transmission time of address and data (bit-rate dependent) and of the reply delayof the signals (independent of bit-rate). plant The master polls the addresses in a fixed sequence, according to its poll list. 1 2 3 4 5 6 address (i) data (i) address (i+1) 10 µs/km Poll List 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 Individual period 44 µs .. 296 µs
  • 43. 3.2 Field bus operation 18 Industrial Automation Cyclic operation principle The delivery delay (refresh rate) is deterministic and constant. No explicit error recovery needed since a fresh value will be transmitted in the next cycle. Only states may be transmitted, not state changes. To keep a low poll time, only small data items may be transmitted (< 256 bits) Cyclic operation is used to transmit the state variables of the process. These are called Process Data (or Periodic Data) The bus is under control of a central master (or distributed time-triggered algorithm). Data are transmitted at fixed intervals, whether they changed or not. Cycle time is limited by the product of the number of data transmitted by the duration of each poll (e.g. 100 µs / point x 100 points => 10 ms) The bus capacity must be configured beforehand. Determinism gets lost if the cycles are modified at run-time.
  • 44. 3.2 Field bus operation 19 Industrial Automation Source-Addressed Broadcast The bus master broadcasts the identifier of a variable to be transmitted: Phase1: Process Data are transmitted by source-addressed broadcast. The device that sources that variable responds with a slave frame containing the value, all devices subscribed as sink receive that frame. Phase 2: bus. master bus subscribed devices subscribed device subscribed device source sink sink sink variable value bus variable identifier bus master devices (slaves) source sink sink subscribed devices sink device device devices (slaves)
  • 45. 3.2 Field bus operation 20 Industrial Automation Read And Write Transfers turn-around time address source data time Most field busses operate with read cycles only. read transfer: master Write-No ack transfer write transfer: master (source) address next transfer Read Transfer Write Transfer With Ack master (source) arb arb turn-around time next transfer address data address arb arb data address arb address arb ack Local Area Networks operate with write-only transfers. Their link layer or transport layer provides acknowledgements by another write-only transfer next transfer time time destination Parallel busses use read and write-ack transfers • • turn-around time may be large compared with data transfer time. •
  • 46. 3.2 Field bus operation 21 Industrial Automation Round-tip Delay The round-trip delay limits the extension of a read-only bus master remotest data source repeater repeater closest data sink Master Frame access delay propagation delay (t_pd = 6 µs/km) t_source distance next Master Frame t_ms Slave Frame T_m T_m T_s T_m t_repeat t_repeat (t_repeat < 3 µs) t_repeat t_sm t_mm
  • 47. 3.2 Field bus operation 22 Industrial Automation Optimizing Cyclic Operation Solution: introduce sub-cycles for less urgent periodic variables: Cyclic operation uses a fixed portion of the bus's time The poll period increases with the number of polled items The response time slows down accordingly Cyclic polling need tools to configure the poll cycles. The poll cycles should not be modified at run-time (non-determinism) A device exports many process data (state variables) with different priorities. If there is only one poll type per device, a device must be polled at the frequency required by its highest-priority data. To reduce bus load, the master polls the process data, not the devices group with period 1 ms time 4a 8 16 1 4b 64 3 1 ms period (basic period) 2 ms period 2 4a 4 ms period 1 ms 1 ms 1 1 1 2
  • 48. 3.2 Field bus operation 23 Industrial Automation Cyclic Transmission and Application Bus and applications are decoupled by a shared memory, the traffic memory, which acts as distributed database actualized by the network. The bus master scans the identifiers at its own pace. The bus traffic and the application cycles are asynchronous to each other. Traffic Memory cyclic algorithms cyclic algorithms cyclic algorithms cyclic algorithms port address application 1 Ports Ports Ports application 2 application 4 source port sink port port data sink port cyclic poll bus controller bus master application 3 bus Periodic List Ports bus controller bus controller bus controller bus controller
  • 49. 3.2 Field bus operation 24 Industrial Automation Application Of Cyclic Bus The principle of cyclic operation, combined with source-addressed broadcast, has been adopted by most modern field busses This method gives the network a deterministic behavior, at expenses of a reduced bandwidth and geographical extension. It is currently used for power plant control, rail vehicles, aircrafts, etc... The poll scan list located in the central master (which may be duplicated for availability purposes) determines the behavior of the bus. It is configured for a specific project by a single tool, which takes into account the transmission wishes of the applications. This guarantees that no application can occupy more than its share of the bus bandwidth and gives control to the project leader.
  • 50. 3.2 Field bus operation 25 Industrial Automation Example: delay requirement Worst-case delay for transmitting all time critical variables is the sum of: Source application cycle time Individual period of the variable Sink application cycle time 8 ms 16 ms 8 ms = 32 ms subscribers application instances device publisher application instance bus instance device device applications bus
  • 51. 3.2 Field bus operation 26 Industrial Automation Example: traffic pattern in a locomotive number of devices: 37 ( including 2 bus administrators) 37 of 16 bits 16 ms 32 ms 64 ms 128 256 49 frames of 256 bits 30 frames of 128 bits 1024 65 frames of 64 bits 18 of 32 period % periodic time occupancy is proportional to surface total = 92%
  • 52. 3.2 Field bus operation 27 Industrial Automation Fieldbus: Event-driven operation 3.1 Field bus types Classes Physical layer 3.2 Field bus operation Data distribution Cyclic Operation Event Driven Operation Real-time communication model Networking 3.3 Standard field busses
  • 53. 3.2 Field bus operation 28 Industrial Automation Event-driven Operation Detection of an event is an intelligent process: • Not every change of a variable is an event, even for binary variables. • Often, a combination of changes builds an event. • Only the application can decide what is an event, since only the application programmer knows the meaning of the variables. Events cause a transmission only when an state change takes place. Bus load is very low on the average, but peaks under exceptional situations since transmissions are correlated by the process (christmas-tree effect). • • event- reporting station event- reporting station event- reporting station plant Multi-master bus: uses write-only transfers intelligent stations sensors/ actors
  • 54. 3.2 Field bus operation 29 Industrial Automation Bus interface for event-driven operation Application Processor Bus Controller message (circular) queues bus driver filter application Each transmission on the bus causes an interrupt. The bus controller only checks the address and stores the data in the message queues. The driver is responsible for removing the messages of the queue memory and prevent overflow. The filter decides if the message can be processed. interrupt
  • 55. 3.2 Field bus operation 30 Industrial Automation Response of Event-driven operation Interruption of server device at any instant can disrupt a time-critical task. Buffering of events cause unbound delays Gateways introduce additional uncertainties Since events can occur anytime on any device, stations communicate by spontaneous transmission, leading to possible collisions Caller Application Called Application Transport software Transport software interrupt request indication confirm Bus time
  • 56. 3.2 Field bus operation 31 Industrial Automation Determinism and Medium Access In Busses Although the moment an event occurs is not predictable, the communication means should transmit the event in a finite time to guarantee the reaction delay. Events are necessarily announced spontaneously: this requires a multi-master medium like in a LAN. The time required to transmit the event depends on the medium access (arbitration) procedure of the bus. Medium access control methods are either deterministic or not. Non-deterministic Collision (Ethernet) Deterministic Central master, Token-passing (round-robin), Binary bisection, Collision with winner.
  • 57. 3.2 Field bus operation 32 Industrial Automation Events and Determinism Although a deterministic medium access is the condition to guarantee delivery time, it is not sufficient since events messages are queued in the devices. The average delivery time depends on the length of the queues, on the bus traffic and on the processing time at the destination. Often, the computers limit far more the event delay than the bus does. Real-time Control = Measurement + Transmission + Processing + Acting bus F F F F F F F F F F F F data packets acknowledgements input and output queues events producers & consumers
  • 58. 3.2 Field bus operation 33 Industrial Automation Events Pros and Cons In an event-driven control system, there is only a transmission or an operation when an event occurs. Advantages: Drawbacks: Can treat a large number of events - if not all at the same time Supports a large number of stations System idle under steady - state conditions Better use of resources Uses write-only transfers, suited for LANs with long propagation delays Suited for standard (interrupt-driven) operating systems (Unix, Windows) Requires intelligent stations (event building) Needs shared access to resources (arbitration) No upper limit to access time if some component not deterministic Response time difficult to estimate, requires analysis Limited by congestion effects: process correlates events A background cyclic operation is needed to check liveliness
  • 59. 3.2 Field bus operation 34 Industrial Automation Fieldbus: real-time communication model 3.1 Field bus types Classes Physical layer 3.2 Field bus operation Centralized - Decentralized Cyclic Operation Event Driven Operation Real-time communication model Networking 3.3 Standard field busses
  • 60. 3.2 Field bus operation 35 Industrial Automation Mixed Data Traffic represent the state of the plant represent state changes of the plant -> Periodic Transmission of Process Variables short and urgent data items Since variables are refreshed periodically, no retransmission protocol is needed to recover from transmission error. -> Sporadic Transmission of Process Variables and Messages infrequent, sometimes lengthy messages reporting events, for: • System: initialisation, down-loading, ... Since messages represent state changes, a protocol must recover lost data in case of transmission errors • Users: set points, diagnostics, status Process Data Message Data ... motor current, axle speed, operator's commands, emergency stops,... periodic phase periodic phase event sporadic phase time basic period basic period sporadic phase
  • 61. 3.2 Field bus operation 36 Industrial Automation Mixing Traffic is a configuration issue Cyclic broadcast of source-addressed variables is the standard solution in field busses for process control. Cyclic transmission takes a large share of the bus bandwidth and should be reserved for really critical variables. The decision to declare a variable as cyclic or event-driven can be taken late in a project, but cannot be changed on-the-fly in an operating device. A message transmission scheme must exist alongside the cyclic transmission to carry not-critical variables and long messages such as diagnostics or network management An industrial communication system should provide both transmission kinds.
  • 62. 3.2 Field bus operation 37 Industrial Automation Real-Time communication stack The real-time communication model uses two stacks, one for time-critical variables and one for messages Logical Link Control time-critical process variables Management Interface time-benign messages Physical Link (Medium Access) Network (connectionless) Transport (connection-oriented) Session Presentation Application 7 6 Remote Procedure Call 5 4 3 2' 1 connectionless connectionless connection-oriented medium access implicit implicit Logical Link Control 2" media common
  • 63. 3.2 Field bus operation 38 Industrial Automation Application Sight Of Communication R4 Traffic Memory Periodic Tasks R3 R2 R1 Message Data (destination-oriented) Process Data (Broadcast) E3 E2 E1 Event-driven Tasks bus Supervisory Data bus controller Message Services Variables Services Queues station
  • 64. 3.2 Field bus operation 39 Industrial Automation Field - and Process bus Fieldbus Process Bus controlled by a central master (redundant for availability) cyclic polling call/reply in one bus transfer (read-cycle) ("fetch principle") number of participants limited by maximum period cheap connection (dumb) only possible over a limited geographical extension strictly deterministic multi-master bus (Arbitration) event-driven call/reply uses two different messages. both parties must become bus master ("bring - principle") large number of participants costly connection (intelligent) also suited for open systems deterministic arbitration -> Token non - deterministic
  • 65. 3.2 Field bus operation 40 Industrial Automation Cyclic or Event-driven Operation For Real-time ? Data are transmitted at fixed intervals, whether they changed or not. Data are only transmitted when they change or upon explicit demand. cyclic operation event-driven operation (aperiodic, demand-driven, sporadic) (periodic, round-robin) Worst Case is normal case Typical Case works most of the time Non-deterministic: delivery time vary widely Deterministic: delivery time is bound All resources are pre-allocated Best use of resources message-oriented bus object-oriented bus Fieldbus Foundation, MVB, FIP, .. Profibus, CAN, LON, ARCnet The operation mode of the communication exposes the main approach to conciliate real-time constrains and efficiency in a control systems.
  • 66. 3.2 Field bus operation 41 Industrial Automation Fieldbus: Networking 3.1 Field bus types Classes Physical layer 3.2 Field bus operation Data distribution Cyclic Operation Event Driven Operation Real-time communication model Networking 3.3 Standard field busses
  • 67. 3.2 Field bus operation 42 Industrial Automation Networking field busses Networking field busses is not done through bridges or routers, because normally, transition from one bus to another is associated with: - data reduction (processing, sum building, alarm building, multiplexing) - data marshalling (different position in the frames) - data transformation (different formats on different busses) Only system management messages could be threaded through from end to end, but due to lack of standardization, data conversion is today not avoidable.
  • 68. 3.2 Field bus operation 43 Industrial Automation Networking: Printing machine (1) B C D E PM LS LS LS PM LS LS LS PM LS LS LS PM LS LS LS MPS Section Control Line bus (AF100) Section Busses (AF100) Console, Section Supervision Reelstand bus (Arcnet) Reelstand-Gateways Operator bus (Ethernet) Plant-bus (Ethernet) Production Reelstands Printing Towers RPE RPD RPC RPB SSC SSD SSE SSB multiplicity of field busses with different tasks, often associated with units. main task of controllers: gateway, routing, filtering, processing data. most of the processing power of the controllers is used to route data
  • 69. 3.2 Field bus operation 44 Industrial Automation Networking: Printing Section (2) Falz- und Wendeturm- steuerung to production preparation (Ethernet) bridge PM PM standby GW GW standby Section bus D Line bus Rollenwechsler- koppler A Pressmasterbus (Ethernet) Interbus-S ARCnet Rollen- wechslerkoppler I Sektions- steuerung MR93 KT94 IBG V-Sercos IBG Interbus AC160 AC160 H -steuerungen Service-Arcnet Turmsteuerung Section bus B Section bus C H-Sercos IBG V-Sercos IBG Interbus AC160 Turmsteuerung IBG V-Sercos IBG Interbus AC160 Turmsteuerung IBG KT94 KT94 KT94 KT94 KT94 KT94 KT94 KT94 KT94 KT94 KT94 KT94 KT94 KT94 ODC KT94 Oxydry-Arcnet Oxydry Sektions- steuerung AC160 Auro Tower-ARCnet LS LS LS V-Sercos Section bus C
  • 70. 3.2 Field bus operation 45 Industrial Automation The worst-case delay for the transmission of all variables is the sum of 5 delays: The actual delay is non-deterministic, but bounded Transmission delay over a Trunk Bus (cyclic bus) gateway speed stop speed stop Feeder Bus Feeder Bus Trunk Bus gateway copying, filtering & marshalling delay copying, filtering & marshalling delay • feeder bus delay • gateway marshalling delay • trunk bus delay • gateway marshalling delay • feeder bus delay 32 ms 16 ms 25 ms 10 ms (synchronized) 32 ms = 100 ms
  • 71. 3.2 Field bus operation 46 Industrial Automation Assessment • What is the difference between a centralized and a decentralized industrial bus ? • What is the principle of source-addressed broadcast ? • What is the difference between a time-stamp and a freshness counter ? • Why is an associative memory needed for source-addressed broadcast ? • What are the advantages / disadvantages of event-driven communication ? • What are the advantages / disadvantages of cyclic communication ? • How are field busses networked ?
  • 72. 2004 June, HK Industrial Automation Automation Industrielle Industrielle Automation 3 Industrial Communication Systems Open System Interconnection (OSI) model 3.3.1 Modèle OSI d’interconnexion OSI-Modell Physical Link Network Transport Session Presentation 6 5 4 3 2 1 Application 7 Prof. Dr. H. Kirrmann ABB Research Center, Baden, Switzerland
  • 73. 2 2004 June, HK 3.3.1 OSI model EPFL - Industrial Automation The OSI model • was developed to structure telecommunication protocols in the ‘70 (Pouzin & Zimmermann) • standardized by CCITT and ISO as ISO / IEC 7498 • is a model, not a standard protocol, but a suite of protocols with the same name has been standardized by UIT / ISO / IEC for open systems data interconnection (but with little success) • all communication protocols (TCP/IP, Appletalk or DNA) can be mapped to the OSI model. • mapping of OSI to industrial communication requires some additions The Open System Interconnection (OSI) model is a standard way to structure communication software that is applicable to any network.
  • 74. 3 2004 June, HK 3.3.1 OSI model EPFL - Industrial Automation OSI-Model (ISO/IEC standard 7498) Physical Link Network Transport Session Presentation 6 5 4 3 2 1 Application 7 "Transport" protocols "Application" protocols Definition and conversion of the data formats (e.g. ASN 1) All services directly called by the end user (Mail, File Transfer,...) e.g. Telnet, SMTP Management of connections (e.g. ISO 8326) End-to-end flow control and error recovery (e.g. TP4, TCP) Routing, possibly segmenting (e.g. IP, X25) Error detection, Flow control and error recovery, medium access (e.g. HDLC) Coding, Modulation, Electrical and mechanical coupling (e.g. RS485)
  • 75. 4 2004 June, HK 3.3.1 OSI model EPFL - Industrial Automation OSI Model with two nodes Physical Link Network Transport Session Presentation Application Physical Medium node 1 node 2 7 6 5 4 3 2 1 7 6 5 4 3 2 1
  • 76. 5 2004 June, HK 3.3.1 OSI model EPFL - Industrial Automation Repeater repeater Ethernet server Ethernet server To connect a workstation of department A to the printer of department B, the cable becomes too long and the messages are corrupted. workstations department A department B Physically, there is only one bus carrying both department’s traffic, only one node may transmit at a time. printer The repeater restores signal levels and synchronization. It introduces a signal delay of about 1..4 bits 500m 500m 500m
  • 77. 6 2004 June, HK 3.3.1 OSI model EPFL - Industrial Automation OSI model with three nodes (bridge) 7 6 5 4 3 2 1 2 1 physical medium (0) 2 1 7 6 5 4 3 2 1 Physical Link Network Transport Session Presentation Application Node 1 bridge Node 2 The subnet on both sides of a bridge have: • the same frame format (except header), • the same address space (different addresses on both sides of the bridge) • the same link layer protocol (if link layer is connection-oriented) Bridges filter the frames on the base of their link addresses physical medium (0) e.g. Ethernet 100 MBit/s e.g. ATM
  • 78. 7 2004 June, HK 3.3.1 OSI model EPFL - Industrial Automation Bridge example repeater Ethernet server Ethernet server Bridge Ethernet 1 server Ethernet 2 In this example, most traffic is directed from the workstations to the department server, there is little cross-department traffic workstations department A department B There is only one Ethernet which carries both department’s traffic department A There are now two Ethernets and only the cross-department traffic burdens both busses printer server department B printer
  • 79. 8 2004 June, HK 3.3.1 OSI model EPFL - Industrial Automation Networking with bridges port port LAN port port port port LAN port port LAN LAN LAN port port port Spanning-tree-Algorithmen avoid loops and ensures redundancy
  • 80. 9 2004 June, HK 3.3.1 OSI model EPFL - Industrial Automation Switch crossbar- switch (or bus) queues full-duplex a switch is an extension of a hub that allows store-and-forward. nodes
  • 81. 10 2004 June, HK 3.3.1 OSI model EPFL - Industrial Automation OSI Model with three nodes (router) physical medium (0) Frames in transit are handled in the network layer . The router routes the frames on the base of their network address. The subnets may have different link layer protocols Node 1 Router Node 2 Physical Link Network Transport Session Presentation Application 3 2 1 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1
  • 82. 11 2004 June, HK 3.3.1 OSI model EPFL - Industrial Automation Repeater, Bridge, Router, Gateway: Topography same speed same medium access same frames Bridge Router backbone (e.g. FDDI) segment Repeater subnet (LAN, bus, extended link) end-to-end transport protocol gateway application- dependent connects different speed, different medium access by store-and-forward same frames and addresses initially transparent in both ways. can limit traffic by filtering devices (nodes, stations) have different link addresses devices (nodes, stations) have different physical addresses different subnetworks, same address space same transport protocol, segmentation/reassembly routers are initially opaque
  • 83. 12 2004 June, HK 3.3.1 OSI model EPFL - Industrial Automation Repeaters, Bridges, Routers and Gateways: OSI model Net Trp Ses Pre Apl Trp Ses Pre Apl MDS LLC Net Trp Ses Pre Apl MAC 10 Mbit/s coax MIS MDS Layer 1 MDS repeater or hub 10 Mbit/s fibre MDS MIS MDS MIS Layer 2 100 Mbit/s Ethernet bridge ( "switch") (store-and-forward) MDS MIS LLC MAC Layer 3 MDS MIS LLC MAC ATM 155 Mbit/s MDS MIS LLC MAC Net Trp Ses Pre Apl MAC MAC router MDS LLC IP TCP RPC gateway intelligent linking devices can do all three functions (if the data rate is the same) Fibre
  • 84. 13 2004 June, HK 3.3.1 OSI model EPFL - Industrial Automation To which level does a frame element belong ? destination source final origin preamble physical link bridge LLC NC network router TRP SES PRE APL application (gateway) repeater, hub CRC A frame is structured according to the ISO model ED link LLC Network Control transport session presentation application phy
  • 85. 14 2004 June, HK 3.3.1 OSI model EPFL - Industrial Automation Encapsulation Frame Signal Error detection Flag Flag Link-address Link control (Acknowledge, Token,etc.) Network address Transport header size User information CRC LinkAdr LinkCrt NetAdr INFO TrpCrt Each layer introduces its own header and overhead
  • 86. 15 2004 June, HK 3.3.1 OSI model EPFL - Industrial Automation Example: OSI-Stack frame structure >48 ISO 8473 connectionless network control 5 ISO 8073 class 4 transport control MA. frame control MA. destination address (6 octets) MA. source address (6 octets) L_destination SAP L_source SAP L_PDU L_PDU = UI, XID, TEST LI TPDU Protocol Identifier Header Length Version/Protocol ID (01) Lifetime DT/ER Type SP MS ER Checksum PDU Segment Length Destination Address (18 octets) Source Address (18 octets) ADDRESS PART Segmentation (0 or 6 octets) Options (priority = 3 octets) (CDT) N(S) ET MAC_header LNK_hdr NET_header TRP_header Destination Reference FIXED PART 13 3 DATA AFI = 49 IDI, Area ID (7 octets) PSI Physical Address (6 octets) LSAP = FE NSAP = 00 IDP (initial domain part) DSP (domain specific part) DATA (DT) TPDU (normal format) LSAP = DSAP FE = network layer 18 = Mini-MAP Object Dictionary Client 19 = Network Management 00 = own link layer (81) IEEE 802.4 token bus ISO 8802 logical link control address length
  • 87. 16 2004 June, HK 3.3.1 OSI model EPFL - Industrial Automation Protocol Data Units and Service Data Units Protocol Data Unit (PDU) N - Layer N+1- Layer N-1 Layer Protocol Data Unit (PDU) Service- Data Unit (SDU) Service- Data Unit (SDU) Layer N provides services to Layer N+1; Layer N relies on services of Layer n-1 (n)-layer entity (n)-layer entity (n+1)-layer entity (n+1)-layer entity (n-1)-layer entity (n-1)-layer entity
  • 88. 17 2004 June, HK 3.3.1 OSI model EPFL - Industrial Automation Service Access Points user of service N user of service N provider of service (N-1) provider of service (N) functions in layer N Service Access Points (SAP) Service Access Points represent the interface to a service (name, address, pointer,...) Service Access Points (SAP)
  • 89. 18 2004 June, HK 3.3.1 OSI model EPFL - Industrial Automation Address and SAPs in a device Link Network Transport z.B. TCP/IP z.B. ISO 8073 ISO 8473 ISO-stack Transport-SAP Physical Physical Address Logical Address or link address Network-SAP (not Network address) TSAP NSAP ASAP Application (z.B. File transfer, Email,....) PhSAP LSAP
  • 90. 19 2004 June, HK 3.3.1 OSI model EPFL - Industrial Automation Procedure call conventions in ISO Service User confirm (network) Service Provider (Network Transmission) request confirm (local) time Service User indication response confirm (user)
  • 91. 20 2004 June, HK 3.3.1 OSI model EPFL - Industrial Automation OSI implementation OSI should be considered as a model, not as an implementation guide Even if many claim to have "OSI"-conformant implementation, it cannot be proven. IEC published about 300 standards which form the "OSI" stack, e.g.: OSI stack has not been able to establish itself against TCP/IP Former implementations, which implemented each layer by an independent process, caused the general belief that OSI is slow and bulky. The idea of independent layers is a useful as a way of thinking, not the best implementation. ISO/IEC 8327-1:1996 Information technology -- Open Systems Interconnection -- Connection-oriented Session protocol: Protocol specification ISO/IEC 8073:1997 Information technology -- Open Systems Interconnection -- Protocol for providing the connection-mode transport service ISO/IEC 8473-2:1996 Information technology -- Protocol for providing the connectionless-mode network service -- ISO 8571-2:1988 Information processing systems -- Open Systems Interconnection -- File Transfer, Access and Management ISO/IEC 8649:1996 Information technology -- Open Systems Interconnection -- Service definition for the Association Control Service Element
  • 92. 21 2004 June, HK 3.3.1 OSI model EPFL - Industrial Automation OSI protocols in industry ISO-OSI standards should be used since they reduce specification and conformance testing work and commercial components exist the OSI model is a general telecommunication framework - implementations considers feasibility and economics. industrial busses use for real-time data a fast response access and for messages a simplified OSI communication stack the OSI model does not consider transmission of real-time data the overhead of the ISO-OSI protocols (8073/8074) is not bearable with low data rates under real-time conditions. Communication is greatly simplified by adhering to conventions negotiating parameters at run-time is a waste in closed applications. the OSI-conformant software is too complex: simple devices like door control or air-condition have limited power. • • • • • • Theory: Reality: Therefore: the devices must be plug compatible: there are practically no options. •
  • 93. 22 2004 June, HK 3.3.1 OSI model EPFL - Industrial Automation TCP / IP structure TCP UDP IP routing ICMP FTP SMTP HTTP Files SNMP Applications Transport Network Ethernet ATM radio modem Link & Physical The TCP/IP stack is lighter than the OSI stack, but has about the same complexity TCP/IP was implemented and used before being standardized. Internet gave TCP/IP a decisive push
  • 94. 23 2004 June, HK 3.3.1 OSI model EPFL - Industrial Automation Conclusions The OSI model is the reference for all industrial communication Even when some layers are skipped, the concepts are generally implemented Real-Time extensions to OSI are under consideration TCP/IP however installs itself as a competitor to the OSI suite, although some efforts are made to integrate it into the OSI model For further reading: Motorola Digital Data Communication Guide TCP/IP/UDP is becoming the backbone for all non-time critical industrial communication Many embedded controllers come with an integrated Ethernet controller, an the corresponding real-time operating system kernel offers TCP/IP services TCP/IP/UDP is quickly displacing proprietary protocols. Like OSI, TCP protocols have delays counted in tens or hundred milliseconds, often unpredictable especially in case of disturbances. Next generation TCP/IP (V6) is very much like the OSI standards.
  • 95. 24 2004 June, HK 3.3.1 OSI model EPFL - Industrial Automation Assessment 1) Name the layers of the OSI model and describe their function 2) What is the difference between a repeater, a bridge and a router ? 3) What is encapsulation ? 4) By which device is an Appletalk connected to TCP/IP ? 5) How successful are implementations of the OSI standard suite ?
  • 96. 2004 June, HK Industrial Automation Automation Industrielle Industrielle Automation 3. Industrial Communication Systems Physical Layer 3.3.2 Niveau physique Physische Schicht 3.3.2 Prof. Dr. H. Kirrmann ABB Research Center, Baden, Switzerland
  • 97. 2 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Physical Layer Outline 2. Topology 3. Physical media 5. Optical Fibres 6. Modulation 8. Encoding 4. Electric Signal coupling 7. Synchronization 9. Repeaters 1. Layering
  • 98. 3 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation OSI Model - location of the physical level Physical Link Network Transport Session Presentation Application Transport protocols Application protocols All services directly called by the end user (Mail, File Transfer,...) Definition and conversion of the data formats (e.g. ASN 1) Management of connections (e.g. ISO 8326) End-to-end flow control and error recovery (z.B. TP4, TCP) Routing, possibly segmenting (e.g. IP, X25) Error detection, Flow control and error recovery, medium access (e.g. HDLC) Coding, Modulation, Electrical and mechanical coupling (e.g. V24) 6 5 4 3 2 1 7
  • 99. 4 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Subdivisions of the physical layer mechanical specifications electrical / optical specifications medium-dependent signalling medium-independent signalling same for different media (e.g. coax, fibre, RS485) applies to one media (e.g. optical fibres) defines the mechanical interface (e.g. connector type and pin-out) applies to one media type (e.g. 200µm optical fibres) Physical Layer
  • 100. 5 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Concepts relevant to the physical layer Topology Mechanical Control Send, Receive, Collision Interface Binary bit, Collision detection [multiple access] Signal quality supervision, redundancy control Modulation Binary, NRZ, Manchester,.. Synchronisation Bit, Character, Frame Flow Control Handshake Medium Channels Coding/Decoding Baseband, Carrier band, Broadband Ring, Bus, Point-to-point Connector, Pin-out, Cable, Assembly signals, transfer rate, levels Half-duplex, full-duplex, broadcast
  • 101. 6 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Example: RS-232 - Mechanical-Electrical Standard DTE DCE DTE DCE 2 Data Terminal Equipment Data Communication Equipment (Modem) Telephone lines 2 modem eliminator cable extension Tip: Do not use Modem cables, only Extension cables Data Terminal Equipment computer terminal 2 Mechanical 2 25 7 Electrical: +12V -12V +3V -3V transmitter receiver "1" Mark Off "0" Space On Topology: Cabling rules Originally developed for modem communication, now serial port in IBM-PCs cable extension Modem Computer Terminal 3 1
  • 102. 7 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Physical Layer Outline 2. Topology 3. Physical media 5. Optical Fibers 6. Modulation 8. Encoding 4. Electric Signal coupling 7. Synchronization 9. Repeaters 1. Layering
  • 103. 8 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Topology: Simplex, Half and Full Duplex Full-duplex Sender/ Receiver Link (Point -To-Point) Bus (Half-Duplex, except when using Carrier Frequency over multiple bands) Ring (Half-Duplex, except double ring) Terminator Examples: Ethernet, Profibus Examples: SERCOS, Interbus-S Examples: RS232 Half-duplex Sender/ Receiver Sender/ Receiver Sender/ Receiver consists of point-to-point links Examples: RS485
  • 104. 9 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Bus topologies party-line a bus is a broadcast medium (delays come from propagation and repeaters) radio free topology repeater Terminator Terminator advantage: little wiring disadvantages: easy to disrupt, high attenuation and reflections, no fibres hub star advantage: robust point-to-point links, can use fibres disadvantage: requires hub, more wiring point-to-point
  • 105. 10 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation 500m Repeater repeater Ethernet server Ethernet server To connect a workstation of department A to the printer of department B, the cable becomes too long and the messages are corrupted. workstations department A department B Physically, there is only one Ethernet carrying both department’s traffic, only one node may transmit at a time. printer 500m The repeater restores signal levels and synchronization. It introduces a signal delay of about 1..4 bits 500m
  • 106. 11 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Bus: repeaters and hubs partyline point-to-point link repeaters higher-level hub hubs assemble point-to-point links to form a broadcast medium (bus) partyline
  • 107. 12 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Party-line (bus) and star wiring I/O PLC I/O I/O I/O I/O PLC wiring length = d • n, increases linearly with number of devices d wiring length = d • n • n / 2 • 2 increases with square of number of devices hub Up to 32 devices (more with repeaters) Up to 16 devices per hub I/O I/O I/O I/O I/O d = average distance between devices does it fit into the wiring tray ? star wiring may more than offset the advantage of field busses (reduced wiring) and leads to more concentration of I/O on the field devices. party-line wiring is well adapted to the varying topography of control systems
  • 108. 13 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Rings classical ring ring in floor wiring wiring cabinet The wiring amount is the same for a bus with hub or for a ring with wiring cabinet. Since rings use point-to-point links, they are well adapted to fibres a ring consists only of point-to-point links Each node can interrupt the ring and introduce its own frames
  • 109. 14 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Physical Layer Outline 2. Topology 3. Physical media 5. Optical Fibres 6. Modulation 8. Encoding 4. Electric Signal coupling 7. Synchronization 9. Repeaters 1. Layering
  • 110. 15 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation twinax 8 0.9 0.2 3.5 very good Media (bandwidth x distance) 200m 700m 2000m twisted wire Telephone cable Transfer rate (Mbit/s) 0.2 0.1 0.05 Costs (Fr/m) 0.2 good (crosstalk) bad (foreign) Electromagnetic Compatibility group shielding (UTP) 1 0.3 0.1 1 good (crosstalk) regular (foreign) individually shielded (STP) 2 0.35 0.15 .5 very good 50 Ohm 20 8 1 1.2 75 Ohm TV 1/2" 12 2.5 1.0 2.2 good 93-100 Ohm 15 5 0.8 2.5 single mode 2058 516 207 5.5 multimode 196 49 20 6.5 good very good very good good coaxial cables optical fibres Radio bad Infrared 0.02 1 1 1 - - 0 0 good others Power line carrier 1 0.05 0.01 - very bad plastic 1 0.5 - 6.5 very good ultrasound 0.01 - 0 0 bad the bandwidth x distance is an important quality factor of a medium
  • 111. 16 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Physical Layer Outline 2. Topology 3. Physical media 5. Optical Fibres 6. Modulation 8. Encoding 4. Electric Signal coupling 7. Synchronization 9. Repeaters 1. Layering
  • 112. 17 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Electrical: Transmission media Cost efficient wiring: twisted pair (without Coaxial cable Unshielded twisted wire screen shield dielectric Telephone Shielded twisted wire (Twinax) flexible, cheap, medium attenuation ~1 MHz..12 MHz inflexible, costly, low losses 10 MHz..100 MHz Zw = 85Ω..120Ω Zw = 50Ω ... 100Ω core very cheap, very high losses and disturbances, very low speed (~10 ..100 kbit/s) numerous branches, not terminated, except possibly at one place Shield very cheap, sensible to perturbations Uncommitted wiring (e.g. powerline com.) 1) Classical wiring technology, 2) Well understood by electricians in the field 3) Easy to configure in the field 4) Cheap (depends if debug costs are included) 1) low data rate 2) costly galvanic separation (transformer, optical) 3) sensible to disturbances 4) difficult to debug, find bad contacts 5) heavy twisting compensates disturbances
  • 113. 18 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Electrical: Twisted wire pair characteristic impedance most used in industrial environment: 120 Ohm for bus, 150 Ohm for point-to-point. Standard from the telecommunication world: ISO/IEC 11801 Cat 5 (class D): 100 MHz, RJ 45 connector Cat 6 (class E): 200 MHz, RJ 45 connector Cat 7 (class F): 600 MHz, in development These are only for point-to-point links ! (no busses)
  • 114. 19 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Electrical: What limits transmission distance ? Attenuation: copper resistance, dielectric loss. Frequency dependent losses cause dispersion (edges wash-out): Signal reflection on discontinuities (branches, connectors) cause self-distortions Characteristic impedance Attenuation Linear resistance Linear capacitance Cross talk Common-mode Shield protection All parameters are frequency-dependent
  • 115. 20 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Consider in cables - characteristic impedance (Zw) (must match the source impedance) - attenuation (limits distance and number of repeaters) - bending radius ( layout of channels) - weight - fire-retardant isolation L' R' C' L' R' C' L' R' C' L' R' C' G' lumped line model specific inductance (H/m) specific resistance (W/m) specific capacitance (F/m) specific conductance (S/m) Zw = L' C' G' G' G'
  • 116. 21 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Electrical: Signal Coupling Types Resistive direct coupling driver on line without galvanic coupling collision possible when several transmitters active Wired-OR combination possible Inductive transformer-coupling galvanic separation retro-action free good electromagnetic compatibility (filter) cheap as long as no galvanic separation is required (opto-coupler) signal may not contain DC-components bandwidth limited Capacitive capacitor as coupler weak galvanic separation signal may not contain DC components cheap good efficiency good efficiency not efficient
  • 117. 22 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Electrical: Resistive (direct) coupling Ru Rd Zw Zw + Us + Us - Us Unipolar, unbalanced Open Collector (unbalanced) Bipolar, unbalanced Rt Ut Rt Ut = 5 V (e.g.) Bus line, characteristic impedance = Zw Out In device Out In device Out In device Terminator and Pull-up resistor wired-OR behaviour (“Low” wins over “High” Coax
  • 118. 23 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Electrical: Balanced Transmission Zw Shield (Data Ground) Differential transmitter and receiver + good rejection of disturbances on the line and common-mode - double number of lines Differential amplifier (OpAmp) Used for twisted wire pairs (e.g. RS422, RS485) Common mode rejection: influence of a voltage which is applied simultaneously on both lines with respect to ground. The shield should not be used as a data ground (inductance of currents into conductors) UA UB symmetrical line (Twisted Wire Pair) Rt +Ub 100 ?
  • 119. 24 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Electrical: RS-485 as an example of balanced transmission The most widely used transmission for busses over balanced lines (not point-to-point) stub tap 120? A B Data-GND A 100? RxS TxS RxS TxS RxS TxS Terminator segment length • • • Zw ˜ 120? , C' ˜ 100 pF/m Ishort < 250 mA Short-circuit limitation needed 120? multiple transmitter allowed
  • 120. 25 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Electrical: RS-485 Distance x Baudrate product 20 50 100 200 500 1000 2000 5000 10000 10KBd 100KBd 1 MBd 10 MBd limited by: Cable quality: attenuation, capacitive loading, copper resistance Receiver quality and decoding method distance Signal/Noise ratio, disturbances 12 1200 Baudrate limited by copper resistance 100? /km -> 6dB loss limit limited by frequency-dependent losses ˜ 20 dB/decade
  • 121. 26 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Electrical: Transformer Coupling Provides galvanic separation, freedom of retro-action and impedance matching Sender/Receiver Twisted Wire Pair shield Isolation transformer isolation resistors but: no DC-components may be transmitted. cost of the transformer depends on transmitted frequency band (not center frequency) Source: Appletalk manual Sender/Receiver
  • 122. 27 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Electrical: MIL 1553 as an example of transformer coupling Twisted Wire Pair shield Isolation transformer isolation resistors Direct Coupling (short stub: 0.3 m) short stub Sender/Receiver shield Isolation transformer isolation resistors long stub Double-Transformer (long stub: 0.3 .. 6m) Extract from: MIL-STD-1553 MIL 1553 is the standard field bus used in avionics since the years '60 - it is costly and obsolete
  • 123. 28 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Electrical: Free topology wiring terminator voltage source Free topology is used to connect scattered devices which are usually line-powered. Main application: building wiring Transmission medium is inhomogeneous, with many reflections and discontinuities. Radio techniques such as echo cancellation, multiple frequency transmission (similar to ADSL) phase modulation, etc... are used. Speed is limited by the amount of signal processing required (typically: 10 kbit/s)
  • 124. 29 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Electrical: Power Line Carrier technology HF-trap A free-topology medium using the power lines as carrier. Used for retrofit wiring (revamping old installations) and for minimum cabling Problems with disturbances, switches, transformers, HF-traps, EMC,.. Low data rates ( < 10 kbit/s) Proposed for voice communication over the last mile (ASCOM) Difficult demodulation Capacitive or inductive coupling, sometimes over shield Applications: remote meter reading, substation remote control 220V
  • 125. 30 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Electrical: Mechanical Connecting devices to an electrical bus some applications require live insertion (power plants, substations) time-outs (causing emergency stop) limit disconnection time short stub junction box thread-through 2 connectors no live insertion 1 connector live insertion (costly) junction box 1 connector live insertion Electrical wiring at high speed requires careful layout (reflections due to device clustering or other discontinuities, crosstalk, EM disturbances) stub double-connector 2 connectors live insertion installation ? installation or operational requirements may prohibit screws (only crimping)
  • 126. 31 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Practical solution to live insertion Offers life insertion but costs a lot (also in place)
  • 127. 32 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Electrical: Connectors Field busses require at the same time low cost and robust connectors. The cheapest connectors come from the automobile industry (Faston clips) and from telephony (RJ11, RJ 45) However, these connectors are fragile. They fail to comply with: - shield continuity - protection against water, dust and dirt (IP68 standard) - stamping-proof (during commissioning, it happens that workers and vehicles pass over cables) The most popular connector is the sub-D 9 (the IBM PC's serial port), which exists in diverse rugged versions. Also popular are Weidmann and Phoenix connectors.
  • 128. 33 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Electrical: Water-proof Connectors connector costs can become the dominant cost factor…
  • 129. 34 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Physical Layer Outline 2. Topology 3. Physical media 5. Optical Fibers 6. Modulation 8. Encoding 4. Electric Signal coupling 7. Synchronization 9. Repeaters 1. Layering
  • 130. 35 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Fiber: Principle Is GaAs LED PIN fotodiode different refraction coefficients Cable Transmitter laser-diode (GaAsP, GaAlAs, InGaAsP) Receiver Wavelength 1300 nm-window (Monomode) Transmitter, cable and receiver must be "tuned" to the same wavelength 850 nm (< 3,5 dB/km, > 400 MHz x km) laser (power), glass (up to 100 km) or plastic (up to 30 m). PIN-diode light does not travel faster than electricity in a fiber (refraction index). 3 components: transmitter fibre receiver
  • 131. 36 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Fiber: Types Multimodefibre N(r) 50 - 300 µm 50 - 100 µm 2-10 µm Monomode fibre waveguide total reflection gradual reflection 50 µm Core Clad Refraction profile Cross-section Longitudinal section 5dB/km 3 dB/km 2,3 dB/km 800nm (infra-red) 1300nm 0,6 dB/km 0,4 dB/km 20MHz·km 1 GHz·km 100 GHz·km telecom - costly 50 or 62.5 µm LAN fibre HCS (Hard-Clad Silica) ø 200 µm, < 500m (red) 650nm 10 dB/km
  • 132. 37 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Fibre: Use Material plastic glass / plastic glass distance 70m 400m 1km Usage local networking remote networking telephone Connector simple high-precision Cost cheap medium medium aging poor very good good bending very good good poor bandwidth poor good very good Type POF HCS/PCF GOF precision in industry, fibers cost the same as copper - think about system costs ! POF: Plastic Optical Fibres GOF: Glass Optical Fibres HCS: silica fibre
  • 133. 38 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Fiber: building an optical bus Passive coupler Active star coupler electrical segment (wired-or) fibre pair opto-electrical transceiver Every branch costs a certain percentage of light n% coupling losses n% coupling losses Passive star coupler 1 2 3 4 5 6 1 2 3 4 5 6 Fused zone costly manufacturing (100 $ branches) costly manufacturing (100 $ / 4 branches)
  • 134. 39 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Fiber: building an optical ring and bridging Powered unpowered Double ring Mechanical bridging is difficult This is why optical fibers are mostly used in rings (FDDI, Sercos) example of solution prism spring
  • 135. 40 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Fiber: advantages 1 ) high bandwidth and data rate (400 MHz x km) 2 ) small, frequency-insensitive attenuation (ca. 3 dB/km) 4 ) immune against electromagnetic disturbances (great for electrical substations) 5 ) galvanic separation and potential-free operation (great for large current environment) 6 ) tamper free 7 ) may be used in explosive environments (chemical, mining) 8 ) low cable weight (100 kg/km) and diameter, flexible, small cable duct costs 10) standardized 3 ) cover long distances without a repeater 9 ) low cost cable
  • 136. 41 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Fiber: Why are fibres so little used ? 1) In process control, propagation time is more important than data rate 2) Attenuation is not important for most distances used in factories (200m) 3) Coaxial cables provide a sufficiently high immunity 5) Galvanic isolation can be achieved with coaxial cables and twisted pairs through opto-couplers 6) Tapping is not a problem in industrial plants 8) In explosive environments, the power requirement of the optical components hurts. 9) Installation of optical fibres is costly due to splicing 4) Reliability of optical senders and connections is insufficient (MTTF ≈ 1/power). 7) Optical busses using (cheap) passive components are limited to a few branches (16) 10) Topology is restricted by the star coupler (hub) or the ring structure
  • 137. 42 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Radio Transmission Radio had the reputation to be slow, highly disturbed and range limited. Mobile radio (GSM, DECT) is able to carry only limited rate of data (9.6 kbit/s) at high costs, distance being limited only by ground station coverage. IEEE 802.11 standards developed for computer peripherals e.g. Apple’s AirPort allow short-range (200m) transmission at 11 Mbit/s in the 2.4 GHz band with 100mW. Bluetooth allow low-cost, low power (1 mW) links in the same 2.4 GHz band, at 1 Mbit/s Modulation uses amplitude, phase and multiple frequencies (see next Section) Higher-layer protocols (WAP, …) are tailored to packet radio communication. Radio == mobile -> power source (batteries) and low-power technologies. bluetooth module
  • 138. 43 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Wireless Field busses short distance, limited bandwidth, area overlap and frequency limitations not tamper-free, difficult to power the devices costs of base station but: who changes the batteries ? no wiring, mobile, easy to install
  • 139. 44 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Redundancy at the physical layer cable come together at each device centralized wiring star coupler B Star topology Party-Line decentralized wiring both cables can run in the same conduct where common mode failure acceptable Terminator Terminator star coupler A common mode failures cannot be excluded since wiring has to come together at each device star couplers should be separately powered
  • 140. 45 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Physical Layer Outline 2. Topology 3. Physical media 5. Optical Fibers 6. Modulation 8. Encoding 4. Electric Signal coupling 7. Synchronization 9. Repeaters 1. Layering
  • 141. 46 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Modulation Base band Carrier band Broadband Signals may be modulated on a carrier frequency (e.g. 300MHz-400MHz, in channel of 6 MHz) Signal transmitted as a sequence of frequencies, several at the same time. Signal transmitted as a sequence of binary states, one at a time (e.g. Manchester) Signal transmitted as a sequence of frequencies, one at a time (e.g. FSK = frequency shift keying = 2-phase Modulation. Frequency 5-108 MHz 162-400 MHz Backward channel Forward- channel
  • 142. 47 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Physical Layer Outline 2. Topology 3. Physical media 5. Optical Fibres 6. Modulation 8. Encoding 4. Electric Signal coupling 7. Synchronization 9. Repeaters 1. Layering
  • 143. 48 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Synchronisation: where does it take place ? "determine the beginning and the end of a data stream" Bit synchronisation Recognize individual bits Frame synchronisation Recognize a sequence of bits transmitted as a whole Message synchronisation Recognize a sequence of frames Session synchronisation Recognize a sequence of messages Clock +NRZ Data +Framing Data in Manchester II Start-sync (Violation) Stop-sync (Violation) = Line Signal Example: Frame synchronisation using Manchester violation symbols Character synchronisation Recognize groups of (5,7,8,9,..) bits 1 1 0 1 0 0 0 1 Data
  • 144. 49 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Frames: Synchronization character-synchronous (e.g. bisync) A character is used as synchronisation character If this character appears in the data stream, it is duplicated The receiver removes duplicated synchronisation characters delimiter (e.g. IEC 61158) A symbol sequence is used as delimiter, which includes non-data symbols bit-synchronous (e.g. HDLC) A bit sequence is used as a flag (e.g. 01111110). To prevent this sequence in the bit-stream, the transmitter inserts a "0" after each group of 5 consecutive "1", which the receiver removes. Delimiter (not Manchester) "1" "1" "0" "0" "1" "1" Manchester symbols 1 1 1 0 0 0 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0 0 1 0 Data Signal 1 1 1 0 0 0 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 10 0 0 Bit-stuffing flag SYN A B C SYN SYN D E F G SYN Byte-stuffing A B C SYN D E F G Data Signal flag flag Signal
  • 145. 50 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Physical Layer Outline 2. Topology 3. Physical media 5. Optical Fibers 6. Modulation 8. Encoding 4. Electric Signal coupling 7. Synchronization 9. Repeaters 1. Layering
  • 146. 51 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Encoding: popular DC-free encodings 1 1 0 1 1 0 0 0 Manchester 1: falling edge at midpoint 0: rising edge at midpoint DC-free, memoryless* Miller (MFM) centre frequency halved not completely DC-free memory: two bits (sequence 0110) Differential Manchester always transition at midpoint 1: no transition at start point 0: transition at start point (polarity-insensitive, DC-free, memoryless) Xerxes replaces “101” sequence by DC-balanced sequence DC-free, memory: two bits Ethernet, FIP IEC 61158, MVB, MIL 1553 High-density diskettes LON FlexRay memoryless*: decoding does not depend on history user
  • 147. 52 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Encoding: DC-free coding for transformer coupling DC-free encoding is a necessary, but not sufficient condition The drivers must be carefully balanced (positive and negative excursion |+U| = |-U|) Slopes must be symmetrical, positive and negative surfaces must be balanced Preamble, start delimiter and end delimiter must be DC-free (and preferably not contain lower-frequency components) Transformer-coupling requires a lot of experience. Many applications (ISDN…) accept not completely DC-free codes, provided that the DC component is statistically small when transmitting random data, but have to deal with large interframe gaps. effect of unbalance (magnetic discharge)
  • 148. 53 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Decoding base-band signals Zero-crossing detector Sampling of signal needs Phase-Locked Loop (PLL) and preamble (? delimiter) Signal Frequency Analysis requires Signal Processor, Quadrature/Phase analysis decoding depends on the distance between edges 1 0 1 0 1 0 1 0 1 N+ N- 1 0 N-N+ 0 1 1 1 Preamble Delimiter RxS Uh+ Uh- idle level active idle Daten Dynamic: 10 dB Dynamic: 32 dB Dynamic: 38 dB histeresis unipolar signal time Uh+ Uh- line bipolar signal Dynamic: 18 dB
  • 149. 54 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Encoding: Physical frame of IEC 61158-2 Start delimiter (8 bit times) 1 N+ N- 1 0 N- N+ 0 1 N+ N- N+ N- 1 0 1 1 0 1 0 1 0 1 0 +U -U end delimiter payload 0V defines end of frame needed since preamble is variable length start preamble 1 0 0 1 1 0 1 1 Payload (variable length) Preamble (variable) for PLL synchronisation End delimiter (8 bit times)
  • 150. 55 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Encodings: Multi-frequency frequency 54 kHz 49,5 kHz 45 kHz 40,5 kHz 36 kHz 31,5 kHz 27 kHz 22,5 kHz 90 kHz 85,5 kHz 81 kHz 76,5 kHz 72 kHz 67,5 kHz 63 kHz 58,5 kHz "0" "SB1" "1" "0" "1" "0" "1" "0" "1" "0" "1" "0" "1" "0" "1" "0" "1" "SB2" "SB3" "SB8" "SB4" "SB5" "SB6" "SB7" unused power Best use of spectrum Adaptive scheme (frequency-hopping, avoid disturbed frequencies, overcome bursts) Base of ADSL, internet-over-power lines, etc... Requires digital signal processor Limited in frequency EMC considerations
  • 151. 56 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Bandwidth and Manchester Encoding " 0 " " 0 " " 0 " " 1 " " 0 " " 1 " " 1 " 2-step Delimiter 3-step Non-data symbols may introduce a lower-frequency component which must go through a transformer. The transformer must be able to transmit frequencies in a 1:20 ratio 3-step
  • 152. 57 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Encoding: qualities 1) Self-clocking, Explicit clocking or asynchronous Clocked: separate clock channel Self-clocking: clock channel multiplexed with signal Asynchronous: requires synchronisation at next higher level. Code such as HDB3 insert "Blind Bits" to synchronize a random sequence. 2) Spectral efficiency Which frequency components can be found in a random data sequence ? especially: is there a DC-component ? (Important for transformer and transceiver coupling) Pseudo-DC-free codes such as AMI assume that "1" and "0" are equally frequent. 3) Efficiency: relation of bit rate to Baudrate Bitrate = Information bits per second Baudrate = Signal changes per second 4) Decoding ease Spectral-efficient codes are difficult to decode This is especially the case with memory-codes (value depends on former symbols) (e.g. Miller, differential Manchester). 5) Integrity For error detection, the type of error which can occur is important, and especially if a single disturbance can affect several bits at the same time (Differential Manchester). 6) Polarity A polarity-insensitive electrical wiring simplifies installation
  • 153. 58 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Physical Layer Outline 2. Topology 3. Physical media 5. Optical Fibres 6. Modulation 8. Encoding 4. Electric Signal coupling 7. Synchronization 9. Repeaters 1. Layering
  • 154. 59 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Repeater The repeater: • decodes and reshapes the signal (knowing its shape) • recognizes the transmission direction and forward the frame • detects and propagates collisions A repeater is used at a transition from one medium to another within the same subnet. repeater segment 2 decoder encoder decoder encoder segment 1 (RS 485) (transformer-coupled) node node node node node node
  • 155. 60 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Repeater and time skew Repeaters introduce an impredictable delay in the transmission since they need some time to synchronize on the incoming signal and resolve collisions.
  • 156. 61 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Star coupler (hub) wired-or electrical media fibre pair opto-electrical transceiver to other device or star coupler to other device or star coupler device device device device A star coupler is a collection of repeaters that connect point-to-point links into a bus (e.g. for optical fibres). it is called "hub" in the Ethernet standard. It is a star topology, but a bus structure
  • 157. 62 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation To probe further Henri Nussbaumer, Téléinformatique 1, Presses polytechniques romandes Fred Halsall, Data Communications, Computer Networks and Open Systems, Addison-Wesley EIA Standard RS-485 B. Sklar , “Digital Communications,” Prentice Hall, Englewood Cliffs, 1988
  • 158. 63 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation Assessment What is the function of the physical layer ? What is the difference between a bus and a ring ? How is a bus wired ? Which electrical media are used in industry ? How is the signal coupled to an electrical media ? How is the signal decoded ? What is an open-collector (open-drain) electrical media ? What are the advantages and disadvantages of transformer coupling ? What limits the distance covered by electrical signals and how is this to overcome ? What are the advantages and disadvantages of optical fibres ? When are optical fibers of 240 mm used rather than 62.5 mm ? What is a broadband medium ? What is DSL ? What is the purpose of modulation ? What is the purpose of encoding ? What is the difference between bit rate and Baudrate and what does it say about efficiency? What limits the theoretical throughput of a medium ? What is the difference between Manchester encoding, Miller and differential Manchester ? Which are the qualities expected from an encoding scheme ?
  • 159. 64 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation
  • 160. 65 2004 June, HK 3.3.2 Field busses - Physical Layer EPFL - Industrial Automation
  • 161. 2004 June, HK Industrial Automation Automation Industrielle Industrielle Automation 3. Industrial Communication Systems Link Layer and Medium Access 3.3.3 Niveau de liaison et accès au médium Verbindungsschicht und Mediumzugriff Prof. Dr. H. Kirrmann ABB Research Center, Baden, Switzerland
  • 162. 2 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Link Layer Outline Link Layer in the OSI model Stacks HDLC as example Frame sub-layer Error detection Error correction Medium Access control Logical Link Control Connection-Oriented and connectionless Error recovery Flow control HDLC Quality Criteria Single Master Rings Ethernet Collision with winner Token Passing Comparison
  • 163. 3 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Link Layer function 1) Data integrity 2) Medium Access 3) Logical Link Control The link layer implements the protocols used to communicate within the same subnet. (subnet: same medium access, same bit rate) - but different media may be interconnected by (bit-wise) repeaters Tasks of the link layer: 4) Link Layer Management
  • 164. 4 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Link Layer in the OSI Model Functions addressing frame format integrity control medium allocation (master redundancy) connection establishment flow Control error handling Medium Access Control (MAC) Logical Link Control (LLC) Network Frame Physical Medium Physical Signaling Physical Link Network Transport Session Presentation 6 5 4 3 2 1 Application 7 Subnet (Bus or Ring) bridge control store-and-forward address discovery
  • 165. 5 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation OSI model with two nodes Physical Link Network Transport Session Presentation Application Physical Medium Node 1 Node 2 7 6 5 4 3 2 1 7 6 5 4 3 2 1
  • 166. 6 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation OSI model with repeater (physical layer connection) Physical Link Network Transport Session Presentation Application 7 6 5 4 3 2 1 1 physical medium (0) Node 1 repeater 1 7 6 5 4 3 2 1 Node 2 The two segments on each side of a repeater form a single subnet, identified by • same speed (medium, modulation may differ) • same frame format (except fringe effects) • same medium access • same address space (transparent on both side of the repeater) Repeaters introduce a delay in the order of a few bit time. physical medium (1)
  • 167. 7 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation OSI model with three nodes (bridge): link layer connection Physical Link Network Transport Session Presentation Application 7 6 5 4 3 2 1 2 1 physical medium (0) Node 1 bridge 2 1 7 6 5 4 3 2 1 Node 2 The subnet on both sides of a bridge have: • the same frame format (except header), • the same address space (different addresses on both sides of the bridge) • the same link layer protocol (if link layer is connection-oriented) Bridges filter the frames on the base of their link addresses physical medium (0)
  • 168. 8 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Link Layer Outline Link Layer in the OSI model Stacks HDLC as example Frame sub-layer Error detection Error correction Medium Access control Logical Link Control Connection-Oriented and connectionless Error recovery Flow control HDLC Quality Criteria Single Master Rings Ethernet Collision with winner Token Passing Comparison
  • 169. 9 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation HDLC as example of a link layer protocol Function Standard Address Flag CRC Data Control 8 bit 01111110 16 bit (n · 8) 8 bit Flag 01111110 Integrity Check Error recovery Medium Access Objects 16-bit Cyclic Redundancy Check Master/Slave, (with slave initiative possible) positive acknowledgement and retry 7-frames (127 frames) credit system Flow control Reliable transmission between devices of a subnet HDLC (High Level Data Link) Frame structure according to ISO 3309.
  • 170. 10 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation HDLC Topology Primary (Mainframe) Secondary (Terminal) Secondary (Terminal) Secondary (Terminal) Secondary (Terminal) Secondary (Terminal) full-duplex or half-duplex medium The Primary (Master) is connected with the Secondaries (Slaves) over a multidrop bus (e.g. RS 485) or over point-to-point lines Secondary (Terminal) Secondary (Terminal) Secondary (Terminal) HDLC bases physically on a bus, but is logically a star network
  • 171. 11 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation HDLC - Full- and Half duplex operation Command/Data Sender/Receiver Responder/ Secondary Sender/Receiver Requester/ Primary Acknowledgement Command/Acknowledgement Sender/Receiver Responder/ Secondary Sender/Receiver Requester/ Primary Data Sender/Receiver Responder/ Secondary Sender/Receiver Requester/ Primary Half-Duplex Full-Duplex The Primary switches the Secondary to send mode, the Secondary sends until it returns control
  • 172. 12 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Link Layer Outline Link Layer in the OSI model Stacks HDLC as example Frame sub-layer Error detection Error correction Medium Access control Logical Link Control Connection-Oriented and connectionless Error recovery Flow control HDLC Quality Criteria Single Master Rings Ethernet Collision with winner Token Passing Comparison
  • 173. 13 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Frame Sublayer The frame layer is concerned with the correct frame format and contents, with (practically) no consideration of the medium or speed. sublayer Medium Access Control (MAC) Logical Link Control (LLC) Network Frame Physical Medium Physical Signaling Medium Access Control (MAC) Logical Link Control (LLC) Network Frame Physical Medium Physical Signaling
  • 174. 14 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Error Handling Industry imposes high standards regarding data integrity Transmission quality is not very high , but consequences are severe. Errors not detected at the link layer are very difficult to catch at higher layers Error detection Frame data are protected by redundant information, such as parity bits,checksum, CRC (Cyclic Redundancy Check) Error recovery Except when medium is very poor (Power Line Carrier, radio), error correcting Erroneous frames are ignored, the potential sender of the error is not informed (the address of the sender is unknown if the frame is damaged) The sender is informed of the lack of response when it does not receive the expected acknowledgement within a time-out. Definition of the time-out has a strong impact on real-time behaviour codes are not used.
  • 175. 15 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Link Layer Outline Link Layer in the OSI model Stacks HDLC as example Frame sub-layer Error detection Error correction Medium Access control Logical Link Control Connection-Oriented and connectionless Error recovery Flow control HDLC Quality Criteria Single Master Rings Ethernet Collision with winner Token Passing Comparison
  • 176. 16 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Error Detection Error detection require redundancy in the transmitted information. Signal redundancy: Signal quality supervision (squelch, jamming,..) Coding redundancy: Timing-violations in decoder Data redundancy: error detecting code k data bits r check bits n-bit codeword = (n,k) block code • Code efficiency: CEF = k/n • Hamming-Distance Quality criteria • Residual Error Rate
  • 177. 17 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Hamming Distance The Hamming Distance between two words is the number of bits in which they differ: Word 1: 01100110 Word 2: 00101001 -> Hamming-Distance = 5 The Hamming Distance of a code is the minimum number of bits which need to be tilted in a valid codeword to produce another valid (but erroneous) codeword 00000 00001 00011 00111 01111 code word code word m = 4 Number of detectable bit errors: ZD = HD – 1 Numbers of correctable bit errors: ZC = (HD–1)/2 Example: HD = 4: ZD = 3, ZC = 1 Example 1st error 2nd error 3rd error 4th error
  • 178. 18 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Hamming distance in 3 dimensions: parity 000 001 101 111 110 010 011 100 legal illegal Odd parity: sum Modulo-2 of all "1" in the codeword (including the parity bit) is odd 1 0 1 1 0 0 0 0 par D7 D6 D5 D4 D3 D2 D1 1 D0 The parity bit is the last transmitted bit (->LSB first, a matter of convention)
  • 179. 19 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Error Detection through CRC The data stream consists of a sequence of n "0" and "1" This sequence is treated as a polynomial of degree n. This polynomial is divided by a Generator polynomial of degree m, m<n, The rest of this division (which has (m-1) bits) is appended to the data stream. (Cyclic Redundancy Check) rest / At reception, the data stream is divided through the same generator-polynomial, the rest of that division should be identical to the transmitted rest. To simplify the receiver circuit, the rest is also divided by the generator polynomial, the result should then be a known constant if the transmission was error-free. The Generator Polynomial is chosen according to the expected disturbances: burst or scattered errors, and the channel error model (bit inversion) Principle data (dividend) GP(divisor)
  • 180. 20 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Residual Error Rate, Parity Hamming Distance R e r = 1 - (1- E r ) n - n · E r · (1- E r ) n -1 Residual error rate exactly one error no error E r Bit error probability Rer for two word length: E r = 10 -5 n = 9 bit R er = 72 · 10 -10 E r = 10 -5 n = 513 bit R er = 2.6· 10 -5 2 quite useless ... quite efficient…. Rer = Probability of occurrence of an undetected error in spite of an error detecting code as a function of the bit error probability Example:
  • 181. 21 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Integrity classes and bit error rate Residual Error Rate 10 -16 10 -14 10 -12 10 -10 10 - 8 10 - 6 10 - 4 10 - 2 10 0 Integrity class I1 I n t e g r i t y c l a s s I 2 Integrity class I3 FT2 FT1.2 10-5 10-4 10-3 10-2 10-1 10 0 Bit error rate The standard IEC 61870-5 (protocols for remote control of substations) defines several classes of robustness in function of the bit error rate (bad/good bits)
  • 182. 22 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Synchronization Errors 01111110 01111110 flag flag FCS HDLC-frame 01111110 01111110 flag flag FCS 01111110 "FCS" discarded false flag 1 Chance in 65536, that the random data form a correct CRC disturbance HDLC-frame with error A single error can falsify a frame -> HD = 1 It is uninteresting how likely this case is, the fact is, that it can occur. The synchronization should have a higher Hamming distance than the data itself. Because of this bug, HDLC when used in industry require additional error checks. precisely 1111110 is the most frequent sequence in a random bit stream because of bit-stuffing. any data Frame Check Sequence (CRC)
  • 183. 23 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Link Layer Outline Link Layer in the OSI model Stacks HDLC as example Frame sub-layer Error detection Error correction Medium Access control Logical Link Control Connection-Oriented and connectionless Error recovery Flow control HDLC Quality Criteria Single Master Rings Ethernet Collision with winner Token Passing Comparison
  • 184. 24 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Error Correcting Codes Error correcting codes are used where the probability of disturbances is high (e.g. power line communication) and the time to retransmit is long (e.g. space probe near Jupiter). In industry, error correcting codes are normally directly embedded in the physical layer, e.g. as part of a multitone transmission (ADSL) or of a radio protocol (Bluetooth). Error correction necessarily decreases the data integrity, i.e. the probability of accepting wrong data, since the redundancy of correction is taken from the code redundancy. It is much more important to reject erroneous data (low residual error rate) than to try to correct transmission. However, when the medium is very bad (radio), error correction is necessary to transmit even short messages. Assigning bits for error detection and correction is a tradeoff between integrity and availability.
  • 185. 25 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Link Layer Outline Link Layer in the OSI model Stacks HDLC as example Frame sub-layer Error detection Error correction Medium Access control Logical Link Control Connection-Oriented and connectionless Error recovery Flow control HDLC Quality Criteria Single Master Rings Ethernet Collision with winner Token Passing Comparison
  • 186. 26 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Medium Access Control Medium Access Control gives the right to send in a multi-master bus Network Logical Link Control (LLC) Network Frame Physical Medium Physical Signaling Logical Link Control (LLC) Frame Physical Medium Physical Signaling Network Medium Access Control (MAC) Medium Access Control (MAC) Medium Access Control (MAC) Logical Link Control (LLC) Frame Physical Medium Physical Signaling
  • 187. 27 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Link Layer Outline Link Layer in the OSI model Stacks HDLC as example Frame sub-layer Error detection Error correction Medium Access control Logical Link Control Connection-Oriented and connectionless Error recovery Flow control HDLC Quality Criteria Single Master Rings Ethernet Collision with winner Token Passing Comparison
  • 188. 28 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Medium Access Control - quality criteria Fairness all requesters will eventually be allowed to transmit Timelyness all requesters will be allowed to transmit within a certain time, depending on their priority. Robustness communication errors or the permanent failure of one component does not prevent the others to access the medium. Determinism all requesters will be allowed to transmit within a finite time
  • 189. 29 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Link Layer Outline Link Layer in the OSI model Stacks HDLC as example Frame sub-layer Error detection Error correction Medium Access control Logical Link Control Connection-Oriented and connectionless Error recovery Flow control HDLC Quality Criteria Single Master Rings Ethernet Collision with winner Token Passing Comparison
  • 190. 30 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation MAC single master (e.g. Profibus DP) bus bus master devices (slaves) slave slave slave command reply command ack command reply the bus master allocates time slots to each slave it may assign priorities (or no priority: round-robin, all are treated equally) the master may be the source and the destination of data + strictly deterministic, complete and flexible control - polling takes time, since devices which have nothing to transmit must be polled improvement: “ look-at-me ” (short poll frame allowing slave to request poll of a longer frame) = "slave initiative" used in Profibus DP time read write with ack command write no ack read & write - the master has little knowledge about data importance
  • 191. 31 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Link Layer Outline Link Layer in the OSI model Stacks HDLC as example Frame sub-layer Error detection Error correction Medium Access control Logical Link Control Connection-Oriented and connectionless Error recovery Flow control HDLC Quality Criteria Single Master Rings Ethernet Collision with winner Token Passing Comparison
  • 192. 32 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation MAC Rings (1): register insertion principle devices output output output shift register input input input master Devices are connected by point-to-point links (no bus!), there is one sender per segment. The operation is similar to a large shift register. The master sends a long frame with the output data to the first device in the ring. Each device reads the data intended for it, inserts its data instead and passes the frame to the next device. The last device gives the frame back to the master. application memory time time data data
  • 193. 33 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation MAC Rings (2): pros and cons Two major field busses use the ring topology, Interbus-S and SERCOS and the register-insertion principle described. the position of the bit in the frame corresponds to the position of the device in the ring, there are no device addresses - easy to use, but prone to misconfiguration. each device introduces a delay at least equal to a few bits + deterministic access, good usage of capacity, addresses are given by device sequence on the ring, only point-to-point links - long delays (some µs per device)
  • 194. 34 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Link Layer Outline Link Layer in the OSI model Stacks HDLC as example Frame sub-layer Error detection Error correction Medium Access control Logical Link Control Connection-Oriented and connectionless Error recovery Flow control HDLC Quality Criteria Single Master Rings Ethernet Collision with winner Token Passing Comparison
  • 195. 35 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation MAC Ethernet (1): CSMA-CD principle (stochastic) improvement 2: (Binary Backoff) Every station sends as it pleases if no acknowledgement comes, it retransmit No upper limit to the waiting time, mean waiting time depends on the arrival rate of frames and on their average length. (pure Aloha) Advantage: retry after a random time, doubled after each collision, max 15 times be aware that you are jammed improvement 1: improvement 3: (Carrier Sense) (Collision Detection) Principle do not send when the medium is occupied Arbitration does not depend on number or on address of the stations Drawback: The medium access is not deterministic, but for light traffic (<1%) there is no noticeable delay.
  • 196. 36 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation MAC Ethernet (2): collision conditions repeater Station A must detect that its frame collided while it is still transmitting its frame at 10 Mbit/s, limits radius to about 2500 m Ethernet minimum frame size = 64 Bytes, or 51,2 ms @ 10 Mbit/s A B minimum frame size = 64 Bytes preamble = 8 Bytes collision at 100Mbit/s, limits radius to about 250 m (2 x 7.5 s/km+ 2 repeaters) Tpd Station B started transmission just before receiving A’s frame. it nevertheless transmits its header completely time
  • 197. 37 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation MAC Ethernet (3): propagation conditions and bus diameter The frame must be long enough to allow all stations to detect a collision while the frame is being transmitted. 500 m 2 x Tpd = 2 x propagation time (@10Mbit/s Ethernet: 51,2 µs) 500 m Collisions can only be detected reliably when the frame size is longer than the propagation delay -> padding to a minimum size (512 bits = 64 Bytes) The "diameter" of the network is limited to 2,5 km Since a station which expects a collision must wait one slot time before transmitting, the maximum frame throughput on Ethernet is limited by the slot time.
  • 198. 38 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation MAC Ethernet (4): collision probability and simultaneous transmitters previous frame 0 1 2 3 4 5 • • • time After the end of a frame, a transmitter chooses a slot at random from a fixed number of slots Ethernet is not efficient for small frame size and large number of simultaneous transmitters Ethernet is considered to enter overload when reaching 10%-18% load 0 0.2 0.4 0.6 0.8 1 1 2 3 4 5 10 32 64 128 256 4096 1024 512 48 utilisation 100% number of transmitters frame size
  • 199. 39 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation MAC Ethernet (5): when collisions can't be detected A small number of simultaneous transmitters causes a high probability loss of a packet . LON can retry up to 255 times: probability of lost message is low, but delay is long 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 without collision detection with collision detection number of simultaneous transmitters probability of loosing a packet source: P. Koopman, CMU LON uses a p-persistent MAC with 16-slot collision avoidance (p = 1/16) It is not always possible to detect collisions.
  • 200. 40 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Link Layer Outline Link Layer in the OSI model Stacks HDLC as example Frame sub-layer Error detection Error correction Medium Access control Logical Link Control Connection-Oriented and connectionless Error recovery Flow control HDLC Quality Criteria Single Master Rings Ethernet Collision with winner Token Passing Comparison
  • 201. 41 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation MAC CAN (1): Deterministic Arbitration Such a medium allows a bit-wise "Wired-OR" operation When several transmitters are simultaneously active, the dominant state wins over the recessive state if there is at least one transmitter sending the dominant state (dominant is “Low” in open collector, "Bright" in an optical fiber, or a collision on a medium that allows collisions). A device is capable to know if the signal it puts on the line is disturbed (XOR). Terminator and pull-up resistor Bus line Rt Ut Rt Ut The CAN fieldbus uses media with a dominant and a recessive state Example: open-collector: Terminator and pull-up resistor device 1 device 2 device 3 device 4 Jam Out In XOR Jam Out In XOR Jam Out In XOR Jam Out In XOR
  • 202. 42 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation MAC CAN (2): Collision with Winner • Each station has a different identity (in this example: 4 bit ID) • Each station listens before sending and can detect collisions • Competing stations start transmitting at the same time (1st bit is a SYNC-sign) • Each station begins its transmission with its identity, bit by bit • In case of collision, "1" wins over "0" ("1" = Low, bright, dominant). • A station, whose "0" bit was transformed into a “1" retires immediately • The winning station has not been disturbed and transmits. • Loosing stations await the end of the ongoing transmission to start again. Station 10 (wins) slot time 1 0 1 0 1 0 0 (1) Station 09 1 0 1 0 0 (1) (1) (0) Station 06 Bus signal Also known as "Urn" or "binary bisection" method Advantage: deterministic arbitration (assumes fairness), good behavior under load the size of the unique ID defines arbitration time, transmission delay defines slot time -> 40m @ 1 Mbit/s, 400m @ 100 kbit/s Drawback:
  • 203. 43 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation MAC CAN (3): Deterministic Arbitration Advantage: deterministic arbitration (assumes fairness, I.e. a device only transmits again when all losers could), good behavior under load. the slot time (one bit time) must be long enough so that every station can detect if it has been disturbed - I.e. twice as long as the propagation time from one end of the bus to the other ( signal speed = 5 ns / m). Therefore, the bit rate is dependent on the bus extension: 40m @ 1 Mbit/s, 400m @ 100 kbit/s the size of the unique ID defines arbitration time. Drawback:
  • 204. 44 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Link Layer Outline Link Layer in the OSI model Stacks HDLC as example Frame sub-layer Error detection Error correction Medium Access control Logical Link Control Connection-Oriented and connectionless Error recovery Flow control HDLC Quality Criteria Single Master Rings Ethernet Collision with winner Token Passing Comparison
  • 205. 45 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation MAC Profibus (1): Token principle All stations form a logical ring Each station knows the next station in the ring (and the overnext) Each station delegates the right to send to the next station in the ring, (in the form of a token frame or as an appendix to a data frame). z.B.: Token Bus (IEEE 803.4), Profibus (IEC 61158) Variants Token with Priority (back to the station with the highest priority) Problems: Loss or duplication of token, initialization do not confuse with token ring !
  • 206. 46 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation MAC Profibus (2): Token passing active stations (potential masters) AS AS AS passive stations (slaves) 12 25 31 logical ring current bus master Active Stations (AS) can become master if they own the token, for a limited duration (one frame only). After that time, the master passes the token to a station with a higher address or, if it has the highest address, to the station with the lowest address. A station must send at least one frame (data or token) when it gets its turn. station address
  • 207. 47 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation MAC Profibus (3): Token passing algorithm Each station holds a List of Active Stations (LAS) Previous Station Next Station This Station PS TS NS AS GAP AS AS When the current master has no more data to send, or when its turn expires, it sends a token frame to the Next Station (NS) in the ring. NS acknowledges reception of the token. If the master does not receive an acknowledgement for two consecutive trials, the master removes the station from the LAS and declares the overnext active station (OS) as NS. This station accepts the token only if it receives it twice. The master tests at regular intervals with a "Request FDL-Status" for the presence of further stations in the gap between itself and NS. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 .. 30 32 Active Station Overnext Station
  • 208. 48 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation MAC Profibus (4): Token initialization A starting station listens to the bus before trying to send. If it senses traffic, a station records the token frames and builds a list of active stations (LAS). In particular, it observes if a station with the same name as itself already exists. If a station does not register any traffic during a certain time, it sends a token frame to itself. It sends the first token frame to itself, to let other starting stations register it. Only when it detects no other station does a station begin with a systematic poll of all addresses, to build the LAS. When a master checks the gap, the station will receive a token offer.
  • 209. 49 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Link Layer Outline Link Layer in the OSI model Stacks HDLC as example Frame sub-layer Error detection Error correction Medium Access control Logical Link Control Connection-Oriented and connectionless Error recovery Flow control HDLC Quality Criteria Single Master Rings Ethernet Collision with winner Token Passing Comparison
  • 210. 50 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Comparison of Medium Access Control Methods optimistic stochastic pessimistic deterministic central master token passing collision with winner carrier sense collision detection p-persistent collision
  • 211. 51 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Link Layer Outline Link Layer in the OSI model Stacks HDLC as example Frame sub-layer Error detection Error correction Medium Access control Logical Link Control Connection-Oriented and connectionless Error recovery Flow control HDLC Quality Criteria Single Master Rings Ethernet Collision with winner Token Passing Comparison
  • 212. 52 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Logical Link Control Sublayer Two Link services: - unacknowledged connectionless service and - connection oriented services Network Medium Access Control (MAC) Logical Link Control (LLC) Network Frame Physical Medium Physical Signaling Medium Access Control (MAC) Logical Link Control (LLC) Frame Physical Medium Physical Signaling
  • 213. 53 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Connection-Oriented and Connection-Less communication Connectionless mode (Datagram ≈ letter) Each packet (Datagram) contains all information needed to forward it to its final destination over the network, including the path back to the sender. The network assumes no responsibility for the ordering of packets and does not try to recover damaged datagrams. The burden of flow control and error recovery is shifted to the application. Connection-Oriented mode (Virtual Circuit ≈ telephone) A connection is first established between sender and receiver. Information packets are identified by their connection identifier and by their sequence number within that connection. The network cares for opening and closing connections and ensures that packets are received in same order as they are sent, recovering lost packets and controlling the flow. Applications see the network as a reliable pipe. Connection is closed after use (and reused) Semantic of CO-transmission Open_Channel(Node, Task, Channel_Nr); Send_Message (Channel_Nr, Msg1); Send_Message (Channel_Nr, Msg2); Close(Channel_Nr); Msg1 will be received before Msg2, sequence is maintained. Semantic of CL-transmission Send_Packet (source, destination, Packet1); these considerations apply to all levels of the OSI model Send_Packet (source, destination, Packet2);
  • 214. 54 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Connection-Oriented Link Service Connection establishment and disconnection Send and receive frames Flow Control (Buffer control) Retry in case of error REQUEST INDICATION CONFIRM service user service provider service user RESPONSE Task: Flow Control and Error Recovery
  • 215. 55 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Flow Control "Adapt the speed of the sender to that of the receiver" ( = synchronization at the link layer) Methods Use Acknowledgements: do not send until an acknowledgement is received (acknowledgements have two purposes: error recovery and flow control !) Credit: the receiver indicates how many frames it can accept (sliding Window protocol). Improvement: variable window size. Explicit braking (CTRL-S/ CRTL-Q) • • • Upper Window Edge Lower Window Edge sent but not yet acknowledged sent and acknowledged can be sent may not be sent 12 6 7 8 9 11 10 packets time
  • 216. 56 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Simple transfer with window size = 1 LLC DATA (0) ACK (1) DATA (1) DATA ( last) ACK (last) ACK (2) LLC Consumer alive time-out connect timer ack timer late acks Connect Request Connect Confirm i Producer nm_message_ind nm_connect.ind tm_message.req nm_message.cnf Connection Transfer Disconnection Bus nm_connect.cnf Every packet takes at least two propagation times time
  • 217. 57 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Error Recovery General rule: Erroneous information frames are repeated (error correcting codes belong to physical layer) 1) In cyclic transmission, information is not explicitly repeated in case of loss, the receiver will receive a fresh information in the next cycle. A freshness control supervises the age of the data in case communication ceases. The sender of information frames expects acknowledgement of the receiver, indicating which information it received. To distinguish repetitions from new information, each packet receives a sequence number (in the minimum odd/even). The sender repeats the missing information a number of times, until it receives an acknowledgement or until a time-out expires. 3) In broadcast transmission, it is relatively difficult to gather acknowledgements from all possible receivers, so in general unacknowledged broadcast is used. The receiver is expected to protest if it does not receive the information. 2) In event-driven transmission, no information may be lost, a repetition is explicit: a) c) b) The receiver acknowledges repetitions even if it already received the information correctly. d)
  • 218. 58 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Link Layer Outline Link Layer in the OSI model Stacks HDLC as example Frame sub-layer Error detection Error correction Medium Access control Logical Link Control Connection-Oriented and connectionless Error recovery Flow control HDLC Quality Criteria Single Master Rings Ethernet Collision with winner Token Passing Comparison
  • 219. 59 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Example: HDLC HDLC (High-level Data Link Control is derived from IBM's SDLC (Synchronous Data Link Control) These protocols were developed for connection of point-of-sale terminals to a one mainframe computer. HDLC is the most frequently used link layer protocol. It is the base for the CCITT-standard X25 (Telenet, Datex-P, Telepac) and used in Bitnet, Appletalk, etc... The HDLC protocol is implemented in the hardware of numerous microcontrollers (e.g. Zilog 80C30, Intel, Siemens 82525,... and in some microprocessors (e.g. 68360). HDLC is the base for the Local Area Network protocol IEEE 802.2
  • 220. 60 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation HDLC Control Field (ISO 4335) Control Field Bits Control Field Format for: 1 2 3 4 5 6 7 8 0 N(S) P/F N(R) Information Transfer Command/Response (I-Format PDU) 1 0 S P/F N(R) 1 1 M P/F M Supervisory Commands/Responses (S-Format PDUs) Unnumbered Commands/Response (U-Format PDUs) 16 8 FCS adr control 8 8 01111110 01111110 flag flag 8 any data physical address of Secondary (for command and response) N(S) = Sequence number of sender N(R) = Sequence number of receiver S = Supervisory P/F = Poll/Final (Please respond/Final in sequence)
  • 221. 61 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation HDLC Connection Types The sender includes the sequence number in each packet. The receiver indicates which packet it expects next, either through a special frame ( Receiver Ready N(R) ) or within its information frames (I-Frame, N(R)) At the same time, this sequence number acknowledges all previously received frames with number N(R) -1. Traffic is divided intopackets (= information frame)each receiving a sequence number (Modulo 8). LAP (link access procedure): assymetric Primary/Secondary; NRM (normal response mode): only one station as primary; ARM (asynchronous response Mode): spontaneous transmission of secondary; LAPB (LAP-balanced): every station can become primary and start transmitting (if medium access allows). HDLC provides different connection types:
  • 222. 62 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation HDLC Exchange (NMR in ISO 4335) set normal response mode, poll UA,F SNRM, P I0,0 I1,0 I2,0P RR3,F I3,0 Primary (Commander) Secondary (Responder) time information packets receiver ready, expects 3 please confirm accept connection, final Send Sequence accept connection, final set normal response mode, poll UA;F SNRM; P I0,0 I1,0 I2,0;F RR0;P RR3;P time several information packets receiver ready, expects 0 last frame I3,0 receiver ready, expects 3 Receive Sequence Primary (Commander) Secondary (Responder) The data transmission takes place under control of the Primary. Therefore, both "Send Frame" and "Receive Frame" are supported
  • 223. 63 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Clocks In a fieldbus, devices must be synchronized to a common clock to time-stamp their transmissions.
  • 224. 64 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Time Distribution in a single master system At fixed intervals, the Master broadcasts the exact time as a periodic variable. When receiving this variable, the bus controllers generate a pulse which can resynchronize a slave clock or generate an interrupt request. application processor 1 bus master PORTS BUS bus controller pulse master clock time variable int req pulse int req bus controller PORTS application processor 2 pulse int req bus controller PORTS application processor 3 slave clock
  • 225. 65 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Clock compensation for transmission delays slave clocks master 1 other master synchronizer slave clock MVB 1 other MVB master clock device with clock The clock does not need to be generated by the Master, but the master must poll the clock The clock can synchronize sampling within a few µs across several bus segments.
  • 226. 66 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation IEEE 1588 PTP Clock Synchronization IEEE 1588 defines the Precision Time Protocol, a clock synchronization that assumes that two consecutive frames have the same delay, but the moment of sending suffers jitter. The clock device (possibly coupled to a radio signal) sends the first frame with an coarse time stamp, but registers in hardware the exact moment when the frame was sent. It then sends a second frame with the exact time at which the first frame was sent. Bridges and switches are responsible to compensate for their internal delays and send a corrected time frame.
  • 227. 67 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation High precision clock synchronization In some application, even the PTP protocol is insufficient. In this case, either the clock is distributed by a separate, dedicated medium (as in railways signalling and electrical substations. Alternatively, all devices receive a radio signal from GPS to recalibrate their internal clocks.
  • 228. 68 2004 June, HK 3.3.3 Field busses - Link Layer EPFL - Industrial Automation Assessment What is the purpose of the link layer ? Which is the role of the three sublayers in the link layer ? What is the Hamming Distance ? What is the Residual Error Rate ? What is the code efficiency ? Where are error-correcting codes used ? What is the formal of an HDLC frame ? What is the purpose of medium access control ? Which medium access does not require an arbitration ? Which kinds of arbitration exist ? How does the CAN arbitration works and what is its assumption on the medium ? How does the Ethernet arbitration works ? What is the influence of collision detection in a LON arbitration ? Which medium access are deterministic ? What is the difference between connection oriented and connectionless transmission ? How are error corrected by the logical link control in cyclic transmission ? How are error corrected by the logical link control in event-driven transmission ? How does a sliding window protocol works ? How does a transmission in HDLC work ? How are clocks synchronized ?
  • 229. Prof. Dr. Hubert Kirrmann ABB Ltd, Baden, Switzerland 3.3.4 OSI Upper Layers - Presentation Layer, ASN.1 and data types Niveaux supérieurs OSI - couche de présentation, ASN.1 et types de données Obere OSI-Schichten – Darstellungsschicht, ASN.1 und Datentypen Industrial Automation Automation Industrielle Industrielle Automation PersonnelRecord ::= [APPLICATION 0] IMPLICIT SET { name Name, title [0] VisibleString, number EmployeeNumber, dateOfHire [1] Date, nameOfSpouse [2] Name, children [3] IMPLICIT SEQUENCE OF ChildInformation DEFAULT {} 2005, May, HK
  • 230. 3.0.3 Presentation Layer 2005 May, HK 2 Industrial Automation Presentation layer in the OSI-Model (ISO/IEC standard 7498) Transport protocols Application protocols All services directly called by the end user (Mail, File Transfer,...) Definition and conversion of the data formats (e.g. ASN 1) Management of connections (e.g. ISO 8326) End-to-end flow control and error recovery (e.g. TP4, TCP) Routing, possibly segmenting (e.g. IP, X25) Error detection, Flow control and error recovery, medium access (e.g. 802.2, HDLC) Coding, Modulation, Electrical and mechanical coupling (e.g. Ethernet) Physical Link Network Transport Session Presentation 6 5 4 3 2 1 Application 7
  • 231. 3.0.3 Presentation Layer 2005 May, HK 3 Industrial Automation Presentation Layer The presentation layer is responsible that all communication partners agree on the format of the data
  • 232. 3.0.3 Presentation Layer 2005 May, HK 4 Industrial Automation Transfer Syntax: describe what is in a frame ? Role: how to define formally the format and meaning of the transmitted data >48 ISO 8473 connectionless network control 5 ISO 8073 class 4 transport control L_destination SAP L_source SAP L_PDU L_PDU = UI, XID, TEST LI TPDU Protocol Identifier Header Length Version/Protocol ID (01) Lifetime DT/ER Type SP MS ER PDU Segment Length Address Part (CDT) N(S) ET MAC_header LNK_hdr NET_header TRP_header Destination Reference FIXED PART 13 3 DATA AFI = 49 PSI Physical Address (6 octets) LSAP = FE NSAP = 00 IDP (initial domain part) DSP (domain specific part) DATA (DT) TPDU (normal format) LSAP = DSAP FE = network layer 18 = Mini-MAP Object Dictionary Client 19 = Network Management 00 = own link layer (81) IEEE 802.4 token bus ISO 8802 logical link control address length IDI, Area ID (7 octets) MA. frame control address (6 octets) MA. source (6 octets) MA. destination address Checksum Destination Address (18 octets) Source Address (18 octets) Segmentation (0 or 6 octets) Options (priority = 3 octets)
  • 233. 3.0.3 Presentation Layer 2005 May, HK 5 Industrial Automation ASN.1 justification Why do we need ASN.1 ( or a similar notation)
  • 234. 3.0.3 Presentation Layer 2005 May, HK 6 Industrial Automation Semantic Levels of Data Representation Transmission Specification Language and Encoding Rules Traffic Memory format Application Storage format (Assembly language) Bus Transmission Format Application Memory Traffic Memory time Storage format SEQUENCE { item1 INTEGER16, item2 INTEGER4, count UNSIGNED8; } D15 D00 Bus Controller Application Language format Semantic format Application Processor struct { unsigned count; int item2:8; int item1:4; int dummy:4; } 154,5 Vrms Parallel Bus Format (8 bit, 16 bit, 32 bits) (16-bit oriented)
  • 235. 3.0.3 Presentation Layer 2005 May, HK 7 Industrial Automation Bit Transmission Order time 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 UART, HDLC, Ethernet FDDI, FIP, CAN, MVB LSB MSB MSB LSB first Most data links are byte-oriented (transmit 8 bit as an indivisible unit) The order of bit transmission within a byte (octet) is dependent on the link. It does not matter as long as all bus participants use the same scheme There is no relation between the bit and the byte ordering scheme Who says which bit is really transmitted first ? (FDDI: multi-bit symbol transmission, multi-bit transmission with interleaving) first Legacy of the old telex octet in octet out Convention: only consider octet streams
  • 236. 3.0.3 Presentation Layer 2005 May, HK 8 Industrial Automation Integer representation in memory: Big-Endian vs Little Endian x0000 address 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 x0001 x0002 x0003 x0004 Intel Motorola = 2 = 2 INTEGER8 INTEGER16 = 1 = 256 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x0005 x0006 INTEGER32 = 1 = 16777216 IBM, TCP/IP, Unix, RISC DEC MSB LSB B7B6B5B4B3B2B1B0 0 1 2 3 4 5 6 7 1 2 3 4 5 6 7 8 Processor TCP/IP (bit position) (bit offset) (bit name) LE BE Memory contents Profibus three different naming schemes !
  • 237. 3.0.3 Presentation Layer 2005 May, HK 9 Industrial Automation How are sequence of octets transmitted ? 0 1 2 3 INTEGER32 Most Significant First ? Transmission Order on the bus ? how to name bits ? time The standard in network protocols is always: Most Significant Octet first (Big-Endian)
  • 238. 3.0.3 Presentation Layer 2005 May, HK 10 Industrial Automation So, how to respect network byte ordering ? Since network protocols require a “most significant octet first” transmission (NBO =Network Byte Ordering), all little-endian processors must convert their data before putting them into the transmission buffer, pipe or socket, by calling the Unix functions: Function Name Description htons Host order to network order, short (2 bytes, 16 bits) htonl Host order to network order, long (4 bytes, 32 bits) ntohs Network order to host order, short (2 bytes, 16 bits) ntohl Network order to host order, long (4 bytes, 32 bits) All data "seen" by the sockets layer and passed on to the network must be in network order struct sockaddr_in s; /* WRONG */ s.sin_port = 23; /* RIGHT */ s.sin_port = htons(23); - Extremely error prone
  • 239. 3.0.3 Presentation Layer 2005 May, HK 11 Industrial Automation Inconsistency: Token-bus frame (IEEE 802.4) N N 0 N N 0 0 0 F F M M M P P P I/G L/U lsb msb Destination Address first MAC symbol preamble remaining 44 bits of address I/G L/U lsb msb remaining 44 bits of address lsb msb Frame Check Sequence N N 1 N N 1 I E first octet lsb msb Source Address last data octet lsb msb Addresses are transmitted least significant bit first Data are transmitted least significant bit first within an octet, but most significant octet first within a word (imposed by higher layers) Checksum is transmitted most significant bit first read this picture from left to right, then top to bottom
  • 240. 3.0.3 Presentation Layer 2005 May, HK 12 Industrial Automation How to specify transmitted data stationID functionID snu gni nodeID or groupID protocolID command parameter offset 0 CommandPDU :== SEQUENCE { BOOLEAN1 snu -- system BOOLEAN1 gni -- group CHOICE (gni) { Group : ENUM6 groupID; Individual: ENUM6 nodeID; } ENUM8 stationID; ... intuitive formal time offset 0 1 2 3 4 5 6 7 first: agree on a bit and byte ordering scheme: {0,0} scheme recommended. second: describe the data stream formally (machine-readable) 0 1 2 3 4 i i+1
  • 241. 3.0.3 Presentation Layer 2005 May, HK 13 Industrial Automation Can a “C”-declaration serve as an encoding syntax ? how is size given? to which structure does it point? typedef struct { char location[ LOCATION_LEN ]; unsigned long object_id; alarm_type_t alarm_type; priority_level_t priority_level; unsigned long index_to_SNVT; unsigned value[ 4 ]; unsigned long year; unsigned short month; unsigned short day; unsigned short hour; unsigned short minute; unsigned short second; unsigned long millisecond; unsigned alarm_limit[ 4 ]; } SNVT_alarm; allowed values in enum ? is "short" a byte ? is “unsigned” 16 bits or 32 bits ? Such a machine-dependent syntax is only valid if all applications use the same syntax on the same machine with the same compiler, it is not suited to describe the bus traffic.
  • 242. 3.0.3 Presentation Layer 2005 May, HK 14 Industrial Automation Abstract Syntax Notation Number 1 (ASN.1) • The IEC/ISO define a standard notation in IEC 8824 (ASN.1), allowing to define simple types (primitive) and constructed types. • Data structures can take forms not usually found in programming languages. • Each data structure is identified during transmission by a tag. • In principle, ASN.1 only defines data structures to be transmitted, but not how they are encoded for transmission. • One possible coding of the primitive and constructed data types is defined in ISO/IEC 8825 as "Basic Encoding Rules“ (BER) defined in ISO 8825. • More efficient encodings (PER,…) also exist. • ASN.1 can be used for defining memory contents, file contents or communication data, and in general any exchanged information. • ASN.1 has the same role as XML, but it is far more efficient.
  • 243. 3.0.3 Presentation Layer 2005 May, HK 15 Industrial Automation ASN.1 Syntax Example Name: Title: Employee Number: Date of Hire: Name of Spouse: Number of Children: Child Information Name: Date of Birth Child Information Name: Date of Birth John P Smith Director 51 17 September 1971 Mary T Smith 2 Ralph T Smith 11 November 1957 Susan B Jones 17 July 1959 PersonRecord ::= [APPLICATION 0] SEQUENCE { name Name title [0] VisibleString, number EmployeeNumber, dateOfHire [1] Date, nameOfSpouse [2] Name, children [3] SEQUENCE OF Childinformation DEFAULT {} } Name ::= [APPLICATION 1] SEQUENCE { givenName VisibleString, initial VisibleString, familyName VisibleString} EmployeeNumber ::= [APPLICATION 2] INTEGER ChildInformation ::= SEQUENCE { name Name, dateOfBirth [0] Date} Date ::= [APPLICATION 3] VisibleString -- YYYYMMDD Informal ASN.1
  • 244. 3.0.3 Presentation Layer 2005 May, HK 16 Industrial Automation Abstract syntax and transfer syntax An abstract syntax describes the elements of information without considering their encoding (i.e. how they are represented in memory or on a bus) E.g. A transfer syntax defines the name of the structures and elements, their value range [e.g. 0..15], …. ASN.1 is defined in the standard ISO 8824-1. A transfer syntax describes how the structures and elements are effectively encoded for storing and transmission, so that the receiver can fully decode the transmitted information. At transmission time, only the transfer syntax is visible, it cannot be interpreted without knowing the abstract syntax. E.g. A transfer syntax defines that an array of 33 Unicode characters is transmitted. The receiver knows from the abstract syntax that this is a person’s name. The basic encoding rules for ASN.1 are defined in the standard ISO 8825-1.
  • 245. 3.0.3 Presentation Layer 2005 May, HK 17 Industrial Automation ASN.1 encoding: TLV ASN.1 does not say how data are stored nor transmitted, but it assumes that the transmission format consists for each item of: a tag, a length and a value (TLV) (recursive) length value tag length tag value tag length tag length The value may be itself a structured object: value the tag specifies the data type of the value that follows, implicitly or explicitly.
  • 246. 3.0.3 Presentation Layer 2005 May, HK 18 Industrial Automation ASN.1 Data Types BOOLEAN INTEGER BITSTRING OCTETSTRING NULL OBJECT_ID OBJECT_DESC EXTERNAL REAL ENUMERATED ANY SEQUENCE ordered sequence of types (record) SEQUENCE OF ordered sequence of same type (array) CHOICE one of an unordered, fixed sequence of different types. SET unused SET OF unused UNIVERSAL APPLICATION CONTEXT_SPECIFIC PRIVATE Constructed Types Basic Types Open arrays (dynamic size) and pointers are not allowed four Tag Types
  • 247. 3.0.3 Presentation Layer 2005 May, HK 19 Industrial Automation ASN.1: The Type SEQUENCE An ASN.1 SEQUENCE is similar to a “C”-struct: Example: PersonRecord ::= SEQUENCE { person VisibleString chief VisibleString title VisibleString, number INTEGER, dateOfHire UniversalTime } This notation assumes that all elements in the sequence are present and are transmitted in the specified order. person chief title number dateOfHire INTEGER UniversalTime VisibleString PersonRecord
  • 248. 3.0.3 Presentation Layer 2005 May, HK 20 Industrial Automation Tagging PersonRecord ::= [APPLICATION 1] SEQUENCE { person [1] VisibleString, chief [2] VisibleString, title [3] VisibleString, number [4] INTEGER, dateOfHire [5] UniversalTime } When elements of a sequence may be missing, it is necessary to tag the items, i.e. identify the items by an integer. Of course, if all types would be different, it would be sufficient to specify the type, but this practice (called EXPLICIT tagging) should not be followed. Structured types need in any case a tag, otherwise they cannot be distinguished from another structured type (note how “PersonRecord” is identified) person title number dateOfHire A4 A5 A1 A1 A3 tags
  • 249. 3.0.3 Presentation Layer 2005 May, HK 21 Industrial Automation ASN.1: The CHOICE type A choice selects exactly one alternative of several. There is normally a distinct tag for each choice, but the type can also be used as tag, as long as all types are distinct: Quantity ::= CHOICE { [0] units INTEGER16, [1] millimetres INTEGER32, [2] kilograms FLOAT } 2 4 1.2 E 03 quantity in millimeters kilograms, IEEE format 1 2 1234 quantity in millimeters 0 2 1234 quantity in units
  • 250. 3.0.3 Presentation Layer 2005 May, HK 22 Industrial Automation Difference between ASN.1 and “C”* or XML/XDR ASN.1 is a format for data exchange, “C” is a compiler-dependent format for storage in RAM. The basic data types are defined differently. ASN.1 types may have a variable size (INTEGER may be 8, 16, 32, 64 bits). ASN.1 SEQUENCE differs from a “C” struct since not all elements must be transmitted, nor is their order to be maintained (if tagging is used). ASN.1 CHOICE differs from a “C” union since the length depends on the chosen item, and the contents differ. ASN.1 has the same role as XML. XML is however both an abstract and a transfer syntax, it is sent in clear text. Unix systems use XDR (Sun's external data representation) that is 32-bit oriented, not efficient for small data items, also a mixture of abstract and transfer syntax.
  • 251. 3.0.3 Presentation Layer 2005 May, HK 23 Industrial Automation Explicit and implicit tagging ASN.1 can assign automatically a tag to elements of a sequence. This practice is dangerous, because another encoding (PER) could use other tag numbers. It is preferable to make tags explicit everywhere that is needed.
  • 252. 3.0.3 Presentation Layer 2005 May, HK 24 Industrial Automation Transfer Syntax: Basic Encoding Rules (BER) 0 2 02 length = 2 octets 12 34 type = UNIVERSAL Integer value = 1234 Example: BER supports all ASN.1 structures. Exception: if size is 0, there is no value field (== NULL) A companion to ASN1, BER (ISO 8825-1) defines encoding rules for ASN.1 data types BER tags all data, either implicitly or explicitly Type, Tag and size are transmitted before every value or structured data (tag included in basic types)
  • 253. 3.0.3 Presentation Layer 2005 May, HK 25 Industrial Automation BER – Tag/Type field (for universal class only): 00 = null (size = 0, no value) 01 = Boolean type 02 = Integer type 03 = Bitstring type 04 = Octetstring type 05 = Null type 06 = Object Identifier type 07 = Object Descriptor type 16 = Sequence and Sequence_Of types 17 = Set and Set_Of types 18-22 = Character strings (numeric, printable, …) 23-24 = Time types 25 = Graphic string 26 = VisibleString (ISO646) > 28 = reserve and escape: use a second octet. Tag Primitive {0} or Constructed {1} 00 = UNIVERSAL 01 = APPLICATION 10 = CONTEXT_SPECIFIC 11 = PRIVATE Class Example: 00000010 = UNIVERSAL INTEGER 10100001 = [CONTEXT_SPECIFIC 1] SEQUENCE P: after the size comes a value - C: after the size comes a tag
  • 254. 3.0.3 Presentation Layer 2005 May, HK 26 Industrial Automation Example ASN.1 and BER 1 high_prio 2 1 command 2 reference (MSB) reference (LSB) 0 1 4 caller (MSB) caller (LSB) 3 2 2 P P P P P CS CS CS CS UN high_prio command reference caller 7 C AP 16 8 1 (useful information) CallerRef :== [APPLICATION 7] SEQUENCE { priority [2] INTEGER, command [0] INTEGER, reference [1] INTEGER, caller INTEGER}
  • 255. 3.0.3 Presentation Layer 2005 May, HK 27 Industrial Automation Examples Tag/Type: • 1000’0000 Context Specific, not constructed, implicit, tag = [0] • 0110’0001 Application Specific, constructed, implicit, tag = [1] AB 1010’1101 Context Specific, constructed, implicit, tag = [11] 01 0000’0001 Basic Type, not constructed, boolean decoding the first digit: 0,1: Universal, not constructed 2,3: Universal, constructed 4,5: Application Specific, not constructed [APPLICATION 1] 6,7: Application Specific, constructed 8,9: Context Specific, not constructed [6] A,B: Context Specific, constructed constructed means: the next octet is not a value, but a type/tag !
  • 256. 3.0.3 Presentation Layer 2005 May, HK 28 Industrial Automation Examples A0 0E 02 01 0A A1 09 A0 03 80 01 00 A1 02 80 00 A1 67 02 01 0A A1 62 A0 5D 1A 0B 54 65 6D 70 65 72 61 74 75 72 65 1A 0C 54 65 6D 70 65 72 61 74 75 72 65 31 1A 07 61 72 72 61 79 5F 35 1A 04 62 6F 6F 6C 1A 0F 66 65 65 64 65 72 31 5F 33 5F 70 68 61 73 65 1A 05 66 6C 6F 61 74 1A 0F 68 65 72 62 73 5F 74 65 73 74 5F 74 79 70 65 1A 08 75 6E 73 69 67 6E 65 64 81 01 00 -- A0 18 02 01 0B A6 13 A0 11 80 0F 66 65 65 64 65 72 31 5F 33 5F 70 68 61 73 65 A1 34 02 01 0B A6 2F 80 01 00 A1 16 81 14 66 65 65 64 65 72 31 5F 33 5F 70 68 61 73 65 24 41 64 64 72 A2 12 A2 10 A1 0E 30 05 A1 03 85 01 10 30 05 A1 03 85 01 10 -- A0 1E 02 01 0C A4 19 A1 17 green: tag / type red: size black: value null
  • 257. 3.0.3 Presentation Layer 2005 May, HK 29 Industrial Automation Beyond ASN.1 and BER ASN.1 / BER could not impose themselves in field busses because of the high overhead involved (32 bits for a single boolean !) ISO / UIT developed more efficient encodings, such as ISO/IEC 8825-2: Packed Encoding Rules (PER), that exists in two versions: aligned (on an 8-bit boundary) or not aligned (bit stream) In low speed busses such as fieldbus, this is still too much overhead. IEC 61158-6 (Fieldbus) offers 3 encodings: Traditional Encoding Rules (Profibus) Compact Encoding Rules (for FAL) Buffer Encoding Rules (FIP) 100 MBit/s Ethernet has sufficient bandwidth, but the burden is shifted to the processors (Data compression gives variables length messages, costs a lot in compression & decompression)
  • 258. 3.0.3 Presentation Layer 2005 May, HK 30 Industrial Automation ROSIN Compact – Retrofit Encoding The railways operators needed to define formally the exchange rules for data of already existing devices, of different manufacturers and vintage. Therefore, a notation was developed (ROSIN notation) to describe any data transfer, on a bit rather than a byte-orientation. It also allows to cope with alignment (data should be transmitted at an offset that is a multiple of their size to reduce processor load) Indeed, since these devices already communicate using a proprietary protocol, transmission must already be unambiguous. Each data type is specified, e.g. Integer32 differs from Integer32_LE (Little Endian) The ROSIN notation uses the ASN.1 meta-syntax, but it does not imply a TLV scheme. - the length can be deduced from the type or position, - typing information is inserted explicitly when: • a choice exists among several alternative types (e.g. depends on success/failure) • types have a (large) variable size (e.g. text strings, files) • sequences have optional fields and out-of-sequence fields (occurs too often).
  • 259. 3.0.3 Presentation Layer 2005 May, HK 31 Industrial Automation ROSIN - Retrofit encoding rules example 0 7 snu gni node_id parameter1 parameter2 parameter3 par4 parameter5 Type_InfoMessage ::= RECORD { parameter1 INTEGER8 -- octet. parameter2 INTEGER16, -- 16-bit word, MSB first parameter3 UNSIGNED6, -- 6- bit value par4 ANTIVALENT2, -- 2 bits for par4, e.g. check variable. parameter5 Parameter5, -- parameter5 has a structured type parameter6 STRING32, -- an array of up to 32 8-bit characters. -- trailed if shorter with “0” characters. snu ENUM1 { USER (0), -- 0 = user SYSTEM (1) -- 1 = system }, gni ENUM1 { -- could also be expressed as BOOLEAN1 INDIV (0), -- individual function addressing GROUP (1), -- group addressing. }, node_id UNSIGNED6, -- 6-bit unsigned integer sta_or_func ONE_OF [snu] { -- meaning depends on ‘snu’ function [USER] UNSIGNED8, -- if snu = user, function identifier station [SYSTEM] UNSIGNED8 -- if snu = system, station identifier }, next_station_id UNSIGNED8, -- next station or ‘FF’H if unknown tv BOOLEAN1, -- TRUE if 1 res1 BOOLEAN1 (=0), -- 0 (place holder) topo_counter UNSIGNED6, -- 6-bit unsigned integer tnm_code ENUM8 { -- has only two defined values FIRSTCASE (‘1E’H) -- one of two defined values SECONDCASE (‘84’H) -- the other defined value }, action_code Action_Code, -- this type is used several times } parameter6 CHARACTER8 sta_or_func next_station_id tv d1 top_counter tnm_code action_code 0 1 2 3 4 5 6 7 39 40 41 42 43 44
  • 260. 3.0.3 Presentation Layer 2005 May, HK 32 Industrial Automation Comparing Coding Efficiency Boolean BER 24 XDR 16 A-PER 5 U-PER 5 FER BuER 16 8 1 ROSIN Integer8 24 16 16 12 16 16 8 Unsigned8 24 16 11 11 16 16 8 Integer16 32 24 24 20 24 24 16 Unsigned 16 32 24 24 19 24 24 16 Integer32 48 40 24..48 36 40 40 32 Unsigned32 48 40 24..48 35 40 40 32 String [32] 272 272 272 272 272 272 256 (FIP) (Profibus) (SUN) (UIT) (ISO) encoding/decoding highly packed data may cost more than is won by shorter transmission
  • 261. 3.0.3 Presentation Layer 2005 May, HK 33 Industrial Automation Engineering Units Many process variables represent analog, physical values of the plant. Data presentation (e.g. integer) is insufficient to express the meaning of the variable. Therefore, it is necessary to allocate to each variable a data type in engineering units. "A unit of measure for use by operating/maintenance personnel usually provided by scaling the input quantity for display (meter, stripchart or CRT)" IEEE Scaling (determined the possible range of a variable) is necessary for analog displays. It requires the definition of the possible range of values that the variable may take.
  • 262. 3.0.3 Presentation Layer 2005 May, HK 34 Industrial Automation SI Units -2 3 3 time s current A angle rad force N torque Nm power W frequency s-1 angular velocity rad/s mass kg pressure Pa flow m /s mass flow kg/s tension V reactive power var impedance W temperature K volume m energy J position, distance m angular acceleration rad s All physical variables should be restricted to SI Units (NIST 330-1991, IEEE 268A-1974) or refered directly to them For instance: • variable unit variable unit • angles shall be represented in radian rather than degree or grad. speeds shall be expressed in meter/second, not in km/h or in miles/hour
  • 263. 3.0.3 Presentation Layer 2005 May, HK 35 Industrial Automation Why floating point ? Floating point format is the only safe representation of a physical variable. Exception: In special applications (e.g. GPS data), an ASCII representation may be more appropriate, albeit not efficient. In this case, data can also be processed as BCD (as in pocket calculators) Floating point format (IEEE Std 254) - require twice the place (32 bits vs 16 bits), - adds about 50% to traffic (analog values are only 10% of total), - cost more to process (floating point unit) but - removes all ambiguities, rounding errors, overflow and underflow. Therefore, devices shall indicate their exported and imported variables as REAL32. Internally, devices can use other formats. Variables, whose precision do not depend on their absolute value: time, elapsed distance (odometer), energy, money, countable objects
  • 264. 3.0.3 Presentation Layer 2005 May, HK 36 Industrial Automation Fractionals 0 e.g. offset = 0,0 m/s, span = 100,0 m/s, base unit = UNSIGNED16 means: 0 = 0,0 m/s, 65536 == 100,0 m/s e.g. offset = - 32,768 V, span = 65,536 V, base unit = INTEGER16 means: 0 = -32,768 m/s, 65536 == 32,767 V A device can indicate the format of a fractional analog variable by specifying (as a REAL32) the span and the offset to be applied to the base unit: offset value physical variable 65535 -32768 +32767 span value UNSIGNED16 INTEGER16 0
  • 265. 3.0.3 Presentation Layer 2005 May, HK 37 Industrial Automation Scaled Variables Process Variables are often transmitted and processed as fractionals: Fractional format expresses analog values as integer multiples of the resolution e.g.: Some standards provides a bipolar or unipolar analog data format: e.g. : fractionals require producer and consumer to agree on range and resolution: e.g. resolution 0.5 V, range 6553.5 V distance = 0..65535 x 0.1 m (resolution) --> 0 .. 65535 (UNSIGNED16) distance = -32768..+32767 x 0.1 m --> -32768 .. 32768 speed = 0.. 6553,5 m/s, resolution = 0.1 m/s --> 0 .. 65535 (UNSIGNED16) speed = 0.. 6.5535 m/s, resolution = 0,0001 m/s --> 0 .. 65535 (UNSIGNED16) 0..200% of physical variable == 0..65536 (UNSIGNED16) -200%..+200%-e of 10 kV == -32768 .. 32768 fractionals are easy to process but error prone (overflow, underflow) A conversion from fractional to floating point did cost over 5 Mia € (Ariane 501 accident) (INTEGER16) (INTEGER16) The resolution is often a decimal fraction of a unit !
  • 266. 3.0.3 Presentation Layer 2005 May, HK 38 Industrial Automation Constructed Application Data Types Circuit Breaker command: DoubleCommand not permitted OFF ON not permitted Persistent Regulating Command not permitted Lower Higher not permitted RegulatingStep Command not permitted Next Step Lower Next Step Higher not permitted Double-Point Information indeterminate determined OFF determined OFF not permitted Code 00 01 10 11 Time-Stamped Variable: value time status
  • 267. 3.0.3 Presentation Layer 2005 May, HK 39 Industrial Automation Application Data Types Structured Text: RTF - Microsoft Word Native Format HTTP - Hypermedia data presentation Some standards for video: QuickTime -- an Apple Computer specification for video and audio. Motion Picture Experts Group (MPEG) -- video compression and coding. Some graphic image formats: Graphics Interchange Format (GIF) -- compression and coding of graphic images. Joint Photographic Experts Group (JPEG) -- compression and coding for graphic images. Tagged Image File Format (TIFF) -- coding format for graphic images. 14
  • 268. 3.0.3 Presentation Layer 2005 May, HK 40 Industrial Automation Presentation Layer in the application Coding and conversion functions to application layer data cannot be done in the presentation layer due to the lack of established rules These functions ensure that information sent from the application layer of one system will be readable by the application layer of another system. Examples of presentation layer coding and conversion schemes in the application: Common data representation formats -- The use of standard image, sound, and video formats allow the interchange of application data between different types of computer Conversion of character representation formats -- Conversion schemes are used to exchange information with systems using different text and data representations (such as ASCII and Unicode). Common data compression schemes -- The use of standard data compression schemes allows data that is compressed at the source device to be properly decompressed at the destination (compression can take place at different levels) Common data encryption schemes -- The use of standard data encryption schemes allows data encrypted at the source device to be properly unencrypted at the destination.
  • 269. 3.0.3 Presentation Layer 2005 May, HK 41 Industrial Automation Gateway When devices share no common transport layer protocol, gateways act as protocol converters and application layer protocols must ensure end-to-end control. Protocol Conversion is costly in development and real time, since protocols are in general insufficiently specified, custom-designed, and modified without notice. Protocol Conversion requires at least an semantical equivalent of the objects on both sides of the gateway, so that one command can be converted into another - if possible. bus type 2 bus type 1 network transport session presentation gateway application Real-Time Protocols link physical link PD-marshalling link MSG network transport session presentation PV link application physical PV physical physical
  • 270. 3.0.3 Presentation Layer 2005 May, HK 42 Industrial Automation To probe further http://www.isi.salford.ac.uk//books/osi/all.html - An overview of OSI http://www.oss.com/ - Vendor of ASN.1 tools http://www-sop.inria.fr/rodeo/personnel/hoschka/347.txt - List of ASN.1 tools http://lamspeople.epfl.ch/kirrmann/mms/OSI/osi_ASN1products.htm - ASN.1 products
  • 271. 3.0.3 Presentation Layer 2005 May, HK 43 Industrial Automation Assessment which are the “upper layers”? which is the function of the network level ? what is the difference between repeater, bridge, router and gateway ? what is the difference between hierarchical and logical addressing ? what is the role of the transport layer ? when is it necessary to have a flow control at both the link and the transport layer ? what is the role of the session layer in an industrial bus ? which service of the session layer is often used in industrial networks ? what is the role of the presentation layer ? what is ASN.1 ? what is the difference between an abstract syntax and a transfer syntax ? why is ASN.1 not often used in industrial networks and what is used instead ? what is the ROSIN notation for and how is a data structure represented ? how should physical (analog) variables be represented ?
  • 273. 1 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation Prof. Dr. H. Kirrmann ABB Research Center, Baden, Switzerland 3.4 MVB: a fieldbus case study Industrial Automation Automation Industrielle Industrielle Automation
  • 274. 2 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Outline 1. Applications in rail vehicles 2. Physical layer 1. Electrical RS 485 4. Frames and Telegrams 5. Medium Allocation 7. Fault-tolerance concept 8. Integrity Concept 2. Middle-Distance 3. Fibre Optics 9. Summary 3. Device Classes 6. Clock Synchronization
  • 275. 3 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation standard communication interface for all kind of on-board equipment data rate delay medium number of stations > 600 vehicles in service in 1998 status up to 4095 simple sensors/actuators 1'500'000 bits/second 0,001 second twisted wire pair, optical fibres up to 255 programmable stations Multifunction Vehicle Bus in Locomotives cockpit power line diagnosis radio Train Bus motor control power electronics brakes track signals Vehicle Bus
  • 276. 4 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation Multifunction Vehicle Bus in Coaches covered distance: > 50 m for a 26 m long vehicle < 200 m for a train set diagnostics and passenger information require relatively long, but infrequent messages brakes air conditioning doors power light passenger information seat reservation Vehicle Bus Train Bus
  • 277. 5 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Physical Media • OGF • EMD • ESD Media are directly connected by repeaters (signal regenerators) All media operate at the same speed of 1,5 Mbit/s. (2000 m) (200 m) (20 m) optical fibres shielded, twisted wires with transformer coupling wires or backplane with or without galvanic isolation twisted wire segment sensors optical links rack optical links rack star coupler devices
  • 278. 6 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Covered Distance The MVB can span several vehicles in a multiple unit train configuration: The number of devices under this configuration amounts to 4095. MVB can serve as a train bus in trains with fixed configuration, up to a distance of: > 200 m (EMD medium or ESD with galvanic isolation) or > 2000 m (OGF medium). Train Bus devices node devices with short distance bus repeater MVB
  • 279. 7 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Topography all MVB media operate at same speed, segments are connected by repeaters. Device Device Device Device Terminator Train Bus OGL link Repeater Repeater Repeater Device Device Device Device Bus Administrator EMD Segment section ESD Segment ESD Segment Node Device Device Device
  • 280. 8 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Outline 1. Applications in vehicles 2. Physical layer 1. ESD (Electrical, RS 485) 4. Frames and Telegrams 5. Medium Allocation 7. Fault-tolerance concept 8. Integrity Concept 2. EMD (Transformer-coupled) 3. OGF (Optical Glass Fibres) 9. Summary 3. Device Classes 6. Clock Synchronization
  • 281. 9 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation ESD (Electrical Short Distance) RS485 Interconnects devices over short distances (- 20m) without galvanic separation Based on proven RS-485 technology (Profibus) Main application: connect devices within the same cabinet. terminator/ biasing + 5 V GND Ru (390W) Rm (150 W) Rd (390 W) terminator/ biasing segment length device 1 device N device 2.. n-1 RxS TxS RxS TxS RxS TxS • • • equipotential line Data_N Data_P Bus_GND Ru (390W) Rm (150 W) Rd (390 W) + 5 V
  • 282. 10 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation ESD Device with Galvanic Isolation 1 power protection circuit RS 485 transceiver Data GND galvanic barrier RxS' TxS' TxF' RxS TxS TxF +5V cable female male shield connected to connector casing shield connected to connector casing opto- couplers DC/DC converter 1 device casing connected to supply ground protective earth 0V el +5V el +Vcc
  • 283. 11 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation ESD Connector for Double-Line Attachment 9 8 7 6 cable Line_A Line_B Line_A Line_B 10 4 5 2 1 3 2 1 4 5 3 female male 9 8 7 6 cable Line_A Line_B Line_A Line_B reserved (optional TxE) B.Data_P A.Data_P A.Data_N B.Data_N B.Bus_5V A.Bus_5V A.Bus_GND B.Bus_GND
  • 284. 12 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation EMD (Electrical Medium Distance) - Single Line Attachment • Connects up to 32 devices over distances of 200 m. • Transformer coupling to provide a low cost, high immunity galvanic isolation. • Standard 120 Ohm cable, IEC 1158-2 line transceivers can be used. • Main application: street-car and mass transit • 2 x 9-pin Sub-D connector transceiver bus section 2 device bus section 1 bus controller shield transformer
  • 285. 13 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation EMD Device with Double Line Attachment Carrying both redundant lines in the same cable eases installation it does not cause unconsidered common mode failures in the locomotive environment (most probable faults are driver damage and bad contact) 1 B1. Data_P B1. Data_N B2. Data_P B2. Data_N transceiver A B2 transceiver B Connector_2 A.Data_P A.Data_N B.Data_P B.Data_N Bus_Controller device Line_B Line_A A1. Data_P A1. Data_N 1 B1 A1 Connector_1 Line_B Line_A A1. Data_P A1. Data_N 1 A2
  • 286. 14 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation EMD Connectors for Double-Line Attachment 4 5 2 1 3 7 6 9 8 terminator connector 3 4 5 Connector_1 (female) 2 1 Line_B 7 6 9 8 Line_A B1.Data_N B1. Data_P A1. Data_N A1. Data_P A.Term_P B.Term_N Line_B Line_A B.Term_P A.Term_N Zt.A female cable 3 4 5 Connector_1 (male) 2 1 Line_B 7 6 9 8 male Line_A B1.Data_N B1. Data_P A1. Data_N A1. Data_P shields contacts case Zt.B
  • 287. 15 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation EMD Shield Grounding Concept Shields are connected directly to the device case Device cases should be connected to ground whenever feasible device device inter-section connectors terminator terminator device device ground shield possible shield discontinuity device ground inter-device impedance inter-device impedance
  • 288. 16 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation OGF (Optical Glass Fibre) Covers up to 2000 m Proven 240µm silica clad fibre Main application: locomotive and critical EMC environment wired-or electrical media fibre pair device device device Rack opto-electrical transceiver Star Coupler to other device or star coupler to other device or star coupler device device device ESD segment
  • 289. 17 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation OGF to ESD adapter Double-line ESD devices can be connected to fibre-optical links by adapters to star coupler B from star coupler B A.Data_P to star coupler A from star coupler A A.5V TxE TxD RxDA 1 RxDB 1 B.0V B.5V A.Data_P 5 3 3 fibre-optical transceivers RS-485 transceiver MVBC A.0V
  • 290. 18 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Repeater: the Key Element (redundant) bus administrator The repeater: • decodes and reshapes the signal (knowing its shape) • recognizes the transmission direction and forward the frame • detects and propagates collisions A repeater is used at a transition from one medium to another. repeater EMD segment decoder encoder decoder encoder ESD segment (RS 485) (transformer-coupled) bus administrator slave slave slave slave
  • 291. 19 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Repeater duplicated segment Line_A Line_B direction recogniser decoder repeater decoder encoder decoder decoder encoder Line_A (single-thread optical link) Line_B (unused for single- thread) recognize the transmission direction and forward the frame decode and reshape the signal (using a priori knowledge about ist shape) jabber-halt circuit to isolate faulty segments detect and propagate collisions increase the inter-frame spacing to avoid overlap can be used with all three media appends the end delimiter in the direction fibre to transformer, remove it the opposite way handles redundancy (transition between single-thread and double-thread)
  • 292. 20 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Outline 1. Applications in vehicles 2. Physical layer 1. Electrical RS 485 4. Frames and Telegrams 5. Medium Allocation 7. Fault-tolerance concept 8. Integrity Concept 2. Middle-Distance 3. Fibre Optics 9. Summary 3. Device Classes 6. Clock Synchronization
  • 293. 21 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Class 1 Device Class 1 or field devices are simple connections to sensors or actuators. They do not require a micro-controller. The Bus Controller manages both the input/output and the bus. They do not participate in message data communication. MVB redundant bus pairs (ESD) analog or binary input/ output board bus (monomaster) device address register RS 485 drivers/ receivers bus controller device status A B
  • 294. 22 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Class 2-3 Device Class 2 and higher devices have a processor and may exchange messages. Class 2 devices are configurable I/O devices (but not programmable) The Bus Controller communicates with the Application Processor through a shared memory, the traffic store, which holds typically 256 ports. • • • MVB redundant bus pairs (ESD) application processor shared local RAM private RAM local input/ output EPROM RS 485 drivers/ receivers Bus Controller traffic store device status A B
  • 295. 23 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Class 4-5 Device Class 4 devices present the functionality of a Programming and Test station To this effect, they hold additional hardware to read the device status of the other devices and to supervise the configuration. They also have a large number of ports, so they can supervise the process data transmission of any other device. Class 5 devices are gateways with several link layers (one or more MVB, WTB). Class 4 devices are capable of becoming Bus Administrators. The device classes are distinguished by their hardware structure.
  • 296. 24 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVBC - bus controller ASIC 12 bit device address CPU parallel bus to traffic store duplicated electrical or optical transmitters duplicated electrical or optical receivers A19..1 D15..0 address A B A B Manchester and CRC encoder 16x16 Tx buffer 16x16 Rx buffer Traffic Store Control & Arbiter Main Control Unit Class 1 logic data control Clock, Timers & Sink Time Supervision • Bus administrator functions • Bookkeeping of communication errors • Hardware queueing for message data • Supports 8 and 16-bit processors • Supports big and lirttle endians • 24 MHz clock rate • HCMOS 0.8 µm technology • 100 pin QFP • Automatic frame generation and analysis • Adjustable reply time-out • Up to 4096 ports for process data • 16KByte.. 1MByte traffic store • Freshness supervision for process data • In Class 1 mode: up to 16 ports • Bit-wise forcing • Time and synchronization port DUAL Manchester and CRC decoders JTAG interface
  • 297. 25 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Bus Interface Application processor 2 message ports MVB bus controller Traffic Store 0..4095 Logical Ports (256 typical) for Process data 6 bus management ports 8 physical ports The interface between the bus and the application is a shared memory, the Traffic Memory , where Process Data are directly accessible to the application. messages packets and bus supervision process data base
  • 298. 26 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Outline 1. Applications in vehicles 2. Physical layer 1. Electrical RS 485 4. Frames and Telegrams 5. Medium Allocation 7. Fault-tolerance concept 8. Integrity Concept 2. Middle-Distance 3. Fibre Optics 9. Summary 3. Device Classes 6. Clock Synchronization
  • 299. 27 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Manchester Encoding 1 1 0 1 0 0 0 1 0 1 1 1 1 1 0 1 data clock frame signal 9-bit Start Delimiter frame data 8-bit check sequence The Manchester-coded frame is preceded by a Start Delimiter containing non-Manchester signals to provide transparent synchronization. 1 2 3 4 5 6 7 8 0 end delimiter
  • 300. 28 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Frame Delimiters 0 8 1 2 3 4 5 6 7 active state idle state active state idle state 0 Different delimiters identify master and slave frames: This prevents mistaking the next master frame when a slave frame is lost. Master Frame Delimiter Slave Frame Delimiter 8 1 2 3 4 5 6 7 start bit start bit
  • 301. 29 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Frames Formats F address 9 bits 4 12 8 9 16 bits slave frames sent in response to master frames 8 CS 9 32 bits 8 9 64 bits 8 master frames issued by the master MSD 16 (33) 16 (33) 32 (49) 64 (81) MSD = Master Start Delimiter (9 bits) CS = Check Sequence (8 bits) SSD = Slave Start Delimiter (9 bits) useful (total) size in bits F = F_code (4 bits) data CS SSD data SSD CS data SSD CS 9 64 bits 8 data SSD CS 128 (153) 9 64 bits 8 data SSD CS 256 (297) 64 bits data 8 CS data 8 CS 64 bits data 8 CS 64 bits data 8 CS 64 bits The MVB distinguishes two kinds of frames:
  • 302. 30 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Distance Limits master frame master time distance next master frame t_sm t_ms < 42,7µs slave frame t_s The reply delay time-out can be raised up to 83,4 µs for longer distances (with reduced troughput). t_source The distance is limited by the maximum allowed reply delay of 42,7 µs between a master frame and a slave frame. max repeater delay repeater delay repeater delay t_ms remotest data source propagation delay (6 µs/km) repeater repeater
  • 303. 31 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Telegrams message tranport control final function origin node origin function Process Data Message Data 16, 32, 64, 128 or 256 bits of Process Data 4 bits 12 bits F = 0..7 Master Frame (Request) Slave Frame (Response) dataset time 256 bits of Message Data source device destination device prot ocol size time FN FF ON OF MTC Master Frame final node 4 bits 12 bits F = 8-15 Master Frame 16 bits Slave Frame Supervisory Data time port address port address 4 bits 12 bits F = 12 source device decoded by hardware Telegrams are distinguished by the F_code in the Master Frame transport data
  • 304. 32 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation Source-addressed broadcast The device which sources that variable responds with a slave frame containing the value, all devices subscribed as sink receive that frame. The bus master broadcasts the identifier of a variable to be transmitted: Phase1: Phase 2: devices (slaves) bus master bus subscribed devices subscribed device subscribed device source sink sink sink variable value bus bus master devices (slaves) source sink sink subscribed devices sink subscribed device subscribed device variable identifier
  • 305. 33 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation Traffic Memory bus The bus and the application are (de)coupled by a shared memory, the Traffic Memory, where process variables are directly accessible to the application. Process Data Base Application Processor Bus Controller Traffic Memory Associative memory two pages ensure that read and write can occur at the same time
  • 306. 34 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation Restriction in simultaneous access page 1 becomes valid t2 t1 writer reader 1 page0 page1 (slow) reader 2 page 0 becomes valid time • there may be only one writer for a port, but several readers • a reader must read the whole port before the writer overwrites it again • there may be no semaphores to guard access to a traffic store (real-time) traffic store starts ends error ! • therefore, the processor must read ports with interrupt off.
  • 307. 35 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation Operation of the traffic memory In content-addressed ("source-addressed") communication, messages are broadcast, the receiver select the data based on a look-up table of relevant messages. For this, an associative memory is required. Since address size is small (12 bits), the decoder is implemented by a memory block: 0 1 2 4 5 6 7 voids 4091 4092 4093 4094 4095 0 0 0 1 2 0 0 voids 0 4 0 3 0 12-bit Address data(4) data(5) data (4094) storage bus processor data(4092) port index table 0 data(4) data(5) data (4094) data(4092) 0 page 0 page 1
  • 308. 36 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB F_code Summary F_code 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 address logical all devices device device device device group device device request Process_Data reserved reserved reserved Master_Transfer General_Event reserved reserved Message_Data Group_Event Single_Event Device_Status source single device subscribed as source Master >= 1devices - - single device >= 1devices single device single device size 16 32 64 128 256 - - - 16 16 - - 256 16 16 16 response Process_Data (application -dependent) Master_Transfer Event_Identifier Message_Data Event_Identifier Event_Identifier Device_Status destination all devices subscribed as sink Master Master selected device Master Master Master or monitor Master Frame Slave Frame
  • 309. 37 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Outline 1. Applications in vehicles 2. Physical layer 1. Electrical RS 485 4. Frames and Telegrams 5. Medium Allocation 7. Fault-tolerance concept 8. Integrity Concept 2. Middle-Distance 3. Fibre Optics 9. Summary 3. Device Classes 6. Clock Synchronization
  • 310. 38 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation Master Operation The Master performs four tasks: 1) Periodic Polling of the port addresses according to its Poll List 2) Attend Aperiodic Event Requests 3) Scan Devices to supervise configuration 4) Pass Mastership orderly (last period in turn) The Administrator is loaded with a configuration file before becoming Master SD periodic phase time event phase guard phase 1 2 3 4 5 6 1 2 9 8 1 2 ? ? ? ? ? ? ? ? EV 7 guard phase super- visory phase SD basic period basic period periodic phase event phase super- visory phase sporadic phase sporadic phase
  • 311. 39 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation Bus Traffic State of the Plant Response in 1..200 ms Spurious data losses will be compensated at the next cycle event Sporadic Data time On-Demand Transmission Events of the Plant Response at human speed: > 0.5 s • Initialisation, calibration Flow control & error recovery protocol for catching all events • Diagnostics, event recorder Basic Period Basic Period State Variable Messages ... commands, position, speed Periodic Transmission Periodic Data
  • 312. 40 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Medium Access Between periodic phases, the Master continuously polls the devices for events. A basic period is divided into a periodic and a sporadic phase. During the periodic phase, the master polls the periodic data in sequence. Since more than one device can respond to an event poll, a resolution procedure selects exactly one event. Periodic data are polled at their individual period (a multiple of the basic period). periodic phase ? time sporadic phase 1 2 3 4 5 6 guard time 7 8 9 10 basic period periodic phase ? basic period 1 2 sporadic phase ! events ? events ? event data guard time ? ? ? ? ? 1 2 3 individual period
  • 313. 41 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Bus Administrator Configuration The Poll List is built knowing: the list of the port addresses, size and individual period the reply delay of the bus the list of known devices (for the device scan the list of the bus administrators (for mastership transfer) • • • • 1 1 1 1 1 2.0 2.0 2.0 4.0 4 ms time 8.2 4.0 period 0 period 1 period 2 period 3 begin of turn Tspo Tspo 2.1 2.1 4.1 cycle 2 period 4 Tspo Tspo 1 ms 1 ms 1 ms 1 ms 2 ms 2 ms
  • 314. 42 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Poll List Configuration The algorithm which builds the poll table spreads the cycles evenly over the macroperiod 1 8.1 1 2 3 4 5 6 7 1 7 1 1 4.2 1 1 1 1 1 1 4.0 1 basic period period period period period period period period period T_spo 1 2.0 8.1 0 2.1 0 2.0 2.1 2.0 2.1 2.0 2.1 2.0 2.1 2.1 4.2 4.0 4.0 period macroperiod (8 T_bp shown, in reality 1024 T_bp) guard 1 BP datasets 2 BP datasets 2 BP datasets >350µs
  • 315. 43 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Event Resolution (1) To scan events, the Master issues a General Event Poll (Start Poll) frame. A device with a pending event returns an Event Identifier Response. The Master returns that frame as an Event Read frame to read the event data If only one device responds, the Master reads the Event Identifier (no collision). If no device responds, the Master keeps on sending Event Polls until a device responds or until the guard time before the next periodic phase begins. Start Event Poll (parameters and setup) Event Identifier Response from slave CS Event Identifier returned as master frame Event data 12 1234 Event Poll telegram Event Read telegram xxxx time SSD CS MSD xxxx 9 EMET - CS MSD 12 1234 CS SSD
  • 316. 44 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Event Resolution (2) The devices are divided into groups on the base of their physical addresses. The Master first asks the devices with an odd address if they request an event. • If only one response comes, the master returns that frame to poll the event. If several devices respond to an event poll, the Master detects the collision and starts event resolution • If collision keeps on, the master considers the 2nd bit of the device address. • If there is no response, the master asks devices with an even address. C event reading any? xxx1 xx11 N x101 0101 A time group poll collision silence individual poll valid event frame start poll and parameter setup A D collision arbitration round C C telegram
  • 317. 45 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Event Resolution (3) 000 100 010 110 001 101 011 111 x00 x10 x01 x11 xx0 xx1 silence collision n = 0 n = 1 width of group address no event individual poll collision silence event read n = 2 odd devices even devices EA EA EA EA EA EA EA EA time collision silence collision xxx silence Example with a 3-bit device address: 001 and 101 compete general poll start arbitration
  • 318. 46 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Time Distribution At fixed intervals, the Master broadcasts the exact time as a periodic variable. When receiving this variable, the bus controllers generate a pulse which can resynchronize a slave clock or generate an interrupt request. Bus controller Sync port address Bus master Periodic list Sync port variable Master clock Bus controller Slave clock Ports Int Req Application processor 2 Bus controller Slave clock Ports Int Req Application processor 3 Bus controller Ports Int Req Application processor 1 Slave clock MVB
  • 319. 47 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Slave Clock Synchronization Slave clocks Bus administrator 1 Bus administrator 2 Synchronizer Slave clock MVB 1 Master clock Slave devices Slave clocks The clock does not need to be generated by the Master. The clock can synchronize sampling within 100 µs across several bus segments. MVB 2
  • 320. 48 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Outline 1. Applications in vehicles 2. Physical layer 1. Electrical RS 485 4. Frames and Telegrams 5. Medium Allocation 7. Fault-tolerance concept 8. Integrity Concept 2. Middle-Distance 3. Fibre Optics 9. Summary 3. Device Classes 6. Clock Synchronization
  • 321. 49 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Fault-tolerance Concept Transmission Integrity MVB rather stops than provides false data. The probability for an undetected transmission error (residual error rate) is low enough to transmit most safety-critical data. This is achieved through an extensive error detection scheme Transmission Availability MVB continues operation is spite of any single device error. In particular, configurations without single point of failure are possible. Graceful Degradation The failure of a device affects only that device, but not devices which do not depend on its data (retro-action free). Configurability Complete replication of the physical layer is not mandatory. When requirements are slackened, single-thread connections may be used and mixed with dual-thread ones. This is achieved through a complete duplication of the physical layer.
  • 322. 50 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Basic Medium Redundancy The bus is duplicated for availability (not for integrity) One frame may go lost during switchover A frame is transmitted over both channels simultaneously. The receiver receives from one channel and monitors the other. Switchover is controlled by signal quality and frame overlap. decoder receivers transmitters bus line A bus line B bus controller encoder selector address data parallel bus logic send register receive register A B A B decoder control signal quality report
  • 323. 51 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Medium Redundancy The physical medium may be fully duplicated to increase availability. Duplicated and non-duplicated segments may be connected Principle: send on both, receive on one, supervise the other repeater repeater A B device electrical segment X optical link A optical link B electrical segment Y device A B device device repeater repeater
  • 324. 52 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Double-Line Fibre Layout A B A B star coupler B Bus Administrator opto links A opto links B star coupler A copper bus A copper bus B redundant Bus Administrator The failure of one device cannot prevent other devices from communicating. Optical Fibres do not retro-act. device rack
  • 325. 53 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Master Redundancy To increase availability, the task of the bus master may be assumed by one of several Bus Administrators If a bus administrator detects no activity, it enters an arbitration procedure. If it wins, it takes over the master's role and creates a token. token passing Bus current bus master bus administrator 1 slave device slave device slave device slave device slave device slave device slave device bus administrator 2 bus administrator 3 A centralized bus master is a single point of failure. The current master is selected by token passing: To check the good function of all administrators, the current master offers mastership to the next administrator in the list every 4 seconds.
  • 326. 54 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Outline 1. Applications in vehicles 2. Physical layer 1. Electrical RS 485 4. Frames and Telegrams 5. Medium Allocation 7. Fault-tolerance concept 8. Integrity Concept 2. Middle-Distance 3. Fibre Optics 9. Summary 3. Device Classes 6. Clock Synchronization
  • 327. 55 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation BT0.5 MVB Transmission Integrity (1) Manchester II encoding Double signal inversion necessary to cause an undetected error, memoryless code Clock Data Frame Manchester II symbols Line Signal 1 1 0 1 0 0 0 1 violations 2) Signal quality supervision Adding to the high signal-to-noise ratio of the transmission, signal quality supervision rejects suspect frames. time BT = bit time = 666 ns reference edge 125ns 125ns 125ns 1) Start Delimiter BT1.0 BT1.5
  • 328. 56 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Transmission Integrity (2) F address 9 4 12 8 9 16 2 bytes 8 CS size in bits repeat 1, 2 or 4 x CS 9 32 4 bytes 8 CS 9 64 8 bytes DATA 64 8 CS Master Frame MSD SSD SSD SSD 16 (33) 16 (33) 32 (49) 64 (81) 128 (153) 256 (297) MD = Master frame Delimiter CS = Check Sequence 8 bits SD = Slave frame Delimiter useful (total) size in bits 3) A check octet according to TC57 class FT2 for each group of up to 64 bits, provides a Hamming Distance of 4 (8 if Manchester coding is considered): Slave Frame (Residual Error Rate < 10 under standard disturbances) -15
  • 329. 57 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation mm MVB Transmission Integrity (3) MSD ADDRESS a ADDRESS b DATA (b) MSD SSD accept if 0.5µs < t_mm < 42.7 µs time CS DATA (a) SSD CS CS CS 5) Response time supervision against double frame loss: MSD ADDRESS a DATA (a) SSD respond within 1.3 µs < t < 4.0 µs ms CS CS MSD ADDRESS b CS respond within 4 µs < t <1.3 ms sm time 1,3 ms 4) Different delimiters for address and data against single frame loss: 6) Configuration check: size at source and sink ports must be same as frame size. > 22 µs > 22 µs t
  • 330. 58 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Safety Concept Very high data integrity, but nevertheless insufficient for safety applications (signalling) Increasing the Hamming Distance further is of no use since data falsification becomes more likely in a device than on the bus. • critical data transmitted periodically to guarantee timely delivery. Data Transfer Redundant plant inputs A and B transmitted by two independent devices. Device Redundancy Availability Data Integrity Availability is increased by letting the receiving devices receive both A and B. The application is responsible to process the results and switchover to the healthy device in case of discrepancy. Diverse A and B data received by two independent devices and compared. The output is disabled if A and B do not agree within a specified time. • obsolete data are discarded by sink time supervision. • error in the poll scan list do not affect safety.
  • 331. 59 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Integer Set-up redundant vehicle bus (for availability only) input devices redundant input fail-safe comparator and enabling logic redundant, integer output ° A B A B poll time individual period spreader device (application dependent) output devices confinement A B A B application responsibility Bus Administrator
  • 332. 60 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Integer and Available Set-up redundant vehicle bus (for availability) redundant input B A comparator and enabling logic A B available and integer output switchover logic or comparator (application dependent) A B A B poll time individual period spreader device (application dependent) output devices confinement B A B A input devices A B C C redundant bus administrator redundant bus administrator
  • 333. 61 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Outline 1. Applications in vehicles 2. Physical layer 1. Electrical RS 485 4. Frames and Telegrams 5. Medium Allocation 7. Fault-tolerance concept 8. Integrity Concept 2. Middle-Distance 3. Fibre Optics 9. Summary 3. Device Classes 6. Clock Synchronization
  • 334. 62 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Summary Topography: Medium: Covered distance: OGF: 2000 m, total 4096 devices Communication chip Processor participation none (class 1), class 2 uses minor processor capacity Interface area on board Additional logic RAM, EPROM , drivers. Medium redundancy: fully duplicated for availability Signalling: Manchester II + delimiters Gross data rate Response Time Address space Frame size (useful data) bus (copper), active star (optical fibre) copper: twisted wire pair optical: fibres and active star coupler EMD: 200 m copper with transformer-coupling dedicated IC available 20 cm2 (class 1), 50 cm2 (class 2) 1,5 Mb/s typical 10 µs (<43 µs) 4096 physical devices, 4096 logical ports per bus 16, 32, 64, 128, 256 bits Integrity CRC8 per 64 bits, HD = 8, protected against sync slip ESD: 20 m copper (RS485)
  • 335. 63 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Link Layer Interface telegram handling Lower Link Layer message data supervisory data Traffic Store process data LP LM LS Upper Link Layer Real-Time Protocols Physical Layer master polling arbitration mastership transfer station management Link Layer Interface slave Process Data Message Data Supervisory Data frame coding
  • 336. 64 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Components Bus Controllers: BAP 15 (Texas Instruments, obsolete) MVBC01 (VLSI, in production, includes master logic MVBC02 (E2S, in production, includes transformer coupling) Medium Attachment Unit: ESD: fully operational and field tested (with DC/DC/opto galvanic separation) OGF: fully operational and field tested (8 years experience) EMD: lab tested, first vehicles equipped Stack: Link Layer stack for Intel 186, i196, i960, 166, 167, Motorola 68332, under DOS, Windows, VRTX,... Bus Administrator configurator Tools: Bus Monitor, Download, Upload, remote settings Repeaters: REGA (in production) MVBD (in production, includes transformer coupling)
  • 337. 65 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB Throughput (raw data) 32 16 48 64 80 96 112 128 144 160 176 192 208 224 240 256 MVB @ 1,5 Mbit/s IEC Fieldbus @ 1,0 Mbit/s IEC Fieldbus @ 2,5 Mbit/s dataset size in bits transmission delay [ms] 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.1
  • 338. 66 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation MVB & IEC 61158-2 Frames Preamble Start Delimiter Data 1 N+N- 1 0 N+ N- 0 1 N+N- N+N- 1 0 1 0 N-N+ 1 N- N+ 1 1 1 1 0 1 0 1 0 1 0 End Delimiter Data v v v v Spacing v v 0 0 0 0 N+ N- 0 N+N- Data v v Master Frame Slave Frame PhSDU FCS FCS FCS IEC 61158-2 frame MVB frame 8 bits 16 bits IEC65 frames have a lesser efficiency (-48%) then MVB frames To compensate it, a higher speed (2,5 Mbit/s) would be needed. End Delimiter Start Delimiter
  • 339. 67 3.4 MVB case study 2003 July, HK EPFL - Industrial Automation