osp07 programmable logic controller
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
TI -3222: Otomasi Sistem Produksi
Pr ogr a m m a ble Logic Con t r olle r
Laborat orium Sist em Produksi
www.lspit b.org
©2004
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
Hasil Pembelajaran
•
Um um
•
Khusus
Mahasiwa m am pu unt uk m elakukan proses perancangan
sist em ot om asi, sist em m esin NC, sert a m erancang dan
m engim plem ent asikan sist em kont rol logika.
Mem aham i fungsi PLC sert a kom ponen- kom ponen PLC
TI-3222: Otomasi Sistem Produksi - 7
2
1
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PURPOSE OF Programmable
Logic Controllers (PLCs)
•
I nit ially designed t o replace relay logic boards
•
•
Accept s input from a series of swit ches
Sends out put t o devices or relays
Sequence device act uat ion
Coordinat e act ivit ies
TI-3222: Otomasi Sistem Produksi - 7
3
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PURPOSE OF Programmable
Logic Controllers (PLCs)
•
I nit ially designed t o replace relay logic boards
•
•
Accept s input from a series of swit ches
Sends out put t o devices or relays
Sequence device act uat ion
Coordinat e act ivit ies
TI-3222: Otomasi Sistem Produksi - 7
4
2
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
FUNCTI ONS OF CONTROLLERS
•
•
•
•
1) on- off cont rol,
2) sequent ial cont rol,
3) feedback cont rol, and
4) m ot ion cont rol.
TI-3222: Otomasi Sistem Produksi - 7
5
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
CONTROL DEVI CES
1) m echanical cont rol - cam , governor, et c.,
2) pneum at ic cont rol - com pressed air, valves,
et c.
3) elect rom echanical cont rol - swit ches, relays,
a t im er, count ers, et c,
4) elect ronics cont rol - sim ilar t o
elect rom echanical cont rol, except uses
elect ronic swit ches.
5) com put er cont rol.
TI-3222: Otomasi Sistem Produksi - 7
6
3
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PROGRAMMABLE LOGI C
CONTROLLER
Invented in 1968 as a substitute for hardwired relay panels.
" A digit ally operat ing elect ronic apparat us which uses a
program m able m em ory for t he int ernal st orage of
inst ruct ions by im plem ent ing specific funct ions such as logic
sequencing, t im ing, count ing, and arit hm et ic t o cont rol,
t hrough digit al or analog input / out put m odules, various
t ypes of m achines or processes. The digit al com put er which
is used t o perform t he funct ions of a program m able
cont roller is considered t o be wit hin t his scope. Excluded
are drum and ot her sim ilar m echanical sequencing
cont rollers."
National Electrical Manufacturing Association (NEMA)
TI-3222: Otomasi Sistem Produksi - 7
7
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
VENDORS
•
•
•
•
•
•
•
Rockwell
GE/ Fanuc
Schnieder
MODI COM - GOULD
ALLEN- BRADLEY
Honeywell
SQUARE- D
et c.
TI-3222: Otomasi Sistem Produksi - 7
8
4
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PLC
Input
CPU
Input
Module
Flag
System
Output
Output
Module
User Ladder
Diagram
Working
memory
registers
TI-3222: Otomasi Sistem Produksi - 7
9
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PLC Configuration
TI-3222: Otomasi Sistem Produksi - 7
10
5
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
What devices does a PLC interact with?
•
•
•
I NPUT RELAYS- ( cont act s) These are connect ed t o t he out side
world. They physically exist and receive signals from swit ches,
sensors, et c. Typically t hey are not relays but rat her t hey are
t ransist ors.
I NTERNAL UTI LI TY RELAYS- ( cont act s) These do not receive
signals from t he out side w orld nor do t hey physically exist .
They are sim ulat ed relays and are what enables a PLC t o
elim inat e ext ernal relays. There are also som e special relays
t hat are dedicat ed t o perform ing only one t ask. Som e are
always on while som e are always off. Som e are on only once
during pow er- on and are t ypically used for init ializing dat a
t hat was st ored.
COUNTERS- These again do not physically exist . They are
sim ulat ed count ers and t hey can be pr ogram m ed t o count
pulses. Typically t hese count ers can count up, down or bot h
up and down. Since t hey are sim ulat ed t hey are lim it ed in
t heir count ing speed. Som e m anufact urers also include highspeed count ers t hat are hardware based. We can t hink of
t hese as physically exist ing. Most t im es t hese count ers can
count up, down or up and down.
TI-3222: Otomasi Sistem Produksi - 7
11
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
What devices does a PLC interact with?
Continued
•
•
•
TI MERS- These also do not physically exist . They com e in m any
variet ies and increm ent s. The m ost com m on t ype is an on- delay
t ype. Ot hers include off- delay and bot h ret ent ive and nonret ent ive t ypes. I ncrem ent s vary from 1m s t hrough 1s.
OUTPUT RELAYS- ( coils) These are connect ed t o t he out side world.
They physically exist and send on/ off signals t o solenoids, light s,
et c. They can be t ransist ors, relays, or t riacs depending upon t he
m odel chosen.
DATA STORAGE- Typically t here are regist ers assigned t o sim ply
st ore dat a. They are usually used as t em porary st orage for m at h
or dat a m anipulat ion. They can also t ypically be used t o st ore
dat a when power is rem oved from t he PLC. Upon power- up t hey
will st ill have t he sam e cont ent s as before power was rem oved.
Very convenient and necessary! !
TI-3222: Otomasi Sistem Produksi - 7
12
6
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
SWI TCHES
Non-locking
Locking
Normally Open
Normally Closed
P1
SPDT
DPST
P2
Multiple Throw
Multiple Pole
Break-before-make
Make-before-break
13
TI-3222: Otomasi Sistem Produksi - 7
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
TERMS
Th r ow - n u m be r of st a t e s
Pole
- n u m be r of con n e ct in g m ovin g pa r t s ( n u m be r of
in dividu a l cir cu it s) .
A serial switch box (A-B box) has
two 25 pin serial ports to switch from.
SPDT
A
B
Output
Input
DPST
Knob
How is this switch classified?
TI-3222: Otomasi Sistem Produksi - 7
14
7
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
TYPES OF SWI TCHES
1. Basic swit ch, operat ed by a m echanical level,
2. Push- but t on swit ch,
3. Slide swit ch,
4. Thum bwheel swit ch,
5. Lim it swit ch,
6. Proxim it y swit ch, and
7. Phot oelect ric swit ch.
RATING: voltage, current
TI-3222: Otomasi Sistem Produksi - 7
15
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
RELAYS
A switch whose operation is activated by an electromagnet is called a "relay"
contact
coil
input
Relay coil
Output contact
TI-3222: Otomasi Sistem Produksi - 7
16
8
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
COUNTER
Digit al count ers out put in t he form of a relay cont act when a
preassigned count value is reached.
input
5
Register
Accumulator
reset
contact
output
Input
Reset
Output
Count
0
12
3
0
5
4
1
17
TI-3222: Otomasi Sistem Produksi - 7
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
TI MER
A t im er consist s of an int ernal clock, a count value regist er, and an
accum ulat or. I t is used for or som e t im ing purpose.
Clock
Accumulator
reset
Register
Clock
contact
Contact
output
Reset
Output
Count
0
1
2
3
4
Time 5 seconds.
TI-3222: Otomasi Sistem Produksi - 7
5
18
9
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
AN EXAMPLE OF RELAY LOGI C
For process cont rol, it is desir ed t o have t he process st art ( by t urning on a
m ot or) five seconds aft er a part t ouches a lim it swit ch. The process is
t er m inat ed aut om at ically when t he finished part t ouches a second lim it
sw it ch. An em ergency sw it ch will st op t he process any t im e when it is
pushed.
L1
LS1
PB1
LS2
R1
R1
R1
TIMER
R2
PB1
LS1
LS2
PR=5
TIMER
5
R1
TI-3222: Otomasi Sistem Produksi - 7
Motor
R2
19
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PLC ARCHI TECTURE
Program m able cont rollers replace m ost of t he relay panel wiring by
soft ware program m ing.
Program
Loader
PC
Switches
Printer
Processor
I/O
Modules
Memory
Power
Supply
Machines
Cassette
Loader
EPROM
Loader
External Devices
Peripherals
A typical PLC
TI-3222: Otomasi Sistem Produksi - 7
20
10
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PLC COMPONENTS
1. Processor
Microprocessor based, m ay allow ar it hm et ic
operat ions, logic operat or s, block m em ory m oves,
com put er int er face, local area net wor k , funct ions, et c.
2. Mem ory
Measured in w ords.
ROM ( Read Only Mem ory) ,
RAM ( Random Access Mem or y) ,
PROM ( Pr ogram m able Read Only Mem or y) ,
EEPROM ( Elect ronically Erasable Pr ogram m able
ROM) ,
EPROM ( Erasable Pr ogram m able Read Only Mem ory ) ,
EAPROM ( Elect ronically Alt erable Pr ogram m able
Read Only Mem or y) , and
Bubble Mem or y.
TI-3222: Otomasi Sistem Produksi - 7
21
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PLC COMPONENTS
3. I / O
Modular plug- in periphery
AC volt age input and out put ,
DC volt age input and out put ,
Low level analog input ,
High level analog input and out put ,
Special purpose m odules, e.g.., high speed t im ers,
St epping m ot or cont rollers, et c. PI D, Mot ion
4. Power supply AC power
5. Peripheral
Hand held program m er ( loader) ,
CRT program m er,
Operat or console,
Print er,
Sim ulat or,
EPROM loader,
Casset t e loader,
Graphics processor, and
Net work com m unicat ion int erface. MAP, LAN
TI-3222: Otomasi Sistem Produksi - 7
22
11
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
LADDER DI AGRAM
A ladder diagram ( also called cont act sym bology) is a m eans of
graphically represent ing t he logic required in a relay logic
syst em .
Rail
start
PB1
emergency stop
PB2
R1
Rung
R1
R1
A
TI-3222: Otomasi Sistem Produksi - 7
23
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
Ladder Representation
TI-3222: Otomasi Sistem Produksi - 7
24
12
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PLC WI RI NG DI AGRAM
Input
01
02
Output
PLC
01
02
20
11
A
12
20
03
11
20
External
switches
Stored program
TI-3222: Otomasi Sistem Produksi - 7
25
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
SCAN
A PLC resolv es t he logic of a ladder diagram ( program ) rung by rung, from
t he t op t o t he bot t om . Usually , all t he out put s are updat ed based on t he
st at us of t he int ernal regist er s. Then t he input st at es are check ed and t he
cor responding input regist er s are updat ed. Only aft er t he I / Os have been
resolved, is t he program t hen execut ed. This process is run in a endless
cy cle. The t im e it t akes t o finish one cy cle is called t he scan t im e.
Output
Input
begin
Idle
Scan cycle
Resolve
logic
TI-3222: Otomasi Sistem Produksi - 7
26
13
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PLC I NSTRUCTI ONS
1) Relay,
2) Tim er and count er,
3) Program cont rol,
4) Arit hm et ic,
5) Dat a m anipulat ion,
6) Dat a t ransfer, and
7) Ot hers, such as sequencers.
TI-3222: Otomasi Sistem Produksi - 7
27
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
LOGI C STATES
ON : TRUE, cont act closure, energize, et c.
OFF: FALSE, cont act open , de- energize, et c.
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. )
TI-3222: Otomasi Sistem Produksi - 7
28
14
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
AND and OR LOGI C
PB2
PB1
R1
R1 = PB1.AND.PB2
AND
PB4
PB3
R2
R2 = PB2.AND.~PB4
R1
PB1
R1 = PB1 .OR. PB2
OR
PB2
TI-3222: Otomasi Sistem Produksi - 7
29
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
COMBI NED AND & OR
R1 = PB1 .OR. (PB2 .AND. PB3)
R1
PB1
PB2
pb3
TI-3222: Otomasi Sistem Produksi - 7
30
15
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
Relay diagram symbols
TI-3222: Otomasi Sistem Produksi - 7
31
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
Relay diagram symbols
TI-3222: Otomasi Sistem Produksi - 7
32
16
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
RELAY
A Relay consists of two parts, the coil and the contact(s).
Cont act s:
a. Norm ally open
-| | -
b. Norm ally closed
-| / | -
c. Off- on t ransit ional
-| ↓ | -
d. On- off t ransit ional
- | ↑| -
Coil:
a. Energize Coil
-( )-
b. De- energize
-(/ )-
c. Lat ch
- ( L) -
d. Unlat ch
- ( U) -
()
33
TI-3222: Otomasi Sistem Produksi - 7
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
TI MERS AND COUNTERS
I n pu t
Tim ers:
a. Ret ent ive on delay
b. Ret ent ive off delay
c. Reset
- ( RTO) - ( RTF) - ( RST) -
Tr u e
Fa lse
Tr u e
RTO
count ing
st op
count ing
r e su m e
RTF
st op
count ing
st op
RTO r e a ch PR va lu e , ou t pu t ON
RTF r e a ch PR va lu e , ou t pu t OFF
Count er:
PR value in 0.1 second
a. Count er up
b. Count er down
c. Count er reset
- ( CTU) - ( CTD) - ( CTR) -
TI-3222: Otomasi Sistem Produksi - 7
34
17
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
SEQUENCER
Sequencers are used with machines or processes involving
repeating operating cycles which can be segmented into
steps.
Ou t pu t
St ep
A
B
C
Dw ell t im e
1
ON
OFF
OFF
5 sec
2
ON
ON
OFF
10 sec
3
OFF
OFF
ON
3 sec
4
OFF
ON
OFF
9 sec
TI-3222: Otomasi Sistem Produksi - 7
35
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
A-B PLC
I / O point s are num ber ed, t hey correspond t o t he I / O slot on
t he PLC.
For A- B cont roller used in our lab
I/O
uses 1- 32
I nt ernal relays use 033 - 098
I nt ernal t im ers/ count ers/ sequencers use 901- 932
St at us 951- 982
TI-3222: Otomasi Sistem Produksi - 7
36
18
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
Programming a PLC
TI-3222: Otomasi Sistem Produksi - 7
37
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
Ladder Logic for Tank
TI-3222: Otomasi Sistem Produksi - 7
38
19
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
Logic for Ladder Solution
TI-3222: Otomasi Sistem Produksi - 7
39
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
How does it work?
TI-3222: Otomasi Sistem Produksi - 7
40
20
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PROGRAMMI NG EXAMPLE 1
Bar code reader
microswitch
Stopper
Conveyor
Part
Robot
id
Machine
D e scr ipt ion
St a t e
Ex pla na t ion
MSI
m icro swit ch
1
part arrive
R1
out put t o bar code reader
1
scan t he part
C1
input from bar code reader
1
right part
R2
out put robot
1
loading cycle
R3
out put robot
1
unloading cycle
C2
input from robot
1
robot busy
R4
out put t o st opper
1
st opper up
C3
input from m achine
1
m achine busy
C4
input from m achine
1
t ask com plet e
TI-3222: Otomasi Sistem Produksi - 7
41
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
SOLUTI ON
Input
MS1
C1
C2
C3
C4
Output
01
02
11
12
03
04
13
14
Programmable
Controller
PLC
05
15
R1
R2
R3
•
R4
•
•
01
11
14
14
02
14
04
05
03
03
12
•
13
Ru n g 1 . I f part
arrives and no part is
st opped, t rigger t he
bar code reader.
Ru n g 2 . I f it is a
right part , act ivat e t he
st opper.
Ru n g 3 . I f t he
st opper is up, t he
m achine is not busy
and t he robot is not
busy, load t he part
ont o t he m achine.
Ru n g 4 . I f t he t ask is
com plet ed and t he
robot is not busy,
unload t he m achine.
TI-3222: Otomasi Sistem Produksi - 7
42
21
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
Jefferson street
EXAMPLE 2 TRAFFI C LI GHTS
Main street
Cycle t im e
St reet
Red
Yellow
Green
Main
3
1
4
Jefferson
5
1
2
TI-3222: Otomasi Sistem Produksi - 7
43
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
WI RI NG DI AGRAM
input
output
64
Programmable
Controller
Jefferson Red
65
Jefferson Yellow
66
Jefferson Green
67
Main Red
70
Main Yellow
71
Main Green
TI-3222: Otomasi Sistem Produksi - 7
44
22
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PROGRAM (1)
901
RTO
RUNG1
901
RUNG2
901
901
902
67
RUNG3
RTO
901
RUNG5
901
RUNG6
902
903
66
J. Green
903
RTO
901
RUNG8
902
903
20
RST
904
M. Green
71
RUNG9
904
71
RUNG10
30
RST
66
RUNG7
M. Red
902
67
RUNG4
80
RST
RTO
901
RUNG11
904
904
40
RST
905
70
RUNG12
M. Yellow
45
TI-3222: Otomasi Sistem Produksi - 7
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PROGRAM (2)
RUNG13
905
70
RTO
901
RUNG14
903
905
906
65
RUNG15
RUNG16
RUNG18
RUNG19
RUNG 20
J. Yellow
906
65
901
RUNG17
10
RST
RTO
906
10
RST
902
907
64
907
RTO
64
901
907
J. Red
50
RST
TI-3222: Otomasi Sistem Produksi - 7
46
23
TI -3222: Otomasi Sistem Produksi
Pr ogr a m m a ble Logic Con t r olle r
Laborat orium Sist em Produksi
www.lspit b.org
©2004
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
Hasil Pembelajaran
•
Um um
•
Khusus
Mahasiwa m am pu unt uk m elakukan proses perancangan
sist em ot om asi, sist em m esin NC, sert a m erancang dan
m engim plem ent asikan sist em kont rol logika.
Mem aham i fungsi PLC sert a kom ponen- kom ponen PLC
TI-3222: Otomasi Sistem Produksi - 7
2
1
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PURPOSE OF Programmable
Logic Controllers (PLCs)
•
I nit ially designed t o replace relay logic boards
•
•
Accept s input from a series of swit ches
Sends out put t o devices or relays
Sequence device act uat ion
Coordinat e act ivit ies
TI-3222: Otomasi Sistem Produksi - 7
3
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PURPOSE OF Programmable
Logic Controllers (PLCs)
•
I nit ially designed t o replace relay logic boards
•
•
Accept s input from a series of swit ches
Sends out put t o devices or relays
Sequence device act uat ion
Coordinat e act ivit ies
TI-3222: Otomasi Sistem Produksi - 7
4
2
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
FUNCTI ONS OF CONTROLLERS
•
•
•
•
1) on- off cont rol,
2) sequent ial cont rol,
3) feedback cont rol, and
4) m ot ion cont rol.
TI-3222: Otomasi Sistem Produksi - 7
5
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
CONTROL DEVI CES
1) m echanical cont rol - cam , governor, et c.,
2) pneum at ic cont rol - com pressed air, valves,
et c.
3) elect rom echanical cont rol - swit ches, relays,
a t im er, count ers, et c,
4) elect ronics cont rol - sim ilar t o
elect rom echanical cont rol, except uses
elect ronic swit ches.
5) com put er cont rol.
TI-3222: Otomasi Sistem Produksi - 7
6
3
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PROGRAMMABLE LOGI C
CONTROLLER
Invented in 1968 as a substitute for hardwired relay panels.
" A digit ally operat ing elect ronic apparat us which uses a
program m able m em ory for t he int ernal st orage of
inst ruct ions by im plem ent ing specific funct ions such as logic
sequencing, t im ing, count ing, and arit hm et ic t o cont rol,
t hrough digit al or analog input / out put m odules, various
t ypes of m achines or processes. The digit al com put er which
is used t o perform t he funct ions of a program m able
cont roller is considered t o be wit hin t his scope. Excluded
are drum and ot her sim ilar m echanical sequencing
cont rollers."
National Electrical Manufacturing Association (NEMA)
TI-3222: Otomasi Sistem Produksi - 7
7
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
VENDORS
•
•
•
•
•
•
•
Rockwell
GE/ Fanuc
Schnieder
MODI COM - GOULD
ALLEN- BRADLEY
Honeywell
SQUARE- D
et c.
TI-3222: Otomasi Sistem Produksi - 7
8
4
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PLC
Input
CPU
Input
Module
Flag
System
Output
Output
Module
User Ladder
Diagram
Working
memory
registers
TI-3222: Otomasi Sistem Produksi - 7
9
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PLC Configuration
TI-3222: Otomasi Sistem Produksi - 7
10
5
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
What devices does a PLC interact with?
•
•
•
I NPUT RELAYS- ( cont act s) These are connect ed t o t he out side
world. They physically exist and receive signals from swit ches,
sensors, et c. Typically t hey are not relays but rat her t hey are
t ransist ors.
I NTERNAL UTI LI TY RELAYS- ( cont act s) These do not receive
signals from t he out side w orld nor do t hey physically exist .
They are sim ulat ed relays and are what enables a PLC t o
elim inat e ext ernal relays. There are also som e special relays
t hat are dedicat ed t o perform ing only one t ask. Som e are
always on while som e are always off. Som e are on only once
during pow er- on and are t ypically used for init ializing dat a
t hat was st ored.
COUNTERS- These again do not physically exist . They are
sim ulat ed count ers and t hey can be pr ogram m ed t o count
pulses. Typically t hese count ers can count up, down or bot h
up and down. Since t hey are sim ulat ed t hey are lim it ed in
t heir count ing speed. Som e m anufact urers also include highspeed count ers t hat are hardware based. We can t hink of
t hese as physically exist ing. Most t im es t hese count ers can
count up, down or up and down.
TI-3222: Otomasi Sistem Produksi - 7
11
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
What devices does a PLC interact with?
Continued
•
•
•
TI MERS- These also do not physically exist . They com e in m any
variet ies and increm ent s. The m ost com m on t ype is an on- delay
t ype. Ot hers include off- delay and bot h ret ent ive and nonret ent ive t ypes. I ncrem ent s vary from 1m s t hrough 1s.
OUTPUT RELAYS- ( coils) These are connect ed t o t he out side world.
They physically exist and send on/ off signals t o solenoids, light s,
et c. They can be t ransist ors, relays, or t riacs depending upon t he
m odel chosen.
DATA STORAGE- Typically t here are regist ers assigned t o sim ply
st ore dat a. They are usually used as t em porary st orage for m at h
or dat a m anipulat ion. They can also t ypically be used t o st ore
dat a when power is rem oved from t he PLC. Upon power- up t hey
will st ill have t he sam e cont ent s as before power was rem oved.
Very convenient and necessary! !
TI-3222: Otomasi Sistem Produksi - 7
12
6
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
SWI TCHES
Non-locking
Locking
Normally Open
Normally Closed
P1
SPDT
DPST
P2
Multiple Throw
Multiple Pole
Break-before-make
Make-before-break
13
TI-3222: Otomasi Sistem Produksi - 7
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
TERMS
Th r ow - n u m be r of st a t e s
Pole
- n u m be r of con n e ct in g m ovin g pa r t s ( n u m be r of
in dividu a l cir cu it s) .
A serial switch box (A-B box) has
two 25 pin serial ports to switch from.
SPDT
A
B
Output
Input
DPST
Knob
How is this switch classified?
TI-3222: Otomasi Sistem Produksi - 7
14
7
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
TYPES OF SWI TCHES
1. Basic swit ch, operat ed by a m echanical level,
2. Push- but t on swit ch,
3. Slide swit ch,
4. Thum bwheel swit ch,
5. Lim it swit ch,
6. Proxim it y swit ch, and
7. Phot oelect ric swit ch.
RATING: voltage, current
TI-3222: Otomasi Sistem Produksi - 7
15
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
RELAYS
A switch whose operation is activated by an electromagnet is called a "relay"
contact
coil
input
Relay coil
Output contact
TI-3222: Otomasi Sistem Produksi - 7
16
8
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
COUNTER
Digit al count ers out put in t he form of a relay cont act when a
preassigned count value is reached.
input
5
Register
Accumulator
reset
contact
output
Input
Reset
Output
Count
0
12
3
0
5
4
1
17
TI-3222: Otomasi Sistem Produksi - 7
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
TI MER
A t im er consist s of an int ernal clock, a count value regist er, and an
accum ulat or. I t is used for or som e t im ing purpose.
Clock
Accumulator
reset
Register
Clock
contact
Contact
output
Reset
Output
Count
0
1
2
3
4
Time 5 seconds.
TI-3222: Otomasi Sistem Produksi - 7
5
18
9
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
AN EXAMPLE OF RELAY LOGI C
For process cont rol, it is desir ed t o have t he process st art ( by t urning on a
m ot or) five seconds aft er a part t ouches a lim it swit ch. The process is
t er m inat ed aut om at ically when t he finished part t ouches a second lim it
sw it ch. An em ergency sw it ch will st op t he process any t im e when it is
pushed.
L1
LS1
PB1
LS2
R1
R1
R1
TIMER
R2
PB1
LS1
LS2
PR=5
TIMER
5
R1
TI-3222: Otomasi Sistem Produksi - 7
Motor
R2
19
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PLC ARCHI TECTURE
Program m able cont rollers replace m ost of t he relay panel wiring by
soft ware program m ing.
Program
Loader
PC
Switches
Printer
Processor
I/O
Modules
Memory
Power
Supply
Machines
Cassette
Loader
EPROM
Loader
External Devices
Peripherals
A typical PLC
TI-3222: Otomasi Sistem Produksi - 7
20
10
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PLC COMPONENTS
1. Processor
Microprocessor based, m ay allow ar it hm et ic
operat ions, logic operat or s, block m em ory m oves,
com put er int er face, local area net wor k , funct ions, et c.
2. Mem ory
Measured in w ords.
ROM ( Read Only Mem ory) ,
RAM ( Random Access Mem or y) ,
PROM ( Pr ogram m able Read Only Mem or y) ,
EEPROM ( Elect ronically Erasable Pr ogram m able
ROM) ,
EPROM ( Erasable Pr ogram m able Read Only Mem ory ) ,
EAPROM ( Elect ronically Alt erable Pr ogram m able
Read Only Mem or y) , and
Bubble Mem or y.
TI-3222: Otomasi Sistem Produksi - 7
21
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PLC COMPONENTS
3. I / O
Modular plug- in periphery
AC volt age input and out put ,
DC volt age input and out put ,
Low level analog input ,
High level analog input and out put ,
Special purpose m odules, e.g.., high speed t im ers,
St epping m ot or cont rollers, et c. PI D, Mot ion
4. Power supply AC power
5. Peripheral
Hand held program m er ( loader) ,
CRT program m er,
Operat or console,
Print er,
Sim ulat or,
EPROM loader,
Casset t e loader,
Graphics processor, and
Net work com m unicat ion int erface. MAP, LAN
TI-3222: Otomasi Sistem Produksi - 7
22
11
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
LADDER DI AGRAM
A ladder diagram ( also called cont act sym bology) is a m eans of
graphically represent ing t he logic required in a relay logic
syst em .
Rail
start
PB1
emergency stop
PB2
R1
Rung
R1
R1
A
TI-3222: Otomasi Sistem Produksi - 7
23
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
Ladder Representation
TI-3222: Otomasi Sistem Produksi - 7
24
12
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PLC WI RI NG DI AGRAM
Input
01
02
Output
PLC
01
02
20
11
A
12
20
03
11
20
External
switches
Stored program
TI-3222: Otomasi Sistem Produksi - 7
25
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
SCAN
A PLC resolv es t he logic of a ladder diagram ( program ) rung by rung, from
t he t op t o t he bot t om . Usually , all t he out put s are updat ed based on t he
st at us of t he int ernal regist er s. Then t he input st at es are check ed and t he
cor responding input regist er s are updat ed. Only aft er t he I / Os have been
resolved, is t he program t hen execut ed. This process is run in a endless
cy cle. The t im e it t akes t o finish one cy cle is called t he scan t im e.
Output
Input
begin
Idle
Scan cycle
Resolve
logic
TI-3222: Otomasi Sistem Produksi - 7
26
13
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PLC I NSTRUCTI ONS
1) Relay,
2) Tim er and count er,
3) Program cont rol,
4) Arit hm et ic,
5) Dat a m anipulat ion,
6) Dat a t ransfer, and
7) Ot hers, such as sequencers.
TI-3222: Otomasi Sistem Produksi - 7
27
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
LOGI C STATES
ON : TRUE, cont act closure, energize, et c.
OFF: FALSE, cont act open , de- energize, et c.
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. )
TI-3222: Otomasi Sistem Produksi - 7
28
14
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
AND and OR LOGI C
PB2
PB1
R1
R1 = PB1.AND.PB2
AND
PB4
PB3
R2
R2 = PB2.AND.~PB4
R1
PB1
R1 = PB1 .OR. PB2
OR
PB2
TI-3222: Otomasi Sistem Produksi - 7
29
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
COMBI NED AND & OR
R1 = PB1 .OR. (PB2 .AND. PB3)
R1
PB1
PB2
pb3
TI-3222: Otomasi Sistem Produksi - 7
30
15
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
Relay diagram symbols
TI-3222: Otomasi Sistem Produksi - 7
31
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
Relay diagram symbols
TI-3222: Otomasi Sistem Produksi - 7
32
16
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
RELAY
A Relay consists of two parts, the coil and the contact(s).
Cont act s:
a. Norm ally open
-| | -
b. Norm ally closed
-| / | -
c. Off- on t ransit ional
-| ↓ | -
d. On- off t ransit ional
- | ↑| -
Coil:
a. Energize Coil
-( )-
b. De- energize
-(/ )-
c. Lat ch
- ( L) -
d. Unlat ch
- ( U) -
()
33
TI-3222: Otomasi Sistem Produksi - 7
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
TI MERS AND COUNTERS
I n pu t
Tim ers:
a. Ret ent ive on delay
b. Ret ent ive off delay
c. Reset
- ( RTO) - ( RTF) - ( RST) -
Tr u e
Fa lse
Tr u e
RTO
count ing
st op
count ing
r e su m e
RTF
st op
count ing
st op
RTO r e a ch PR va lu e , ou t pu t ON
RTF r e a ch PR va lu e , ou t pu t OFF
Count er:
PR value in 0.1 second
a. Count er up
b. Count er down
c. Count er reset
- ( CTU) - ( CTD) - ( CTR) -
TI-3222: Otomasi Sistem Produksi - 7
34
17
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
SEQUENCER
Sequencers are used with machines or processes involving
repeating operating cycles which can be segmented into
steps.
Ou t pu t
St ep
A
B
C
Dw ell t im e
1
ON
OFF
OFF
5 sec
2
ON
ON
OFF
10 sec
3
OFF
OFF
ON
3 sec
4
OFF
ON
OFF
9 sec
TI-3222: Otomasi Sistem Produksi - 7
35
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
A-B PLC
I / O point s are num ber ed, t hey correspond t o t he I / O slot on
t he PLC.
For A- B cont roller used in our lab
I/O
uses 1- 32
I nt ernal relays use 033 - 098
I nt ernal t im ers/ count ers/ sequencers use 901- 932
St at us 951- 982
TI-3222: Otomasi Sistem Produksi - 7
36
18
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
Programming a PLC
TI-3222: Otomasi Sistem Produksi - 7
37
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
Ladder Logic for Tank
TI-3222: Otomasi Sistem Produksi - 7
38
19
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
Logic for Ladder Solution
TI-3222: Otomasi Sistem Produksi - 7
39
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
How does it work?
TI-3222: Otomasi Sistem Produksi - 7
40
20
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PROGRAMMI NG EXAMPLE 1
Bar code reader
microswitch
Stopper
Conveyor
Part
Robot
id
Machine
D e scr ipt ion
St a t e
Ex pla na t ion
MSI
m icro swit ch
1
part arrive
R1
out put t o bar code reader
1
scan t he part
C1
input from bar code reader
1
right part
R2
out put robot
1
loading cycle
R3
out put robot
1
unloading cycle
C2
input from robot
1
robot busy
R4
out put t o st opper
1
st opper up
C3
input from m achine
1
m achine busy
C4
input from m achine
1
t ask com plet e
TI-3222: Otomasi Sistem Produksi - 7
41
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
SOLUTI ON
Input
MS1
C1
C2
C3
C4
Output
01
02
11
12
03
04
13
14
Programmable
Controller
PLC
05
15
R1
R2
R3
•
R4
•
•
01
11
14
14
02
14
04
05
03
03
12
•
13
Ru n g 1 . I f part
arrives and no part is
st opped, t rigger t he
bar code reader.
Ru n g 2 . I f it is a
right part , act ivat e t he
st opper.
Ru n g 3 . I f t he
st opper is up, t he
m achine is not busy
and t he robot is not
busy, load t he part
ont o t he m achine.
Ru n g 4 . I f t he t ask is
com plet ed and t he
robot is not busy,
unload t he m achine.
TI-3222: Otomasi Sistem Produksi - 7
42
21
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
Jefferson street
EXAMPLE 2 TRAFFI C LI GHTS
Main street
Cycle t im e
St reet
Red
Yellow
Green
Main
3
1
4
Jefferson
5
1
2
TI-3222: Otomasi Sistem Produksi - 7
43
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
WI RI NG DI AGRAM
input
output
64
Programmable
Controller
Jefferson Red
65
Jefferson Yellow
66
Jefferson Green
67
Main Red
70
Main Yellow
71
Main Green
TI-3222: Otomasi Sistem Produksi - 7
44
22
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PROGRAM (1)
901
RTO
RUNG1
901
RUNG2
901
901
902
67
RUNG3
RTO
901
RUNG5
901
RUNG6
902
903
66
J. Green
903
RTO
901
RUNG8
902
903
20
RST
904
M. Green
71
RUNG9
904
71
RUNG10
30
RST
66
RUNG7
M. Red
902
67
RUNG4
80
RST
RTO
901
RUNG11
904
904
40
RST
905
70
RUNG12
M. Yellow
45
TI-3222: Otomasi Sistem Produksi - 7
D e pa r t e m e n Te k nik I ndust r i FTI - I TB
PROGRAM (2)
RUNG13
905
70
RTO
901
RUNG14
903
905
906
65
RUNG15
RUNG16
RUNG18
RUNG19
RUNG 20
J. Yellow
906
65
901
RUNG17
10
RST
RTO
906
10
RST
902
907
64
907
RTO
64
901
907
J. Red
50
RST
TI-3222: Otomasi Sistem Produksi - 7
46
23