Você está na página 1de 167

Instructor : NASRUL BIN SALIM PAKHERI

E-Mail : NASRUL@ump.edu.my
Tel: 019-9012035
Room no:E10-C14
1. PLC Introduction
 What does PLC stand for?

PLC – Programmable Logic Controller

PLC implements Logic Control Functions by means of a


program
1. PLC Introduction
A collection of electronic devices
& equipments

To assure :
1.Stability
2. Accuracy
3. Smooth transition
1. PLC Introduction
 Feature

 Completely come with power supply and basic


Input/Output modules.
1. PLC Introduction
 An application examples 1 : Gate Control

 PLC can sense a vehicles at the entrance or exit, and


open and close the gate automatically.
 The current vehicles count is easily determinedby
programming a simple counter.
1. PLC Introduction
 An application examples 2 : Conveyor system

 PLC can be used to Start/Stop latching logic for motor


control.
 Counters can be used for monitoring product amount.
1. PLC introduction
 Comparing traditional and programmable control
system
Conventional Programmable
Controlled panel Controlled panel
controller controller

Traditional control system-the Programmable control system-the


behavior depend mainly on the behavior depend mainly on the
wiring arrangement instruction stored in the memory

It much simpler to change program than wiring


1. Introduction
 How does PLC differ from a computer ?
 A computer optimize d for calculation and display task
 A computer is programmed by a specialist
 A PLC is designed for (logic) control and regulation
tasks
 A PLC is programmed by a non- specialist
 A PLC is well adapted to industrial environment
What is a Programmable Controller
 In an automated system, the PLC is commonly
regarded as the heart of the control system.
 The PLC may used to control a simple and repetitive
task.
 Or a few of them may be interconnected together with
other controller or host computer through a sort of
communication network, in order to integrate the
control in a complex process.
What is a Programmable Controller
cont…
 A PLC consist of a Central Processing Unit(CPU)
containing an application program and input and
output interface module, which is directly connected
to I/O devices.
 The program control a PLC so that when an input
signal from an input device turns ON, the appropriate
response is made.
 The response normally involve turning ON an output
signal to some sort of output devices.
What is a Programmable Controller
cont…
What is a Programmable Controller
cont…
 Central Processing Unit (CPU)
The CPU is a microprocessor that co-ordinates the
activities of the PLC system. It executes the program,
process I/O signals and communicates with external
devices.
 Memory
There are various types of memory units. It is the area
that holds the operating system and user memory.
The operating system is actually software that co-
ordinates the PLC.
What is a Programmable Controller
cont…
Ladder program, Timer and Counter Values are stored
in the user memory.
Various type of memory:
1. Read Only Memory ( ROM)
ROM is a non-volatile memory that can be
programmed only once. It is therefore unsuitable. It
is least popular as compared with others memory
type.
What is a Programmable Controller
cont…
2. Random Access Memory (RAM)
RAM is commonly used memory type for storing the
user program and data. The data in the volatile RAM
would be lost if the power source is removed. However,
backing up the RAM with battery solves the problem.
What is a Programmable Controller
cont…
3. Erasable Programmable Read Only Memory(EPROM)
EPROM hold data permanently just like ROM. It does
not require battery back up. However, exposing it to
ultraviolet light can erase its content. A PROM writer
is required to reprogram the memory.
What is a Programmable Controller
cont…
4. Electrically Erasable Programming Read Only
Memory ( EEPROM)
EEPROM combines the access flexibility of RAM and
the the non-volatilility of ROM in one. Its contents can
be erased and reprogrammed electrically, however, to a
limit number of times.
What is a Programmable Controller
cont…
 Input devices
Intelligence of an automated system is greatly
depending on the ability of a PLC to read in the signal
from various of types of automatic sensing and manual
input field devices.
 Manual input
Basic man-machine interface are Push button, keypad,
barcode reader, toggle switch.
What is a Programmable Controller
cont…
 Automatic sensing devices
Detection of work piece, monitoring of moving
mechanism, checking on the pressure, and detect
liquid level PLC need to tap signal from devices like
proximity switch, limit switch, photo electric sensor ,
level sensor or etc.
What is a Programmable Controller
cont…
What is a Programmable Controller
cont…
 Output devices
