Top Banner
plc flowchart - 11.1 11. FLOWCHART BASED DESIGN 11.1 INTRODUCTION A flowchart is ideal for a process that has sequential process steps. The steps will be executed in a simple order that may cha nge as the re sult of some simple decisions. The symbols us ed for flowcha rts a re shown i n Figure 11.1. These blocks are connected using arrows to indicate the sequence of the steps. The different blocks imply different types of program actions. P rograms always ne ed a start  bloc k, but PLC programs rarely stop so the stop block is ra rel y used. Other important blocks include operations  and decisions. The other functions may be used but are not necessary for most PLC applications. Figure 11.1 Flow chart S ymbols Topics: Objectives: Ba able to describe a process with a flowchart. • Be able to convert a flowch art to ladder logic. • Describing process control using flowcharts • Conversion of flowcharts to l adde r logic Start/Stop Operation Decision I/O Disk/Storage Subroutine
28

plc_flowchart.pdf

Jun 02, 2018

Download

Documents

Nitin Nilesh
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 1/28

plc flowchart - 11.1

11. FLOWCHART BASED DESIGN

11.1 INTRODUCTION

A flowchart is ideal for a process that has sequential process steps. The steps willbe executed in a simple order that may cha nge as the re sult of some simple decisions. Thesymbols used for flowcharts are shown in F igure 11.1. These blocks are connected usingarrows to indicate the sequence of the steps. The different blocks imply different types ofprogram 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 . Theother functions may be used but are not necessary for most PLC applications.

Figure 11.1 Flowchart Symbols

Topics:

Objectives: Ba able to describe a process with a flowchart.

• Be able to convert a flowchart to ladder logic.

• Describing process control using flowcharts• Conversion of flowcharts to ladder logic

Start/Stop

Operation

Decision

I/O

Disk/Storage

Subroutine

Page 2: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 2/28

plc flowchart - 11.2

A flowchart is shown in Figure 11.2 f or a control system for a large water tank.When a start button is pushed the tank will start to fill, and the flow out will be stopped.When full, or the stop button is pushed the outlet will open up, and the flow in will bestopped. In the flowchart the general flow of execution starts at the top. The first operationis to open the outlet valve and close the inlet valve. Next, a single decision block is used towait for a button to be pushed. when the button is pushed the yes branch is followed andthe inlet valve is opened, and the outlet valve is closed. Then the flow chart goes into aloop that uses two decision blocks to wait until the tank is full, or the stop button ispushed. If either case occurs the inlet valve is closed and the outlet valve is opened. Thesystem then goes back 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 is needed. Many begin-ners will neglect to put in checks for stop buttons.

Page 3: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 3/28

plc flowchart - 11.3

Figure 11.2 A Flowchart for a Tank Filler

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.

START

Open outlet valve

start button pushed?

Open inlet valveClose outlet valve

Is tank full?

stop button pushed?

Open outlet valveClose inlet valve

no

no

yes

yes

no

yes

Close inlet valve

Page 4: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 4/28

plc flowchart - 11.4

4. When the sequence may change use decision blocks for branching.

Once a flowchart has been created ladder logic can be written. There are two basictechniques that can be used, the first presented uses blocks of ladder logic code. The sec-ond uses normal ladder logic.

11.2 BLOCK LOGIC

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

Page 5: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 5/28

plc flowchart - 11.5

Figure 11.3 Labeling Blocks in the Flowchart

Each block in the flowchart will be converted to a block of ladder logic. To do thiswe will use the MCR (Master Control Re lay) instruct ion (it will be discussed in moredetail later.) The instruction is shown in F igure 11.4, and will appear as a matched pair ofoutputs labelled MCR . If the first MCR line is true then the ladder logic on the followinglines will be scanned as normal to the second MCR. If the first line is false the lines to the

START

Open outlet valve

start button pushed?

Open inlet valveClose outlet valve

Is tank full?

stop button pushed?

Open outlet valveClose inlet valve

no

no

yes

yes

no

yes

F1

F2

F3

F4

F5

F6

STEP 1: Add labels to each block in the flowchart

Close inlet valve

Page 6: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 6/28

plc flowchart - 11.6

next MCR block will all be forced off. If a normal output is used inside an MCR block, itmay be forced off. Therefore latches will be used in this method.

Figure 11.4 The MCR Function

The first part of th e ladder logic required will reset the logic to an initial condition,as shown in Figure 11.5. T he line will only be true for the first scan of the PLC, and at that

time it will turn on the flowchart block F1 which is the reset all values off operation. Allother operations will be turned off.

A

MCR

MCR

If A is true then the MCR will cause the ladder in betweento be executed. If A is false the outputs are forced off.

Note: We will use MCR instructions to implement some of the state based programs.This allows us to switch off part of the ladder logic. The one significant note toremember is that any normal outputs (not latches and t imers) will be FORCEDOFF. Unless this is what you want, put the normal outputs outside MCR blocks.

