Communications Systems: 189 Network Basics 191 Simple Fieldbus Systems 196 Fieldbus Systems 197
Communications Systems: 189 Network Basics 191 Simple Fieldbus Systems 196 Fieldbus Systems 197
Communications Systems
iiiiiii~'iiiiiiiiI
                         INTRODUCTION                                                                                   189
   iiiiiii
!iiii!!ii!ii!iiiii   3   SIMPLE FIELDBUS SYSTEMS                                                                        196
INTRODUCTION
In a modem digital drive, adjustments such as PID gains          usually involve multiple drives working in unison with each
and acceleration ramp times are software settings rather than    other. A field engineer may be faced with the daunting task
the potentiometers and DIP switches found in their ana-          of setting up the parameters for thirty drives, each one
logue predecessors. To permit adjustment of these software       having over four-hundred parameters.
parameters, most drives provide a human-machine interface
(HMI) consisting of an onboard display and buttons. Users        To address this challenge, most modem digital drives have a
manipulate the buttons to scroll to the parameter of interest    built-in communications port using the RS-232 or RS-485
and to alter its value. The problem is that many sophisticated   serial standard. There are two principal reasons for the
drives may have several hundred parameters and the built-in      inclusion of a communications port on a digital drive: set up
HMI system can be cumbersome to use. Compounding this            of the drive's parameters and real-time control of a number
problem is the fact that modem automation applications           of drives in an automation application.
190        INTRODUCTION: Drive Set Up
PLC drives
~ ~ :~::~ ~:~i~ ~
                                                          reference
                                                              run
                                                               sT6
                                                               reverse
                                                             reference
                                                                  run
                                                                   stop__
                                                                     reverse
                                            direct wiring of signals
DRIVE SET UP
                                                                       which permits a single drive to be connected; if an RS-485
Many drive manufacturers provide WindowsTM-based set up                converter is used then multiple drives can be connected
and maintenance programs to acquire and alter the drive's              through a multidrop cable. Control Techniques' drives can
parameters. These configuration programs can operate on a              be configured and maintained by PC applications such as
laptop computer and attach to the drive via the serial com-            Unisoft (for the Unidrive product range) which supports
munications port. The standard PC COM port uses RS-232                 single and multidrop connections (Figure 8.1).
                                                                                                        Chapter 8.2          191
PLC drives
serial network
Many applications require a number of drives to be inte-            In conclusion, simple serial communication portals built
grated with I/O and PLC devices. The traditional approach is        into drives greatly enhance the task of set up and maintenance
to use discrete wiring for the interconnections (Figure 8.2).       of the drive's adjustment parameters. For real-time control of
                                                                    the drive in an industrial process, a fieldbus offers the
Replacing the unwieldy wiring looms with a single digital
                                                                    advantages of higher speed, simplified installation and
serial network is an attractive alternative, as it will result in
                                                                    enhanced reliability. The benefits in replacing discrete
a dramatic reduction in the wiring and cost of installation
                                                                    interconnections with a fieldbus are summarised below:
(Figure 8.3). Provided that installation guidelines are met
(i.e. maximum number nodes, trunk length and correct ter-           •   wiring costs are dramatically reduced especially if dis-
minations etc.) reliability will be improved simply due to              tributed I/O is utilised
the reduced number of connections. The data remains in the          •   data remains in the digital domain and most analogue
digital domain with many analogue components and their                  components can be eliminated; no conversion errors,
associated conversion, repeatability and drift errors being             no repeatability and drift errors and substantial cost
eliminated. The flexibility offered by a serial network also
                                                                        savings