Some of commonly controlled devices are motors,
solenoids, relays indicators, buzzers, pilot lamp,
alarms and etc.
Through activation of motor and solenoids the PLC
can control from a simple pick and place system to
much complex servo positioning system.
However, devices like pilot run, buzzers and alarms are
for notifying purpose.
What is a Programmable Controller
cont…
PLC Operation(Scan time)
 The process of reading the inputs, executing the
program and updating the outputs is knows as scan.
 The scan time is normally a continuous and
sequentially process of reading the status of inputs,
evaluating the control logic and updating outputs.
 Scan time specification indicates how fast the
controller can react to the field inputs and correctly
solve the control logic.
PLC Operation(Scan time) cont…
PLC Operation(Scan time) cont…
1. CHECK INPUT STATUS
 First the PLC takes a look at each input to determine if it is on
or off. In other words, is the sensor connected to the first
input on? How about the second input? How about the
third... It records this data into its memory to be us

2. EXECUTE PROGRAM
 Next the PLC executes your program one instruction at a
time. Maybe your program said that if the first input was on
then it should turn on the first output. Since it already knows
which inputs are on/off from the previous step it will be able
to decide whether the first output should be turned on based
on the state of the first input. It will store the execution
results for use later during the next step.

©snaim 2008
PLC Operation(Scan time)
3. UPDATE OUTPUT STATUS
 Finally the PLC updates the status of the outputs. It
updates the outputs based on which inputs were on
during the first step and the results of executing your
program during the second step. Based on the example
in step 2 it would now turn on the first output because
the first input was on and your program said to turn on
the first output when this condition is true.

Check i/p Status Execute Program Update o/p Status

©snaim 2008
Factors influencing Scan Time
 The time required to make a single scan varies from 0.1
ms up to 10 ms depending on its CPU processing speed
and the length of the user program.
 The user of remote I/O subsystem increase the scan
time as a results of having to transmit the I/O update
the remote subsystem.
 Monitoring of the control program also adds overhead
time to the scan, as the controller’s CPU has to send
the status of coils and contact to the CRT or other
monitoring devices.
Conventional Control Panel and its
difficulties
 Beginning of industrial revolution, in 1960 & 1970
automated machines were controlled by
electromechanical relays.
 Relays were all hardwired together inside control
panel.
 Conventional relay control panel is very inflexible.
Conventional Control Panel and its
difficulties cont..
Disadvantage of Conventional
Control Panel
 There is to much wiring work in the panel.
 Modification can be quite difficult.
 Troubleshooting can be quite troublesome as you may
require a skillful person.
 Power consumption can be quite high as the coil
consumer power.
 Machine downtime is usually long when problem
occur, as it take long time to trouble shooting.
 Difficult to do modification and maintenance.
PLC Control Panel and Advantages
PLC Control Panel and Advantages
cont..
 The wiring of the system usually reduces by 80%.
 Power consumption greatly reduced as PLC consume
much less power.
 The PLC self-diagnostic function enable easy and fast
troubleshooting of the system.
 Modification of the control sequence or application
can easily be done by programming through the
console or computer software without changing of I/O
wiring.
PLC Control Panel and Advantages
cont..
 In PLC system, spare parts for relays and hardware
timers are greatly reduced as compared to
conventional control panel.
 The machine cycle time is improve due to the speed of
PLC operation is in millisecond.
 It cost much less compared to conventional system in
situation when the number of I/Os is very large and
control function are complex.
 The reliability is high an easily maintenance.
WireITEM
Logic Vs PLCLOGIC
WIRED PLC
Controlled Device Specific Purpose General Purpose
(Hardware)
Control Scale Small and Medium Medium and large

Change or addition to Difficult Easy


specification
Delivery period Several Days Almost immediate

