Industriell datakommunikation

Luca Beltramelli Email: [email protected]

Mittuniversitetet References

Books: • Practical Industrial Data Communications by Reynders, Deon Mackay, Steve Wright, Edwin

• Industrial Communication Systems by Wilamowski, Bogdan M. Irwin, J. David

Mittuniversitetet Industriell Datakommunikation - Fieldbus 2 Program

04/05/2018 • Seminar I: • Introduction to Fieldbus and Industrial Automation • Overview of fieldbus technologies (Part 1) 07/05/2018 • Seminar II: • Overview of fieldbus technologies (Part 2) • Real Time Ethernet • WirelessHART

Mittuniversitetet Industriell Datakommunikation 3 Control System

Reference Set + CONTROL ACTUATOR PLANT ALGORITHM -

Feedback SENSOR

Control System

Mittuniversitetet Industriell Datakommunikation 4 Networked Control System

Controller(s)

Communication Sensor(s) Network Actuator(s)

Mittuniversitetet Industriell Datakommunikation 5 What is a Fieldbus?

Fieldbuses are real-time networks for sensors and actuators.

Used for the communication among sensors, actuators and controllers

Data and Nodes Management

Fieldbus

Diagnostic Safety and and Security Integration

Mittuniversitetet Industriell Datakommunikation - Fieldbus 6 Real Time

“A real-time system is one whose logical correctness is based on both the correctness of the outputs and their timeliness”

Soft vs Hard Real Time

Failure to meet deadline

HARD RT SOFT RT Catastrophic Failure Performance degradation

Mittuniversitetet Industriell Datakommunikation 7 The Automation Pyramid

Office Network: TCP IP, Ethernet

Plant Network: Ethernet, ControlNet

Fieldbus: FF, PA, LON

Simple fieldbus or Sensor Bus: CAN, DeviceNet, SDS, ASI-bus, Interbus-S

Mittuniversitetet Industriell Datakommunikation - Fieldbus 8 : the beginning

Traditionally in industries the communication was completly analog Moving to digital communication brings many benefits: • Immunity to noise; • Less cabling; • Better Diagnostic; 20 Fieldbus replace the traditional

4 – 20 mA analog technology. [mA]

4

Measurement Range

Mittuniversitetet Industriell Datakommunikation - Fieldbus 9 4-20 mA vs Fieldbus

4-20 mA Fieldbus Information Analog Digital Signal Integrity Low (EMI, High Attenuation, ...) Communication Phyisical Physical, Data Link, Layer Application Diagnostic Minimal Extensive Installation cost High Low Cost per device Low High

Mittuniversitetet Industriell Datakommunikation - Fieldbus 10 Fieldbuses: field devices

One of the key requirements for the adoption of fieldbus is the distribuited intelligence. To access the fieldbus sensors and actuators are required to implement a communication stack. Smart Sensors: • Computetion capabilities; • Communicate in a digital way; • They use a communication standard (at least layers 1 and 2 of ISO/OSI);

Mittuniversitetet Industriell Datakommunikation - Fieldbus 11 Fieldbus Evolution

From the first proprietary solutions (’80) to the actually used standard (’90)

International Predecessors Proprietary solutions Standards 1969 1979 1991 … 1996

First PLC (Modicon 084)

MODBUS CAN Profibus FMS/DP/PA HART FOUNDATION fieldbus

Mittuniversitetet Industriell Datakommunikation - Fieldbus 12 Fieldbus Evolution

From the first proprietary solutions (’80) to the actually used standard (’90)

Industrial Ethernet Wireless Networks

2001 … 2006 2007 2009 2010

EtherCAT (2003) Eth/IP (2001) Profinet (2004) SafetyNET (2006) …

Release of WirelessHART Release of ISA100.11a Introduction of IO-Link

Mittuniversitetet Industriell Datakommunikation - Fieldbus 13 Fieldbus and the OSI Model

Layer ISO/OSI Model Layer ISO/OSI Model

7 Application 7 Application 6 Presentation 5 Session 4 Transport 3 Network 2 Data link 2 Data link + MAC 1 Physical 1 Physical OSI Model Implementation Model

Mittuniversitetet Industriell Datakommunikation - Fieldbus 14 Fieldbus: the applications

Factory Automation

Process Automation FIELDBUS Automative

Home Automation

Mittuniversitetet Industriell Datakommunikation - Fieldbus 15 FIELDBUS FOR AUTOMOTIVE Safety • Redundancy, Check codes, very low data error rate

Determinism • Synchronized communications, TDMA

Wireless networks are considered unreliable and, up to now, are used for entertainment and extravehicular communications

IEEE 802.11p for data exchange between high-speed vehicles (V2V) in the licensed ITS band of 5.9 GHz (5.85-5.925 GHz).