allows applications to be configured for specific end user          •   provided that the communication system is suitably
needs without adding extra cable connections. Internal                  robust the overall system becomes less susceptible to
parameters of remote nodes can easily be accessed for                   EM noise and ground-loop problems
remote supervision and data logging.                                •   remote supervision and set up of the drives over the
The speed of standard PC serial communications may be                   network
adequate for set up and configuration activities, but is            •   if the selected factory network is one that has wide
usually too slow for this purpose. Consequently, a number of            industry support, many sensors, actuators, HMI systems
high-speed industrial networks have evolved to meet this                and controllers can be directly connected to it without
need. They are generally known as fieldbus systems.                     special interfacing.
2 NETWORK BASICS
Communications networks have so much in common that it              is used as a framework for organising the various data com-
has become standard practice to relate their features and           munications functions occurring between disparate devices
design elements to an internationally agreed model. The             which communicate. The complete OSI model defines seven
Open Systems Interconnection (OSI) Reference Model,                 component parts or layers; however only three of these layers
developed by the International Standards Organisation (ISO),        are usually developed for industrial communications.
192                        NETWORKBASICS
Fieldbus systems often include special features related to                                                                                                   required for the nodes to be connected in a logical bus
device interoperability and the real-time nature of industrial                                                                                               structure.
automation applications. The device profile defines device
interoperability features such as electronic data sheets which                                                                                               Interface Circuits
allow devices from different manufacturers to interoperate
without complex configuration or custom software. Cyclic                                                                                                     All PCs support the RS-232 data transmission system. The
data is network data that bypasses parts of the software for                                                                                                 signal appears as a single-ended voltage with reference to a
efficiency.                                                                                                                                                  signal ground. The voltage swing of the RS-232 circuit
                                                                                                                                                             shown in Figure 8.5 is -+-12 volts ( - 1 2 V for logic one,
                                                                                                                                                              + 12 V for logic zero). When not transmitting the signal is
PHYSICAL LAYER                                                                                                                                               held at logic one ( - 1 2 V).
Starting at the lowest layer in the OSI model (Figure 8.4), the                                                                                              Observing that the logic zero/one detection thresholds are
physical layer is concerned with the actual transmission of                                                                                                  typically +3 and - 3 volts in most implementations, it is
raw bits. In a factory network, analogue quantities, switches,                                                                                               clear that a modest spike could trick the receiver into making
command codes and textual data are all converted into                                                                                                        a false bit determination, as shown below in Figure 8.6. For
numeric information and transmitted as a stream of binary                                                                                                    this reason, RS-232 signalling circuits are almost never used
bits from the source node to the destination node. Typically,                                                                                                in modern factory communications systems.
the bit stream is logically grouped into octets (or bytes).                                                                                                  Adoption of differential signalling solves most of the
The following sections describe the key facets of the phy-                                                                                                   problems inherent in single-ended RS-232 communica-
sical layer.                                                                                                                                                 tions. In the RS-485 standard, two conductors are used to
                                                                                                                                                             represent the bit: one carrying the original bit and the other
Network Cables and Connectors                                                                                                                                carrying its logical inverse. The differential receiver at
                                                                                                                                                             the receiving end subtracts the two signals to recover the
The physical layer requires a transmission medium for the                                                                                                    original data. Any noise induced into one conductor is
data signals to flow. The principal transmission medium of                                                                                                   induced in the other conductor and the subtraction operation
factory networks today is either copper cable or fibre-optic                                                                                                 will thus cancel out the common-mode noise. Note: the
cable.                                                                                                                                                       signal levels are 0 V and 5 V.
Twisted-pair copper cable is preferred for cost and ease of                                                                                                  RS-485 also supports operation with multiple nodes on the
installation. Fibre-optic cables are less susceptible to EM                                                                                                  same cable. When a transmitter is not actually transmitting it
fields and offer higher bandwidths; however they are more                                                                                                    is disabled and presents a high impedance to the bus.
expensive and difficult to install. Also, an expensive hub is                                                                                                Typically, all receivers are enabled and see every message,
                                                                                                                                                             but the protocol allows them to discard messages not
                                                                                                                                                             intended for them.
                                                                                                                                                             Data Encoding
                                                                                                                                                             The differential signalling described in the previous section
 I~~................~Ye~i
                    layer       .7:i..~i..i.application
                    .........~..........                              layer
                                            ~.:.~..:.~..i~~iP~P:,l:,i~~~i
                                                                        ~i~~~i             ....~.i.....~..........~...~...~...........
                                                                            ...~..i~..ila..ye:                                                   cyclic
                                                                                                                                                 data
                                                                                                                                                             allows us to reliably send a single bit down a network cable.
                                                                                                                                                             Since the network is typically used for numeric data or
                                                                                                                                                             characters, multiple bits are used to convey the information.
                                      layer 2: data link layer                                                                                               These multiple bits must be encoded either asynchronously
                                                                                                                                                             or synchronously.
                                                                                                                                                             In asynchronous encoding it is up to the receiver to properly
                                                                                                                                                             sample and detect the multiple bits. The standard PC COM
