• No results found

PLC Programming

N/A
N/A
Protected

Academic year: 2021

Share "PLC Programming"

Copied!
18
0
0

Loading.... (view fulltext now)

Full text

(1)

LADDER LOGIC

LADDER LOGIC

Prepared by

Prepared by

Gagandeep

Gagandeep

(2)

FUNCTIONS OF

FUNCTIONS OF

CONTROLLERS

CONTROLLERS

1) on-off control,

1) on-off control,

2) sequential control,

2) sequential control,

3) feedback control, and

3) feedback control, and

4) motion control.

(3)

CONTROL

CONTROL

DEVICES

DEVICES

1) mechanical control -

1) mechanical control - cam, governor

cam, governor, etc.,

, etc.,

2) pneumatic control

2) pneumatic control - compressed air, valves,etc.

- compressed air, valves,etc.

3) electromechanical control - switches, relays, a

3) electromechanical control - switches, relays, a

timer, counters, etc,

timer, counters, etc,

4) electronics control - similar to

4) electronics control - similar to

electromechanic

electromechanical control, except

al control, except uses

uses

electronic switches.

electronic switches.

5) computer control.

5) computer control.

(4)

SWITCHE

SWITCHE

S

S

DPST DPST SPDT SPDT N o n

-N o n -llo o c c kkiinngg LLo o c c kkiin n gg

N

No o rrm m a a lllly O y O ppe e nn No No rrm m a a lllly Cy Clloos s e e dd

M

Mu u llttiip p lle e TTh h rro o ww

P P 11

P P 22

M

Mu u llttiip p lle e P P o o llee

B

(5)

TYPES OF

TYPES OF

SWITCHES

SWITCHES

Selector switches

Selector switches

Pushbutton switches

Pushbutton switches

Photoelectric

Photoelectric

switches

switches

Limit Switches

Limit Switches

Proximity switches

Proximity switches

Level switches

Level switches

Thumbwheel

Thumbwheel

switches

switches

Slide switches

Slide switches

RATING:

RATING:

24

24 V

Volts AC/DC

olts AC/DC

48

48 V

Volts AC/DC

olts AC/DC

120

120 V

Volts AC/DC

olts AC/DC

230

230 V

Volts AC/DC

olts AC/DC

• •

TTL level

TTL level

(Transistor-to-transistor

(Transistor-to-transistor

±5V)

±5V)

(6)

RELAY

RELAY

S

S

A switch whose operation is activated by an electromagnet is

A switch whose operation is activated by an electromagnet is called a "relay"called a "relay"

contact contact coil coil input input Relay coil Relay coil R1 R1 R1 R1 Output contact Output contact

(7)

 AN EXAMPLE OF RELA

 AN EXAMPLE OF RELA

Y

Y

LOGIC

LOGIC

For a process control, it is desired

For a process control, it is desired to have the process start (by turning on ato have the process start (by turning on a motor) five seconds after

motor) five seconds after a part a part touched a limit touched a limit switch. switch. The process isThe process is

terminated automatically when the finished part touches a second limit switch. terminated automatically when the finished part touches a second limit switch.  An emerge

 An emergency switch wncy switch will stop the process ill stop the process any time wany time when it is pushed.hen it is pushed.

L1 L1 LS1 LS1 PB1PB1 LS2LS2 R1R1 R1 R1 R1 R1 TIMERTIMER R2R2 PR=5 PR=5 LS1 LS1 PB1 PB1 LS2 LS2 R1 R1 TIMER TIMER 5 5 Motor Motor R2 R2

(8)

LADDER

LADDER

DIAGRAM

DIAGRAM

 A

 A ladder diagram (aladder diagram (also called contalso called contact symboct symbology) logy) is a means of is a means of graphicallygraphically representi

representing the ng the logic required in logic required in a a relay logic relay logic system.system.

A A R1 R1 PB1 PB1 PB2PB2 R1 R1 R1 R1 start

start emergemergenency stopcy stop

Rail Rail

Rung Rung

(9)

PLC WIRING

PLC WIRING

DIAGRAM

DIAGRAM

External External switches switches Stored program Stored program 01 01 02 02 2020 20 20 20 20 1111 01 01 02 02 03 03 11 11 12 12 C C PLC PLC Input

Input OutputOutput

A A B B

(10)

PLC

PLC

Programming

Programming

Ladder Diagram - most common

Ladder Diagram - most common

Structure T

Structure Text

ext Programming

Programming (ST)

(ST)

Functional Block Programming (FB)

Functional Block Programming (FB)

Instruction List (IL)

Instruction List (IL)

(11)

 AND

 AND

and OR

and OR

LOGIC

LOGIC

PB1 PB1 PB2PB2 R1R1 R2 R2 R1 = PB1.AND.PB2 R1 = PB1.AND.PB2 R2 = PB2.AND.~PB4 R2 = PB2.AND.~PB4 PB3 PB3 PB4PB4 PB1 PB1 R1R1 PB2 PB2 R1 = PB1 .OR. PB2 R1 = PB1 .OR. PB2 AND AND OR OR

(12)

COMBINED

COMBINED

AND

AND

&

&

OR

OR

R1 = PB1 .OR. (PB2 .AND. PB3) R1 = PB1 .OR. (PB2 .AND. PB3) PB1 PB1 R1R1 PB2 PB2 pb3pb3

(13)

RELAY

RELAY

Contacts:

Contacts:

a.

a. Normally Normally open open -| -| |- |-b.

b. Normally Normally closed closed -|/|- -|/|-c.

c. Positive Positive transition transition sensing sensing -|-|PP|- |-d. Negative

d. Negative transition transition sensing sensing -|-|NN|-

|-Coil: Coil:

a.

