LOGIC
CONTROLLERS
Richard A. Wysk
IE450 - Manufacturing Systems
Agenda
Review brief history of PLCs and
manufacturing control systems
Introduce the concepts of discrete control of
manufacturing
Review the various kinds of instrumentation
used for control.
Overview ladder logic programming
Readings
Chapter 10 of Computer Aided Manufacturing, Chang,
Chang, T.C. and Wysk, R. A. and Wang, H.P., 3rd Edition,
2006.
Exercise
What are some common examples of
control?
Washing machine, sump pump, microwave,
.
Others?
Types of control
Temporal -- control based in time
State -- control based in state level
Hybrid both temporal and state
Objectives
To define the basic components of a PLC
To apply PLC based control to a
manufacturing system
To be identify instrumentation required to
implement a PLC control system
To program a PLC
To implement a PLC control program and
hardware
PURPOSE OF Programmable
Logic Controllers (PLCs)
Initially designed to replace relay logic
boards
Sequence device actuation
Coordinate activities
FUNCTIONS OF
CONTROLLERS
1) on-off control,
2) sequential control,
3) feedback control, and
4) motion control.
CONTROL
DEVICES
1) mechanical control - cam, governor, etc.,
2) pneumatic control - compressed air,
valves, etc.
3) electromechanical control - switches,
relays, a timer, counters, etc,
4) electronics control - similar to
electromechanical control, except uses
electronic switches.
5) computer control.
PLC
CPU
Input
Input
Module
Flag
System
Output
User Ladder
Diagram
Working
memory
registers
Output
Module
PLC
Configuration
SWITCHE
S
Non-locking
Locking
Normally Open
Normally Closed
P1
SPDT
DPST
P2
Multiple Throw
Multiple Pole
Break-before-make
Make-before-break
TERM
S
DPST
B
Output
Input
Knob
How is this switch classified?
TYPES OF
SWITCHES
RELAY
A switch whose operation is activated by an electromagnet is called a "relay"
S
contact
coil
input
Relay coil
Output contact
COUNTE
Digital counters output in the form of a relay contact when a
R
preassigned count value is reached.
input
Register
Accumulator
reset
contact
output
Input
Reset
Output
Count
12
TIME
A timer consists of an internal clock, a count value register, and
an accumulator. It is used forR
or some timing purpose.
Clock
Accumulator
reset
Register
Clock
contact
Contact
output
Reset
Output
Count
Time 5 seconds.
AN EXAMPLE OF RELAY
For process control, it is desired to have the process start (by turning on a motor) five
seconds after a part touches a limit
switch. The process is terminated automatically
LOGIC
when the finished part touches a second limit switch. An emergency switch will stop
the process any time when it is pushed.
L1
LS1
PB1
LS2
R1
R1
R1
TIMER
R2
PB1
LS1
LS2
PR=5
TIMER
5
R1
Motor
R2
PLC
Programmable controllers
replace most of the relay panel wiring
ARCHITECTURE
by software programming.
Program
Loader
PC
Switches
Printer
Processor
I/O
Modules
Memory
Power
Supply
Machines
Cassette
Loader
EPROM
Loader
External Devices
Peripherals
A typical PLC
PLC
1. Processor
Microprocessor based, may allow arithmetic
operations, logic operators,
block memory moves, computer interface,
COMPONENTS
local area network, functions, etc.
2. Memory
Measured in words.
ROM),
PLC
3. I/O
Modular plug-in periphery
COMPONENTS
AC voltage input and
output,
DC voltage input and output,
Low level analog input,
High level analog input and output,
Special purpose modules, e.g.., high speed timers,
Stepping motor controllers, etc. PID, Motion
4. Power supply AC power
5. Peripheral
CRT programmer,
Operator console,
Printer,
Simulator,
EPROM loader,
Cassette loader,
Graphics processor, and
Network communication interface. MAP, LAN
LADDER
A ladder diagram (also called contact symbology) is a means of
DIAGRAM
graphically representing
the logic required in a relay logic
system.
Rail
Rung
start
PB1
emergency stop
PB2
R1
R1
R1
A
Ladder Representation
PLC WIRING
DIAGRAM
Input
01
02
Output
PLC
01
02
20
11
12
20
03
20
11
External
switches
Stored program
SCA
A PLC resolves the logic of a ladder diagram (program) rung by rung, from the top to
the bottom. Usually, all the outputs are updated based on the status of the internal
N
registers. Then the input states are checked and the corresponding input registers are
updated. Only after the I/Os have been resolved, is the program then executed. This
process is run in a endless cycle. The time it takes to finish one cycle is called the scan
time.
Output
Input
begin
Idle
Scan cycle
Resolve
logic
1) Relay,
PLC
INSTRUCTIONS
LOGIC
STATES
ON : TRUE, contact
closure, energize, etc.
OFF: FALSE, contact open , de-energize,
etc.
Do not confuse the internal relay and program with the external
switch and relay. Internal symbols are used for programming.
External devices provide actual interface.
(In the notes we use the symbol "~" to represent
negation. AND and OR are logic operators. )
AND and OR
LOGIC
PB1
PB2
R1
R1 = PB1.AND.PB2
AND
PB3
PB4
R2
R2 = PB2.AND.~PB4
PB1
R1
R1 = PB1 .OR. PB2
OR
PB2
R1
PB1
PB2
pb3
RELA
A Relay consists of two parts, the coil and the contact(s).
Y
Contacts:
a. Normally open
-| |-
b. Normally closed
-|/|-
c. Off-on transitional
-||-
d. On-off transitional
-| |-
()
Coil:
a. Energize Coil
-( )-
b. De-energize
-(/)-
c. Latch
-(L)-
d. Unlatch
-(U)-
TIMERS AND
COUNTERS
True
Timers:
Input
False
a. Retentive on delay
-(RTO)-
-(RTF)-
c. Reset
-(RST)-
RTF
stop
True
counting
resume
counting stop
Counter:
-(CTU)-
b. Counter down
-(CTD)-
c. Counter reset
-(CTR)-
SEQUENCE
Sequencers are used with machines or processes involving
repeating operating cyclesR
which can be segmented into
steps.
Output
Step
ON
OFF OFF
5 sec.
ON
ON OFF
10 sec.
OFF OFF ON
3 sec.
OFF
9 sec.
ON OFF
Dwell time
Programming a PLC
Oil is consumed
randomly. The
tank needs to be
refilled by turning
on a pump. Two
hydrostatic
switches are used
to detect a high
and low level.
PROGRAMMING EXAMPLE
1
Bar code reader
microswitch
Stopper
Conveyor
Part
Robot
id description
MSI microswitch
R1 output to bar code reader
C1 input from bar code reader
R2 output robot
R3 output robot
C2 input from robot
R4 output to stopper
C3 input from machine
C4
input from machine
Machine
state
1
1
1
1
1
1
1
1
1
explanation
part arrive
scan the part
right part
loading cycle
unloading cycle
robot busy
stopper up
machine busy
task complete
SOLUTIO
N
Input
MS1
01
02
03
04
05
C1
C2
C3
C4
01
Programmable
Controller
PLC
11
14
14
02
14
04
05
03
03
12
13
Output
11
12
13
14
15
R1
R2
R3
R4
Cycle time
Street
Red
Main
Jefferson
3
5
Yellow
1
1
Green
4
2
input
WIRING
DIAGRAM
output
64
Programmable
Controller
Jefferson Red
65
Jefferson Yellow
66
Jefferson Green
67
Main Red
70
Main Yellow
71
Main Green
RUNG1
RUNG2
RUNG3
RUNG4
PROGRAM
(1)
901
901
RUNG7
RUNG8
RUNG9
RUNG10
67
902
RTO
901
901
902
903
902
903
904
RST
904
904
RTO
904
905
J. Green
20
M. Green
71
71
901
30
66
903
RTO
901
M. Red
RST
66
RUNG11
RUNG12
902
80
RST
67
RUNG5
RUNG6
901
901
RTO
RST
70
40
M. Yellow
PROGRAM
(2)
RUNG13
RUNG14
RUNG15
RUNG16
RUNG17
RUNG18
RUNG19
RUNG 20
70
901
903
905
906
RST
902
906
907
906
RTO
RST
J. Yellow
10
64
907
RTO
64
901
10
65
65
901
905
RTO
907
RST
J. Red
50