Figure 8.4 Open Systems Interconnection                                                                                                                      port uses a method of encoding called NRZ (non return to
                                                                                                                                                             zero). In NRZ encoding, the voltage level determines the bit
                                                      RS-232                                                                                                                                       + 12 volts
                                         __~~/interface                                                      >~/                    ] ~                                              logic zero
                                                                                                                                                                                ................   + 3 volts
                                                                         )>                                   >>                                                                                    Ovolts
                                                      m                                                                                  m
m n
3 volts
                                                                                                                                                      idle
                                                                                                                                                                                \             logic one
                                                                                                                                                                                                   - 12volts
Figure 8.5 RS-232 interface
                                                                                                                                                                        Chapter   8.2   193
                                                                                                                                       0 volts
                                                                                                                      ~                                    detection!
                               '°°'c°ne                                                                       1"l"--t
                                                                                                                   ......... v°'*s
........................................ 25 volts
                                                                                                                                  +5
                              ,,,                               >> Rx                                                                            ~tr     data
                                                                                                                                                       ansmitted
           data                                                                                                            data
m B
+5
f 0a*areceived
Figure 8. 7 RS-485
value (one or zero). In Figure 8.8, the character Hex 1C is                                                               Manchester encoding, there is always a transition in the
transmitted. The receiving electronics must detect the                                                                    middle of a bit period. Logical zero is a downward transition
change from line idle state to the start of a bit pattern (called                                                         and logic one is an upward transition. Since there is always a
the start bit). Once the start bit has been detected, each data                                                           transition, a phased-lock loop circuit can be used to extract
bit must be sampled in the middle of its respective bit period                                                            the clock signal. This makes it easy for the receiver circuit to
(Figure 8.9). This assumes that the receiver has its own                                                                  sample and detect the bits.
sample clock to do this and that the incoming bit rate (baud
rate) is known.
The disadvantages of NRZ encoding is that the timing of the                                                               Network Topology
sampling is independent of the transmitted signal. Also, the
start bit and stop bit carry no information and thus waste                                                                The topology of a network describes how the nodes are con-
throughput.                                                                                                               nected together. The main topologies are the bus topology
                                                                                                                          where all nodes connect together onto a common medium,
Another encoding method called NRZI (nonreturn to zero
                                                                                                                          and a ring topology where nodes are interconnected in
inverted) uses transitions to determine the bit values (zero is
                                                                                                                          a unidirectional loop. Some networks are wired in a star
no transitions, one is a transition).
                                                                                                                          topology which requires the use of a multioutput repeater
Finally, the Manchester encoding system allows the                                                                        called a hub. Ethernet 10baseT is an example of this
clock signal to be recovered from the transmitted data. In                                                                approach.
194        NETWORKBASICS:Data-link Layer
logic 1 0 0 1 1 1 0 0 0
                                start   bit       bit       bit   bit       bit       bit           bit   bit   stop
                                bit     0          1        2     3         4         5             6     7     bit
0 0 1 0 1 1 0
                        i/ preamble                                           data
                                                                 I this is the data we want to transfer I
There are a number of protocols designed for RS-232 or RS-        CONTROL TECHNIQUES' PROTOCOL
485 communications which are still widespread in automa-
tion applications.                                                All Control Techniques' products offer a simple ASCII-based
                                                                  protocol which allows parameters to be read and written
                                                                  (Figure 8.3).
