chapter 4 plc

39
Chapter 4 Fundamental of Programmable Logic Controller Industrial Electronics DEK 3113

Upload: hattori-sidek

Post on 22-Nov-2014

5.149 views

Category:

Education


9 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Chapter 4 plc

Chapter 4

Fundamental of Programmable Logic Controller

Industrial Electronics

DEK 3113

Page 2: Chapter 4 plc

Ta’aruf SessionTa’aruf Session Engr. Reza Ezuan Samin Engr. Reza Ezuan Samin B.Eng (Electronics) 2004B.Eng (Electronics) 2004 M.Eng in Electrical Engineering M.Eng in Electrical Engineering

(Mechatronics) 2006(Mechatronics) 2006 Contact info:Contact info:

Office : 07-4537868Office : 07-4537868 E-mail : E-mail : [email protected] HP:016-7585859HP:016-7585859

Page 3: Chapter 4 plc
Page 4: Chapter 4 plc

What is a PLC Cont.. Programmable Logic Controllers (PLCs), also

referred as programmable controllers, are in the computer family.

PLC is a digital electronic device, that uses programmable memory to store instructions.

Can be programmed to implement functions such as logic, sequencing, timing, counting and arithmetic.

Page 5: Chapter 4 plc

HARDWARE CONFIGURATION OF PLC

Laboratory Training set

Page 6: Chapter 4 plc

PLC Advantages PLCs are similar to computer but have

certain features which are specific to their use as controller. These are:

1. They are rugged and designed to withstand vibrations, temperature, humidity, and noise.

2. The interfacing for inputs and outputs is inside the controller.

3. Easily programmed and easily understood programming language.

Page 7: Chapter 4 plc

PLC Operation1. A PLC monitors inputs, makes decisions based

on its program, and controls outputs to automate a process or machine.

2. The operation of the PLC system is simple and straightforward. The processor or CPU completes three processes:(1) scans, or reads, from the input devices (2) executes or "solves" the program logic, and (3) updates, or writes, to the output devices.

Page 8: Chapter 4 plc
Page 9: Chapter 4 plc

Memory map/address

Page 10: Chapter 4 plc

TIMER (TIM) address is from TIM 000 – 511

MNEMONIC FUNCTION

Page 11: Chapter 4 plc

COUNTER (CNT)

The address sharing with timerCP

CNT 007

#10

00004

00002

CNT 00710010 (siren)

END

Mnemonic LD 00004 LD 00002

CNT 007 #10

LD CNT 007 OUT 10010

Fun (01)

Page 12: Chapter 4 plc

CNTR (12) CNTR is a reversible counter where both

up count and down count can be down by the same counter

CNTR (12)

up

down

reset

Page 13: Chapter 4 plc

DIFU(13) – DIFFERENTIATION UP DIFU turns its output ON when it detects

an OFF to ON transition in its input signal

Page 14: Chapter 4 plc

DIFD(14) – DIFFERENTIATION DOWN DIFD turns its output ON when it detects

an ON to OFF transition in its input signal or from HIGH to LOW signal

Page 15: Chapter 4 plc

Car park systemA simple car park control system allows only a maximum of 30 cars parking spaces. Every time a car comes in, an incoming sensor will add 1 and any car that goes out an outgoing sensor will deduct 1. If the car park is occupied with 30 cars at one time, a full sign will be lighted up to inform there is no vacancy. Use instruction CNTR for counting and DIFU and DIFD for the sensor.

Page 16: Chapter 4 plc

KEEP(11) – LATCHING RELAY

To replace normal latchingHas two input-set and resetBetter use HR so the output retain even though power fails Set =00000

Reset=00001

KEEP (11)

IR/Output Port/HR

END

Page 17: Chapter 4 plc

Example An incoming bar for a parking lot will raise up for 20 seconds when sensor 1

detects an incoming car. After passing the bar, sensor 2 will start count up the number of cars that parks in the parking lot. At the exit sensor 3 will deduct out going cars from the parking lots. If at one time the number of cars in the parking lot is 20 then the full sign light will be on.

