Me Elective 2-Mechatronics: Lecture 7 - Introduction To PLC

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 50

ME ELECTIVE 2-

MECHATRONICS
LECTURE 7 – INTRODUCTION
TO PLC
Contents
• Introduction
• What is a PLC?
• PLC Basics
• How Does a PLC work?
• PLC Wiring
• Physical Structure of PLC
o Rack or Chassis
o Power Supply Module
o CPU Module and Memory
o Input and Output Module
o Communication Interface Module
• I/O Assignment
• PLC Configuration
• Types of PLCs
o Compact PLC
o Modular PLC
• PLC Applications
PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
INTRODUCTION
A Programmable Controller (PC), sometimes called Programmable Logic
Controller (PLC) is a general purpose programmable controller whose
controlling function is effected through software. It is one of the more important
links in the chain of technologies required for total plant level automation

The programmable controller was developed by the manufacturers of industrial


controller at the request of engineer from General Motors Corporation to
replaced hard-wired relay controller used to control sequential machine-tool
operation and material handling equipment.

The growth of the application for programmable controllers has been slow but
steady since they were introduced into the automobile manufacturing industry
originally but recent application perform a number of different record keeping
activities, such as Monitoring the number of parts produced, the number of parts
rejected, and the downtime for particular machine for each shift.

PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
What is a PLC
A Programmable Logic Controller (PLC, is a devices which uses a computer to turn out
devices, such motors, Lights, buzzer and relays “on” and “off” in respond to the input
devices such as switches and sensor.

A PLC is specially designed to operate reliably under harsh industrial environments – such
as extreme temperatures, wet, dry, and/or dusty conditions. PLCs are used to automate
industrial processes such as a manufacturing plant’s assembly line, an ore processing
plant, or a wastewater treatment plant.

PLCs share many features of the personal computer you have at home. They both have a
power supply, a CPU (Central Processing Unit), inputs and outputs (I/O), memory, and
operating software (although it’s a different operating software).

The biggest differences are that a PLC can perform discrete and continuous functions that
a PC cannot do, and a PLC is much better suited to rough industrial environments. A PLC
can be thought of as a ‘ruggedized’ digital computer that manages the electromechanical
processes of an industrial environment.

PLCs play a crucial role in the field of automation, using forming part of a larger SCADA
system. A PLC can be programmed according to the operational requirement of the
process. In the manufacturing industry, there will be a need for reprogramming due to the
change in the nature of production. To overcome this difficulty, PLC-based control systems
were introduced. We’ll first discuss PLC basics before looking at various applications of
PLCs.

PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
PLC Basics
PLCs were invented by Dick Morley in 1964. Since then PLC has revolutionized the
industrial and manufacturing sectors. There is a wide range of PLC functions like
timing, counting, calculating, comparing, and processing various analog signals.

The main advantage of PLC over a “hard-wired” control system is that you can go
back and change a PLC after you’ve programmed it, at little cost (just the cost of
the programmer’s time). In a hard-wired control system, you’re essentially having to
rip out wires and start from scratch (which is more expensive and takes longer).
Let’s look at an example to better understand this advantage.

Imagine you have a light connected to a switch. In general, the light operates under
two conditions – ON and OFF. Now you are given a task that when you turn ON the
switch, the light should glow only after 30 seconds. With this hard-wired setup –
we’re stuck. The only way to achieve this is to completely rewire our circuit to add a
timing relay. That’s a lot of hassle for a minor change.

PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
This is where a programmable logic controller comes into the picture,
which doesn’t require any additional wiring and hardware to make sure
of a change. Rather it requires a simple change in code, programming the
PLC to only turn on the light 30 seconds after the switch is turned ON.
So, by using a PLC, it is easy to incorporate multiple inputs and outputs.

This is just a simple example – a PLC has the ability to control much
larger and more complex processes. A PLC can be customized depending
on the application and needs of the user

PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
How Does a PLC work?
The working of a programmable logic controller can be easily understood as a cyclic
scanning method known a the scan cycle.

The Basics of PLC Operation


The operation of a PLC is very simple. The processor makes decisions based on a
ladder logic program written by the user. In order to use the program properly, the
PLC must communicate with the various field devices it is tasked with monitoring
and controlling. It then compares the actual conditions of the field devices with what
the program instructs them to do, and updates the output devices accordingly.

Operational Sequence
The operational sequence is as follows:
1. Input switch is pressed.
2. Input module places a “1” in the input data table,
3. The ladder logic program sees the “1” and caused a “1” to be put into the output data table.
4. The output data table causes the output module to energize associated point.
5. The output device energizes

PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
Figure 1: PLC Scan Cycle

PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
The Scan Cycle
PLCs operate by continually scanning programs and repeat this process many
times per second. When a PLC starts, it runs checks on the hardware and
software for faults, also called a self-test. If there are no problems, then the PLC
will start the scan cycle. The scan cycle consists of three steps: input scan,
executing program(s), and output scan.
Input Scan: A simple way of looking at this is the PLC takes a snapshot of the
inputs and solves the logic. The PLC looks at each input card to determine if it is
ON or OFF and saves this information in a data table for use in the next step. This
makes the process faster and avoids cases where an input changes from the start
to the end of the program.
Execute Program (or Logic Execution): The PLC executes a program one
instruction at a time using only the memory copy of the inputs the ladder logic
program. For example, the program has the first input as ON. Since the PLC
knows which inputs are ON/OFF from the previous step, it will be able to decide
whether the first output should be turned ON.
Output Scan: When the ladder scan completes, the outputs are updated using
the temporary values in memory. The PLC updates the status of the outputs
based on which inputs were ON during the first step and the results of executing a
program during the second step. The PLC now restarts the process by starting a
self-check for faults.

PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
Logic Scan
Ladder logic programs are modeled after relay logic. In relay logic, each
element in the ladder will switch as quickly as possible. Program elements
can only be examined one at a time in a fixed sequence. The ladder logic
scan begins at the top rung. At the end of the rung, it interprets the top
output first, and then the output branched below it. On the second rung, it
solves branches, before moving along the ladder logic rung.

PLC Logic Scan PREPARED BY:


ENG’R. CHRISTOPHER GUTIERREZ
PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
LOGIC CIRCUIT ANALYSIS AND DEVELOPMENT
A logic circuit is a circuit that executes a processing or controlling function in
a computer. This circuit implements logical operations on information to
process it.

Logic circuits utilize two values for a given physical quantity (voltage, for
example) to denote the Boolean values true and false or 1 and 0 respectively.
Logic circuits have inputs, as well as having outputs which can be dependent
on the inputs. In logic circuit diagrams, connection from one circuit’s output
to another circuit’s input is displayed as an arrowhead at the input end.

When it comes to performance, logic circuits are similar to programming


language functions. The inputs are similar to function parameters while the
outputs are similar to function returned values. A logic circuit can
accommodate multiple outputs.

PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
REVIEW OF SERIES AND PARALLEL CIRCUIT
When the Positive side is connected to negative Side of the power supply, as shown in the
figure, a complete electrical Circuit are created. However this type of circuit is “ No useful
purpose.

To construct a useful circuit, an output must be added. An Output device is any device which
converts electrical energy into another form.

Often the load is placed in the circuit between the positive and negative of the power supply.
The below example the load is a bulb, when the circuit is complete, the current is forced
through the filament of the bulb thus the current heat up the filament and emit light.

The wire has to be connected to be disconnected to turn off the light and then reconnected
to turn it back on. To make the operation simpler. A control or input device can be inserted.
The control device will be used to turn circuit power on and off.
The most basic form of the control device is the switch. Other control devices include
sensors, Timers, and Counters, which are special types of switches.

FIGURE 3-3

Two State of Switch Two switch construction types


1. Open 1. Normally Open
2. Closed 2. Normally closed
Two Types of circuit
Series Circuit – All the Component fall in a line (in Series), one after the other. If one of
the component in the series goes bad and stops operating, the current stops flowing. The
whole circuit is “dead”.

Parallel Circuit – This type of circuit contains more than one path for the current to
flow. If one of the component fails, the others can still operate.
Control devices as well as output devices can be wire in parallel, the three switches in
below figure are wire in parallel. Closing ant of the 3 switches will complete the circuit
and turn the light “on”.
BOOLEAN ALGEBRA
Boolean algebra
provides a mathematical model for a logical decision. A logical decision is a decision which
can have only one of the two possible outcome, YES or NO. other equivalent outcomes
are TRUE or NOT TRUE, and FALSE or NOT TRUE. The Boolean Model uses “1” to
represent “YES” and “0” to represent “NO”. Equivalent YES or NO is are given in the
table below

In Electrical
= Power “ON”

= Power “OFF”

Boolean Symbol
For a more simple statement of the example above and problem like it, Boolean Algebra
uses several symbols. These symbols are applied to letters which are used to represent
the condition, or variable, in a logical Problem. The symbols allow the verbal explanation
of the probable to be replaced by mathematical equation. The “truth table shows the
relationship among a given variables.
Inversed Operation – NOT Function
The logical Inverse operation (NOT) function, changes a logical TRUE (1) to a FLASE (0)
or reverse. The symbol for the inverse operation is a horizontal line above the letter
representing the variable

Thus, if A is the variable, Ã is its inverse and is read “A-NOT” or “A-INVERSE”. The truth
table for A-INVERSE is given below

A Ã
0 1 If A is 0, Then à is 1

1 0 If A is 1 Then, Ã is 0
Logical AND Operation – AND Function
The AND function requires that any two condition or variables connected by AND must both
be True for the decision to be True. The example of clock reading 5:00 used AND function.

And symbolized by the DOT between the symbols for the variable. So if A and B are two
variables, when a is ANDed to B, it is represented “A . B”. Table below is the truth tabke of “A .
B”.
A B A.B
0 0 0
0 1 0
1 0 0
1 1 1

Switches in an electrical circuit can be placed in an AND relationship, as shown in figure below.
For the light to be turned on, both switches must be closed. Any other conditions results in no
flow of electric current, so the light remains off.
Logical OR Operation – OR Function
With the “OR” function, it is sufficient that any one condition be TRUE for the logical decision
to be TRUE.The OR function is symbolized by a plus sign (+) place between the variables, so
condition A OR B looks like A + B. The OR truth table are shown below.

A B A.B
0 0 0
0 1 1
1 0 1
1 1 1

The OR function can be used in the construction of electrical circuit, as shown in the figure
below. In these circuit, it is sufficient for the switch to be closed for the light to come on.
AND, OR and NOT Function
Function can be combined in a variety of ways to reach logical decision.

Example 1
In an example concerning the weather, if it is snowing AND NOT windy, OR if it
is sunny, it is reasonable to go outdoors. In Boolean form

If A = snowing
B = Wind
C = sun
D = go outdoors

Then (A . B ) + C = D
Example 2
Figure below offers second example, using “AND” and “OR” in an electrical circuit.

A B C (A . B) + C

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 1

1 0 0 0

1 0 1 1
1 1 0 1

1 1 1 1

Switches A and B are ANDed together and then ORed with switch C. The Boolean equation for
this circuit is
(A . B) + C = D
Where D represent the light. The equation says that if switches A AND B are Closed, OR if
switch C is Closed, The light D will come on. The truth table is given with the illustration in the
figure above.
Note: that the parentheses around A.B require you to take these variable together A and B are
both closed. The equation
A . (B + C) = D
Then Means that when A is Closed AND either switch B OR C is Closed, Light D will come on.
If your were to draw the electrical circuit, it would be quite different from the figure above. Its
truth table would also be different.
TWO TYPES OF LOGIC CIRCUITRY
Combinational circuitry – operates like a simple function. The output is based on the
present values of the input.
• Combinational circuitry is theoretically built from basic logic gates, which are AND
gates, OR gates, XOR gates, and inverters. The outputs of gates in combinational
circuitry is never sent directly back to earlier inputs.
• An AND gate can conceivably have any number of inputs. Its output is true when all of
its inputs are true.
• An AND gate is frequently used to control a signal – that is, to turn it on or off,
depending on the value of control signals.
• An OR gate can conceivably have any number of inputs. Its output is true when any
one of its inputs is true.
• An XOR gate has two inputs. Its output is true when only of its inputs are true. It will
return false otherwise.
• An XOR gate is sometimes used to control a signal – that is, either to invert it or not,
depending on the value of a control signal.

PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
State circuitry (Sequential Circuit)– this kind of gate performs like an object method. The
output is not only based on the input. It is also based on the historical inputs. This is made
possible by the memory embedded in the circuitry.
• This is similar to an object method with values depending on the object’s state, or
depending on its instance variables.
• State circuitry contains anything that can recollect bits of information, including
memory, registers, and program counters.
• The basic element of state circuitry is a flip-flop. A flip-flop stores one bit of
data. Multiple flip-flops can be combined to form a multi-bit state element called a
register. Multiple registers can be combined into a register bank.

These two types of logic circuitry work hand in hand to form a processor datapath.

Processor Datapath
A processor’s datapath is conceptually organized into two parts:
• Combinational logic determines the state of the processor for the next clock cycle. The
ALU is combinational logic.
State elements hold information about the state of the processor during the current clock
cycle. All registers are state elements.

PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
PLC CIRCUITRY/ WIRING
PLC INTERNAL CIRCUITRY

PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
PLC EXTERNAL WIRING

PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
(Transistor Type)

(Transistor Type)

PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
PLC Wiring Summary
Sink and Source are terms used to define the flow of direct current in an electric
circuit.
• In sinking input or output wiring the device receiving the signal does not
provide power. It acts as a resistive load it must be connected to device
that sources it output signal, or sinking output with a loop power supply.
This circuit provides a path to ground for the electric load.
• In sourcing input or output wiring, the Device receiving the signal provide
power for the input signal. It must be connected to sinking output. Such
as 2 wire transmitter which uses the power from the receiving device. This
circuit provides the voltage source for the electric load.

Logic is defined by the type of components in the circuit.


• A sourcing input or output circuit requires a PNP transistor.
• A sinking input or output circuit requires an NPN transistor.

A simple electronic circuit consists of one digital input connected to a digital


output. To power the circuit, a voltage source, a ground, and a load is necessary.
• A sourcing input or output circuit provides the necessary voltage for the
circuit.
• A sinking input or output circuit provides the necessary ground for the
circuit.
• The digital I/O provides the electrical load required for the circuit to work.
PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
Physical Structure of PLC

Programmable Logic Controllers continuously monitors the input values


from various input sensing devices (e.g. accelerometer, weight scale,
hardwired signals, etc.) and produces corresponding output depending on
the nature of production and industry. A typical block diagram of PLC
consists of five parts namely:

• Rack or chassis
• Power Supply Module
• Central Processing Unit (CPU)
• Input & Output Module
• Communication Interface Module
PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
Rack or Chassis
In all PLC systems, the PLC rack or chassis forms the most important module and acts
as a backbone to the system. PLCs are available in different shapes and sizes. When
more complex control systems are involved, it requires larger PLC racks.

Small-sized PLC is equipped with a fixed I/O pin configuration. So, they have gone for
modular type rack PLC, which accepts different types of I/O modules with sliding and
fit in concept. All I/O modules will be residing inside this rack/chassis

PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
Power Supply Module
This module is used to provide the required power to the whole PLC
system. It converts the available AC power to DC power which is
required by the CPU and I/O module. PLC generally works on a 24V DC
supply. Few PLC uses an isolated power supply.

CPU Module and Memory


CPU module has a central processor, ROM & RAM memory. ROM
memory includes an operating system, drivers, and application
programs. RAM memory is used to store programs and data. CPU is the
brain of PLC with an octal or hexagonal microprocessor.

Being a microprocessor-based CPU, it replaces timers, relays, and


counters. Two types of processors as a single bit or word processor can be
incorporated with a PLC. One bit processor is used to perform logic
functions. Whereas word processors are used for processing text,
numerical data, controlling, and recording data.

CPU reads the input data from sensors, processes it, and finally sends the
command to controlling devices. DC power source, as mentioned in the
previous discussion is required voltage signals. CPU also contains other
electrical parts to connect cables used by other units. PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
Input and Output Module
Have you ever thought about how to sense physical parameters like temperature,
pressure, flow, etc? using PLC? Of course, PLC has an exclusive module for
interfacing inputs and output, which is called an input & output module.

Input devices can be either start and stop pushbuttons, switches, etc and output
devices can be an electric heater, valves, relays, etc. I/O module helps to interface
input and output devices with a microprocessor. The input module of PLC is
explained in the below figure.

PLC Input Module


PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
Circuit Diagram of PLC Input Module
The input module of PLC does four main functions.
Input module interface receives the signal from process devices at 220 V AC
Converts the input signal to 5 V DC that can be used by PLC
Isolator block is used to isolate/prevent PLC from undergoing fluctuation
After which the signal is sent to the output end i.e the PLC

There are two main sections in the input module namely the power section and the
logical section. Both sections are electrically isolated from each other. Initially push
button is closed. So, 220 V AC supply is given to the bridge circuit through the
resistors R1 and R2.
A bridge rectifier (such as a diode bridge rectifier) is used to convert the AC signal into
DC and Zener diode is used to provide a low voltage supply to LED. When the light
from LED falls on the phototransistor, it works in the conduction region. Finally, a 5V
DC supply is given to the processor. PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
The output module of PLC works similarly to the input module but in the
reverse process. It interfaces the output load and processor. So here the first
section would be logic session and the power section comes next. The
working of the output module is shown in the below figure

PLC Output Module

So, here when the program logic high signal is generated from the
processor, LED will turn ON and allow the light to fall on a
phototransistor. When the transistor goes to the conduction region, it
generates a pulse to the gate of the Triac. The isolator block is used to
isolate the logic section and control section.
PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
Communication Interface Module
To transfer information between CPU and communication networks,
intelligent I/O modules are used. These communication modules help to
connect with other PLCs and computers which are placed at a remote
location.

Special Function Modules


• Analog Input Modules
• Analog Module Output
• Temperature Control Modules With PID Algorithm (proportional–
integral–derivative controller)
• HIGH – Speed Counter Moduke
• Positioning Module
• Serial Communication Module
• Intelligent Communication Module
• ETHERNET Interface Module
• Master/ Local Module for CC-Link
• PROFIBUS-DP Interface Module
• DeviceNet Module
• Etc.

PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
I/O ASSIGNMENT
Before a Program Can be sent to the PLC CPU, an Assignment list of the Input and Output
Module configuration should be built. This is required in order that the CPU knows the
correct combination of Module in the Rack(s) so that it can be interface with each module
in the correct manner.

PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
PLC HARDWARE CONFIGURATION
The term "configuring" refers to the arranging of racks, modules, distributed I/O (DP)
racks, and interface submodules in a station window. Racks are represented by a
configuration table that permits a specific number of modules to be inserted, just like a
real rack.

This Section deals with the design concept and configuration defending to the Brand, Type
and series of the PLC

Specifying a PLC System


Here are some consideration that should be taken into account when configuring a
system:

External Devices, Input and Output


• Input/ Output requirement
• System Signal Voltage: 24VDC, 110/ 240VAC
• If 24VDC Inputs then: NPN (sink) or PNP (source) Devices
• Output configuration : Transistor (Sink/ Source), Triac, Relay or Volt Free Relay
Contact

Power Supply Requirement


• Supply Voltage: 24VDC, 110/ 240VAC

Intelligent Modules
• Number of Modules in the System
• External Power Supply Requirement PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
Types of PLCs
The two main types of PLC are fixed / compact PLC and modular PLC.

Compact PLC
Within a single case, there would be many modules. It has a fixed number
of I/O modules and external I/O cards. So, it does not have the capability
to expand the modules. Every input and output would be decided by the
manufacturer
Modular PLC
This type of PLC permits multiple expansion through “modules”, hence
referred to as Modular PLC. I/O components can be increased. It is easier
to use because each component is independent of each other.

PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
Types of PLCs
(based on Output)
PLC are divided into three types based on output namely Relay output,
Transistor output, and Triac Output PLC. The relay output type is best
suited for both AC and DC output devices. Transistor output type PLC
uses switching operations and used inside microprocessors.

According to the physical size, a PLC is divided into Mini, Micro, and
Nano PLC.

Some of the manufacturers of PLCs include:

• Allen Bradley
• ABB
• Siemens
• Mitsubishi PLC
• Hitachi PLC
• Delta PLC
• General Electric (GE) PLC
• Honeywell PLC
PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
PLC Applications
PLCs have a variety of applications and uses, including:

• Process Automation Plants (e.g. mining, oil &gas)


• Glass Industry
• Paper Industry
• Cement Manufacturing
• In boilers – Thermal Power Plants
• Manufacturing Processes

PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ
END

PREPARED BY:
ENG’R. CHRISTOPHER GUTIERREZ

You might also like