MODBUS                                                            The response is a single character A C K (hex code 06) or
                                                                  N A K (hex code 15).
The Modbus serial communications protocol is a de facto
                                                                  Table 8.1 Query
standard designed to integrate PLCs, computers, terminals,
sensors and actuators. Modbus is a master-slave system            Field name                 RTU (hex)           ASCII characters
meaning that one device, the master node, controls all serial
                                                                  Header                     none                :(colon)
activity by selectively polling the slave devices. Modbus
                                                                  Slave address              06                  06
supports one master device and up to 247 slave devices.           Function                   03                  03
Each device is assigned a unique node address.                    Starting address hi        00                  00
                                                                  Starting address lo        6B                  6B
There are two variants of Modbus: ASCII and RTU. ASCII
                                                                  No. of registers hi        00                  00
mode uses a message format that is printable, messages start
                                                                  No. of registers lo        03                  03
with a colon and end with a carriage return.                      Error check                CRC (2 bytes)       LRC (2 characters)
RTU mode uses binary and is therefore not printable. Eight-       Trailer                    none                CRLF
bit characters are sent as a continuous burst and the end of      Total bytes                8                   17
the message is denoted by three and a half character times of
silence. RTU mode messages use half the characters of an          Table 8.2 Response
equivalent ASCII message.                                         Field name            RTU (hex)                ASCII characters
Only the master initiates a transaction. The master is usually    Header                none                     :(colon)
a host PC or HMI device since most Modicon PLCs are               Slave address         06                       06
slaves and cannot initiate a Modbus transaction (the new          Function              03                       03
Quantum PLCs can act as a Modbus master). Typically, the          Byte count            06                       06
host master will read or write registers to a slave. In each      Data hi               02                       02
case, the slave will retum a response message. For a read         Data lo               2B                       2B
                                                                  Data hi               00                       00
operation, the response will carry the requested data. For a
                                                                  Data lo               00                       00
write operation, the response is used to verify acceptance of
                                                                  Data hi               00                       00
the write command. A special case is the broadcast operation      Data lo               63                       63
where a write operation can be directed to all slaves. In this    Error check           CRC (2 bytes)            LRC (2 characters)
case, no response message is forthcoming.                         Trailer               none                     none
The eight-bit address field is the first element of the message   Total bytes           11                       23
(one byte for RTU, or two characters for ASCII). This field       Table 8.3 Query
indicates the address of the destination slave device that
should respond to the message - all slaves receive the mes-       Field name                     Example (hex)               ASCII
sage but only the addressed slave will actually act upon it.      EOT                            04
                                                                  Slave address                  31                          1
The function code field tells the addressed slave which
                                                                                                 31                          1
function to perform. Modbus function codes are specifically
                                                                                                 34                          4
designed for interacting with a PLC on the Modbus indus-                                         34                          4
trial communications system.                                      STX                            02
                                                                  Parameter                      31                          1
Two error check bytes are added to the end of each message:
                                                                                                 38                          8
ASCII mode uses a longitudinal redundancy check (LRC)                                            32                          2
and RTU mode uses a 16-bit CRC check.                                                            33                          3
In the example in Tables 8.1 and 8.2, the host PC is initiating   Value                          33                          3
                                                                                                 32                          2
a read request of three parameters starting with 1.08 from
                                                                                                 2E
drive address 06. The starting holding register is 40108 but
                                                                                                 37                          7
the 4 is dropped in the message string and the rest of the                                       39                          9
register address is entered as one less (0108 becomes 0107,       ETX                            3
0107 is entered as 006B in hexadecimal). The response             Checksum                       1 char
repeats the address and function code, but includes the           Total bytes                    17
values read from the drive.
                                                                                                        Chapter 8.4           197
