7 db flowchart

33
7 Flowchart Based Design una introducci´ on para la programaci´ on de PLC’s Esteban Ch´ avez-Conde UPGto Rob´ otica Automatizaci´ on Ind. Nov 09 Esteban Ch´ avez-Conde UPGto Rob´otica 7 Flowchart Based Design Automatizaci´onInd. Nov 09 1 / 32

Upload: bhasilio-ahuja-montano

Post on 05-Dec-2015

240 views

Category:

Documents


0 download

DESCRIPTION

UNPA

TRANSCRIPT

Page 1: 7 DB Flowchart

7 Flowchart Based Designuna introduccion para la programacion de PLC’s

Esteban Chavez-CondeUPGto Robotica

Automatizacion Ind.Nov 09

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 1 / 32

Page 2: 7 DB Flowchart

Contenido

1 Tecnicas de diseno secuencial

2 Flowchart Based DesignIntroductionBlock LogicSequence Bits

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 2 / 32

Page 3: 7 DB Flowchart

Contenido

1 Tecnicas de diseno secuencial

2 Flowchart Based DesignIntroductionBlock LogicSequence Bits

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 2 / 32

Page 4: 7 DB Flowchart

ReferenciasLibros, tutoriales

Automating Manufacturing Systems with PLC’sHugh JackFree Software Foundation, Inc. May, 2007

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 3 / 32

Page 5: 7 DB Flowchart

Tecnicas de diseno secuencial

Tecnicas de diseno secuencialIntroduccion

En la Figura 1 se muestran tecnicas de diseno secuencial para la solucionde diversos problemas de automatizacion industrial.

Figura 1: Tecnicas de diseno secuencial.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 4 / 32

Page 6: 7 DB Flowchart

Flowchart Based Design

Flowchart Based Design

A flowchart is ideal for a process that has sequential process steps.

The steps will be executed in a simple order that may change as the resultof some simple decisions.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 5 / 32

Page 7: 7 DB Flowchart

Flowchart Based Design Introduction

IntroductionFlowchart Based Design

The symbols used for flowcharts are shown in Figure 2.

Figure 2: Flowchart Symbols.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 6 / 32

Page 8: 7 DB Flowchart

Flowchart Based Design Introduction

IntroductionFlowchart Based Design

These blocks are connected using arrows to indicate the sequence of thesteps. The different blocks imply different types of program actions.Programs always need a start block, but PLC programs rarely stop so thestop block is rarely used.

Other important blocks include operations and decisions. The otherfunctions may be used but are not necessary for most PLC applications.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 7 / 32

Page 9: 7 DB Flowchart

Flowchart Based Design Introduction

IntroductionFlowchart Based Design

A flowchart is shown in Figure 3 for a control system for a large water tank.

Figure 3: A Flowchart for a Tank Filler.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 8 / 32

Page 10: 7 DB Flowchart

Flowchart Based Design Introduction

IntroductionFlowchart Based Design

When a start button is pushed the tank will start to fill, and the flow outwill be stopped. When full, or the stop button is pushed the outlet willopen up, and the flow in will be stopped.

In the flowchart the general flow of execution starts at the top. The firstoperation is to open the outlet valve and close the inlet valve. Next, asingle decision block is used to wait for a button to be pushed. When thebutton is pushed the yes branch is followed and the inlet valve is opened,and the outlet valve is closed.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 9 / 32

Page 11: 7 DB Flowchart

Flowchart Based Design Introduction

IntroductionFlowchart Based Design

Then the flow chart goes into a loop that uses two decision blocks to waituntil the tank is full, or the stop button is pushed. If either case occurs theinlet valve is closed and the outlet valve is opened. The system then goesback to wait for the start button to be pushed again. When the controlleris on the program should always be running, so only a start block isneeded. Many beginners will neglect to put in checks for stop buttons.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 10 / 32

Page 12: 7 DB Flowchart

Flowchart Based Design Introduction

IntroductionFlowchart Based Design

The general method for constructing flowcharts is:

1 Understand the process.

2 Determine the major actions, these are drawn as blocks.

3 Determine the sequences of operations, these are drawn with arrows.

Once a flowchart has been created ladder logic can be written. There aretwo basic techniques that can be used, the first presented uses blocks ofladder logic code. The second uses normal ladder logic.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 11 / 32

Page 13: 7 DB Flowchart

Flowchart Based Design Block Logic

Block LogicFlowchart Based Design

The first step is to name each block in the flowchart, as shown in Figure 4.Each of the numbered steps will then be converted to ladder logic.

Step 1: Add labels to each block in the flowchart.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 12 / 32

Page 14: 7 DB Flowchart

Flowchart Based Design Block Logic

Block LogicFlowchart Based Design

Figure 4: Labeling Blocks in the Flowchart.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 13 / 32

Page 15: 7 DB Flowchart

Flowchart Based Design Block Logic

Block LogicFlowchart Based Design

Each block in the flowchart will be converted to a block of ladder logic. Todo this we will use the MCR (Master Control Relay) instruction. Theinstruction is shown in Figure 5, and will appear as a matched pair ofoutputs labelled MCR.

Figure 5: The MCR Function.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 14 / 32

Page 16: 7 DB Flowchart

