0% found this document useful (0 votes)
4 views11 pages

Lecture 3 - 1

Uploaded by

tvtadtvtad17
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views11 pages

Lecture 3 - 1

Uploaded by

tvtadtvtad17
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

76 Chapter 4

current supply for the input device connected to it (Figure 4.1a). With sinking, the input
device provides the current to the input unit (Figure 4.1b).
Figures 4.2 and 4.3 show the basic input unit circuits for DC and AC inputs. Optoisolators
(see Section 1.3.4) are used to provide protection. With the AC input unit, a rectifier bridge
network is used to rectify the AC so that the resulting DC signal can provide the signal for
use by the optoisolator to give the input signals to the CPU of the PLC. Individual status
lights are provided for each input to indicate when the input device is providing a signal.

Input Input device


unit Input
unit

Input device
(a) (b)

Figure 4.1: Input unit: (a) sourcing and (b) sinking.

LED indicator +P
PLC of input ignal Optoisolator Internal PLC voltage

Input Signal to
toPLC PLC CPU

Protection
diode
Voltage
divider circuit

Figure 4.2: DC input unit.

Live PLC +V Internal


Optoisolator PLC
voltage
Signal to
Input PLC CPU
to PLC

Signal
Neutral
indicator

Figure 4.3: AC input unit.


l/O Processing 77

Inputs
Selected output
—¥• Multi-
plexer

Channel selection signal

Figure 4.4: Multiplexer.

When analog signals are inputted to a PLC, the input channel needs to convert the signal to a
digital signal using an analog-to-digital converter. With a rack-mounted system this may be
achieved by mounting a suitable analog input card in the rack. So that one analog card is not
required for each analog input, multiplexing is generally used (Figure 4.4). This involves
more than one analog input being connected to the card and then electronic switches used to
select each input in turn .Cards are typically available containing 4, 8, or 16 analog inputs.
Figure 4.5a illustrates the function of an analog-to-digital converter (ADC). A single analog
input signal gives rise to on/off output signals along perhaps eight separate wires. The eight
signals then constitute the so-termed digital word corresponding to the analog input signal
level. With such an 8-bit converter there are 28 = 256 different digital values possible; these
are 0000 0000 to 1111 1111, that is, 0 to 255. The digital output goes up in steps
(Figure 4.5b) and the analog voltages required to produce each digital output are termed
quantization levels.
If the binary output is to change, the analog voltage has to change by the difference in analog
voltage between successive levels. The term resolution is used for the smallest change in
analog voltage that will give rise to a change in 1 bit in the digital output. With an 8-bit ADC,
if, say, the full-scale analog input signal varies between 0 and 10 V, a step of one digital bit
involves an analog input change of 10/255 V or about 0.04 V. This means that a change of

Digitaloutput Digital
Bit output
—$• 7
—K• 6 0000 0010 —
— • 5
Analogue Analogue- —p•
—h• 4
to-digital —h• 3
input converter —h• 0000 0001 —
2
—$• 1
0 00000000
0 1 2
(a) (b) Analogue input

Figure 4.5: (a) Function of an analog-to-digital converter, and (b) an illustration


of the relationship between the analog input and the digital output.
78 Chapter 4

0.03 V in the input will produce no change in the digital output. The number of bits in the
output from an analog-to-digital converter thus determines the resolution, and hence
accuracy, that is possible. If a 10-bit ADC is used, then 210 = 1024 different digital values
are possible and, for the full-scale analog input of 0 to 10 V, a step of one digital
bit involves an analog input change of 10/1023 V, or about 0.01 V. If a 12-bit ADC is used,
then 212 = 4096 different digital values are possible and, for the full-scale analog input of 0
to 10 V, a step of one digital bit involves an analog input change of 10/4095 V, or about
2.4 m V. In general, the resolution of an n-bit ADC is 1/ (2n _ 1); this is sometimes approximated
to 2-n.
The following illustrates the analog-to-digital conversion for an 8-bit converter when the
analog input is in the range 0 to 10 V:

Analog Input (V) Digital Output (V)

0.00 0000 0000


0.04 0000 0001
0.08 0000 0010
0.12 0000 0011
0.16 0000 01 00
0.20 0000 0101
0.24 0000 0110
0.28 0000 0111
0.32 0000 1 000
etc.

