0% found this document useful (0 votes)
24 views20 pages

Module PLC

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)
24 views20 pages

Module PLC

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/ 20

UNIVERSITY OF NUEVA CACERES COLLEGE OF ENGINEERING AND ARCHITECTURE

4: Programmable Logic Controller

I. Introduction
For decades, manufacturing and other production industries rely in operating manually using
human labor. Nowadays, it was replaced by machine automation. Human labor is very effective yet it has
inevitable disadvantages. For example, in pencil manufacturing, a stage in the process is to place an eraser
at the pencil’s end, and it is done repeatedly for a thousand times and more. If a human labor is assigned
in this work, he will eventually get tired and bored, and it will significantly affect the efficiency of
production.

Programmable Logic Controller (PLC) is the primary technology used nowadays that provides
automation. In this module, you will be learning what composes PLC, its architecture, functions and
operation.

II. Objectives
After completion of the course the student should be able to:

1. Discuss the importance of employing PLC automation on industrial applications.


2. Describe the general operation of PLC.
3. Write a basic PLC ladder program.

III. PLC Fundamentals


Programmable Logic Controller (PLC) can be simply defined as a special computer used to control
industrial machines. Such machines are used for automation, that is, replacing human workforce by
technology and equipment. It is usually applied to perform repeating processes.

Being a controller, PLC has the capacity to power and control different output devices to perform
specific functions. By programming, PLC is integrated with a certain machine logic while performing such
functions. Figure 4.1 shows the structure of PLC, the entire system is composed of five modules. Let us
describe each of them:
Source: SlidePlayer

Figure 4.1. PLC architecture

ELECTRONICS 3 V.1.0 BY: ART IAN G. BAUTISTA, ECE 63


UNIVERSITY OF NUEVA CACERES COLLEGE OF ENGINEERING AND ARCHITECTURE

 Processor Module

Contains a memory, where the program is stored, and CPU, that makes decisions and executes
control instructions based on the program instructions in memory.

 Programming Device

Used to input the desired instructions. These instructions determine what the PLC will do for
a specific input. Several methods are available in programming a PLC, where ladder programming is
most common.

 Input Module

Accepts a variety of digital and analog signals from various field devices and converts them
into a logic signal that can be used by the CPU. Different kinds of switches, sensors and transducers
are the primary devices under this module.

 Output Module

Converts control instructions from the CPU into a digital or analog signal that can be used to
control or power various field devices. These include indicators like lamps and alarms, and actuators
like motors, valves, solenoids, hydraulics, pneumatics, etc.

 Power Supply Module

Supply the necessary power for the PLC and its peripherals. Most PLC system is powered
by 24 𝑉dc.

PLC can be compared to a personal computer (PC), it can perform various functions and do it
simultaneously. However, PCs excel in the processing and some advance features that a requires large
memory capacity. PLCs are limited in memory and can perform few functions, that why its best in
industrial processes where only basic operations are required. Moreover, PLCs are designed to be rugged
that is able to withstand industrial conditions.

PLC Applications
PLC are widely used is even outside the production industry. You may be familiar with
several day-to-day operation yet you may be surprised that those are PLC applications. Here are
some:

 Traffic Light System

Traffic lights are automated by PLC using its timer


functions. Basic traffic light operations are programmed in a
sequence where a time interval is allotted to each light signal. It
does not necessarily require an input device but in some places,
input devices are made available for pedestrians.

(a)

ELECTRONICS 3 V.1.0 BY: ART IAN G. BAUTISTA, ECE 64


UNIVERSITY OF NUEVA CACERES COLLEGE OF ENGINEERING AND ARCHITECTURE

 Car Park Monitoring System

Car parks such as those in mall and other public


establishments utilizes the counter function of PLC to
monitor the number of vehicles in a parking lot, available
spaces, etc. In this application, it may require sensors as input
or manual switches.

(b)

 Bottling System

The process of bottling drinks is more advance


application of PLC. Usually, the PLC is used to perform
several functions simultaneously. This include the control
of motors for conveyor, mechanical arms for capping,
counter, and packaging.

(c)

 Process Control System

Another advance application of PLC is process control