Examples: LIN – very simple protocol (e.g. window automation) CAN – CAN version with TDMA (e.g. ABS) FlexRay – New (BMW, Audi, Mercedes …), increases baud rate with respect to CAN (up to 10Mbytes/s) and adopts a TDMA with dynamic slots assignment.

Mittuniversitetet Industriell Datakommunikation - Fieldbus 16 FIELDBUS FOR HOME AUTOMATION

The low-cost is mandatory, non-invasive and mobile sensors could be the future (wireless fieldbuses)

Primary needs: low-cost, simple installation, auto-configuration

There are a lot of proprietary solutions:

• CAN – based solutions (different application layers) • Some emerging Ethernet-based solutions (security and costs problems) • EIB, EHS and Batibus converge into Konnex (KNX) (ISO/IEC 14543- 3,EN50090) • European Standard (Siemens, ABB, Bticino, Vimar, etc.) • Wired and wireless

• LONWorks • Widespread in USA • Supported by electronic devices (Neuron Chips produced by Toshiba, Freescale, Cypress)

Mittuniversitetet Industriell Datakommunikation - Fieldbus 17 FIELDBUS FOR PROCESS AUTOMATION • Safety is mandatory (particularly in chemical, oil, industries,…) • High availability (redundant system) • Reduce wiring (long distances) - the bus also powers the devices • Speed is not important • Cycle time are in the order of several hundreds of ms • Timestamp is important in case of fault (resolution ~ 100 ms)

There are only two big players:

• PROFIBUS PA • FIELDBUS FOUNDATION (it has local loop control between devices)

They use the same physical layer (Manchester, powered, 31.25kbaud) but they are totally different at the data layer.

Wireless can be used for non critical processes, as it reduce wiring and allow a range extension by suitable network topologies (mesh)

Mittuniversitetet Industriell Datakommunikation - Fieldbus 18 FIELDBUS FOR FACTORY AUTOMATION

The main goals are: • Fast and low-cost • High rejection to noise • Safety (e.g.protection of human operator)

Speed can be very important • Reduced communication times means more products, i.e. higher gain… • Motion control (motor drives) need isochronous communication

More than 20 fieldbuses for Factory Automation • PROFIBUS DP is the most diffused but holds only the 15% of the market (RS485, max 12Mbit/s) • DeviceNet, CANOpen, use CANbus (max 1Mbit/s) Factory environment is hostile for wireless technology (metal, walls,…)

Mittuniversitetet Industriell Datakommunikation - Fieldbus 19 The Ideal Fieldbus: some characteristics

• Transfers a “big number” of small data; • Supports real-time traffic (Upper bounded response times, ex. 1ms..1s); • Operates in hazardous environments (high temperature, vibrations, etc.); • Is robust and easy to install; • Has high availability (e.g. redundant architectures); • Has continuous supervision and diagnostic; • Manages long distances (100m .. 4 km); • Has good data transmission rate (e.g. 50 kbit/s … 5 Mbit/s); • Supports clock synchronization (e.g. milliseconds up to microseconds); • Manages non real-time traffic for maintenance and diagnosis.

Mittuniversitetet Industriell Datakommunikation - Fieldbus 20 Fieldbus: the topology

Fieldbus daisy chain topology Tree topology

• Flexibility of the hardware of the measurement system • Cable reduction • Every node can share information with other nodes

•Different delays from node to the measurement system •Less realiable

Mittuniversitetet Industriell Datakommunikation - Fieldbus 21 Fieldbus: distributed measurements

In Industry to ensure good control and monitoring actions, sensor nodes should… A. Be synchronized • Synchronization protocols • Delay • Jitter

B. Be identified and localized • Identifier for each sensor • Localization of moving sensor

C. Be qualified • Uncertainty measurement • Status report

Mittuniversitetet Industriell Datakommunikation - Fieldbus 22 Fieldbus: Measurement and Control

Measurement Loop Control • Data require a time reference • Delay must be limited (timestamp) (deterministic transmission)

Mittuniversitetet Industriell Datakommunikation - Fieldbus 23 Fieldbus: Networked Control System (NCS)

Actuator Process Sensor

Communication Network

Controller

Close loops in Process Automation Close loops in Factory Automation • Process (temperature, humidity,…Tcycle > 1s) • Motion (positioning, speed, torque… Tcycle < 1 ms)

Mittuniversitetet Industriell Datakommunikation - Fieldbus 24 Fieldbus: a complex scenario

Ethernet Seriplex CAN Profibus-FMS WorldFIP Batibus Profibus- CANOpen FlexRay PA PROFInet EtherLink ProfibusAND-DP MANY OTHERS Sercos FieldBus Foundation BacNET !!!ControlFIP Hart IEEE 802.11 -RTPS DeviceNet M-Bus Modbus Profisafe ControlNet Ethercat

