Thiết bị và hệ thống tự động
Lecturer Ph.D Truong Dinh Chau, Department of Automatic Control, Faculty of Electrical – Electronics Engineering, HCM. City University of Technology tdchau@hcmut.edu.vn 091. 543-74-40 Industry Automation Outcome 9 Structured Logic Design Topics: Objectives: • Know examples of applications to industrial problems. • Know how to design time base control programs. • Timing diagrams • Design examples • Designing ladder logic with process sequence bits and timing diagrams The time required for a poorly designed program: • 10% on design, • 30% on writing, • 40% debugging and testing, • 10% documentation. The time required for a high quality program design: • 30% design, • 10% writing software, • 10% debugging and testing, •10% documentation. Software development cycle sequential problem simple/small steps with complex/large single process STATE DIAGRAM EQUATIONSBLOCK LOGIC shorter development time performance is important multiple SFC/GRAFSET PETRI NET processes buffered (waiting) state triggers no waiting with single states SEQUENCE BITS FLOW CHART some deviations very clear steps PROCESS SEQUENCE BITS ALGORITHM 1. Understand the process. 2. Write the steps of operation in sequence and give each step a number. 3. For each step assign a bit. 4. Write the ladder logic to turn the bits on/off as the process moves through its states. 5. Write the ladder logic to perform machine functions for each step. 6. If the process is repetitive, have the last step go back to the first. Flag raising controller Description: • A flag raiser that will go up when an up button is pushed, and down when a down button is pushed. • Both push buttons are momentary. • There are limit switches at the top and bottom to stop the flag pole. • When turned on at first the flag should be lowered until it is at the bottom of the pole. Flag raising controller Algorithm (events + states): 1. The flag is moving down the pole waiting for the bottom limit switch. 2. The flag is idle at the bottom of the pole waiting for the up button. 3. If the up button push, the flag moves up, waiting for the top limit switch. 4. The flag is idle at the top of the pole waiting for the down button. 5. If the down button push go to step 1. Flag raising controller Steps (only states): 1. The flag is moving down the pole. 2. The flag is idle at the bottom of the pole. 3. The flag moves up. 4. The flag is idle at the top of the pole. Flag raising controller Step 1. The flag is moving down the pole. Step 2. The flag is idle at the bottom of the pole. Step 3. The flag moves up. Step 4. The flag is idle at the top of the pole. L U U step 1 step 2 step 3 step 4 first scan This section of ladder logic forces the flag raiser to start with only one state on, in this case it should be the first one, step 1. down step 1 The ladder logic for step 1 turns on the motor to lower the flag and when the bottom limit switch is hit it goes to step 2. motor L U step 2 step 1 step 1 bottom limit switch The ladder logic for step 2 only waits for the push button to raise the flag. L U step 3 step 2 step 2 flag up button up step 3 The ladder logic for step 3 turns on the motor to raise the flag and when the top limit switch is hit it goes to step 4. motor L U step 4 step 3 step 3 top limit switch The ladder logic for step 4 only waits for the push button to lower the flag. L U step 1 step 4 step 4 flag down button Design Case: Design a control system for a coffee maker that will follow the steps below. 1. The coffee maker is idle 2. The start button is pushed, and the water heater is on for 5 minutes. The pot heater is also turned on. 3. After that the water heater is turned off, but the pot heater is kept on for an additional 1 hour and 55 minutes. 4. The coffee maker returns to an idles state. Additional problem Sample, 2 robot arms, 1 heater, 1 cooler Design with Timing Diagrams 1. Understand the process. 2. Identify the outputs that are time dependent. 3. Draw a timing diagram for the outputs. 4. Assign a timer for each time when an output turns on or off. 5. Write the ladder logic to examine the timer values and turn outputs on or off. Design with Timing Diagrams Write ladder logic that will give the following timing diagram for B after input A is pushed. After A is pushed any changes in the state of A will be ignored. true false 0 2 5 6 8 9 t(sec) Design with Timing Diagrams true false 0 2 5 6 8 9 t(sec) TON Timer t_a Base 1s Preset 2 on TON Timer t_b Base 1s Preset 3 t_a.DN TON Timer t_c Base 1s Preset 1 t_b.DN TON Timer t_d Base 1s Preset 2 t_c.DN TON Timer t_e Base 1s Preset 1 t_d.DN t_a.TT output t_c.TT t_e.TT door 1 door 2 2s 10s 14s Design Example – Handicap door Design Example – Handicap door open button auto auto t_14.DN TON Timer t_2 Delay 2s TON Timer t_10 Delay 10s TON Timer t_14 Delay 14s auto t_10.TT door 1 t_2.TT door 2 t_2.DN door 1 door 2 2s 10s 14s t_14.TT Design with Timing Diagrams 1 3 5 6 7 10 Start, Stop button Design with Timing Diagrams A B 3 5 11 22 26 t (sec) 0