40
Programmable Logic controller 1 Programmable Logic Controllers

PLC Instructions IIT-Delhi

Embed Size (px)

DESCRIPTION

PLC Instructions IITD. PLC Lecture notes from IIT Delhi for facytory automation

Citation preview

Page 1: PLC Instructions IIT-Delhi

Programmable Logic controller 1

Programmable Logic Controllers

Page 2: PLC Instructions IIT-Delhi

Automation Lab PLC Architecture

Programmable Logic controller 2

Page 3: PLC Instructions IIT-Delhi

Micrologix 1100 Panel

3

Page 4: PLC Instructions IIT-Delhi

Micrologix 1100 I/Os

4

Page 5: PLC Instructions IIT-Delhi

Analog Input Module

5

Page 6: PLC Instructions IIT-Delhi

Analog Output Module

6

Page 7: PLC Instructions IIT-Delhi

Relay Contacts

7

Page 8: PLC Instructions IIT-Delhi

Micrologix 1100

8

Page 9: PLC Instructions IIT-Delhi

I/O Addressing

Programmable Logic controller 9

Page 10: PLC Instructions IIT-Delhi

I/O Addressing Examples

10

Page 11: PLC Instructions IIT-Delhi

Instruction Set XIC [Examine if Closed]

This instruction (also called

"examine on" or "normally opened") functions as an input or storage bit.

If the corresponding memory bit is a "1" (on), this instruction will allow rung continuity and outputs will be energized.

Programmable Logic controller 11

Page 12: PLC Instructions IIT-Delhi