I/O assignment: i/p o/p Sensor 1 Bar (Motor) Sensor 2 Timer 1 (TIM 1 = #200) Sensor 3 CNTR (#20) Reset button Full Sign Tim 1 contact CNTR contact

Page 18: Chapter 4 plc

Sensor 1

Sensor 2

Sensor 3

Incoming

Outgoing

Ladder Diagram

Figure for example given

Page 19: Chapter 4 plc

MOV(21) To move a data from one channel to

another channel

Mov(21)

S

D

S

S : Source Channel

IR,SR,AR,DM,HR,TC,LR,#

D : Destination channel

IR,AR,DM,HR,LR

Page 20: Chapter 4 plc

Example transfer dataeg-transfer data from channel 000 to 100

25313MOV(21)

000

100

Page 21: Chapter 4 plc

Transfer data diagramSource input Channel 000

Destination Output Ch 100

Page 22: Chapter 4 plc

  

15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00

000 0 0 0 1 0 0 0 1 1 0 1 0 0 1 1 1

001                                

002                                

.                                

.                                

.                                

100 0 0 0 1 0 0 0 1 1 0 1 0 0 1 1 1

.                                

999                                

BitChannel/Word

Page 23: Chapter 4 plc

Example Display Error Code of Machine To Aid Tracing Source Of

Problem Using MOV instruction design : Activation of error input signal 00001 to 00003 will sound an alarm

and at the same time display the error code. Input 00006 will reset the error code displayed after machine

recovery from error.

Page 24: Chapter 4 plc

Example ladder diagram

00001

00002

00003

RED LIGHT 10000

Alarm

Alarm Code #1

00001 MOV(21)#0001

101

MOV(21)#0002

101

00002

MOV(21)#0003

101

00003

MOV(21)#0000

101

00006

END

Alarm Code #2

Alarm Code #3

Reset Alarm Code Display

Page 25: Chapter 4 plc

CMP(20)-compareCompare is used to compare the data in a specific channel with thedata in another channel or a four-digit hexadecimal constant

CMP(20)

Cp1

Cp2

Cp1: First Compare Word

IR,SR,AR,DM,HR,TC,LR,#

Cp 2: Second Compare Word

IR, AR, DM, HR, LR

Page 26: Chapter 4 plc

25313 TR0

CMP(20)

#0020

HR1

25507 ( < )

25506(=)

10001

10002

Green Light

Red Light

ExampleADDR OP CODE DATA

0000 LD 25313

0001 OUT TR0

0002 CMP (20)

#0020

HR1

0003 AND 25507

0004 OUT 10001

0005 LD TR 0

0006 AND 25506

0007 OUT 10002

Page 27: Chapter 4 plc

Add(30)

To add data in two different channel

ADD(30)

Au

Ad

R

Au: Augend Channel

IR,SR,AR,DM,HR,TC,LR,#

Ad: Addend Channel

IR,SR,AR,DM,HR,TC,LR,#

R: Result

IR,AR,DM,HR,LR

Page 28: Chapter 4 plc

ADD(30)

HR000

#1234

HR000

00007

ADDR OP CODE DATA

0000 LD 00007

0001 ADD(30)

0002 HR000

#1234

HR000

0003 END(01)

The operation:

HR000 #00011.#1234

2. Add #0001 + #1234 = #12353. The result:

HR000 #1235

HR000 #1235

Page 29: Chapter 4 plc

Sub(31)

Opposite of add

Page 30: Chapter 4 plc
Page 31: Chapter 4 plc

Continue..A simple car park control system allows only a maximum of 30 cars parking spaces. Every time a car comes in, an incoming sensor will add 1 and any car that goes out an outgoing sensor will deduct 1. If the car park is occupied with 30 cars at one time, a full sign will be lighted up to inform there is no vacancy. Replace CNTR with ADD and SUB.

Page 32: Chapter 4 plc

ExerciseUsing KEEP instruction to solve these problemsinstead of normal latching:A sensor is placed outside yellow line that enclosed the robot to provide safety cautions to the user. If the sensor detects someone crossing the yellow line the robot will automatically stop its operation and the siren will on until a reset button is pressed. Then the push button need to be pressed for robot to run again.

YELOW LINE

ROBOT

sensor

sensorsensor

Page 33: Chapter 4 plc

Solution

Page 34: Chapter 4 plc

Exercise 2

An automatic home garage is equipped with sensor 1, S1, that detects the approaching car and will open the garage until sensor 2, S2,detects the whole car body has safely parks inside the garage. Use DIFU and DIFD to solve the problem.

S1

S2

Garage Door

Page 35: Chapter 4 plc

Solution

Page 36: Chapter 4 plc

Exercise 3 A conveyor belt is used to transfer red and blue balls for

sorting by initially pressed the start button. A colour sorter system is designed to sort red balls and blue balls. If sensor 1 detects red ball, the ball will be pushed into bin 1 by cylinder 1 (CY1) for 2 seconds. If sensor 2 detects blue ball then the ball will be pushed into bin 2 by cylinder 2 (CY2) for another 2 seconds. If the counter has counted 10 red balls, then red light is on and when counter has counted 10 blue balls then green light is on. When either lights is on the conveyor stops the transferring of the balls. The conveyor will start again when reset button is pressed to empty the adder of full ball and the system restart. Use ADD, MOV, CMP instead of CNT.

Page 37: Chapter 4 plc

Assignment A conveyor belt is used to transfer red and blue balls for sorting by

initially pressed the start button. A color sorter system is designed to sort red balls and blue balls. If sensor 1 detects red ball, the ball will be pushed into bin 1 by cylinder 1 (CY1).If sensor 2 detects blue ball then the ball will be pushed into bin 2 by cylinder 2 (CY2). If the counter has counted 10 red balls, then red light is on and when counter has counted 10 blue balls then green light is on. When either lights is on the conveyor stops the transferring of the balls. Use CNT instead of ADD and SUB.

Assume traveling time for cylinder from original position to full extension(vice versa is 0.2 sec) and all cylinder is single acting cylinder.

All cylinder will go back to its original position after transferring the ball.

Page 38: Chapter 4 plc

AssignmentTwo different item need to be sort out. It is been placed along a conveyor belt. Conveyor belt will turn on when sensor 1 detect the first item present on that conveyor belt at its origin. When sensor 2 detect item A, it will be transferred by single acting cylinder, CY1 to first path. When LS1 detect the full extension of CY1,it will return to its initial position. When sensor 3 detect item B,it will be transferred by single acting cylinder,CY2 to second path.When LS2 detect full extension of CY2,it will return to its intial position.If the counter has counted 30 item A, green light will be on.If the counter counted 30 item B,blue light will be on.When one of the counter has count 30 item no matter item A or item B, the conveyor belt will be turn off. It will be turn on again when the adder of full ball is reset to zero then the system will restart again. Use DIFU, ADD, MOV, and CMP instead of CNT.

Page 39: Chapter 4 plc

BREAK TIME !

Any Questions So far???