Mittuniversitetet Industriell Datakommunikation - Fieldbus 25 HART

Mittuniversitetet HART (Highway Addressable Remote Transducer) • Developed in 1980, from 1990 is an open communication technology for process automation. • Enables the transmission of digital information superimposed on analog 4-20 mA communication. • The 4-20 mA is used for transmitting the analog data from sensor in the field.

ISO/OSI Layer HART Model 7 Application HART Commands 6 - 3

2 Data link HART Protocol Rules 1 Physical Bell 202 (FSK modulation)

Mittuniversitetet Industriell Datakommunikation - Fieldbus 27 “Analog” for sensing information, digital for diagnostics

FSK modulation ‘0’ – 2200 Hz ‘1’ – 1200 Hz

The average value of the Frequency Shift Keying (FSK) modulation is zero, the analog communication is unaffected by it.

Mittuniversitetet Industriell Datakommunikation - Fieldbus 28 HART: Point to Point communication

HART: Multi-point communication

Mittuniversitetet Industriell Datakommunikation - Fieldbus 29 HART Telegram

Three classes of commands: • Universal Commands • Common Practice Commands; • Device-Specific Commands.

Mittuniversitetet Industriell Datakommunikation - Fieldbus 30 Reference

• Official Website

• Practical Industrial Data Communications - Ch. 18a

Mittuniversitetet Industriell Datakommunikation - Fieldbus 31 MODBUS RTU and ASCII

Mittuniversitetet • Application layer (Layer 7) messaging protocol • Developed by Modicon in 1980 • Mainly Used in SCADA system • Master-slave protocol • Communication is initiated by the Master (Client) • Slaves (Server) communicate only to the Master • One communication at the time (Unicast or Multicast) • Peer-to-peer • UART (RS232, RS485) • 1 master, <248 slaves

Mittuniversitetet Industriell Datakommunikation - Fieldbus 33 Modbus message Frame

Communication based around a Query-Response cycle

The function code in the query tells the addressed slave device the action to perform. (ex. read Input Registers, Force Single Coil, Read Coil Status )

Mittuniversitetet Industriell Datakommunikation - Fieldbus 34 • Two serial transmission mode (no coexistence): • ASCII mode • 1 byte -> 2 char (0-9, A-F) • Error Check -> LRC • Bits per Byte:

• RTU mode • 1byte -> 8 bit (0 … 255) • Error Check -> CRC • Bits per Byte:

Mittuniversitetet Industriell Datakommunikation - Fieldbus 35 Reference

• Modbus over serial line • Modbus Specifications • Official Website

• Practical Industrial Data Communications - Ch. 8a

Mittuniversitetet Industriell Datakommunikation - Fieldbus 36 CANbus

Mittuniversitetet Controller Area Network (CAN) Developed in ’85 by Bosch for automotive • Random access bus (32 users, 1Mbps @ 40m) • CSMA/CA • Multi-master bus • Asynchronous Serial Bus • 4 frames: DATA (data exchange), REMOTE (request to send data), ERROR (error signaling), OVERLOAD (temporary unavailable)

Mittuniversitetet Industriell Datakommunikation - Fieldbus 38 The CAN standard includes:

• Physical layer • Data-link layer • Message types • Arbitration rules for bus access • Methods for fault detection and fault confinement

Mittuniversitetet Industriell Datakommunikation - Fieldbus 39 Phy layer • Maximum bitrate 1Mbps. • The bitrate depend on the bus length. • The bitrate is limited to sense the collision between distant nodes. • Twisted pair cable, differential transmission

Mittuniversitetet Industriell Datakommunikation - Fieldbus 40 • Bit Coding: NRZ (does not ensure enough edges for synchronization)

• Bit Stuffing is Required

(CAN, …)

(Profibus, Ethernet …) • “open-collector like”, that is “0” level wins

• Automatic bus release if collision occurs and retransmission

Mittuniversitetet Industriell Datakommunikation - Fieldbus 41 The Arbitration Field contains a 11-bit (CAN 2.0 A) or 29-bit (CAN 2.0 B) identifier for the data.

Data with higher priority have the MSBs at ´0´ and win the arbitration.

Higher Layer Protocols • CANOPEN • DEVICENET • CAN Kingdom • …

Mittuniversitetet Industriell Datakommunikation - Fieldbus 42 Reference

• Official Website • Industrial Communication Systems - Ch. 31

Mittuniversitetet Industriell Datakommunikation - Fieldbus 43 PROFIBUS

