Professional Documents
Culture Documents
CHAPTER 2 Programmable Logic Controller (PLC) and Relay Ladder Logic (RLL)
CHAPTER 2 Programmable Logic Controller (PLC) and Relay Ladder Logic (RLL)
CHAPTER 2
Chapter 2: Programmable Logic Controller (PLC) and Relay Ladder Logic (RLL).
2.1
2.2
2.3
2.4
2.5
2.6
.21
golanA
tupuO
CLP
medoM
.22
COUNTERS: These again do not physically exist. They are simulated counters and
they can be programmed to count pulses. Typically these counters can count up, down or
both up and down. Since they are simulated they are limited in their counting speed.
Some manufacturers also include high-speed counters that are hardware based. We can
think of these as physically existing. Most of the time these counters can count up, down
or up/down.
TIMERS: These also do not physically exist. They come in many varieties and
increments. The most common type is an on-delay type. Others include off-delay and
both retentive and non-retentive types. Increments vary from 1ms through 1s.
OUTPUT RELAYS-(coils):These are connected to the outside world. They physically
exist and send on/off signals to solenoids, lights, etc. They can be transistors, relays, or
triacs depending upon the model chosen.
DATA STORAGE: Typically there are registers assigned to simply store the data.
They are usually used as temporary storage for math or data manipulation. They can also
typically be used to store data when power is removed from the PLC. Upon power-on
they will still have the same contents as before when power has been removed.
ANALOG MODELS: This covers analog inputs and outputs. The analog models
cover reading analog signals from sensor, provides analog signal such as thermocouples,
strain gauges, thermistor, pressure sensor.etc. The analog output signals can be used to
command external controller e.g. servomotors amplifier, solenoid amplifier etc.
USER INTERFACE INPUT: Which contains extra push-bottoms that can be
configured by the user to set/reset logic output devices e.g. relays outputs, or can be used
as a storage of messages that can be displayed on liquid crystal display. Furthermore,
some of these interfaces has led which can be configured by the user.
NETWORKING MODULES: Larger PLCs could have serial port that can be used for
networking a multiple of PLCs that are to be programmed from one main computer or
sending/receiving data between PLC network. Furthermore, some of the PLCs are
equipped with remote control module (modem) to program the PLC from long distance
computer.
The CPU of the PLC contains a microprocessor, which means that a PLC is basically a
specialized computer that has been designed to control the operation of machines and
processes within the harsh environment of the plant.
The language used to program the PLC to perform the logic required to connect the filed
input to its outputs is called Relay Ladder Logic (RLL). The RLL language is programmed by
means of special software using personal computer (connected to the PLC using serial port)
or hand-held programmer which has led or liquid-crystal display and keyboard as illustrated
in Fig. 2.2.
Hand-held programmer or PC communication
Input
Module
(logic or
continuous)
+24V DC
User
interface
Output
module
(logic or
continuous
modules)
M
S
Serial port
Power Supply
.23
RAM and EPROM memory are used to store the program instructions in the PLC. The
computer or hand-held programmer can be used to load and save the RLL programs into the
PLC.
The physical input and output modules can be discrete or analog I/O modules and can be
selected and specified when purchasing the PLC, and depend on the number of the required
I/O lines.
The discrete I/O modules connects field inputs devices of the ON/OFF nature like limit
switches, push button switches, solenoids, solenoid valve or electro-mechanical relay ..etc.
Each discrete I/O module supply voltage source. Since these voltages can be of different
magnitude or types, I/O modules are available at various AC & DC voltages ratings as shown
in Table 2.1. Furthermore, the inputs and outputs are connected to LEDs to indicate the
operation of the I/O module
Table 2.1: common ratings for discrete I/O interface modules.
Interface input module
24 V AC/DC
12-48 V AC
48 V AC/DC
120 V AC
230 V AC/DC
230 V DC
5 V (TTL)
5 V DC (TTL)
.25
on yet. It turns off before scan 4 looks at the inputs. Therefore signal 3 is never seen by the
PLC. This illustrates the importance of scanning time of the PLC.
Control circuit
.26
Next, we would like to replace the relay control system with PLC control system using relay
ladder logic. After seeing a few of these it will become obvious why its called a ladder
diagram. We have to create one of these because, unfortunately, a PLC doesn't understand a
schematic diagram. It only recognizes code. Fortunately most PLCs have software, which
convert ladder diagrams into code. This shields us from actually learning the PLC's code.
The PLC doesn't understand terms like switch, relay, bell, etc. It prefers input, output, coil,
contact, etc. It doesn't care what the actual input or output device actually is. It only cares
that its an input or an output.
First we replace the battery with a symbol. This symbol is common to all ladder diagrams.
We draw what are called bus bars. These simply look like two vertical bars. One on each side
of the diagram. Think of the left one as being + voltage and the right one as being ground.
Further think of the current (logic) flow as being from left to right. Next we give the inputs a
symbol. In this basic example we have one real world input. (i.e. the switch) We
.27
.28
Example 2:
Redraw the relay ladder logic of Example 1, using normally closed switch for SW2 ?
The amended RLL is shown in Fig. 2.12:
Fig. 2.12 Amended RLL using Normally closed switch for switch SW2.
The Boolean logic equation will be : Coil = SW1 . SW2
2.4 Motor control using PLC, two push buttons and motor starter
Here two push buttons switches
(Start/Stop) are used to switch
the motor on/off. These
switches are connected to the
two PLC inputs discrete type),
as shown in Fig. 2.13.
One of the output ports
(discrete outputs) of the PLC
used to switch motor starter
on/off, which will start/stop the
electric motor.
The control steps of the electric
motor using RLL is shown in
Fig. 2.14.
Motor
starter
Output
Motor
PLC
Input
4
.29Go to
step 1
Motor starter
Output
Motor
Two indicators
PLC
Input
Input
Fig. 2.15 Amended RLL for motor control after adding two indicators.
The modified RLL is given as follows:
Fig. 2.15 (a)RLL when Start push button undressed, (b)RLL when Start push button
pressed
10
.2
Fig. 2.16 PLC Programming technique using PC computer through serial port.
In case of PC program, a special software program must be installed in the PC which is
provided by the manufacturer to write and edit user Relay Ladder Logic (RLL). This also
transfers the program between PLC and PC computer and vise versa. The program
developed to be friendlier with user during RLL development, as shown in Fig. 2.17.
Fig. 2.17 Example of RLL developed using TPDS software for Toshiba PLC.
Because the PLC uses Relay Ladder Logic diagrams, the convention from any existing relay
ladder to programmed relay ladder logic is simple. Each rung is a combination of input
conditions (symbols) connected from left to right, with the symbol that represents the output
at the far right. The symbols that represent the inputs are connected in series, parallel, or
some combination to obtain the desired logic. The following examples show how PLC can
be used to carry out different control logics, as shown in Fig. 2.18. Note, any combination
logic called Boolean equation.
Example 3:
Develop a relay-ladder logic that allows four switches in a room to control a single light?
SW1
LIGHT=SW1+SW2+SW3+SW4
The RLL is shown in Fig. 2.19.Light
SW2
SW3
SW4
11
.2
SW2
LAMP
SW2
Lamp
LAMP
SW1
{ Relay Ladder Diagram}
SW2
SW1
Lamp
SW2
SW1
SW3
Lamp
SW2
SW1
SW3
Lamp
SW2
SW4
SW5
SW1
SW3
Y20
SW2
SW4
Y20
Lamp
12
.2
SW1
SW3
Y20
SW2
SW4
Y20
Lamp
SW1
SW3
Y20
SW2
SW4
SW4
Y20
Lamp
SW1
SW3
Y20
Y20
SW4
Y20=(SW1.SW3)+(SW1.SW4)
+(SW2.SW3)+(SW2.SW4)
LAMP= SW4 . Y20
Or
LAMP= ((SW1.SW3)+(SW1.SW4)
+(SW2.SW3)+(SW2.SW4)) . SW4
Y20=SW1. SW3+Y20.SW3
LAMP= SW4 . Y20
Note: 1st Boolean equation is memory or
filp-flop.
Y20
Lamp
Example 4:
Modify the developed relay-ladder logic given in example 3 such that these switches are
enabled/disabled using external supervisor through switch (SW5) ?
SW1
SW5
Light
LIGHT=(SW1+SW2+SW3+SW4) . SW5
SW2
SW3
SW4
Fig. 2.20 Modified RLL by adding external switch SW5, refer example 4.
13
.2
PROBLEMS
2.1) Develop the RLL diagrams for the following Boolean equations :
F1 = A . B + A . B
F2 = sw1 . sw2 . sw3 . sw4
F3 = ( sw1 . sw2 . sw3) + sw4
Y = (A.B.C + D ) . (E.F)
2.2) Drive the Boolean equations for the following relay ladder logics
(a)
SW1
SW3
SW4
Y20
Y20
SW4
Y20
Lamp
(b)
SW1
SW3
SW4
Y20
SW2
SW5
SW6
SW1
2.3) Develop a relay ladder logic that will switch on the motor on/off in automatic and
manual (called jog) modes?
(ans: SW1: START push bottom, SW3 STOP push bottom, SW2 JOG or Manual
operating mode, and Y20 memory that will run the relay that will switch the motor on)
SW1
SW3
Y20
Y20
SW2
Y20
Y20
motor
14
.2
15
.2