Instruction Set XIO [Examine if Open] This instruction (also called "examine

off" or "normally closed") functions as an input or storage bit.

If the corresponding memory bit is a "1" (on), this instruction will not allow rung continuity and outputs on its rung will be de-energized.

If the corresponding memory bit is a "0" (off), this instruction will assume its normal status and allow rung continuity and outputs on the rung will be energized.

Programmable Logic controller 12

Page 13: PLC Instructions IIT-Delhi

Instruction Set OTE [Output Energize] This instruction sets the specified bit

when rung continuity is achieved (rung goes true).

Under normal operating conditions, if the set bit corresponds to an output device, the output device will be energized when the rung goes true.

Programmable Logic controller 13

Page 14: PLC Instructions IIT-Delhi

Instruction Set OTL [Output Latch] This instruction functions much the

same as the OTE with the exception that once a bit is set with an OTL, it is "latched" on. Once an OTL bit has been set "on" (1 in the memory) it will remain "on" even if the rung condition goes false. The bit must be reset with an OTU instruction.

Latch and unlatch instructions must be assigned the same address in your logic program. Output addresses are specified to the bit level. Programmable Logic controller 14

Page 15: PLC Instructions IIT-Delhi

Instruction Set OTU [Output Unlatch] Use this output instruction to unlatch

(reset) a latched (set) bit which was set by an OTL instruction.

The OTU address must be identical to the OTL address which originally set the bit.

Note: In the event of a power loss, any OTL controlled output device will energize with the return of power if the OTL bit was set when power was lost.

Programmable Logic controller 15

Page 16: PLC Instructions IIT-Delhi

Timers & Counters

Delay turning ON an output: TON Delay turning OFF an output: TOF Time an event retentively: RTO

Count Up: CTU Count Down: CTD

Programmable Logic controller 16

Page 17: PLC Instructions IIT-Delhi

Understanding Timer and Counter Instruction Terms

Accumulated Value (ACC) For a timer, this is the number of timebase intervals

the instruction has counted. For a counter, this is the number of false-to-true

transitions that have occurred.

Preset Value (PRE) The preset value is the set point that you enter in the

timer or counter instruction. When the accumulated value becomes equal to or

greater than the preset value, the done status bit is set. You can use this bit to control an output device.

17

Page 18: PLC Instructions IIT-Delhi

Understanding Timer and Counter Instruction Terms

Timebase The timebase determines the duration of each

timebase interval.

Timer Data File Element

15 14 13 12 11 … 0 Word 0: EN TT DN Word 1: Preset Value Word 2: Accumulated Value

18

Page 19: PLC Instructions IIT-Delhi

Understanding Timer and Counter Instruction Terms

Counter Data File Element 15 14 13 12 11 … 0 Word 0: CU CD DN OV UN Word 1: Preset Value Word 2: Accumulated Value

19

Page 20: PLC Instructions IIT-Delhi

TON [Timer On-Delay] Use the TON instruction to turn an

output on or off after the timer has been ON for a preset time interval.

This output instruction begins timing (at either one second or one hundredth of a second intervals) when its rung goes "true."

It waits the specified amount of time (as set in the PRESET), keeps track of the accumulated intervals which have occurred (ACCUM), and sets the DN (done) bit when the ACCUM (accumulated) time equals the PRESET time.

Programmable Logic controller 20

Page 21: PLC Instructions IIT-Delhi

TON [Timer On-Delay] As long as rung conditions

remain true, the timer adjusts its accumulated value (ACC) each evaluation until it reaches the preset value (PRE).

The accumulated value is reset when rung conditions go false, regardless of whether the timer has timed out.

If power is lost while a TON is timing but has not reached its preset value, the EN, and TT bits remain set , and the accumulated value (ACCUM) remains the same.

21

Preset Accum

DN

Page 22: PLC Instructions IIT-Delhi

TON Example Cylinder 1A1 extends, if start button S1

is actuated. Once this has been extended for 2s, a

second cylinder 2A1 move to its forward end position.

Sensors 1B1 and 1B2 indicates the retracted and the forward end positions of cylinder 1A1.

22

Page 23: PLC Instructions IIT-Delhi

TOF [Timer Off-Delay] Use the TOF instruction to turn an

output on or off after its rung has been off for a preset time interval.

The TOF instruction begins to count timebase intervals when the rung makes a true-to-false transition.

As long as rung conditions remain false, the timer increments its accumulated value (ACC) based on the timebase for each scan until it reaches the preset value (PRE).

The Accumulated value is reset when rung conditions go true regardless of whether the timer has timed out.

Programmable Logic controller 23

Preset Accum

DN

Page 24: PLC Instructions IIT-Delhi

TOF [Timer Off-Delay] Status bits: 13 = DN (done bit): Set when

rung conditions are true; remain so until rung conditions go false and the accumulated value is greater than or equal to the preset value.

14 = TT (timer timing bit): Set when rung conditions are false and the accumulated value is less than the preset value; remain so until rung conditions go true or when the done bit is reset.

15 = EN (enable bit): Set when rung conditions are true; remain so until rung conditions go false.

24

Page 25: PLC Instructions IIT-Delhi

RTO [Retentive Timer On-Delay] An RTO function the same as a TON

with the exception that once it has begun timing, it holds its count of time even if the rung goes false, a fault occurs, or power is lost.

When rung continuity returns (rung goes true again), the RTO begins timing from the accumulated time which was held when rung continuity was lost.

By retaining its accumulated value, retentive timers measure the cumulative period during which rung conditions are true.

The accumulated value can be reset by the RES instruction.

25

Preset Accum

DN

Page 26: PLC Instructions IIT-Delhi

RTO Example Pressing of the start button S2 is to

cause the piston of a cylinder to advance. This mechanism is used to clamp workpieces.

When the piston advance fully, it is to remain in this position for 20 seconds.

The cylinder then returns to its initial position.

26

Page 27: PLC Instructions IIT-Delhi

RES [Reset] The RES instruction is used to reset

timers and counters. When conditions preceding it in the

rung are true, the RES resets the accumulated value and control bits of the timer or counter.

Make sure that the timer or counter being controlled by the reset instruction has the same address as the reset instruction.

For example, if your RTO address is T4:1, your RES address must also be T4:1.

27

Page 28: PLC Instructions IIT-Delhi

RES [Reset] When resetting a counter, if the RES

instruction is enabled and the counter rung is enabled, the CU or CD bit is reset.

Warning! Do not use the RES instruction to reset a TOF instruction.

A RES always clears the status bits and the accumulated value. This could result in unpredictable machine operation or injury to personnel.

28

Page 29: PLC Instructions IIT-Delhi

CTU [Count Up] This output instruction counts up for

each false-to-true transition of conditions preceding it in the rung and produces an output when the accumulated value reaches the preset value.

Rung transitions might be triggered by a limit switch or by parts traveling past a detector.

The ability of the counter to detect false-to-true transitions depends on the speed (frequency) of the incoming signal.

The on and off duration of an incoming signal must not be faster than the scan time. Programmable Logic controller 29

Page 30: PLC Instructions IIT-Delhi

CTU [Count Up] Each count is retained when the

rung conditions again become false, permitting counting to continue beyond the preset value.

This way you can base an output on the preset but continue counting to keep track of inventory/parts, etc.

Note: Use a RES (reset) instruction with the same address as the counter, or another instruction in your program to overwrite the value.

Programmable Logic controller 30

Page 31: PLC Instructions IIT-Delhi

CTU [Count Up] Counter files use three words

per element. Instruction Bits:

12 = OV (count up overflow) bit 13 = DN (done) bit 15 = CU (count up enable) bit

The ON or OFF status of counter done, overflow, and underflow bits is retentive.

The accumulated value and control bits are reset when a RES is enabled.

Programmable Logic controller 31

Page 32: PLC Instructions IIT-Delhi

CTD [Count Down] This output instruction counts down

for each false-to-true transition of conditions preceding it in the rung and produces an output when the accumulated value reaches the preset value.

Rung transitions might be triggered by a limit switch or by parts traveling past a detector.

Each count is retained when the rung conditions again become false.

The count is retained until a RES (reset) instruction with the same address as the counter is enabled.

Programmable Logic controller 32

Page 33: PLC Instructions IIT-Delhi

CTU [Count Down] Counter files use three words per

element. Instruction Bits:

11 = UN (count down underflow) bit 13 = DN (done) bit 14 = CD (count down enable) bit

The accumulated value and control bits are reset when a RES is enabled.

Programmable Logic controller 33

Page 34: PLC Instructions IIT-Delhi

CTU Example Parts are to be ejected from a gravity-feed

magazine via a cylinder. If Push button S1 is actuated, the cylinder is

to advance, eject a workpiece and then retract again.

15 parts are to be ejected in this way. When 15 parts have been ejected, it should no longer be possible to trigger a cylinder movement via push button S1. First the counter must be reset by actuating push button S2. 34

Page 35: PLC Instructions IIT-Delhi

Level Application We are controlling lubricating

oil being dispensed from a tank.

This is possible by using two sensors.

We put one near the bottom and one near the top, as shown in the picture.

Programmable Logic controller 35

• Here, we want the fill motor to pump lubricating oil into the tank until the high level sensor turns on.

• At that point we want to turn off the motor until the level falls below the low level sensor. Then we should turn on the fill motor and repeat the process.

Page 36: PLC Instructions IIT-Delhi

Level Application Here we have a need for 3 I/O

(i.e. Inputs/Outputs). 2 are inputs (the sensors) and 1

is an output (the fill motor). Both of our inputs will be NC

(normally closed) fiber-optic level sensors. When they are NOT immersed in liquid they will be ON. When they are immersed in liquid they will be OFF.

Programmable Logic controller 36

Input: Low Level I:0.0/0 High Level I:0.0/1 Output: Fill Motor O:0.0/0 Internal Utility Relay B3:0/0

Page 37: PLC Instructions IIT-Delhi

Level Application Initially the tank is empty.

Therefore, input I:0.0/0 is TRUE and

input I:0.0/1 is also TRUE Gradually the tank fills

because O:0.0/0 (fill motor) is ON.

After some scans the oil level rises above the low level sensor and it becomes open. (i.e. FALSE).

Fill motor remains ON till oil level reaches and touches high level sensor and it also becomes open. (i.e. FALSE).

Programmable Logic controller 37

Page 38: PLC Instructions IIT-Delhi

Level Application As soon as both sensors are

false, we want fill motor OFF. Oil level starts decreasing

making High Level sensor ON.

As soon as Low level sensor is ON, we want fill motor to ON again.

And this sequence continues.

Programmable Logic controller 38

Page 39: PLC Instructions IIT-Delhi

PLC Problem – Class Assignment

Programmable Logic controller 39

Page 40: PLC Instructions IIT-Delhi

PLC Problem When a part is placed on the conveyor at position 1, it automatically

moves to position 2. Upon reaching position 2, it stops and is stamped. After stamping, it automatically moves to position 3. It stops at 3,

where the part is removed manually from the conveyor. Assume that only one part is on the conveyor at a time.

The three visual indicators are showing status of the system, Light: Power ON, Go: Part is in process, Stop: Process stopped.

LS1, LS2, and LS3 are magnetic proximity switches. LSUP and LSDN are two limit switch to sense the position of

stamper. Up & Dn are two solenoids to control operation of double acting

stamping cylinder. Conveyor motor is controlled by an external ON/OFF relay to get the

desired conveyor movement. Programmable Logic controller 40