Maintenance (by makers Difficult Easy


and users)
Reliability Depends on design and Very High
manufacture
Economic Efficiency Advantage on small Advantage on small
scale operation medium and large scale
operation
©snaim 2008
What PLC
CONTROL Can Do?FUNCTIONS
TYPE
Sequences Control •Conventional Relay Control Logic Replacer
/P.C.B Card Controller Replacer
•Timers/Counters
•Auto/Semi-auto/Manual Control of machine
and Processes
Sophisticated Control / •Arithmetic Operation
Regulatory Control •Information handling
•Analog Control (Temperature, Pressure)
•P.I.D (Proportional-Integral-Derivation)
•Servo Motor and Stepper Motor
Supervisory Control •Process Monitoring and Alarm
•Fault Diagnostic and Monitoring
•Interfacing with Computer -Printer/ASCII
•Factory Automation
•Local Area Network / Wide Area Network
©snaim 2008
PLCs’ manufacturer
OMRON
Allen Bradley
Schneider (Modicon,
Telemecanique, Square D)
GE Fanuc
Siemens
Automation Direct (Koyo)
Toshiba
Mitsubishi
Hitachi
Keyence
Honeywell
Festo
Yokogawa
Eberle
Emerson
Texas Instruments

©snaim 2008
PLC Application
 There are many application :
1. Material Handling
2. Conveyor system
3. Packaging Machine
4. Pump Control
5. Water Treatment
6. Chemical Processing Plant
7. Printing Industries
8. Traffic Light system
9. Etc…
A relay
 An electrical operated switch.
 Many relays use electromagnet to operate a switching
mechanism .
A relay cont…
2.0 PLC Hardware Design

OMRONCQM1H SERIES

©snaim 2008
PLC Configuration

Rack Mini

Micro

©snaim 2008
Shoe Box
PLC Configuration
The configuration of PLC refers to the packaging of the components.

Typical configurations are listed below from largest to smallest.


 Rack Type : A rack can often be as large as 18” by 30” by 10”
 Mini: These are similar in function to PLC racks, but about the half size.
Dedicated Backplanes can be used to support the cards OR DIN rail
mountable with incorporated I/O bus in module.
 Shoebox: A compact, all-in-one unit that has limited expansion
capabilities. Lower cost and compactness make these ideal for small
applications. DIN rail mountable.
 Micro: These units can be as small as a deck of cards. They tend to have
fixed quantities of I/O and limited abilities, but costs will be lowest. DIN
rail mountable.

©snaim 2008
Sizing of PLC

Micro PLC: I/O up to 32 points


Small PLC: I/O up to 128 points
Medium PLC: I/O up to 1024 points
Large PLC: I/O up to 4096 points
Very Large: I/O up to 8192 points

©snaim 2008
Basic PLC Schema

CPU
Power Supply
Memory
Input Blocks
Output Blocks
Communications
Expansion
Connections

©snaim 2008
Introduction to OMRON PLC

 Features
 Application
CQM1H Features
CQM1H Features cont…
CQM1H Features cont…
What CQM1H can do?
What CQM1H can do? Cont..
What CQM1H can do? Cont..
What CQM1H can do? Cont..
What CQM1H can do? Cont..
What CQM1H can do? Cont..
PLC hardware
component OMRON CQM1H PLC
design
2.1.1 Power supply
unit

2.1.2 CPU- memory

2.1.3 Input and


output units
CQM1H CPU51
Power
Supply CPU Input Output
Unit unit Module module

PA206 CQM1H-CPU51 0 CH OC 221

INNER INNER
BOARD BOARD
SLOT 1 SLOT 2

RS-232
PORT
CPU units
Power supply units
Memory cassette (optional)
Inner Boards
Input Units
Output Units
I/O Expansion units and Dedicated Units
CPU Unit Overview
Basic Specification & Maximum Units
Power Supply Units

 Power Supply Units


I/O expansion units
I/O expansion units cont..
CPU Unit description

1
CPU Unit description cont..

2
Memory I/O allocation
Memory I/O allocation cont…
I/O Specification
I/O Specification cont…
I/O Specification cont…
I/O Specification cont…
I/O Specification cont…
I/O Specification cont…
Basic PLC Progrmming
Outline

 Introduction to Programming Software


 Ladder Diagram
 Basic Logic Functions
 Mnuemonic Code
 CX-Programmer
Flowchart
Ladder Diagram
 Primary programming language for PLCs.
 Other programming methods include:
 Function block diagrams (FBDs)
 Structured text (ST)
 Instruction List (IL)
 Sequential function charts (SFCs)
 Visual and Graphical language unlike textual high-level,
such as C, C++, Java…
 Derived form relay logic diagrams
 Primitive Logic Operations
 OR
 AND
 NOT