for specific or custom operations. For the example in the
figure, two chemicals are mixed together in a container, then
drained. For a certain chemical solution, an amount of
chemical 1 is poured for a time interval and after which,
chemical 2 is poured out. The process is carried out by the
pumps as instructed by the PLC timer program.

Such process may require additional sensors for error Source: Slideshare
detection and safety features. PLC can integrate such
features.

(d)

Figure 4.2. PLC Applications

ELECTRONICS 3 V.1.0 BY: ART IAN G. BAUTISTA, ECE 65


UNIVERSITY OF NUEVA CACERES COLLEGE OF ENGINEERING AND ARCHITECTURE

PLC Setup

Learning PLC is best with a training


module. Figure 4.3 shows a basic PLC trainer.
Such module utilizes the fundamental
functions of PLC such as the input-output
functions. It has different kinds of switch
integrated as input peripherals, and multi-
colored lamps for output along with open
ports available for external output device. In
this kind of module, hardwiring is less
necessary since almost everything is prepared
for easy operation.

Source: Festo
Figure 4.3. Basic PLC Trainer

More advance trainer includes additional


components for mechatronics operation. Elaborate
hardwiring is expected in this trainer, so the user must be
careful to check the connections before energizing the
system. You will personally attach different input and
output devices to the PLC and create a mini system that
Source: LabVolt

actually operates. The package may include sensors used


for switching and pneumatics where components like a
motor and solenoids are powered by compressed air.

Figure 4.4. PLC – Mechatronics Trainer

Figure 4.5 shows one of the PLC used in our laboratory – Allen Bradley Micrologix 1000. It
has one (1) Input terminal with ten (10) ports – numbered 0 to 9, and (1) Output terminal with
six (6) ports – numbered 0 to 5. This model is powered by 24V dc power. The Serial port is used
to connect the PLC to a computer for programming and monitoring. Input indicators corresponds
to the input terminal. When a port is activated, its corresponding indicator lights up. Output
indicators have the same function. Status indicators tells the current status or operation of the
PLC. Power indicator indicates that the PLC is on. Run indicates when the PLC is doing its function
based on the program instruction. Fault indicates if the PLC detected error in the system and
connection. Force indicates if the input-output (IO) force functions are present or enabled.

ELECTRONICS 3 V.1.0 BY: ART IAN G. BAUTISTA, ECE 66


UNIVERSITY OF NUEVA CACERES COLLEGE OF ENGINEERING AND ARCHITECTURE

Source: Google
Figure 4.5. Parts of PLC

Every operation done by the system is handled by the PLC. By concept, the controller
simply provides different ways of connecting an input to an output based on the instructions given
by the program. All training module requires a computer that will be used to write a program and
to download the program to the PLC.

IV. PLC Programming


There are various ways to program a PLC. This is also referred to as softwiring, one of the main
advantages of PLC. Physical components of a PLC system are arranged and interconnected by the usual
media used for electrical and electronic configurations or also called hardwiring. In a production plant for
example, if a PLC system is configured for a particular process, but for instance after sometime the plant
changed their product, it’s possible to not redo the physical wiring anymore, the process can be changed
easily by just changing the program. The following is the programming methods employed in today’s PLC.

Instruction List
It is a text-based low-level type of programming language which is based on how the
processor works. Instruction list is consisting of series of control instructions or commands like
using machine code in microprocessor. Every instruction consists of an operator and an operand.

ELECTRONICS 3 V.1.0 BY: ART IAN G. BAUTISTA, ECE 67


UNIVERSITY OF NUEVA CACERES COLLEGE OF ENGINEERING AND ARCHITECTURE

Structured Text
Considered as high-level programming language. A textual language based on the
programming language PASCAL, BASIC or C. It is eventually used for more complex problems and
data structures. It uses comprehensive constructs to allow a very compact formulation of the
programming task and the ability to evaluate complex mathematical expression.

It offers the advantage that it allows a clear program structure. The disadvantage of this
language is its lower efficiency. The programs are slower and longer.

Ladder Diagram
A graphical programming language which was referenced from circuit diagrams. It is
combined with binary variables (digital logic operations) used for addressing, and it resembles the
circuit diagram of earlier relay control systems with contacts and coils.

