CPD7 - B1 Lecture Notes - 4 Introduction To Programmable Logic Controllers PDF
CPD7 - B1 Lecture Notes - 4 Introduction To Programmable Logic Controllers PDF
Introduction to Programmable
Logic Controllers
Outline
Hardwired Relay Control Logic
Programmable Logic Controllers
What is a PLC?
PLC modules
PLC Programming Instructions
Examples
Vcc
+ Pilot
_ Lamp
GND
Vcc or
Power GND BUS
Bus
Department of Electrical and Electronics Engineering, University of the Philippines ©
U. P. National Engineering Center
August 2002 Competency Training & Certification Program
National Electrification Administration in Electric Power System Engineering
Introduction to Programmable Logic Controllers 4
NO NO NO NO
Sample Relays
Relays as Switches
VSOURCE
Switch
+ -
1 2
3 4
5 6 7 8
7 8
Power GND
Relay Terminologies:
Illustration 1:
Momentary Switch RLY A
Illustration 2:
RLY A
Latch
RLY A
Illustration 3: Illustration 4:
Latch and Automatic ON Auto Shutdown Sequence
Sequence
RLY A RLY A
RLY B
RLY A
RLY A
TIM 1
TIM 1
RLY A
RLY A
RLY B
RLY B
TIM 1; TC 2 secs.
TIM 1; TC 2 secs.
+ RUN Ra Rb Rc
Vt
Field
Armature
M
Winding
RUN
Start PB
RUN
RUN
TIM 1
RUN
A
TIM 1; TC 2 secs.
A Relay-Based TIM 2
A
Motor Control Circuit
B
TIM 2; TC 2 secs.
TIM 3
B
C
TIM 3; TC 2 secs.
U. P. National Engineering Center Competency Training & Certification Program
National Electrification Administration in Electric Power System Engineering
Introduction to Programmable Logic Controllers 12
Internal Relays
Inputs
Start Start PB
RUNi Start
RUNi
Ai RUN
RUNi
TIM 1; TC 2 secs.
TIM 2 A
Ai Ai
Bi
TIM 2; TC 2 secs. B
Bi
TIM 3
Bi
Ci C
Ci
TIM 3; TC 2 secs.
Sample PLCs
Pushbuttons (sensors)
connected to PLC
inputs can be used to
start and stop a motor
connected to a PLC
through a motor
starter (actuator).
http://www.sea.siemens.com/step/
Before PLCs
Hard-Wired Control
• Prior to PLCs, many of these control
tasks were solved with contactor or
relay controls. This is often referred to
as hardwired control.
• Circuit diagrams had to be designed,
electrical components specified and
installed, and wiring lists created.
• Electricians would then wire the
components necessary to perform a
specific task.
• If an error was made the wires had to be
reconnected correctly.
• A change in function or system
expansion required extensive
component changes and rewiring.
http://www.sea.siemens.com/step/
Advantages of PLCs
http://www.sea.siemens.com/step/
U. P. National Engineering Center Competency Training & Certification Program
National Electrification Administration in Electric Power System Engineering
Introduction to Programmable Logic Controllers 18
http://www.sea.siemens.com/step/
U. P. National Engineering Center Competency Training & Certification Program
National Electrification Administration in Electric Power System Engineering
Introduction to Programmable Logic Controllers 19
Central
Input Output
Processing Unit
Modules Modules
(CPU)
Operator Programming
Interface Device
Discrete Inputs
Pushbuttons, and Switches
Relay Contacts
Comparator/Binary
Outputs
Standard Discrete Levels:
5, 12, 24, and 48 Volts (DC)
12, 24 48 Volts (AC)
http://www.sea.siemens.com/step/
Discrete Inputs
http://www.sea.siemens.com/step/
Analog Inputs
Continuous values
of input signals
Standard Analog
Input Levels:
0 to 20 mA
4 to 20 mA
0 to 10 volts
-10 to +10V
-5v to +5v
http://www.sea.siemens.com/step/
http://www.plcs.net/
http://www.plcs.net/
Discrete Outputs
ON/OFF Controls
Actuators such as
motor starters, lamps,
electromechanical
relays
http://www.sea.siemens.com/step/
http://www.plcs.net/
U. P. National Engineering Center Competency Training & Certification Program
National Electrification Administration in Electric Power System Engineering
Introduction to Programmable Logic Controllers 28
http://www.plcs.net/
U. P. National Engineering Center Competency Training & Certification Program
National Electrification Administration in Electric Power System Engineering
Introduction to Programmable Logic Controllers 29
Analog Outputs
http://www.sea.siemens.com/step
/
U. P. National Engineering Center Competency Training & Certification Program
National Electrification Administration in Electric Power System Engineering
Introduction to Programmable Logic Controllers 30
Analog Outputs
Analog outputs may be used as a variable reference for control valves,
chart recorders, electric motor drives, analog meters, and pressure
transducers.
Like analog inputs, analog outputs are generally connected to a
controlling device through a transducer. The transducer takes the voltage
signal and, depending on the requirement, amplifies, reduces, or changes
it into another signal which controls the device.
In the following example a 0 - 10 VDC signal controls a 0 - 500 Lbs. scale
analog meter.
http://www.sea.siemens.com/step/
http://www.sea.siemens.com/step/
Programming Device
Used to input
program instructions
to the PLC.
Uses either a
Personal Computer
with a programming
software, or a
specialized Programming
Console
http://www.sea.siemens.com/step/
http://www.sea.siemens.com/step/
http://www.plcopen.org
PLCopen
Standardization in Industrial Control programming
AND A B C
A C -| |--|/|----------------( )
B
Program Instructions
Instructions
Standard Instructions – those that are found in most PLC
programs. Examples include timer, counter, math, logical,
increment/decrement, move, and block functions.
Special Instructions – are used to manipulate data. They
include shirt, table, find, conversion, for/next, and real-time
instructions.
High-speed instructions allow for events and interrupts to
occur independently of the PLC scan time. These include
high-speed counters, interrupts, output, and transmit
instructions.
http://www.sea.siemens.com/step/
Logical AND
http://www.sea.siemens.com/step/
U. P. National Engineering Center Competency Training & Certification Program
National Electrification Administration in Electric Power System Engineering
Introduction to Programmable Logic Controllers 38
Logical OR
http://www.sea.siemens.com/step/
Timers
http://www.sea.siemens.com/step/
U. P. National Engineering Center Competency Training & Certification Program
National Electrification Administration in Electric Power System Engineering
Introduction to Programmable Logic Controllers 40
On-Delay Timer
http://www.sea.siemens.com/step/
U. P. National Engineering Center Competency Training & Certification Program
National Electrification Administration in Electric Power System Engineering
Introduction to Programmable Logic Controllers 41
Retentive On-Delay
http://www.sea.siemens.com/step/
Off-Delay Timer
http://www.sea.siemens.com/step/
U. P. National Engineering Center Competency Training & Certification Program
National Electrification Administration in Electric Power System Engineering
Introduction to Programmable Logic Controllers 43
Timer Example
http://www.sea.siemens.com/step/
Counters
http://www.sea.siemens.com/step/
UP Counters
http://www.sea.siemens.com/step/
U. P. National Engineering Center Competency Training & Certification Program
National Electrification Administration in Electric Power System Engineering
Introduction to Programmable Logic Controllers 46
Down Counters
http://www.sea.siemens.com/step/
U. P. National Engineering Center Competency Training & Certification Program
National Electrification Administration in Electric Power System Engineering
Introduction to Programmable Logic Controllers 47
UP/DOWN Counters
http://www.sea.siemens.com/step/
LOAD INSTRUCTIONS:
A
Address Instruction Operands
X
00000 LD A
00001 OUT X
B
Address Instruction Operands
Y
00000 LD A
00001 OUT NOT Y
AND OPERATIONS
A B C
X
OR OPERATIONS
A
X
B
COMBINATION BLOCKS
A B C D
X
E
COMBINATION BLOCKS
A C
X
B D Address Instruction Operands
00000 LD A
00001 OR B
00002 LD C
00003 OR NOT D
00004 AND LD --
COMBINATION BLOCKS
A B
X
C D
Address Instruction Operands
00000 LD A
00001 AND NOT B
00002 LD C
00003 AND D
00004 OR LD --
COMBINATION BLOCKS
A C E
X
B D F
Address Instruction Operands Address Instruction Operands
00000 LD A 00000 LD A
00001 OR NOT B 00001 OR NOT B
00002 LD NOT C 00002 LD NOT C
00003 OR D 00003 OR D
00004 AND LD -- 00004 LD E
00005 LD E 00005 OR F
00006 OR F 00006 AND LD --
00007 AND LD -- 00007 AND LD --
00008 OUT X 00008 OUT X
COMBINATION BLOCKS
X
A B
C D
E F
Address Instruction Operands Address Instruction Operands
00000 LD A 00000 LD A
00001 AND NOT B 00001 AND NOT B
00002 LD NOT C 00002 LD NOT C
00003 AND NOT D 00003 AND NOT D
00004 OR LD -- 00004 LD E
00005 LD E 00005 AND F
00006 AND F 00006 OR LD --
00007 OR LD -- 00007 OR LD --
00008 OUT X 00008 OUT X
COMBINATION BLOCKS
A B C D
X
E
F
Block a Block b
COMBINATION BLOCKS
Block b1
A B C D
X
E F
Block b2
Block a Block b
Address Instruction Operands
00000 LD NOT A
00001 AND B
00002 LD C
00003 AND NOT D
00004 LD NOT E
00005 AND F
00006 OR LD --
00007 AND LD --
00008 OUT X
COMBINATION BLOCKS
Block a1 Block b1
A B E F
X
C D G H
Address Instruction Operands
00000 LD A
Block a2 Block b2 00001 AND NOT B
00002 LD NOT C
Block a Block b 00003 AND D
00004 OR LD --
00005 LD E
00006 AND F
00007 LD G
00008 AND H
00009 OR LD --
00010 AND LD --
00011 OUT X
Counters:
Address Instruction Operands
Count Pulse (CP)
CNT N 00000 LD A
00001 AND B
Reset (R) 00002 LD NOT C
SV 00003 CNT 001
00004 # 0700
00005 LD CNT 001
00006 OUT D
CP CNT 001
A B
Reversible Counters:
R #0700 II CNT N
D DI
C SV
R
Timers:
TIM N
SV
Simulation Exercise
A Motor Control Problem
The motor runs CW for 10 seconds, stops, waits for
3 seconds then runs again for another 5 seconds,
this time in the CCW direction. Time transitions
above are exclusive of starting procedure.
An E-Stop PB stops the motor at once.
an external variable, when OFF, automatically stops
the motor after running for 5 seconds. Call this
variable Autostop.
Actuators PLC
HMI,
Management,
Business
Sensors PC-Based Monitoring
Systems
Systems and Data
http://Globalspec.com
U. P. National Engineering Center Competency Training & Certification Program
National Electrification Administration in Electric Power System Engineering
Introduction to Programmable Logic Controllers 66
PLCopen
Standardization in Industrial Control programming
Fermentation Process
Agitator
Feed valve
Acidic reagent
Alkali reagent
Temperature
sensor
pH sensor
Heater band
Harvest valve
1
24V M2
reset count INPUT
24V
2 MODULE +L
3.9K
LDR
24V
3
24V -M
3.9K LDR
1
B
2 A (LSB)
OUTPUT
MOTOR
3 1
MODULE RELAY
24V
4 2
A1
W 4
+L 5
A2
24V
B 5
-M M
R 6
RT
2
INPUT
24V
R
MODULE
level 1 3
24V
(low)
level 2 4
-M
24V
(high)
Examples:Process Control
220V
0
A1
Pump 1
A2
220V
1
A1
Pump 2
OUTPUT A2
220V
2
A1
Heater
MODULE A2
220V
3
A1
Bubbler
A2
24V
4
A1
Agitator
M- A2
PR1 PR2
SR1 SR2
CCW2
BR
CCW2