Programmable Logic Controllers: Richard A. Wysk
Programmable Logic Controllers: Richard A. Wysk
Programmable Logic Controllers: Richard A. Wysk
LOGIC CONTROLLERS
Richard A. Wysk
• 1) on-off control,
• 2) sequential control,
• 3) feedback control, and
• 4) motion control.
CONTROL DEVICES
Working
memory
registers
PLC
Configuration
What devices does a PLC interact
with?
• INPUT RELAYS-(contacts)These are connected to the outside world. They
physically exist and receive signals from switches, sensors, etc. Typically they
are not relays but rather they are transistors.
• INTERNAL UTILITY RELAYS-(contacts) These do not receive signals from
the outside world nor do they physically exist. They are simulated relays and
are what enables a PLC to eliminate external relays. There are also some
special relays that are dedicated to performing only one task. Some are always
on while some are always off. Some are on only once during power-on and are
typically used for initializing data that was stored.
• COUNTERS-These again do not physically exist. They are simulated counters
and they can be programmed to count pulses. Typically these counters can
count up, down or both up and down. Since they are simulated they are limited
in their counting speed. Some manufacturers also include high-speed counters
that are hardware based. We can think of these as physically existing. Most
times these counters can count up, down or up and down.
What devices does a PLC interact
with?
Continued
• TIMERS-These also do not physically exist. They come in many
varieties and increments. The most common type is an on-delay type.
Others include off-delay and both retentive and non-retentive types.
Increments vary from 1ms through 1s.
• OUTPUT RELAYS-(coils)These are connected to the outside world.
They physically exist and send on/off signals to solenoids, lights, etc.
They can be transistors, relays, or triacs depending upon the model
chosen.
• DATA STORAGE-Typically there are registers assigned to simply
store data. They are usually used as temporary storage for math or data
manipulation. They can also typically be used to store data when
power is removed from the PLC. Upon power-up they will still have
the same contents as before power was removed. Very convenient and
necessary!!
SWITCHES
Non-locking Locking
SPDT
P1
DPST
P2
Multiple Throw Multiple Pole
Break-before-make Make-before-break
TERMS
Throw - number of states
Pole - number of connecting moving parts (number of individual circuits).
SPDT
A serial switch box (A-B box) has
two 25 pin serial ports to switch from.
A B
Output
DPST Input
Knob
How is this switch classified?
TYPES OF SWITCHES
1. Basic switch, operated by a mechanical level,
2. Push-button switch,
3. Slide switch,
4. Thumbwheel switch,
5. Limit switch,
6. Proximity switch, and
7. Photoelectric switch.
contact
coil
input
Accumulator
reset
contact
output
Input
Reset
Output
Count 0 12 3 4 5 0 1
TIMER
A timer consists of an internal clock, a count value register, and
an accumulator. It is used for or some timing purpose.
Clock
Accumulator
reset
Register
Clock
contact
Contact
Reset
output
Output
Count 0 1 2 3 4 5
Time 5 seconds.
AN EXAMPLE OF RELAY LOGIC
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
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
TIMER R2
R1 PB1
LS1 LS2
PR=5
TIMER
5
Motor
R2
R1
PLC ARCHITECTURE
Programmable controllers replace most of the relay panel wiring
by software programming.
PC
Program
Loader
Switches
Printer
I/O
Processor
Modules Machines
Cassette
Loader
Power
EPROM Memory Supply
Loader
A typical PLC
PLC COMPONENTS
1. Processor Microprocessor based, may allow arithmetic
operations, logic operators, block memory moves,
computer interface, local area network, functions, etc.
Rail
start emergency stop
PB1 PB2
R1
Rung R1
R1
A
Ladder Representation
PLC WIRING DIAGRAM
01 01 02 20 11 A
02 12
20
03
20 11
External
switches
Stored program
SCAN
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
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
PLC INSTRUCTIONS
1) Relay,
2) Timer and counter,
3) Program control,
4) Arithmetic,
5) Data manipulation,
6) Data transfer, and
7) Others, such as sequencers.
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.
R1 = PB1.AND.PB2
PB1 R1
OR PB2
COMBINED AND & OR
PB1 R1
PB2 pb3
RELAY
A Relay consists of two parts, the coil and the contact(s).
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
Input
True False True
Timers: RTO counting stop counting
resume
a. Retentive on delay -(RTO)- RTF stop counting stop
b. Retentive off delay -(RTF)-
c. Reset -(RST)-
RTO reach PR value, output ON
RTF reach PR value, output OFF
Counter:
PR value in 0.1 second
a. Counter up -(CTU)-
b. Counter down -(CTD)-
c. Counter reset -(CTR)-
SEQUENCER
Sequencers are used with machines or processes involving
repeating operating cycles which can be segmented into
steps.
Output
Step A B C Dwell time
1 ON OFF OFF 5 sec.
2 ON ON OFF 10 sec.
3 OFF OFF ON 3 sec.
4 OFF ON OFF 9 sec.
Rockwell/ Allen Bradley PLC
I/O points are numbered, they correspond to the I/O slot on
the PLC.
Part Conveyor
Robot
Machine
Jefferson street
Cycle time
Main 3 1 4
Jefferson 5 1 2
WIRING DIAGRAM
input output
64 Jefferson Red
65 Jefferson Yellow
Programmable
Controller
66 Jefferson Green
67 Main Red
70 Main Yellow
71 Main Green
PROGRAM (1) 901
RUNG1 RTO
80
901 901
RUNG2 RST
901 902
RUNG3 67 M. Red
902
RUNG4 67
RTO
30
RUNG5 901 902
RST
901 903
RUNG6 66 J. Green
903
RUNG7 66
RTO
901 903 20
RUNG8 RST
902 904 M. Green
RUNG9 71
904
71
RUNG10 RTO
901 904 40
RUNG11 RST
904 905
RUNG12 70 M. Yellow
PROGRAM (2)
905
70
RUNG13 RTO
901 905 10
RUNG14 RST
903 906
RUNG15 65 J. Yellow
906
65
RUNG16 RTO
901 906 10
RUNG17 RST
902 907
RUNG18 64 J. Red
907
RUNG19 64
RTO
901 907 50
RUNG 20 RST