Flowchart Based Design Block Logic

Block LogicFlowchart Based Design

If the first MCR line is true then the ladder logic on the following lines willbe scanned as normal to the second MCR. If the first line is false the linesto the next MCR block will all be forced off. If a normal output is usedinside an MCR block, it may be forced off. Therefore latches will be usedin this method.

The first part of the ladder logic required will reset the logic to an initialcondition, as shown in Figure 6. The line will only be true for the first scanof the PLC, and at that time it will turn on the flowchart block F1 whichis the reset all values off operation. All other operations will be turned off.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 15 / 32

Page 17: 7 DB Flowchart

Flowchart Based Design Block Logic

Block LogicFlowchart Based Design

Step 2: Write ladder logic to force the PLC into the first state.

Figure 6: Initial Reset of States.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 16 / 32

Page 18: 7 DB Flowchart

Flowchart Based Design Block Logic

Block LogicFlowchart Based Design

The ladder logic for the first state is shown in Figure 7. When F1 is truethe logic between the MCR lines will be scanned, if F1 is false the logicwill be ignored. This logic turns on the outlet valve and turns off the inletvalve. It then turns off operation F1, and turns on the next operation F2.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 17 / 32

Page 19: 7 DB Flowchart

Flowchart Based Design Block Logic

Block LogicFlowchart Based Design

Step 3: Write ladder logic for each function in the flowchart.

Figure 7: Ladder Logic for the Operation F1.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 18 / 32

Page 20: 7 DB Flowchart

Flowchart Based Design Block Logic

Block LogicFlowchart Based Design

The ladder logic for operation F2 is simple, and when the start button ispushed, it will turn off F2 and turn on F3. The ladder logic for operationF3 opens the inlet valve and moves to operation F4.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 19 / 32

Page 21: 7 DB Flowchart

Flowchart Based Design Block Logic

Block LogicFlowchart Based Design

Figure 8: Ladder Logic for Flowchart Operation F2.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 20 / 32

Page 22: 7 DB Flowchart

Flowchart Based Design Block Logic

Block LogicFlowchart Based Design

Figure 9: Ladder Logic for Flowchart Operation F3.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 21 / 32

Page 23: 7 DB Flowchart

Flowchart Based Design Block Logic

Block LogicFlowchart Based Design

The ladder logic for operation F4 turns off F4, and if the tank is full itturns on F6, otherwise F5 is turned on. The ladder logic for operation F5is very similar.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 22 / 32

Page 24: 7 DB Flowchart

Flowchart Based Design Block Logic

Block LogicFlowchart Based Design

Figure 10: Ladder Logic for Operation F4.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 23 / 32

Page 25: 7 DB Flowchart

Flowchart Based Design Block Logic

Block LogicFlowchart Based Design

Figure 11: Ladder Logic for Operation F5.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 24 / 32

Page 26: 7 DB Flowchart

Flowchart Based Design Block Logic

Block LogicFlowchart Based Design

The ladder logic for operation F6 turns the outlet valve on and turns offthe inlet valve. It then ends operation F6 and returns to operation F2.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 25 / 32

Page 27: 7 DB Flowchart

Flowchart Based Design Block Logic

Block LogicFlowchart Based Design

Figure 12: Ladder Logic for Operation F6.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 26 / 32

Page 28: 7 DB Flowchart

Flowchart Based Design Sequence Bits

Sequence BitsFlowchart Based Design

In general there is a preference for methods that do not use MCRstatements or latches. The flowchart used in the previous example can beimplemented without these instructions using the following method.

The first step to this process is shown in Figure 13. As before each of theblocks in the flowchart are labelled, but now the connecting arrows(transitions) in the diagram must also be labelled. These transitionsindicate when another function block will be activated.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 27 / 32

Page 29: 7 DB Flowchart

Flowchart Based Design Sequence Bits

Sequence BitsFlowchart Based Design

Figure 13: Label the Flowchart Blocks and Arrows.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 28 / 32

Page 30: 7 DB Flowchart

Flowchart Based Design Sequence Bits

Sequence BitsFlowchart Based Design

The first section of ladder logic is shown in Figure 14. This indicates whenthe transitions between functions should occur. All of the logic for thetransitions should be kept together, and appear before the state logic thatfollows in Figure 15.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 29 / 32

Page 31: 7 DB Flowchart

Flowchart Based Design Sequence Bits

Sequence BitsFlowchart Based Design

Figure 14: The Transition Logic.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 30 / 32

Page 32: 7 DB Flowchart

Flowchart Based Design Sequence Bits

Sequence BitsFlowchart Based Design

The logic shown in Figure 15 will keep a function on, or switch to the nextfunction. Consider the first ladder rung for F1, it will be turned on bytransition T1 and once function F1 is on it will keep itself on, unless T2occurs shutting it off.

If T2 has occurred the next line of ladder logic will turn on F2. Thefunction logic is followed by output logic that relates output values to theactive functions.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 31 / 32

Page 33: 7 DB Flowchart

Flowchart Based Design Sequence Bits

Sequence BitsFlowchart Based Design

Figure 15: The Function Logic and Outputs.

Esteban Chavez-Conde UPGto Robotica () 7 Flowchart Based Design Automatizacion Ind. Nov 09 32 / 32