Ladder Diagram
Ladder Diagram
Terminologies
 Power Rails - Pair of vertical lines
 Rungs - Horizontal lines
 Contacts A, B, C, D… arranged on
rungs
 Note in PLC Ladder Logic: Rungs
 No Real Power Flow (like in
relay ladder)
 There must be continuous
path through the contacts to
energize the output

Power Rails
Ladder Diagram
Binary Input Devices

Device One/Zero Interpretation


Limit switch Contact/no contact

Photodetector Contact/no contact

Pushbutton switch On/off

Timer On/off

Control relay Contact/no contact

Circuit breaker Contact/no contact


Ladder Diagram
Binary Output Devices

Device One/Zero Interpretation


Motor On/off
Alarm buzzer On/off
Lights On/off
Control relay Contact/no contact
Valves Closed/open
Clutch Engaged/not engaged
Solenoid Energised/not energised
Anatomy of Ladder Diagram

o
Anatomy of Ladder Diagram
 Input instructions are entered on the left
 Output instructions are entered on the right
 The power rails simulate the power supply lines
 L1 and L2 for AC circuits and +24V and
ground for DC circuits
 Most PLCs allow more than one output per rung
 The processor (or “controller”) scans ladder
rungs from top-to-bottom and from left-to-right.
 The basic sequence is altered whenever
jump or subroutine instructions are
executed.
Basic Ladder Logic Symbols
Logic Functions

 PLC programming is a logical procedure


 In a PLC program, “things” (inputs and rungs) are
either TRUE or FALSE
 If the proper input conditions are TRUE:
 The rung becomes TRUE and an output action
occurs (for example, a motor turns on)
 If the proper input conditions are not TRUE:
 The rung becomes FALSE and an output action
does not occur
Logic Functions
 AND
Logic Functions
 OR
Logic Functions
 NOT
Relay to Ladder Diagram
Relay to Ladder Diagram
Mneumonic Codes

 These instructions can be derived directly from the ladder


logic diagrams and entered into the PLC through a simple
programming terminal.
 Ladder logic diagrams can be read by the programming
console
 For this reason, ladder diagrams need to be converted into
mnuemonic codes that provides same information as ladder
diagrams and to be typed directly using programming
console.
Examples of Mneumonic Codes

 LOAD and LOAD Not


Examples of Mneumonic Codes

 AND and AND Not


Examples of Mneumonic Codes

 OR and OR Not
Examples of Mneumonic Codes

 Combine AND and OR


Examples of Mneumonic Codes

 OUTPUT and OUTPUT Not


Examples of Mneumonic Codes

 Write the mnuemonic code for the following


ladder diagram
Entering the Ladder Diagram:
CX Programmer
 CX-Programmer, the programming software for all Omron's PLC series,
is fully integrated into the CX-One software suite.

 CX-Programmer includes a wide variety of features to speed up the


development of your PLC program. New parameter-setting dialogues
reduce setup time, and with standard function blocks in IEC 61131-3
structured text or conventional ladder language, CX-Programmer makes
development of PLC programs a simple drag & drop configuration.
CX Programmer

©snaim 2008
CX Programmer: Overview
CX Programmer: Overview
CX Programmer: Input/Output
Opening New File
Configure PLC Devices
CX Programmer: Programming
PLC Mode
Exercise

 Draw process flowchart for


a given system
 Create the ladder diagran in
CX Programmer
Program Error Check (Compile)
Program Error Check (Compile)
Program Error Check (Compile)
Going Online
Going Online
Basic PLC & CX Programmer

Nasrul Salim Pakheri


Teaching Engineer
FKEE, University Malaysia Pahang
Contact : nasrul@ump.edu.my
Timer

 A timer is activated when its execution condition goes ON


and is reset (to S) when the execution condition goes OFF.
 Once activated, TIM measures in units of 0.1 second from
the S.

©nikmzakmal 2010
Timer

 If the execution condition remains ON long enough for TIM


to time down to zero, the Completion Flag for the TC
number used will turn ON and will remain ON until TIM is
reset (that is, until its execution condition goes OFF).

©nikmzakmal 2010
Timer
 Operand Data Areas:

N TC Number 000 - 511