Ladder logic is the main programming method used for PLCs and has been developed to
mimic relay logic so that the amount of retraining needed for engineers and programmers was
greatly reduced.
Source: Slideshare

Figure 4.6. Ladder Program

ELECTRONICS 3 V.1.0 BY: ART IAN G. BAUTISTA, ECE 68


UNIVERSITY OF NUEVA CACERES COLLEGE OF ENGINEERING AND ARCHITECTURE

Functional Block Diagram


A graphical programming language referenced to the logic plans of electronic circuits. It
is a graphical combination of different function elements.

In FBD, binary (digital) logic operations as well as timer, counter and comparator functions
and program and module jumps can be displayed.

Source: Slideshare
Figure 4.7. Functional Block Diagram

Sequential Function Chart


A flowchart-type of programming language that is used to structure controls programs to
be processed sequentially in the form of cascaded sequence. It is mainly used for programming
sequence-orientated control systems. It makes the graphic programming of a complex task in
clear units possible. The control flow of these parts can be arranged gradually in sequential or
parallel processes. It is also known as sequence cascade programming.
Source: Slideshare

Figure 4.8. Sequential Function Chart

ELECTRONICS 3 V.1.0 BY: ART IAN G. BAUTISTA, ECE 69


UNIVERSITY OF NUEVA CACERES COLLEGE OF ENGINEERING AND ARCHITECTURE

V. Ladder Programming
The PLC Ladder Program is a planned set of instructions resembling a hardwired ladder diagram.
It is the only component that will be downloaded to a PLC. Figure 4.9 shows the components of a ladder
program.

Source: Ladder Logic World


Figure 4.9. Components of a Ladder Program

Vertically, the ladder program is divided into two parts – the left-half side is for the inputs and the
right-half side for the outputs. Other components are defined as follows:

 Rail – are the two vertical lines on each side. Those are also called as Power rails, representing
the supplied power (left) and the ground (right).

 Rung – are the horizontal lines where instructions are placed. It can simply be approximated as a
line connecting the supply and the ground to create a complete electrical loop.

 Branch – refers to the line where input 5 is placed in Figure 4.9. Used to create a parallel path
with a rung.

 Instructions – refers to the input and output symbols placed in a rung. Input instructions generally
represent logic switches or contacts. Output Instructions have a lot of options, it generally uses a
coil that represents any output device such as lamps and motors. It also has special logic
instructions that perform arithmetic and logic operations. Logic switches are also utilized in the
output as internal variable to perform subprocesses such as looping.

ELECTRONICS 3 V.1.0 BY: ART IAN G. BAUTISTA, ECE 70


UNIVERSITY OF NUEVA CACERES COLLEGE OF ENGINEERING AND ARCHITECTURE

Logical Continuity
The output device of a rung is energized if electric power can conceptually flow from the
left side of the rung to the right side. Input devices are conditions, and if it is satisfied, the rung
becomes true. Otherwise, inputs are assumed to block the flow of power. It is called logical
continuity, if the left power rail has a continuous path of true condition to the output instruction.

Source: SlidePlayer
Figure 4.9. Logic Continuity

The PLC scans the ladder program rung by rung from top-to-bottom and left-to-right. This
basic sequence is altered whenever a jump or subroutine instructions are executed.

Basic Ladder Logic Instructions


The following instructions are referenced to Allen-Bradley PLCs since it is the PLC that we
utilize in our laboratory. However, the only difference with other PLC brands are the names used to
identify an instruction, the concept is all the same.

 Examine if Closed (XIC)


 Represents a normally open (NO) contact, or in false condition by default. When XIC is
activated, its condition becomes true.
Source: LinkedIn

Figure 4.10. XIC Instruction

ELECTRONICS 3 V.1.0 BY: ART IAN G. BAUTISTA, ECE 71


UNIVERSITY OF NUEVA CACERES COLLEGE OF ENGINEERING AND ARCHITECTURE

 Examine if Open (XIO)


 Represents a normally closed (NC) contact, or in true condition by default. When XIO is
activated, its condition becomes false.

