Definition
- National Electrical Manufacturers Association (NEMA)
Components
l
Input and output module
l
Processor
l
Memory
l
Power supply
l
Detachable programming device
Programmable Logic Controllers
University of Pennsylvania
2
History
1969 specifications (General Motors)
l
Must be programmable (and reprogrammable)
l
Designed to operate in an industrial environment
l
Must accept 120 V ac signals from pushbuttons, switches
l
Outputs must switch and continuously operate loads such as motors
and relays of two amps rating
Before the 1980s, programmable controllers were called PCs.
Programmable Logic Controllers
University of Pennsylvania
3
PLC Functions
A PLC performs the functions of conventional relays, timers, counters
Advantages (over conventional devices)
l
More flexibility
l
Less space, more compact
l
Higher reliability (less mechanical parts)
l
Modular, can be easily connected to computer systems and to hardware
2
Programmable Logic Controllers
University of Pennsylvania
4
Conventional devices
Relays
Programmable Logic Controllers
University of Pennsylvania
5
Conventional devices
Relays (continued)
Programmable Logic Controllers
University of Pennsylvania
6
Conventional devices
Relays (continued)
l
Normally open
l
Normally closed
3
Programmable Logic Controllers
University of Pennsylvania
7
Conventional devices (continued)
Timers
Programmable Logic Controllers
University of Pennsylvania
8
Operation
l
Inputs are sampled and stored in memory
l
Control program is executed
l
Calculated values are used to update the outputs
l
Scan time is generally of the order of milliseconds
Programmable Logic Controllers
University of Pennsylvania
9
Application
4
Programmable Logic Controllers
University of Pennsylvania
10
PLCs versus Computers
Conceptually very similar, though there are practical differences.
l
PLCs are based on solid state technology and generally use
microprocessors as their processing unit.
l
PLCs are used to simulate electromechanical devices that were typical
of
transfer lines and mass production.
PLC
Computer
executes simple program in milliseconds, scan
time is much smaller than 1/60 seconds
possibly complicated program, often timing is
not critical
objective is to make yes/no, 0/1 decisions
tasks may include floating point arithmetic,
manipulation of data
special purpose device, same program is
repeated continuously
general purpose, possibly different programs
no peripherals
need peripherals
programmed using ladder logic
programmed using high-level languages
Programmable Logic Controllers
University of Pennsylvania
11
Why PLCs?
Advantages
Disadvantages
+ many inputs and outputs, excellent
for controlling and monitoring
many processes
+ designed for industrial
environments, robust and reliable
+ reprogrammable
+ modular
+ ideally suited to supervisory
control
+ easy to set up, good for FMS
environment
+ inexpensive
- do not use the full capabilities of
the microprocessor
- ladder logic programming style is
cumbersome and prone to mistakes
- only good for yes/no decisions
- do not handle continuous inputs
and outputs, not good for direct
control
- inflexible (compared to
microprocessors)
Programmable Logic Controllers
University of Pennsylvania
12
Logic Control Systems
Consider a system with two inputs (A, B) and two outputs (X, Y)
where Y is on (true) if and only if A and B are both off (false), and
X is on if and only if A and B are both on (true) or both off (false).
1. Relays
5
Programmable Logic Controllers
University of Pennsylvania
13
Logic Control Systems (continued)
2. Logic Gates
l
X is on if and only if A and B are both on (true) or both off (false).
l
Y is on (true) if and only if A and B are both off (false).
3. PLCs
B
A
X
Y
Programmable Logic Controllers
University of Pennsylvania
14
Logic Control Systems - Representation
Computer program
if ((A=0) and (B=0)) or ((A=1) and (B=1)),
X:=1
else
X:=0;
if ((A=0) and (B=0))
Y:= 1
else
Y:=0;
Truth table
A
B
X
Y
0
0
1
1
1
0
0
0
0
1
0
0
1
1
1
0
Programmable Logic Controllers
University of Pennsylvania
15
Logic Control Systems - Representation
Boolean Logic
X:= A.B
Y:= ~(A+B)
Ladder Logic
X
A
B
Y
A
B
A
B
6
Programmable Logic Controllers
University of Pennsylvania
16
Logic Control Systems - Representation
PLC Program
STR
SHF 00 ENT
AND
SHF 01 ENT
OR SHF 11 ENT
OUT
SHF 10 ENT
STR NOT
SHF 00 ENT
AND NOT SHF 01 ENT
OUT
SHF 11 ENT
10
00
01
11
00
01
00
01
Programmable Logic Controllers
University of Pennsylvania
17
Ladder Logic Diagrams
Input contacts (switches, relays,
photoelectric sensors, limit
switches)
Output loads (actuators, alarms,
lights)
Logical inverse (NOT)
Logical AND operation
Logical OR operation
Programmable Logic Controllers
University of Pennsylvania
18
Ladder Logic Diagrams (continued)
Example
7
Programmable Logic Controllers
University of Pennsylvania
19
Ladder Logic Diagrams
Push-button switch
Programmable Logic Controllers
University of Pennsylvania
20
Ladder Logic Diagrams
Automatic weigh station on a conveyor
Ladder logic diagram
Response from sensors
Sensor X
Sensor Y
Programmable Logic Controllers
University of Pennsylvania
21
20
Rotate base CCW
21
Rotate base CW
22
Lift arm
23
Lower arm
24
Extend arm
25
Retract arm
26
Close gripper
27
Open gripper
Application: Direct Robot Control
8
Programmable Logic Controllers
University of Pennsylvania
22
Application (continued)
Sequence of operations
Programmable Logic Controllers
University of Pennsylvania
23
Application (continued)
PLC Ladder Logic Diagram
(not all rungs shown)
Output
Limit switch
Necessary PLC inputs
Programmable Logic Controllers
University of Pennsylvania
24
Application (continued)
PLC Code