a. Coil Coil -( -( )- )-b.

b. negative negative coil coil -(/)- -(/)-c.

c. Set Set Coil Coil -(S)- -(S)-d.

d. Reset Reset Coil Coil -(R)-

-(R)-A Relay consists of two parts, the coil and the contact(s). A Relay consists of two parts, the coil and the contact(s).

( ) ( )

(14)

Relay

Relay

(continue)

(continue)

Coil: Coil: e.

e. Retentive Retentive memory memory Coil Coil -(M)- -(M)-f.

f. Set Set retentive retentive memory memory Coil Coil -(SM)- -(SM)-g.

g. Reset Reset retentive retentive memory memory Coil Coil -(RM)- -(RM)-h.

h. Positive Positive TTransition-sensing ransition-sensing Coil Coil -(P)- -(P)-h.

h. Negative Negative TTransition-sensing ransition-sensing Coil Coil -(N)-

-(N)-(set coil latches the state, reset coil deenergize the set

(set coil latches the state, reset coil deenergize the set coil.coil. retentive coil retain the state after power failure.)

(15)

TIMERS AND

TIMERS AND

COUNTERS

COUNTERS

Timers: Timers: a.

a. Retentive Retentive on on delay delay -(RTO)- -(RTO)-b.

b. Retentive Retentive off off delay delay -(RTF)- -(RTF)-c.

c. Reset Reset -(RST)- -(RST)-Counter:

Counter:

a.

a. Counter Counter up up -(CTU)- -(CTU)-b.

b. Counter Counter down down -(CTD)- -(CTD)-c.

c. Counter Counter reset reset -(CTR)-

-(CTR)-RTO

RTO counting counting stop stop countingcounting resume resume RTF

RTF stop stop counting counting stopstop True

True False False TrueTrue Input

Input

RTO reach PR value, output ON RTO reach PR value, output ON RTF reach PR value, output OFF RTF reach PR value, output OFF PR value in 0.1 second PR value in 0.1 second

(16)

SEQUENCE

SEQUENCE

R

R

Output Output Step

Step A A B B C C Dwell Dwell timetime 1

1 ON ON OFF OFF OFF OFF 5 5 sec.sec. 2

2 ON ON ON ON OFF OFF 10 10 sec.sec. 3

3 OFF OFF OFF OFF ON ON 3 3 sec.sec. 4

4 OFF OFF ON OFF ON OFF 9 9 sec.sec.

Sequencers are used with machines or processes involving Sequencers are used with machines or processes involving

repeating

repeating operating cycoperating cycles which can les which can be segmentebe segmented intod into steps.

(17)

PROGRAMMING

PROGRAMMING

EXAMPLE 1

EXAMPLE 1

id

id description description state state explanationexplanation MSI

MSI microswitch microswitch 1 1 part part arrivearrive R1

R1 output to output to bar bar code code reader reader 1 1 scan scan the the partpart C1

C1 input input from from bar bar code code reader reader 1 1 right right partpart R2

R2 output robot output robot 1 1 loading loading cyclecycle R3

R3 output robot output robot 1 1 unloading unloading cyclecycle C2

C2 input input from from robot robot 1 1 robot robot busybusy R4

R4 output to output to stopper stopper 1 1 stopper stopper upup C3

C3 input input from from machine machine 1 1 machine machine busybusy C4

C4 input input from from machine machine 1 1 task task completecomplete

Part Part

microswitch microswitch

Bar code reader Bar code reader

Stopper Stopper Conveyor Conveyor Machine Machine Robot Robot

(18)

SOLUTION

SOLUTION

Rung 1.

Rung 1. If paIf part arrivrt arrives and es and nono part is stopped, trigger the part is stopped, trigger the bar code reader.

bar code reader. Rung 2.

Rung 2. If it If it is a is a right partright part,, activate the stopper. activate the stopper. Rung 3.

Rung 3. If the If the stopper is stopper is up, theup, the machine is not busy and the machine is not busy and the robot is not busy, load the robot is not busy, load the part onto the machine. part onto the machine. Rung 4.

Rung 4. If the If the task is task is completedcompleted and the robot is not busy, and the robot is not busy, unload the machine.

unload the machine.

01 01 02 02 03 03 04 04 05 05 11 11 12 12 13 13 14 14 15 15 Input Input Output Output Programmable Programmable Controller Controller PLC PLC MS1 MS1 C1 C1 C2 C2 C3 C3 C4 C4 R1 R1 R2 R2 R3 R3 R4 R4 01 01 1414 1111 02 02 1 14 4 0044 0303 14 14 12 12 13 13 0 05 5 0033

References

Related documents

The data is successfully transmitted over the power lines by using power line module and arduino board by keeping switches on transmitter side while relay board on other side which

Figure 7 shows the relationship between output power Pout and load RL when the relay coil is fixed in the middle of transmitting coil and receiving coil, and the rotation angle θ

As for example 2.1, the PLC ladder logic notation (Figure 2.5 c ) is shortened from the relay wiring diagram to show only the third line, the relay contacts and the coil of the

DBF Breaker failure relay 50BF DBT Breaker coil/tripping circuit supervision relay 74 DDS Digital distribution system 50/51(+) DFF Frequency relay 81 DFM Feeder monitor + hi

As with timing instructions, counting instructions are usually connected like relay coil instructions in the ladder diagram, and space is reserved for the running count value

The Output Latch instruction (OTL) sets the addressed bit to logic state 1 when the rung containing the OTL is true.. After, the bit remains at logic state 1, regardless of

Unlike conventional power gating, the multiple sleep mode capability also provides an option of state-retentive mode to enable power savings during inactive periods

However, if the starting of the generator is automatically done by a relay which switches the battery voltage to ignition coil of the generator while the main power