Source: LinkedIn
Figure 4.11. XIO Instruction

 Output Energize (OTE)


 Represents any output device like motor or lamp, it is generally
assumed as a coil. If the input conditions are true, OTE is activated.

(a)

Source: LinkedIn
 Output Latch (OTL)
 Similar to OTE, it represents any output device like motor or lamp.
However, this instruction is activated when the input conditions are
true, and remains activated even if the conditions becomes false.
(b)

Figure 4.12. (a) OTE, (b) OTL

Instruction Addressing
While creating a PLC program, specific names are used to identify the instructions, similar
to what is shown in preceding figures. These names function as the address of an instruction, and
most of it corresponds to each port of the PLC I/O terminals shown on Figure 4.5, and to an
internal variable. The Allen-Bradley PLCs uses the following format:

ELECTRONICS 3 V.1.0 BY: ART IAN G. BAUTISTA, ECE 72


UNIVERSITY OF NUEVA CACERES COLLEGE OF ENGINEERING AND ARCHITECTURE

 Instruction Type – identifies the type of instruction or internal variable used. The following table
are some of the codes used to name an instruction.

Table 4.1. Instruction Types

Instruction Code
Input I

Output O

Status S2

Binary B3

Timer T4

Internal Variables Counter C5

Control R6

Integer N7

Float F8

 Terminal Number – refers to a particular terminal of the PLC – input and output. A terminal
contains several ports or slots. Some PLC models particularly those used in larger systems have
many terminals. For the PLC shown in Figure 4.5, it has one input terminal and one output
terminal. Terminals are numbered starting from zero. Internal variables are assigned with a
specific terminal number.
o From the example given, ‘0’ refers to the first or only input terminal.

 Port Number – refers to a specific slot on the terminal. For the PLC shown in Figure 4.5, the input
terminal has 10 ports and the output terminal has 6 ports. Ports are numbered starting from zero.
o From the example given, ‘4’ refers to the fourth slot of terminal 0.

Basic Logic Functions

 AND Function – the output is ON only if both inputs are ON.

(a)

ELECTRONICS 3 V.1.0 BY: ART IAN G. BAUTISTA, ECE 73


UNIVERSITY OF NUEVA CACERES COLLEGE OF ENGINEERING AND ARCHITECTURE

 OR Function – the output is ON if any of the two inputs are ON.

(b)

 NAND Function – the output is ON if any of the two inputs are OFF.

(c)

 NOR Function – the output is ON only if both inputs are OFF.

(d)

 XOR Function – the output is ON if any of the two inputs is ON, but not both.

(e)

ELECTRONICS 3 V.1.0 BY: ART IAN G. BAUTISTA, ECE 74


UNIVERSITY OF NUEVA CACERES COLLEGE OF ENGINEERING AND ARCHITECTURE

 XNOR Function – the output is ON only if both of the two inputs are either OFF or ON.

(f)

 Set / Reset Latch using Momentary Switch – used for continuous loops.

Source: LinkedIn
(g)

Figure 4.13. Basic Logic Functions

VI. Timer Instruction


These are output instructions used to provide a timed sequence or time an interval. It can be used
to activate or deactivate a PLC output during definite periods of time. These timers are internal timers
which accuracy depends on the speed of the processor. Each timer instruction is associated with the
following parameters:

 Accumulated Value – refers to the current value of the timer that has been accumulated from
the moment it was energized.

 Preset Value – a value set by the programmer on the timer. When the accumulated value
equals the preset value, a status bit is set which can be used to control an output device.

 Time Base Value – an interval for which the timer is going to use. It can be set to 1s, 0,01s or
0.001s. The actual time can be determined by multiplying the preset value and the time base
value. It also dictates the speed of accumulated value.

 Timer Enable Bit (EN) – a status bit which is set when the input conditions to the left of the
timer instruction are true.

 Timer Done Bit (DN) – a status bit which is set when the accumulated value equals the preset
value. It is reset when the input conditions become false.

ELECTRONICS 3 V.1.0 BY: ART IAN G. BAUTISTA, ECE 75


UNIVERSITY OF NUEVA CACERES COLLEGE OF ENGINEERING AND ARCHITECTURE

 Timer Timing Bit (TT) – a status bit which is set only when the timer is timing. It is reset when