Page 7: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 7/28

plc flowchart - 11.7

Figure 11.5 Initial Reset of States

The ladder logic for the first state is shown in Figure 11.6. When F1 is true thelogic between the MCR lines will be scanned, i f F1 is false the logic will be ignored. Thislogic turns on the outlet valve and turns off the inlet valve. It then turns off operation F1 ,and turns on the next operation F2 .

L

U

U

U

U

U

first scanF1

F2

F3

F4

F5

F6

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

Page 8: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 8/28

plc flowchart - 11.8

Figure 11.6 Ladder Logic for the Operation F1

The ladder logic for operation F2 is simple, and when the start button is pushed, itwill turn off F2 and turn on F3 . The ladder logic for operation F3 opens the inlet valve andmoves to operation F4 .

MCRF1

MCR

L

U

outlet

inlet

U

L

F1

F2

STEP 3: Write ladder logic for each function in the flowchart

Page 9: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 9/28

plc flowchart - 11.9

Figure 11.7 Ladder Logic for Flowchart Operations F2 and F3

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

MCRF2

MCR

U

L

F2

F3

start

MCRF3

MCR

U

L

outlet

inlet

U

L

F3

F4

Page 10: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 10/28

plc flowchart - 11.10

Figure 11.8 Ladder Logic for Operations F4 and F5

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

MCRF4

MCR

U F4

L F6tank full

L F5tank full

MCRF5

MCR

U F5

L F6stop

L F4stop

Page 11: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 11/28

plc flowchart - 11.11

Figure 11.9 Ladder Logic for Operation F6

11.3 SEQUENCE BITS

In general there is a preference for methods that do not use MCR statements orlatches. The flowchart used in the previous example can be implemented without theseinstruc tions using the following method. The first step to this process is shown in Figure11.10. As before each of the blocks in the flowchart are labelled, but now the connectingarrows (transitions) in the diagram must also be labelled. These transitions indicate whenanother function block will be activated.

MCRF6

MCR

L

U

outlet

inlet

U

L

F6

F2

Page 12: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 12/28

Page 13: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 13/28

plc flowchart - 11.13

Figure 11.11 The Transition Logic

The logic shown in Figure 11.12 will keep a function on, or switch to the nextfunction. Consider the first ladder rung for F1 , i t will be turned on by transition T1 andonce function F1 is on it will keep itself on, unless T2 occurs shutting it off. If T2 hasoccurred the next line of ladder logic will turn on F2 . The function logic is followed byoutput logic that relates output values to the active functions.

FST1

F1

T2

F2T3

start

F6

F2 start

F3T4

F5 stop

F5T5

full

T6

F5 stop

F4 full

Page 14: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 14/28

plc flowchart - 11.14

Figure 11.12 The Function Logic and Outputs

F1

T1

T2F1

F2

T2

T3 F2

F3

T3

T4F3

F4

T4

T5F4

F5

T5

T4F5

F6

T6

T2F6

T6

T6

F1outlet

F2

F6

F3inlet

F4

F5

Page 15: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 15/28

plc flowchart - 11.15

11.4 SUMMARY

• Flowcharts are suited to processes with a single flow of execution.• Flowcharts are suited to processes with clear sequences of operation.

11.5 PRACTICE PROBLEMS

1. Convert the following flow chart to ladder logic.

2. Draw a flow chart for cutting the grass, then develop ladder logic for three of the actions/deci-sions.

3. Design a garage door controller using a flowchart. The behavior of the garage door controller isas follows,

- there is a single button in the garage, and a single button remote control.- when the button is pushed the door will move up or down.- if the button is pushed once while moving, the door will stop, a second push will

start motion again in the opposite direction.- there are top/bottom limit switches to stop the motion of the door.- there is a light beam across the bottom of the door. If the beam is cut while the

door is closing the door will stop and reverse.- there is a garage light that will be on for 5 minutes after the door opens or closes.

start

A on

is B on?

A off

yes

no

yes

no

is C on?

Page 16: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 16/28

plc flowchart - 11.16

11.6 PRACTICE PROBLEM SOLUTIONS

1.

start

A on

is B on?

A off

yes

no

yes

nois C on?

F1

F2

F3

F4

F1

F2

F3

F4

L

U

U

U

first scan

MCRF1

AL

F1

F2L

U

MCR

MCRF2

F2U

F3L

MCR

B

MCRF3

AU

F3

F4L

U

MCR

MCRF4

F4U

F1L

MCR

C

F4U

F2L

C

Page 17: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 17/28

plc flowchart - 11.17

2.

Start

Get mower and

Is gas can

gas can

Fill mower

Is Mower on?

empty?

Pull cord

Is all lawn cut?

Push Mower

Stop mower

Put gas and

get gas

mower away

yes

no

no

yes

yes

no

F1

F2F3

F4

F5

F6

F7

F8

F9