To illustrate this idea, consider a thermocouple used as a sensor with a PLC and giving an
output of 0.5 mV per °C. What will be the accuracy with which the PLC will activate the
output device if the thermocouple is connected to an analog input with a range of 0 to 10 V
DC and using a 10-bit analog-to-digital converter? With a 10-bit converter, there are 210=
1024 bits covering the 0 to 10 V range. Thus a change of 1 bit corresponds to 10/1023 V or
about 0.01 V, that is, 10 mV. Hence the accuracy with which the PLC recognizes the input
from the thermocouple is ±5 mV or ±10°C.
Conversion from analog to digital takes time and, in addition, the use of a multiplexer means
that an analog input card of a PLC only takes “snapshot” samples of input signals. For most
industrial systems, signals from a plant rarely vary so fast that this presents a problem.
Conversion times are typically a few milliseconds.

4.1.2 Output Units


With a PLC output unit, when it provides the current for the output device (Figure 4.6a)
it is said to be sourcing, and when the output device provides the current to the output unit,
l/O Processing 79

it is said to be .sinking (Figure 4.6b). Quite often, sinking input units are used for interfacing
with electronic equipment and sourcing output units for interfacing with solenoids.
Output units can be relay, transistor, or triac. Figure 4.7 shows the basic form of a relay
output unit, Figure 4.5 that of a transistor output unit, and Figure 4.9 that of a triac
output unit.

Output Output
unit Load _ unit Load

(a) (b)

Figure 4.6: Output unit: (a) sourcing, and (b) sinking.

Output signal LED PLC


Fuse

From
PLC
CPU
o —V
Optoisolator Relay

Figure 4.7: Relay output unit.

Load
Optocoupler
Current
Fuse
flow
Output

PLC
(a)

Optocoupler
O

Output
Fuse Current
flow
O fi• Load

(b) PLC

Figure 4.8: Basic forms of transistor output: (a) current sinking, and (b) current sourcing.
80 Chapter 4

PLC
Triac o +l/

Fom
PLC Fuse
CPU

Optoisolator
Output
LED load
output signal

Figure 4.9: Triac output unit.

Analog outputs are frequently required and can be provided by digital-to-analog converters
(DACs) at the output channel. The input to the converter is a sequence of bits with each bit
along a parallel line. Figure 4.10 shows the basic function of the converter.
A bit in the 0 line gives rise to a certain size output pulse. A bit in the 1 line gives rise to an
output pulse of twice the size of the 0 line pulse. A bit in the 2 line gives rise to an output
pulse of twice the size of the 1 line pulse. A bit in the 3 line gives rise to an output pulse of
twice the size of the 2 line pulse, and so on. All the outputs add together to give the analog
version of the digital input. When the digital input changes, the analog output changes in a
stepped manner, the voltage changing by the voltage changes associated with each bit. For
example, if we have an 8-bit converter, the output is made up of voltage values of 28 = 256
analog steps .Suppose the output range is set to 10 V DC. One bit then gives a change of
10/255 V or about 0.04 V. Thus we have:

Digital
input Analog
output
7 —¥•• 2—
6 —¥•
5 — •
Digital-to- Analog
4 —¥•
analog —¥• 1—
3 —¥• conveerteer output
2 —¥•
1 —¥•
0
0 —'• 0000 0001
0000 0000 0000 0010
(a) (b) Digital input

Figure 4.10: (a) DAC function, and (b) digital-to-analog conversion.


Digital Input (V) Analog Output (V)

00000000 0.00
00000001 0.04
0000001 0 0.08 + 0.00 = 0.08
00000011 0.08 + 0.04 0.J 2
000001 00 0.1 6
000001 01 0.0J 6 —!—0.00 + 0.04 0.20
0000011 0 0.016 —!—0.08 0.24
00000111 0.016 -I- 0.08 + 0.04 0.28
00001 000 0.32
etc.

Analog output modules are usually provided in a number of outputs, such as 4 to 20 mA, 0 to
+5 V DC, and 0 to +10 V DC, and the appropriate output is selected by switches on the
module. Modules generally have outputs in two forms, one for which all the outputs from that
module have a common voltage supply and one that drives outputs with their own individual
voltage supplies. Figure 4.11 shows the basic principles of these two forms of output.

4.2 Signal Conditioning