S Set value (word, BCD) IO, AR, DM, HR, #

©nikmzakmal 2010
Basic Timer: exercise 1
Start

Push Start
button

No
Timer
5 Sec?

Yes
Yellow
Light ON

End
Basic Timer: exercise 2
Start A

Select Manual Timer


Mode 5 Sec?

No Green Light
Timer ON
5 Sec?
Select Auto
Yes
Mode
Yellow
Light ON Yellow &
Green Light
OFF
A
End
Flicker: exercise 3
Start A

Push Start Timer


button 1 Sec?

No Green Light
Timer OFF
1 Sec?

Yes Push Stop


Green
Light ON
System
RESET
A
End
Flicker: exercise 4
Start A

Push Start No
Timer
button 1 Sec?

No Yes
Timer Green Light
3 Sec? OFF

Continuous
Yes
Blinking
Green
Light ON Push Stop

A System
RESET

End
Timer Application
 Lab sheet 2 : Exercise 5

Input Input Devices


Assignment
0000 Start PB
0001 Stop PB
0002 Auto/Man Selector
Output Output Devices
Assignment
10001 Green Light
10002 Red Light
10003 Yellow Light

© nikmzakmal 2010
Counter

 CNT is used to count down from SV when the execution


condition on the count pulse -CP, goes from OFF to ON.
 The present value (PV) will be decremented by one
whenever CNT is executed with an ON execution condition
for CP and the execution condition was OFF for the last
execution
©nikmzakmal 2010
Timer Application cont…

 Ladder diagram

©nikmzakmal 2010
Counter
 Operand Data Areas:

N TC Number 000 - 511


SV Set value (word, BCD) IO, AR, DM, HR, #

©nikmzakmal 2010
Counter

 The Completion Flag for a counter is turned ON when the


PV reaches zero and will remain ON until the counter is
reset.
 CNT is reset with a reset input, R.
 When R goes from OFF to ON, the PV is reset to SV.

©nikmzakmal 2010
Basic Counter: exercise 6
Start

Push Start
Button

No
Counter
5X?

Yes
Green Light
ON

Push Stop
Button

Green Light
OFF

End
Time Delayed 60 sec: exercise 7

Start A

Push Start Yellow Light


button ON

No
Timer 6 Push Stop
Sec?

Yes System
No RESET

Counter
10 X? End

Yes
A
Counter Application
Input Input Devices
Assignment
Lab Sheet : Exercise 8
0000 Start PB

0001 Stop PB

0002 Auto/Man Selector

Output Output Devices


Assignment

10001 Green Light


10003 Yellow Light

10002 Red Light

©nikmzakmal 2010
Counter Application cont…

 Ladder diagram

©nikmzakmal 2010
Extra exercise…
MAN MODE
NG PART ON &
RUN PART OFF

OK PART
BLINKING
STOP PB

AUTO MODE

NO
IF STOP PB
RUN PART
5x
BLINKING &
OK PART OFF

YES

START PB ALL PART OFF


OR RESET
SYSTEM

©nikmzakmal 2010
INTERMEDIATE PROGRAM
•DIFU & DIFD
•INC & DEC

•Shift Register

•Move & Compare

•Interlocking

©nikmzakmal 2010
DIFU

 Differential UP (rise edge)


 DIFU (13) turns ON the designated bit (B) for one
scan on reception of the leading (rising) edge of the
input signal.
 Operand Data Areas:
 B: Bit IO, AR, HR, LR.
©nikmzakmal 2010
DIFD

 Differential Down (fall edge)


 DIFD(14) turns ON the designated bit (B) for one scan
on reception of the trailing (falling) edge of the input
signal.

 Operand Data Areas:


 B: Bit IO, AR, HR, LR.

©nikmzkmal 2010
DIFU vs DIFD

©nikmzakmal 2008
Basic DIFU:
exercise 1

Start

Push Start
button

Yellow
Light ON

End

©nikmzakmal 2008
Basic DIFD: exercise 2
Start

Select
Manual
mode

RedLight
ON

End

©nikmzakmal 2008
Combination
of DIFU/DIFD: exercise 3

Start Push Stop


Mode
Select
Manual
Mode Yellow &
Green Light
Yellow Light OFF
ON
End
Select Auto
Mode

