LADDER LOGIC
Prepared by Gagandeep
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.
SWITCHE S
No n-lo c king Lo c king
No rma lly Ope n
No rma lly Clo s e d
SPDT
Multiple Thro w
P1
DPST
Multiple P o le
P2
Bre a k-be fo re -ma ke
Ma ke -be fo re -bre a k
TYPES OF SWITCHES
RATING: Selector switches Pushbutton switches 24 Volts AC/DC 48 Volts AC/DC Photoelectric 120 Volts AC/DC 230 Volts AC/DC switches TTL level Limit Switches (Transistor-to-transistor 5V) Proximity switches Isolated Input Level switches Thumbwheel switches Slide switches
RELAY S by an electromagnet is called a "relay" A switch whose operation is activated
contact
coil
input
Relay coil
R1
Output contact
R1
AN EXAMPLE OF RELAY LOGIC For a process control, it is desired to have the process start (by turning on a
L1 LS1 R1 TIMER R2 PB1 LS2 R1
motor) five seconds after a part touched 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.
R1
PB1 LS1
LS2
PR=5
TIMER 5
Motor R2
R1
LADDER DIAGRAM A ladder diagram (also called contact symbology) is a means of graphically
representing the logic required in a relay logic system. Rail
start PB1 emergency stop PB2 R1
Rung
R1
R1 A
PLC WIRING DIAGRAM
A B
Input 01 02 03 20 11 01 20 PLC 02 20 Output 11 12 C
External switches
Stored program
PLC Programming
Ladder Diagram - most common Structure Text Programming (ST) Functional Block Programming (FB) Instruction List (IL) Sequential Function Chart (SFC)
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
COMBINED AND & OR
R1 = PB1 .OR. (PB2 .AND. PB3)
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. Positive transition sensing
d. Negative transition sensing Coil: a. Coil b. negative coil c. Set Coil d. Reset Coil
-|P|-|N|() -( )-(/)-(S)-(R)-
Relay (continue)
Coil: e. Retentive memory Coil f. Set retentive memory Coil g. Reset retentive memory Coil -(M)-(SM)-(RM)-
h. Positive Transition-sensing Coil
h. Negative Transition-sensing Coil
-(P)-(N)-
(set coil latches the state, reset coil deenergize the set coil. retentive coil retain the state after power failure.)
TIMERS AND COUNTERS
Timers: a. Retentive on delay b. Retentive off delay c. Reset Counter: a. Counter up -(CTU)-(RTO)-(RTF)-(RST)True
Input False True counting resume
RTO counting stop RTF stop
counting stop
RTO reach PR value, output ON RTF reach PR value, output OFF
PR value in 0.1 second
b. Counter down
c. Counter reset
-(CTD)-(CTR)-
SEQUENCE Rwith machines or processes involving Sequencers are used
repeating operating cycles which can be segmented into steps. Output Step A B C Dwell time
1
2 3 4
ON
ON OFF OFF
OFF OFF
ON OFF OFF ON ON OFF
5 sec.
10 sec. 3 sec. 9 sec.
PROGRAMMING EXAMPLE 1
Bar code re ader microswitch Stopper Conveyor Part
Robot
Machine
id MSI R1 C1 R2 R3 C2 R4 C3 C4
description microswitch output to bar code reader input from bar code reader output robot output robot input from robot output to stopper input from machine input from 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
SOLUTION
Input MS1 C1 C2 C3 C4 01 02 03 04 05 Pro grammable Controlle r PLC Outpu t 11 12 13 14 15 R1 R2 R3 R4
01
14
11
02
14
14
04
03
12
05
03
13
Rung 1. If part arrives and no part is stopped, trigger the bar code reader. Rung 2. If it is a right part, activate the stopper. Rung 3. If the stopper is up, the machine is not busy and the robot is not busy, load the part onto the machine. Rung 4. If the task is completed and the robot is not busy, unload the machine.