When connecting sensors that generate digital or discrete signals to an input unit, care has to
be taken to ensure that voltage levels match. However, many sensors generate analog signals.
To avoid having a multiplicity of analog input channels to cope with the wide diversity of
analog signals that can be generated by sensors, external signal conditioning is often used to
bring analog signals to a common range and so allow a standard form of analog input channel
to be used.

PLC
Common Individual
PLC
live supplies
O O O L1
1
oN1
2
O O L2
2
4 o N2
5 o L3
0
6 3 N3
7
O o o L4
Fuses Output 4
o N4
loads
Fuses Outputs
(a) (b)

Figure 4.11: Forms of output: (a) common sup P y• and (b) individual supplies.
I/O Processing &S

Might have a reference voltage and compare the voltage from a sensor with it and so obtain
an on/off output depending on whether the voltage from the sensor is above or below the
reference voltage.

4.2.3 Output Protection


Outputs involving coils of wire, such as solenoids and motors, are inductors. When there is a
current, such inductors store energy in the magnetic field, and when the current is switched
off, the magnetic field collapses and produces a back EMF that can be quite large. The
simplest method of protection against this back EMF is to place a diode in parallel with the
coil. The diode is so connected that current cannot flow through it when the current is
energizing the coil but will short-circuit the coil and so suppress the current arising from the
back EMF. Such a diode is often referred to as a flyback diode.
Some output devices may need series current-limiting resistors. For example, an LED display
has generally a maximum current rating of about 10 to 30 mA. With 20 mA the voltage drop
across it might be 2.1 V. Thus if we have an input of 5 V to it, 2.9 V has to be dropped across
a series resistor. This means a series resistance of 2.9/0.020 = 145 Ω and so a standard
resistor of 150 Ω might be used. Some LEDs are supplied with built-in resistors.

4.3 R e m o t e C o n n e c t i o n s
When there are many inputs or outputs located considerable distances away from the PLC,
though it would be possible to run cables from each such device to the PLC, a more economic
solution is to use input/output modules in the vicinity of the inputs and outputs and use just a
single core cable to connect each over the long distances to the PLC, instead of using the
multicore cable that would be needed without such distant I/O modules (Figure 4.18).

Input/output module

Twisted-pair, or screened cable, or


fibre optic cable, communication
link
PLC

Power Input and


output
connections

Remote input/
output module

Figure 4.18: Use of remote input/output module.


96 Chapter 4

Other input/output
modules

Master
PLC

Communication
module
PLC

PLC Communication
port

Units located some distance from the PLC

Figure 4.19: Use of remote input/output PLC systems.

In some situations a number of PLCs may be linked together with a master PLC unit
sending and receiving input/output data from the other units (Figure 4.19). The distant PLCs
do not contain the control program since all the control processing is carried out by the
master PLC.
The cables used for communicating data between remote input/output modules and a central
PLC, or remote PLCs and the master PLC are typically twisted-pair cabling, often routed
through grounded steel conduit to reduce electrical “noise.” Coaxial cable enables higher
data rates to be transmitted and does not require the shielding of steel conduit. Fiber-optic
cabling has the advantage of resistance to noise, small size, and flexibility and is now
becoming more widely used.

4.3.1 Serial and Parallel Communications


In serial communication, data is transmitted one bit at a time (Figure 4.20a). Thus if an 8-bit
word is to be transmitted, the 8 bits are transmitted one at a time in sequence along a cable.

Bits
7
Bits
6
7 6 5 4 3 2 10
5
4
(a) 3
2
1
0
(b)

Figure 4.20: (a) Serial communication and (b) parallel communication.


86 Chapter 4

Bus systems generally employ the method in which a system that wants to transmit listens
to see whether any messages are being transmitted. If no message is being transmitted, a
station can take control of the network and transmit its message. This method is known
as carrier sense multiple access (CSMA). However, we could end up with two stations
simultaneously perceiving the network to be clear for transmission and both
simultaneously taking control and sending messages. The result would be a “collision”
of their transmitted data, resulting in corruption. If such a situation is detected, both
stations cease transmitting and wait a random time before attempting to again transmit.
This is known as carrier sense multiple access with collision detection (CSMA/CD).
PLC manufacturers adopt different forms of network systems and methods of communication
for use with their PLCs. For example, Mitsubishi uses a network termed MelsecNET, Allen-
Bradley has Data Highway Plus, General Electric uses GENET, Texas Instruments uses
TIWAY, and Siemens has PROFIBUS DP. Most, like Allen-Bradley, employ peer-to-peer
forms. With Siemens, PROFIBUS DP is a star, that is, a master/slave form.