Green Light
ON

©nikmzakmal 2010
Move

 Copies the contents of S to D.

©nikmzakmal 2010
MOVE
 Operand Data Areas:

S Source Word IO, AR, DM, HR,


LR, #
D Destination word IO, AR, DM, HR, LR

©nikmzakmal 2010
Compares (CMP)

 Compares Cp1 and Cp2 and;


 Outputs the result to the GR, EQ and LE flags in the
SR area

©nikmzakmal 2010
CMP
 Operand Data Areas:

cp1 1st compare word IO, AR, DM, HR,


TC, LR, #
cp2 2nd compare word IO, AR, DM, HR,
TC, LR, #

©nikmzakmal 2010
Basic Move & CMP :
exercise 4
Start

Push Start
button

Yellow
Light ON

End

©nikmzakmal 2010
Move & CMP:
exercise 5
Start

Push Start
Button

No
Counter
10 X ?

Yes
Green
Light ON

Push Stop
Button

Green Light
OFF

End
INCREMENT & DECREMENT

Purpose: Purpose:
Increments Wd, without affecting Carry DEC(39) decrements Wd, without affecting CY.
(CY). DEC(39) works the same way as INC(38) except
that it decrements the value instead of
incrementing it.
Operand Data Areas:
Wd : Increment Words IO,AR,DM,HR,LR

For INC(38) and DEC(39) the source and result words are the same. That is, the
contents of the source word is overwritten with the instruction result.
©nikmzakmal 2008
Basic INC & DEC :
exercise 7
Start
Compare #5 to
Select Manual DM00
Mode

Move data #0 to If
DM00 Equal=Yellow,
Greater=Green
Select Auto
, Less=Red
Mode

Red Light ON
End
Push Start Pb or
Stop PB

©nikmzakmal 2010
SHIFT REGISTER

SFT(10) - Shift Register


Purpose:
SFT(10) is controlled by three execution conditions, I, P and R.
 If SFT(10) is executed and (a) execution condition P is ON and was OFF the last execution and (b) R is OFF,
then execution condition I is shifted into the rightmost bit of a shift register defined between St and E, that is,
if I is ON, a 1 is shifted into the register; if I is OFF, a 0 is shifted in. When I is shifted into the register, all
bits previously in the register are shifted to the left and the leftmost bit of the register is lost.
 The execution condition on P functions like a differentiated instruction, that is, I will be shifted into the
register only when P is ON and was OFF the last time SFT(10) was executed. If execution condition P has not
changed or has gone from ON to OFF, the shift register will remain unaffected.
 St designates the rightmost word of the shift register; E designates the leftmost. The shift register includes
both of these words and all words between them. The same word may be designated for St and E to create
a 16-bit (that is, 1-word) shift register.
 When execution condition R goes ON, all bits in the shift register will be turned OFF (that is, set to 0) and
the shift register will not operate until R goes OFF again.
SHIFT REGISTER CONT…
 Operand Data Areas:
St:
Starting Word
IO, AR, HR, LR
E:
End Word
IO, AR,
SHIFT REGISTER CONT…
Adress = 200.xx

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 01 0 1
x2 x1
Push
Start
PB
Auto/Manual 1
I
SFT
Select Auto
Start
P 200 ST: Start Word Mode Start set
I=‘1’
Stop 200 E : End word
R
Basic Shift Register :
exercise 8
Start
Push Start Button
Select Auto
Mode

Push Start Button Red Light ON


x2

Green Light ON Push Stop Button

Push Start All indicator Off


Button

Yellow Light ON End

©nikmzakmal 2010
Basic Shift Register :
exercise 9
Start A
Push Start Button Green Light ON
Select Auto
Push Start Button
Mode

Push Start Button Red Light ON Push Stop Button


Red Light ON
x2

Green Light ON Push Start Button Push Start Button All indicator Off

Push Start All indicator Off


Yellow Light ON End
Button

A Push Start
Yellow Light ON
Button

©nikmzakmal 2010
Basic Shift Register cont..: exercise 9
Interlocking (IL and ILC)

 Permissive to run a process

©nikmzakmal 2010
Interlocking (IL and ILC)

©nikmzakmal 2010
BEE 2931-121311

Você também pode gostar