F10

Page 18: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 18/28

plc flowchart - 11.18

FSF1

F2

F3

F4

F5

F6

F7

F8F9

F10

F1MCR

MCR

mower

gas can

L

L

F1

F2

U

L

F2MCR

MCR

F3

F2

L

U

gas can empty

F4

F2

L

U

gas can empty

Page 19: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 19/28

plc flowchart - 11.19

F3MCR

MCR

F4

F3

L

U

F4MCR

MCR

F5

F4

L

U

T4:0/DN

pour gasT4:0/DN

fill gas tank gas can full

TONTimer T4:0

Delay 5s

F5MCR

MCR

F6

F5

L

U

pull cordcord pulled

cord pulled

F6MCR

MCR

F7L

mower on

F5L

mower on

F6U

ETC.....................

Page 20: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 20/28

plc flowchart - 11.20

3.

ST1

start

isremote or

button pushed?

yes

no

turn on door close

is

remote orbutton or bottom

yes

no islight beamon?

no

yeslimit pushed?

turn off door close

isremote or

button pushed?

yes

turn on door open

isremote or

button or top

yes

limit pushed?

turn off door open

no

ST2

ST3

ST4

ST5

ST6

ST7

ST8

ST9

Page 21: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 21/28

plc flowchart - 11.21

L

U

U

U

U

U

U

U

U

first scan

ST1

ST2

ST3

ST4

ST5

ST6

ST7

ST8

ST9

ST2

ST7

TOFT4:0preset 300s

T4:0/DNgarage light

U

U

door open

door close

Page 22: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 22/28

plc flowchart - 11.22

MCR

ST1

MCR

Ubutton

Lremote

ST1

ST2

MCR

ST2

MCR

U

L

ST2

ST3

L door close

Page 23: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 23/28

plc flowchart - 11.23

MCR

ST3

MCR

Ubutton

Lremote

ST3

ST5

bottom limit

UST3

ST3

L ST4

MCR

ST4

MCR

Ulight beam

L

ST4

ST7

Ulight beam

L

ST4

ST3

Page 24: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 24/28

plc flowchart - 11.24

MCR

ST5

MCR

U

L

ST5

ST6

U door close

MCR

ST6

MCR

Ubutton

Lremote

ST6

ST7

MCR

ST7

MCR

U

L

ST7

ST8

Ldoor open

Page 25: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 25/28

plc flowchart - 11.25

MCR

ST8

MCR

Ubutton

Lremote

ST8

ST9

top limit

MCRST9

MCR

U

L

ST9

ST1

Udoor open

Page 26: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 26/28

plc flowchart - 11.26

11.7 ASSIGNMENT PROBLEMS

1. Develop ladder logic for the flowchart below.

2. Use a flow chart to design a parking gate controller.

Start

Turn A on

Is Bon?

Turn A off

Is Con?

no

yes

yes

no

keycard entry

gate

car detector

light

cars enter/leave

- the gate will be raised by one outputand lowered by another. If the gategets stuck an over current detectorwill make a PLC input true. If thisis the case the gate should reverseand the light should be turned onindefinitely.

- if a valid keycard is entered a PLCinput will be true. The gate is to

rise and stay open for 10 seconds.- when a car is over the car detector aPLC input will go true. The gate isto open while this detector isactive. If it is active for more that30 seconds the light should alsoturn on until the gate closes.

Page 27: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 27/28

plc flowchart - 11.27

3. A welding station is controlled by a PLC. On the outside is a safety cage that must be closedwhile the cell is active. A belt moves the parts into the welding station and back out. An induc-tive proximity sensor detects when a part is in place for welding, and the belt is stopped. Toweld, an actuator is turned on for 3 seconds. As normal the cell has start and stop push buttons.

a) Draw a flow chartb) Implement the chart in ladder logic

4. Convert the following flowchart to ladder logic.

5. A machine is being designed to wrap boxes of chocolate. The boxes arrive at the machine on aconveyor belt. The list below shows the process steps in sequence.

1. The box arrives and is detected by an optical sensor (P), after this the conveyoris stopped (C) and the box is clamped in place (H).

2. A wrapping mechanism (W) is turned on for 2 seconds.3. A sticker cylinder (S) is turned on for 1 second to put consumer labelling on the

Inputs

DOOR OPEN (NC)START (NO)STOP (NC)PART PRESENT

Outputs

CONVEYOR ONWELD

Start

Turn off motor

Turn on motor

startpushed

no

yes

stoppushed

no

yes

Page 28: plc_flowchart.pdf

8/11/2019 plc_flowchart.pdf

http://slidepdf.com/reader/full/plcflowchartpdf 28/28

plc flowchart - 11.28

box.4. The clamp (H) is turned off and the conveyor (C) is turned on.5. After the box leaves the system returns to an idle state.

Develop ladder logic for the system using a flowchart. Don’t forget to include regular start andstop inputs.