4 FIELDBUS SYSTEMS
REQUIREMENTS FOR DRIVE APPLICATIONS                                effects. Some applications will require close coordination of
                                                                   a number of drives (e.g. each axis in a CNC machine). In
Drive applications dictate specific fieldbus requirements.         these applications set points and measured values in all
The following section reviews these requirements.                  drives must be consumed and sampled synchronously across
                                                                   the network.
Physical Layer                                                     To achieve these dynamic requirements the real-time or
Contactors, power switching devices and switch gear all            cyclic data is usually handled differently, bypassing the
contribute to a high level of ambient EM noise. The trans-         cumbersome application layer, and presented directly to the
mission media must be immune to this and also be mechani-          drive. Moreover the transactions and mapping of the data is
cally robust enough to survive the rigours of installation.        generally predetermined during system initialisation to
                                                                   avoid the overhead of sending addressing information.
The type of media and signalling method will dictate the
limits for the maximum number of nodes on a network and            General Message Services
the distance between them (Table 8.4). This should be
checked against the application requirements.                      Other general nontime-critical access to the network must be
                                                                   supported. For example, operator interaction, drive set up
Screened twisted pair is generally preferred for cost reasons      (PID gains, ramp times etc.), downloading application
and ease of installation.                                          software, general diagnostics and data logging. These mes-
                                                                   sages are often referred to as noncyclic communication.
Error Detection
The consequence of accepting corrupted data will be cata-
                                                                   Centralised v e r s u s Distributed
strophic in any application and a reliable error-detection         Intelligence
algorithm must be implemented, which will discard cor-
                                                                   If a communication system with the above dynamic char-
rupted data. Error-recovery schemes are generally too
                                                                   acteristics is available it may seem desirable to locate all the
complex for small embedded systems and would also require
                                                                   system control functions in the central controller and simply
redundant data to be transmitted.
                                                                   transfer demands and feedback cyclically with the drives
Many systems include built-in, high-level error-handling           over the network. However, if the drive is capable of
schemes which call for retries ifa frame is corrupted. However,    executing some application functions locally then an alter-
for real-time data, which has a limited lifetime, the system is    native approach is to use a distributed architecture.
best waiting for the next available sampled data.
                                                                   In this scenario some control loops are implemented
                                                                   locally utilising feedback available from the local I/O on the
Dynamic Performance                                                drive. This reduces the load on the network, which is then
                                                                   only called upon to transfer slower outer-loop references
The bandwidth of a drive varies according to the motor and
                                                                   which are less sensitive to variations in the deterministic
drive technology used. A servodrive system may have a
                                                                   response. Although the dynamic requirements of the net-
bandwidth of 1 or 2 kHz. At the other extreme, an open-loop
                                                                   work are less, flexible peer-to-peer communication is
drive coupled to a large fan or pump may have a system time
                                                                   needed to allow data to be shared easily between distributed
constant measured in seconds.
                                                                   processes.
To accommodate the high-performance servo applica-
                                                                   A distributed architecture has some advantages over a cen-
tions the data will need to be delivered every 1 ms or less.
                                                                   tralised structure: a powerful controller necessary to cope
Only a small set of real-time data items needs to be trans-
                                                                   with large levels of computation for the whole system is
ferred at this rate, e.g. speed and torque, control and status.
                                                                   expensive and the software will invariably be unwieldy and
Moreover, the updates must be periodic and deterministic;
                                                                   difficult to maintain. Also, the standard I/O which most
in other words the data must arrive at regular guaranteed
                                                                   drives provide can be utilised very efficiently by a local
time intervals. Ideally the period or cycle of the updates
                                                                   process without loading the network. Clearly, it may be
should be synchronised with the digital control loops in the
                                                                   difficult to partition and distribute some systems and a
drives and controller to eliminate any undesirable beating
                                                                   centralised approach is best (e.g. the interpolation functions
                                                                   of a multiaxis CNC machine).