Mittuniversitetet PROFIBUS (Process Field Bus) Three versions of the standard: • Profibus FMS (1991) • PLC-PLC, PLC-SCADA, PLC-Field device (complex, obsolete)

• Profibus DP (1994) • Simpler than FMS, normally 1 master (PLC), several slaves (field devices) • Market leader

• Profibus PA (1995) • Different and more robust physical layer (IEC 61158-2)

Mittuniversitetet Industriell Datakommunikation - Fieldbus 45 ISO/OSI Layer FMS DP PA Model DP - Profiles PA - Profiles User FMS Devices Profiles DP - Acyclic Part DP - Cyclic Part Fieldbus Message Specification 7 Application (FMS) 6 - 3 2 Data link (Fieldbus Data Link (FDL) IEC Interface IEC 61158-2 (Manchester 1 Physical RS-485 Fiber Optic Encoded Power Bus)

Mittuniversitetet Industriell Datakommunikation - Fieldbus 46 Profibus: the actors

• DPM1 (Master Class 1):central controller which exchanges data with the connected I/O devices (slaves). • Determines the bitrate. • Handles the Token; • Several class1 masters are permitted, typical devices are PLC, PC.

• DPM2 (Master Class 2): diagnostic and startup tool, typically a configuration tool, can control one slave at a time.

• Slave: passive station which acknowledges messages or answers per request

Mittuniversitetet Industriell Datakommunikation - Fieldbus 47 • At least one master is mandatory.

• Profibus networks allow for multiple masters.

• In total 127 stations can be addressed

Mittuniversitetet Industriell Datakommunikation - Fieldbus 48 Master-Slave Communication

The master with the token can make use of communications to address any other station (masters and slaves).

DP Slave State Machine

The slave is in one of four possible states: • Power_ON / Reset • Wait for Parameters • Wait for Configuration • Data Exchange

Cyclic data exchange between a Class 1 master and a DP slave can only take place if the DP slave is in the data-exchange state (DXCHG).

Mittuniversitetet Industriell Datakommunikation - Fieldbus 49 Master-Master Communication Via the master-slave combination:

• whenever one master has the token the other PLC can be a slave to this master.

Using a DP-DP gateway:

• combination of two mono master systems;

• simple data exchange between the two masters up to 244 byte.

Mittuniversitetet Industriell Datakommunikation - Fieldbus 50 Profibus transmission media

 RS-485  Twisted cable  Baudrate 9.6 kbit/s to 12 Mbit/s  Maximum 32 devices  Distance can be extended by means of repeaters • 12 Mbit/s @ 100 m • 187.5 kbit/s @ 1000 m

 Fiber Optic  Single and Multi Mode  Baudrate 9.6 kbit/s to 12 Mbit/s  Distance can be extended by means of repeater to 100 km

 MBP-IS  Twisted cable  Fixed Baudrate of 31.25 kbit/s  Maximum distance 1900 m  Between 10 and 32 devices per segments  Power Supply directly from the bus

Mittuniversitetet Industriell Datakommunikation - Fieldbus 51 Fieldbus Data Link • 4 types of frames • Identified by the value of the first byte (Start Delimiter)

SYN: 33 bits at 1

SD1 10h 01101000 SD2 68h 10100010 SD3 A2h 00010000 Hamming Distance equals to 4 SD4 DCh 11011100

Note: SD3 practically unused

Mittuniversitetet Industriell Datakommunikation - Fieldbus 52 Message SD2 (data exchange)

SD2 Start Delimiter (68H) LE Information length (from 4 to 249) LEr Information length repeated (Hamming distance = 4) DA Destination address SA Source address FC Frame Control DATA UNIT Data field (max length 246) FCS Frame Check Sequence ED End Delimiter (16H) L Information length (L = from 4 to 249)

Mittuniversitetet Industriell Datakommunikation - Fieldbus 53 Message SD1 (data request or Ack)

SD1 Start Delimiter (10H) DA Destination address SA Source address FC Frame Control FCS Frame Check Sequence ED End Delimiter (16H) L Information length (L = 3) Message SD4 (token transfer)

SD4 Start Delimiter (DCH) DA Destination address SA Source address

Message SC (short Ack)

SC Short acknowledgment (E5H)

Mittuniversitetet Industriell Datakommunikation - Fieldbus 54 GSD file (General Station Description)

• each slave or master class 1 device on PROFIBUS needs to have a device description file, the characteristic of each PROFIBUS device is described in the GSD-File;

• the GSD-file contains all device specific parameters e.g.: • Supported Baudrate • Supported Message Length • Number of input / output data • Meaning of diagnostic messages • Options for modular devices e.g. which are available

• text file (ASCII-format);

• each configuration tool relates to the GSD information.

Mittuniversitetet Industriell Datakommunikation - Fieldbus 57