the timing is done.

There are three types of timer instruction: TON, TOF and RTU.

Timer On-Delay (TON) Instruction


A timer instruction which begins timing when the input conditions are true, and is reset
when it becomes false.

For the ladder program shown in Figure 4.14, the TON preset value is 7.

Source: LogixPro
Figure 4.14. TON Ladder Program

The operation is illustrated in Figure 4.15. When the input switch (I:1/0) is activated, the
rung condition becomes true and the TON instruction (T4:0) activates. Timer starts, EN bit is set
and activated with the input. The accumulated value also starts and when the preset value is
reached, the DN bit is set. In rung 1, the DN bit is addressed as T4:0/DN and used to control the
output (O:2/0). Every time DN bit is set, the output is activated.

Source: LinkedIn

Figure 4.15. TON Operation

ELECTRONICS 3 V.1.0 BY: ART IAN G. BAUTISTA, ECE 76


UNIVERSITY OF NUEVA CACERES COLLEGE OF ENGINEERING AND ARCHITECTURE

Timer Off-Delay (TOF) Instruction


A timer instruction which begins timing when the input conditions makes a true-to-false
transition. It continues timing as long as the input conditions remains false. The accumulated
value is reset when the timer ends or input conditions becomes true.

For the ladder program shown in Figure 4.16, the TOF preset value is 7.

Source: LogixPro
Figure 4.16. TOF Ladder Program

The operation is illustrated in Figure 4.17. While the input is true, the DN bit is set. When
the input switch (I:1/0) changes from true-to-false, the TOF instruction (T4:0) activates. Timer
starts, EN bit responds with input. The accumulated value also starts and when the preset value
is reached, the DN bit is reset. In rung 1, the DN bit is addressed as T4:0/DN and used to control
the output (O:2/0). Every time DN bit is set, the output is activated.

Source: LinkedIn

Figure 4.17. TOF Operation

ELECTRONICS 3 V.1.0 BY: ART IAN G. BAUTISTA, ECE 77


UNIVERSITY OF NUEVA CACERES COLLEGE OF ENGINEERING AND ARCHITECTURE

Retentive Timer (RTO) Instruction


A timer instruction which begins timing when the input conditions become true. The
accumulated value is retained even when the input conditions become false, however, it
continues the timing after the input conditions becomes true again.

For the ladder program shown in Figure 4.18, the RTO preset value is 7.

Source: LogixPro
Figure 4.18. RTO Ladder Program

The operation is illustrated in Figure 4.19. When the input switch (I:1/0) is activated, the
rung condition becomes true and the RTO instruction (T4:0) activates. Timer starts, EN bit is set
and activated with the input. The accumulated value also starts but stays on its current value
when the input conditions becomes false, then continue its timing when the condition becomes
true again. When the preset value is reached, the DN bit is set. In rung 1, the DN bit is addressed
as T4:0/DN and used to control the output (O:2/0). Every time DN bit is set, the output is activated.

Source: LinkedIn

Figure 4.19. RTO Operation

ELECTRONICS 3 V.1.0 BY: ART IAN G. BAUTISTA, ECE 78


UNIVERSITY OF NUEVA CACERES COLLEGE OF ENGINEERING AND ARCHITECTURE

VII. Counter Instruction


These are output instructions that count each false-to-true transition of input conditions. Each
counter instruction is associated with the following parameters:

 Accumulated Value – refers to the current value of the counter that increments by 1 every
false-to-true transition of inputs conditions. The initial value is zero.

 Preset Value – a value set by the programmer on the counter. When the accumulated value
is equal or greater than the preset value, a status bit is set which can be used to control an
output device.

 Counter Enable Bit (EN) – a status bit which is set when the input conditions become true,
and resets when becomes false.

 Counter Done Bit (DN) – a status bit which is set when the accumulated value is equal or
greater than the preset value. It is normally reset using a reset instruction.

 Overflow Bit (OV) – a status bit which is set when the maximum count is reached. Its value
varies with the PLC manufacturer. In Allen-Bradley PLCs, the overflow is reached when the
count is equal to 32,768.