Table 8.4 Typical data rates for transmission media
this master-slave architecture and can provide high perfor-           capability of CAN. A number of device profiles have been
mance updates when used at the maximum 12 Mbit/s data                 defined including the A.C./D.C. drives profile.
rate. The dominant physical layer is a multidrop RS-485 bus
using shielded twisted-pair cable.                                    •   Assembly objects - cyclic control data is efficiently
                                                                          packed into the eight-byte CAN data frame without any
Secondary masters (class 2) can be added to the network and               protocol information. Assembly objects are usually
can be used for SCADA-type functions only. A master token                 configured for synchronous exchange with the master
is used to control the master accesses.                                   synchronisation telegram.
There is a wide range of manufacturers in the Profibus user           •   Explicit messaging - this noncyclic service allows a
group and a number of device profiles (including a drive                  single object attribute to be read or written. The CAN
profile) have been defined.                                               message carries the protocol information necessary to
                                                                          identify the object attribute and the value.
Development work on DP to address the synchronisation and
peer-to-peer limitations is ongoing. These enhancements are
both needed for motion control applications. To synchronise           CANopen
the slave drives, the master broadcasts a cyclic and equidi-
                                                                      This is an open-system standard developed by a multivendor
stant clock telegram which all slaves use to synchronise
                                                                      working group. A number of device profiles have been
internal clocks. The peer-to-peer data is realised using a
                                                                      defined including the drive speed and position profile.
producer-consumer data model.
                                                                      •   Process data objects (PDOs) - control data is efficiently
                                                                          packed into the eight-byte CAN data frame without
INTERBUS-S                                                                any protocol information- the 11-bit COB ID (CAN
                                                                          object identifier) is used to identify the data. The COB
Interbus S is a master-slave fieldbus system optimised for                IDs must be allocated during system initialisation.
connecting slave devices to a central controller (typically a             PDOs can be transmitted cyclically in response to the
PLC). Although the data rate is a modest 500 kbit/s, the                  synchronisation telegram, or as unsolicited event-based
useful data throughput is high due to the low protocol                    transmission.
overhead. Slave devices typically provide between four and            •   Service data objects (SDOs) - discrete messaging to read
ten cyclic transmit and receive data words in conjunction                 or write an object.
with a noncyclic channel (PCP).
The network uses a ring topology with the master coordi-
nating all network activity. There are two physical-layer             CTNET
options: the remote bus variant uses RS-485 twisted pair
with a maximum range of 400m between each node; the                   Control Techniques developed CTNet as part of the dis-
lower cost local bus uses TTL levels for short spurs.                 tributed control product strategy. The objectives for CTNet
                                                                      were low cost, easy to install and set up, peer-to-peer
                                                                      exchanges to allow data to be shared between drives, and
CAN                                                                   high performance.
                                                                      CTNet leverages proven token-ring data-link technology
CAN was originally developed by Intel and Bosch for
                                                                      with a unique protocol stack having dual cyclic data chan-
automotive applications. Its performance, simplicity and low
                                                                      nels to provide efficient synchronous transfers for real-time
cost have led to its adoption in many industrial automation
                                                                      control data. In addition, the general-purpose channel pro-
applications. The main CAN-based standards are DeviceNet
                                                                      vides occasional or event-driven transactions suitable for
and CANopen.
                                                                      data logging, diagnostics and set up.
The CAN physical layer is typically very robust but does
                                                                      A bus topology is used which, with the use of repeaters, can
have a baud rate v e r s u s distance trade off due to the bit-wise
                                                                      support up to a maximum of 255 nodes. The network uses a
arbitration scheme.
                                                                      transformer isolated physical layer, which improves noise
                                                                      immunity and makes installation simpler. The default data
DeviceNet                                                             rate is 2.5 Mbit/s.
Originally a Rockwell system, this is now a standard man-             When equipped with CTNet, the drive application modules
aged by the ODVA. Most DeviceNet systems operate under                can be used to build distributed control systems which offer
a master-slave scheme with a master PLC scanner. How-                 many performance and cost benefits over an equivalent
ever, this structure does not fully leverage the peer-to-peer         PLC-based system.