4.4. I Distributed Systems


Often PLCs figure in an hierarchy of communications (Figure 4.28). Thus at the lowest level
we have input and output devices such as sensors and motors interfaced through I/O
interfaces with the next level. The next level involves controllers such as small PLCs or small
computers, linked through a network, with the next level of larger PLCs and computers
exercising local area control. These in turn may be part of a network, with a large mainframe
company computer controlling all.
There is increasing use made of systems that can both control and monitor industrial
processes. This involves control and the gathering of data. The term SCADA, which
stands for supervisory control and data acquisition system, is widely used for such
a system.

Standard Levels
Plant Mainframe
Proprietary LAN network
computer
network

LargePLC
Supervisory Supervisory Computer

PLCs, CNC
Robot PLC Computer PLC PLC
machines, etc.

I/O VO VO VO Plant devices

Figure 4.28: Control hierarchy-


104 Chapter 4

lowest layer, Device Net, to deal with sensors and drives. PLCs would take instructions from
the Ethernet layer and exercise control through the Control Net layer.

6. Processing Inputs
A PLC is continuously running through its program and updating it as a result of the input
signals. Each such loop is termed a cycle. PLCs could be operated by each input being
examined as it occurred in the program, its effect on the program determined, and the output
correspondingly changed. This mode of operation is termed continuous updating.
Because there is time spent interrogating each input in turn with continuous updating, the
time taken to examine several hundred input/output points can become comparatively long.
To allow more rapid execution of a program, a specific area of RAM is used as a buffer store
between the control logic and the input/output unit. Each input/output has an address in this
memory. At the start of each program cycle the CPU scans all the inputs and copies their
status into the input/output addresses in RAM. As the program is executed, the stored input
data is read, as required, from RAM and the logic operations are carried out. The resulting
output signals are stored in the reserved input/output section of RAM. At the end of each
program cycle all the outputs are transferred from RAM to the appropriate output channels.
The outputs then retain their status until the next updating. This method of operation is
termed mass I/O copying. The sequence can be summarized as follows (Figure 4.31):
1. Scan all the inputs and copy into RAM.
2. Fetch, decode, and execute all program instructions in sequence, copying output
instructions to RAM.

3. Update all outputs.


4. Repeat the sequence.

Scan all
inputs

Repeat Carry out


sequence A program

Updat
e
output
s

Figure 4.31: PLC operation.


102 Chapter 4

I =input Module number


0 =output
X: XXX/ XX

T Terminal number
Rack number

Figure 4.32: Allen-Bradley PLC-5 addressing.

I = input
Q =output
Xx x . x
— Bit number
Byte number

Figure 4.33: Siemens SIMATIC S5 addressing.

With the Siemens SIMATIC S5, the inputs and outputs are arranged in groups of eight. Each
such group is termed a byte, and each input or output within a group of eight is termed a bit.
The inputs and outputs thus have their addresses in terms of the byte and bit numbers,
effectively giving a module number followed by a terminal number, a full stop (.) separating
the two numbers. Figure 4.33 shows the system. Thus 10.1 is an input at bit 1 in byte 0, and
Q2.0 is an output at bit 0 in byte 2.
The GEM-80 PLC assigns inputs and output addresses in terms of the module number and
terminal number within that module. The letter A is used to designate inputs, and B outputs.
Thus A3.02 is an input at terminal 02 in module 3, and B5.12 is an output at terminal
12 in module 5.
In addition to using addresses to identify inputs and outputs, PLCs also use their
addressing systems to identify internal, software-created devices, such as relays, timers, and
counters.

Summary
The input/output units of PLCs are designed so that a range of input signals can be changed
into 5 V digital signals and a range of output signals are available. For a PLC input unit with
sourcing, it is the source of the current supply for the input device connected to it; with
sinking, the input device provides the current to the input unit. For a PLC output unit with
sourcing, it provides the current to the output device, and for sinking, the output device
produces the current for the PLC output. Output units can be relay, transistor, or triac.
For inputs, signal conditioning is generally used to convert analog signals to a current in the
range 4 to 20 mA and, thus, by passing through a 250 Ω resistor, to a 1 to 5 V input signal.
This might be achieved by a potential divider or perhaps an operational amplifier. An

You might also like