There are two types of timer instruction: CTU and CTD.

Count-Up (CTU) Instruction


A counter instruction that starts from zero and increments its accumulated value for every
false-to-true transition of the input conditions.

For the ladder program shown in Figure 4.20, the CTU preset value is 10.

Source: LogixPro

Figure 4.20. CTU Ladder Program

ELECTRONICS 3 V.1.0 BY: ART IAN G. BAUTISTA, ECE 79


UNIVERSITY OF NUEVA CACERES COLLEGE OF ENGINEERING AND ARCHITECTURE

The operation is illustrated in Figure 4.21. When the input switch (I:1/0) is activated, the
rung condition becomes true and the CTU instruction (T4:0) activates. EN bit is set and is activated
with the input. The accumulated value increments by 1. When the input condition becomes false,
EN resets.

The similar process occurs when the input conditions become true again. When the preset
value is exceeded, the DN bit is set. In rung 1, the DN bit is addressed as T4:0/DN and used to
control the output (O:2/0). Every time DN bit is set, the output is activated. The accumulated value
continues to increment in every count unless reset by a reset instruction.

Source: LinkedIn
Figure 4.21. CTU Operation

Count-Down (CTD) Instruction


A counter instruction that starts from zero and decrements its accumulated value for
every false-to-true transition of the input conditions.

For the ladder program shown in Figure 4.22, the CTD preset value is −10.

Source: LogixPro

Figure 4.22. CTD Ladder Program

ELECTRONICS 3 V.1.0 BY: ART IAN G. BAUTISTA, ECE 80


UNIVERSITY OF NUEVA CACERES COLLEGE OF ENGINEERING AND ARCHITECTURE

The operation is illustrated in Figure 4.23. When the input switch (I:1/0) is activated, the
rung condition becomes true and the CTD instruction (T4:0) activates. EN bit is set and is activated
with the input. The accumulated value decrements by 1. When the input condition becomes false,
EN resets.

The similar process occurs when the input conditions become true again. Compare to
CTU, the done bit is initially set or activated, but when the preset value is exceeded, the DN bit is
reset. In rung 1, the DN bit is addressed as T4:0/DN and used to control the output (O:2/0). Every
time DN bit is set, the output is activated. The accumulated value continues to decrement in every
count unless reset by a reset instruction.

Source: LinkedIn
Figure 4.23. CTD Operation

Reset (RES) Instruction


An output instruction used to reset the timer, counter and sequencer instructions. The
following instruction parameters are reset:

 For Timer instructions:  For Counter instructions:


o Accumulated value o Accumulated value
o EN bit o EN bit
o DN bit o DN bit
o TT bit

Figure 4.24 shows a rung added to the program to reset a counter. It is done by naming
the reset instruction with the address of the instruction (C5:0). The switch I:1/1 is used to activate
the reset.
Source: LogixPro

Figure 4.24. Reset Instruction

ELECTRONICS 3 V.1.0 BY: ART IAN G. BAUTISTA, ECE 81


UNIVERSITY OF NUEVA CACERES COLLEGE OF ENGINEERING AND ARCHITECTURE

Example 4.1 – Sample Program


Write a ladder program that will continuously activate two outputs alternately every 2 s.

Set/Reset
Latch using
Momentary
Switch

Source: LogixPro
Figure 4.25. 2-second alternate sequence

Rung 0 is a set/reset latch using momentary switch. Input 1 (I:1/0) is used to start the sequence
while input 2 (I:1/1) is used to make the rung false, thus, stopping the sequence. The
internal variable (S:0/0) is placed both in the input and output to create a continuous
loop.

Rung 1 contains S:0/0 as input that activates the timer (T4:0) whose timing function (T4:0/TT) is
used to activate output 1 (O:2/0) in Rung 2.

Rung 3 contains the DN bit of T4:0 that activates the second timer (T4:1). The corresponding
timing function (T4:1/TT) is used to activate output 2 (O:2/1) in Rung 4.

The DN bit of T4:1 is placed in Rung 1 to create a loop and restart the sequence.

ELECTRONICS 3 V.1.0 BY: ART IAN G. BAUTISTA, ECE 82

You might also like