Chapter 4 plc

8,366 views

Published on

Published in: Education, Technology, Business
0 Comments
7 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
8,366
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
378
Comments
0
Likes
7
Embeds 0
No embeds

No notes for slide

Chapter 4 plc

  1. 1. Chapter 4 Fundamental of Programmable Logic Controller Industrial Electronics DEK 3113
  2. 2. Ta’aruf Session <ul><li>Engr. Reza Ezuan Samin </li></ul><ul><li>B.Eng (Electronics) 2004 </li></ul><ul><li>M.Eng in Electrical Engineering (Mechatronics) 2006 </li></ul><ul><li>Contact info: </li></ul><ul><ul><li>Office : 07-4537868 </li></ul></ul><ul><ul><li>E-mail : [email_address] </li></ul></ul><ul><ul><li>HP:016-7585859 </li></ul></ul>
  3. 4. What is a PLC Cont.. <ul><li>Programmable Logic Controllers (PLCs), also referred as programmable controllers, are in the computer family. </li></ul><ul><li>PLC is a digital electronic device, that uses programmable memory to store instructions. </li></ul><ul><li>Can be programmed to implement functions such as logic, sequencing, timing, counting and arithmetic. </li></ul>
  4. 5. HARDWARE CONFIGURATION OF PLC Laboratory Training set
  5. 6. PLC Advantages <ul><li>PLCs are similar to computer but have certain features which are specific to their use as controller. These are: </li></ul><ul><ul><li>They are rugged and designed to withstand vibrations, temperature, humidity, and noise. </li></ul></ul><ul><ul><li>The interfacing for inputs and outputs is inside the controller. </li></ul></ul><ul><ul><li>Easily programmed and easily understood programming language. </li></ul></ul>
  6. 7. PLC Operation <ul><li>A PLC monitors inputs, makes decisions based on its program, and controls outputs to automate a process or machine. </li></ul><ul><li>The operation of the PLC system is simple and straightforward. The processor or CPU completes three processes: </li></ul><ul><li>(1) scans, or reads, from the input devices </li></ul><ul><li>(2) executes or &quot;solves&quot; the program logic, and </li></ul><ul><li>(3) updates, or writes, to the output devices. </li></ul>
  7. 9. Memory map/address
  8. 10. TIMER (TIM) <ul><li>address is from TIM 000 – 511 </li></ul>MNEMONIC FUNCTION
  9. 11. COUNTER (CNT) <ul><li>The address sharing with timer </li></ul>Mnemonic LD 00004 LD 00002 CNT 007 #10 LD CNT 007 OUT 10010 Fun (01) CP CNT 007 #10 00004 00002 CNT 007 10010 (siren) END
  10. 12. CNTR (12) <ul><li>CNTR is a reversible counter where both up count and down count can be down by the same counter </li></ul>CNTR (12) up down reset
  11. 13. DIFU(13) – DIFFERENTIATION UP <ul><li>DIFU turns its output ON when it detects an OFF to ON transition in its input signal </li></ul>
  12. 14. DIFD(14) – DIFFERENTIATION DOWN <ul><li>DIFD turns its output ON when it detects an ON to OFF transition in its input signal or from HIGH to LOW signal </li></ul>
  13. 15. Car park system 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. Use instruction CNTR for counting and DIFU and DIFD for the sensor.
  14. 16. KEEP(11) – LATCHING RELAY <ul><li>To replace normal latching </li></ul><ul><li>Has two input-set and reset </li></ul><ul><li>Better use HR so the output retain even though </li></ul><ul><li>power fails </li></ul>Set =00000 Reset=00001 KEEP (11) IR/Output Port/HR END
  15. 17. Example <ul><li>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. </li></ul><ul><li>I/O assignment : </li></ul><ul><li>i/p o/p </li></ul><ul><li>Sensor 1 Bar (Motor) </li></ul><ul><li>Sensor 2 Timer 1 (TIM 1 = #200) </li></ul><ul><li>Sensor 3 CNTR (#20) </li></ul><ul><li>Reset button Full Sign </li></ul><ul><li>Tim 1 contact </li></ul><ul><li>CNTR contact </li></ul>
  16. 18. Ladder Diagram Figure for example given Sensor 1 Sensor 2 Sensor 3 Incoming Outgoing
  17. 19. MOV(21) <ul><li>To move a data from one channel to another channel </li></ul>Mov(21) S D S S : Source Channel IR,SR,AR,DM,HR,TC,LR,# D : Destination channel IR,AR,DM,HR,LR
  18. 20. Example transfer data <ul><li>eg-transfer data from channel 000 to 100 </li></ul>25313 MOV(21) 000 100
  19. 21. Transfer data diagram Source input Channel 000 Destination Output Ch 100
  20. 22. Bit Channel/ Word     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                                
  21. 23. Example <ul><li>Display Error Code of Machine To Aid Tracing Source Of Problem </li></ul><ul><li>Using MOV instruction design : </li></ul><ul><li>Activation of error input signal 00001 to 00003 will sound an alarm and at the same time display the error code. </li></ul><ul><li>Input 00006 will reset the error code displayed after machine recovery from error. </li></ul>
  22. 24. 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
  23. 25. CMP(20)-compare <ul><li>Compare is used to compare the data in a specific channel with the </li></ul><ul><li>data in another channel or a four-digit hexadecimal constant </li></ul>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
  24. 26. Example 25313 TR0 CMP(20) #0020 HR1 25507 ( < ) 25506(=) 10001 10002 Green Light Red Light ADDR 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
  25. 27. Add(30) <ul><li>To add data in two different channel </li></ul>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
  26. 28. The operation: 1. 2. Add #0001 + #1234 = #1235 3. The result: ADD(30) HR000 #1234 HR000 00007 ADDR OP CODE DATA 0000 LD 00007 0001 ADD(30) 0002 HR000 #1234 HR000 0003 END(01) HR000 #0001 #1234 HR000 #1235 HR000 #1235
  27. 29. Sub(31) <ul><li>Opposite of add </li></ul>
  28. 31. 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.
  29. 32. Exercise <ul><li>Using KEEP instruction to solve these problems </li></ul><ul><li>instead of normal latching: </li></ul><ul><li>A sensor is placed outside yellow line that </li></ul><ul><li>enclosed the robot to provide safety cautions to </li></ul><ul><li>the user. If the sensor detects someone crossing </li></ul><ul><li>the yellow line the robot will automatically stop its </li></ul><ul><li>operation and the siren will on until a reset button </li></ul><ul><li>is pressed. Then the push button need to be </li></ul><ul><li>pressed for robot to run again. </li></ul>YELOW LINE ROBOT sensor sensor sensor
  30. 33. Solution
  31. 34. Exercise 2 <ul><li>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. </li></ul>S1 S2 Garage Door
  32. 35. Solution
  33. 36. Exercise 3 <ul><li>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. </li></ul>
  34. 37. Assignment <ul><li>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. </li></ul><ul><li>Assume traveling time for cylinder from original position to full extension(vice versa is 0.2 sec) and all cylinder is single acting cylinder. </li></ul><ul><li>All cylinder will go back to its original position after transferring the ball. </li></ul>
  35. 38. Assignment <ul><li>Two different item need to be sort out. It is been placed along a </li></ul><ul><li>conveyor belt. Conveyor belt will turn on when sensor 1 detect the first </li></ul><ul><li>item present on that conveyor belt at its origin. When sensor 2 detect </li></ul><ul><li>item A, it will be transferred by single acting cylinder, CY1 to first path. </li></ul><ul><li>When LS1 detect the full extension of CY1,it will return to its initial </li></ul><ul><li>position. When sensor 3 detect item B,it will be transferred by single </li></ul><ul><li>acting cylinder,CY2 to second path.When LS2 detect full extension of </li></ul><ul><li>CY2,it will return to its intial position.If the counter has counted 30 item A, </li></ul><ul><li>green light will be on.If the counter counted 30 item B,blue light will be </li></ul><ul><li>on.When one of the counter has count 30 item no matter item A or item B, </li></ul><ul><li>the conveyor belt will be turn off. It will be turn on again when the adder </li></ul><ul><li>of full ball is reset to zero then the system will restart again. Use DIFU, </li></ul><ul><li>ADD, MOV, and CMP instead of CNT. </li></ul>
  36. 39. BREAK TIME ! <ul><li>Any Questions So far??? </li></ul>

×