Example: Combinatorial Control Example: Sequential Control

16
1 automation 2021 Combinatorial and Sequencing Control Chapter 13 Gunnar Lindstedt automation 2021 Combinatorial vs. Sequential Combinatorial – no memory – Only depends on current signals Sequential – contains state(s) – Next state is a function of: Current inputs Current state Applicable for: Machine and/or Control system automation 2021 Example: Combinatorial Control Machine Control system Task: Run the machine while the “Run” signal is given if both operator A and operator B are present. Give “Fail”-signal if machine doesn’t respond. OpApres OpBpres Run Fail MRun Running MRUN = OpApres AND OPBpres AND Run Fail = MRun AND NOT Running automation 2021 Example: Sequential Control Conveyor Control system Task: Move the object from A to B when the signal “MoveA2B” becomes true. Give a true signal on ”Moved” when the object has reached B. MoveA2B Moved A B Bdetect ConvRun Idle Moving Ready MoveA2B Bdetect NOT MoveA2B

Transcript of Example: Combinatorial Control Example: Sequential Control

Page 1: Example: Combinatorial Control Example: Sequential Control

1

automation 2021

Combinatorial and Sequencing Control

Chapter 13

Gunnar Lindstedt

automation 2021

Combinatorial vs. Sequential

• Combinatorial – no memory– Only depends on current signals

• Sequential – contains state(s)– Next state is a function of:

• Current inputs• Current state

Applicable for:Machine and/or Control system

automation 2021

Example: Combinatorial Control

MachineControlsystem

Task:

Run the machine while the “Run” signal is given if both operator A and operator B are present.

Give “Fail”-signal if machine doesn’t respond.

OpApresOpBpres

RunFail

MRun

Running

MRUN = OpApres AND OPBpres AND Run

Fail = MRun AND NOT Running

automation 2021

Example: Sequential Control

Conveyor

Controlsystem

Task:

Move the object from A to B when the signal “MoveA2B” becomes true.

Give a true signal on ”Moved” when the object has reached B.

MoveA2B

Moved A B

Bdetect

ConvRun

Idle Moving

Ready

MoveA2B

BdetectNOT MoveA2B

Page 2: Example: Combinatorial Control Example: Sequential Control

2

automation 2021

Consequently….

• The controlled machine may contain states

• The controller may contain states

• The macro view of controller and machine contain states if any subsystem contain states

automation 2021

Focus on the Controller• Most controllers are sequential• Is this a sequential controller? :

while (true) {while (NOT MoveA2B) /* do nothing */ ;ConvRun := true;while (NOT Bdetect) /* do nothing */ ;ConvRun := false;Moved := true;while (MoveA2B) /* do nothing */ ;Moved := false;

}

If yes – where is the state?

automation 2021

Event Driven Systems –State Concept

Sequencing circuits

– one state at a time– state transfer– conditions for each

state transfer

1 2

automation 2021

Sequential Control Tools

• State diagrams• Petri nets• Sequential Function Charts -

Grafcet• Switching theory• PLC languages IEC61131

Page 3: Example: Combinatorial Control Example: Sequential Control

3

automation 2021

PLC programming

The standard IEC 61131-3 implies:• definition of sequential function chart

(SFC), and 4 language options– instruction list (IL)– function block (FBD)– ladder diagram (LD)– structured text (ST)

automation 2021

Automation in the Good Old Days….

F

i

Ladder (LD) is based on this model

automation 2021

Ladder Frameworkpower supply ground

automation 2021

Ladder Symbols

a.

b.

c.

DIN US Electric

a.) Normally open (NO), makeb.) Normally closed (NC), breakc.) Output, coil

Page 4: Example: Combinatorial Control Example: Sequential Control

4

automation 2021

Boolean Logic in LD

D

A B Y1

C Y2

+ 24V GNDY1 = AꞏBY2= C+D

automation 2021

Set – Reset in LD(State implementation)

S R

Y

Y

automation 2021

Reflections…

• A relay has only one coil, consequently we use only one coil symbol with the same name.

• An arbitrary number of make/break elements can be used in a ladder diagram.

• Symbols may be physical or logical in a PLC.

automation 2021

An elementary PLC structure

000102030405060708091011121314151617

202122232425262728293031323334353637

phase 1data input

phase 2processing

phase 3signal output

processor

programmemory

datamemory

input signals

input register

output signals

output register

Page 5: Example: Combinatorial Control Example: Sequential Control

5

automation 2021

State Encoding in LD

A B Cx y

A x C B

B

automation 2021

z

Alternative State Transitions

A B Cx y

A x C B

B

D

DNote!y and z have to be mutually excluding

automation 2021

Several Ways to Enter a State

A1 B Cx1 y

A1 x1 C B

B

A2x2

A2 x2

automation 2021

Example: A mixing tank is used to produce process water with correct temperature (T1 true, T2 false). Supply water with approximately correct temperature is filled with V1 to level N2. If the temperature is too high or too low the water is reduced to N1 using dump valve V3. Then hot or cold water is added to level N2 using H or C.This is repeated until the temperature is correct. Then the water is delivered using V2 and a new batch of water should be produced.

V1

V2 V3

H C

N0

N1

N2T1T2

Page 6: Example: Combinatorial Control Example: Sequential Control

6

automation 2021

The Classical Transfer Line

A B C Dfinished

product

raw

material

Starving - no input product

Blocking - can not deliver finished product

automation 2021

Simple Cell

M1 M2

input buffer output buffer

robot

buffer

automation 2021

Petri Net of the simple cell

idle

load M1

working

finished M1

finished

unload M1

idle

load M2

working

finished M2

finished

unload M2

machine 1 machine 2

putget

buffer robot

ii iii iv v vi vii viiiii

C1getunload M2unload M1load M1load M2putC2

iiii

iiiivv

vivii

viii

automation 2021

The Manufacturing Cell

M1 M2 M3

car

in out

Page 7: Example: Combinatorial Control Example: Sequential Control

7

automation 2021

Controlling the Cell

scheduler

machine 1 machine 2 machine 3 robot buffer

automation 2021

1970s: á la carte programming

automation 2021

1980s: industrial packages

Exempel: TDC3000 SCADA SATT line

automation 2021

1990s: open protocolsLarm Övervakning

Styrning

Data- in- samling

Recepthantering

Nätverk

Rapport- generator

Presentation

Databas

Specialmodul

Special- modul

Page 8: Example: Combinatorial Control Example: Sequential Control

8

automation 2021

The Software Problem• Software ~2 yrs• Hardware ~5 yrs• Application ~15 yrs

Requires:• Standardised

interfaces (ActiveX, ODBC, DDE, OPC,...

• Solutions have to survive a generation shift (planned obsolescence)

• Has to permit stepwise implementation

automation 2021

Two different developments

• The process industry– Replace the analog PID controller with a

computer– The instrumentation people

• The manufacturing industry– Replace the electromechanical relays with a

computer– The electricians

automation 2021

Sequential Control Tools

• State diagrams • Petri nets • Sequential Function Charts –

Grafcet (SFC)• Switching theory• PLC languages IEC61131 (LD )

automation 2021

OR u2

u1 y 1> u2

u1 yu u y1 2 0 0 00 1 11 0 11 1 1

y = u + u 1 2

&u2

u1 yAND u2

u1 yu u y1 2 0 0 00 1 01 0 01 1 1

y = u u 1 2

NOR u2

u1 y 1> u2

u1 yu u y1 2 0 0 10 1 01 0 01 1 0

y = u + u 1 2

&u2

u1 yNAND u2

u1 yu u y1 2 0 0 10 1 11 0 11 1 0

y = u u 1 2

1u yNOT u y u y0 11 0

y = u

=1u2

u1 yXOR u2

u1 yu u y1 2 0 0 00 1 11 0 11 1 0

&u y

SLock

u y y = u u 1 2 S

DIN/IEC UStruthtable

booleanexpression

ElementaryBooleanexpressions

Page 9: Example: Combinatorial Control Example: Sequential Control

9

automation 2021

De Morgans theorem

zyxzyx

zyxzyx

)(

)(

automation 2021

Three NOR = AND

u2

u1 y 1>

0u1

1>

0u2

1>

automation 2021

u1

y1

y2

y3

y4

u2

u3

u4

1

& & & & & & & &

1

1

1

1

1

1

1

>

>

>

>

input bufferwith inversion

AND matrix

OR matrix

Structure ofPLD, PROM

automation 2021

PLC programming

The standard IEC 61131-3 implies:• definition of sequential function chart

(SFC), and 4 language options– instruction list (IL)– function block (FBD)– ladder diagram (LD) – structured text (ST)

Page 10: Example: Combinatorial Control Example: Sequential Control

10

automation 2021

From ladder to PLC codeInstruction List (IL)

u1 u2

u2

y1

y1 y2

y3

u3ld u1or y1and u2and u3out Y1out Y2ldi u2out Y3

automation 2021

From ladder to PLC

u1 u2

u3 u4

y1 ld u1and u2ld u3and u4orbout Y1

automation 2021

From Boolean to PLC

&

&&

& 1>

u1

y1

u2

u3

u4

u5

u6

ld u1and u2ld u3and u4ld u5and u6orbanbout Y1

automation 2021

PLC programming

The standard IEC 61131-3 implies:• definition of sequential function chart

(SFC), and 4 language options– instruction list (IL) – function block (FBD)– ladder diagram (LD) – structured text (ST)

Page 11: Example: Combinatorial Control Example: Sequential Control

11

automation 2021

Function Block Diagram (FBD)

automation 2021

PLC programming

The standard IEC 61131-3 implies:• definition of sequential function chart

(SFC), and 4 language options– instruction list (IL) – function block (FBD) – ladder diagram (LD) – structured text (ST)

automation 2021

Structured Text (ST)

Strongly resembles Pascal

automation 2021

PLC programming

The standard IEC 61131-3 implies:• definition of sequential function chart

(SFC), and 4 language options– instruction list (IL) – function block (FBD) – ladder diagram (LD) – structured text (ST)

Page 12: Example: Combinatorial Control Example: Sequential Control

12

automation 2021

Controlling a simple Batch Tank

1

2

3

4

5

tank empty

discharge valve closedpump on

pump offheater on

heater offwait time=”time out”

open discharge valve

empty * start

full

temp

wait time

empty

Function Comment

This expression is true if the sensor for the low levelindicates empty=1 and a start command is given

Start filling operation

The level has reached the upper limit value

End of filling operation and start of heating time

The desired temperature has been reached

The waiting time is “time out”

The waiting time is over

The tank is empty

Initial stateFilling state

Heating state

Wait state

Emptying state

automation 2021

The Sequential Function Chart

1

2

3

4

5

tank empty

discharge valve closedpump on

pump offheater on

heater offwait time=”time out”

open discharge valve

empty * start

full

temp

wait time

empty

Function Comment

This expression is true if the sensor for the low levelindicates empty=1 and a start command is given

Start filling operation

The level has reached the upper limit value

End of filling operation and start of heating time

The desired temperature has been reached

The waiting time is “time out”

The waiting time is over

The tank is empty

The Sequencepart

The Actions

automation 2021

The finite state concept

• The process is represented by 5 states• Only 1 state at a time!• A transition signal marks the change from

one state to another one• A condition for transition (from a sensor, a

timer, an operator)• In each state there is an action

automation 2021

Grafcet

• Developed in France 1977• Graf + AFCET (Association Francaise

pour la Cybernetique Economique et Technique)

• French standard 1982• IEC standard 1988 - IEC 848

(=SFC, Sequential Function Chart)• Essential part of IEC 61131-3

Page 13: Example: Combinatorial Control Example: Sequential Control

13

automation 2021

Alternating Parallel Branches

automation 2021

Grafcet for a Drill(Alternating parallel branches)

drill in positionup

set acknowledge time=time_1

show drill at work piece alarm

set start rotationset drill to work pieceset max time

21

22

23

24 30

drill at work piece * max timedrill at work piece * NOT max time

drill ready * NOT time_1 * work piece

drill start

automation 2021

Simultaneous Parallel Branches

automation 2021

FromSFC

to ladder

Simul-taneousparallel

branchess4

Page 14: Example: Combinatorial Control Example: Sequential Control

14

automation 2021

FromSFC

to ladder

Alternatingparallel

branches

automation 2021

PLC open

• PLC open is an organisation to support the standard 61131-3

• Manufacturer and product independent• Members of the PLC open group are

expected to deliver products that follow the 61131-3 standard

http://www.plcopen.org/

automation 2021

PLC Open (2)• Open systems can be replaced with

software or hardware from a third party• Some companies call products open

incorrectly• The IEC 61131 standard encourages

interchangeable systems• Open architecture controllers replace a

PLC with a standard computer

automation 2021

Batch Operation

• Batch operation software is standardised in the ISA S-88 standard (ISA)

• S-88 defines models and terminology

www.isa.org/isa88

Page 15: Example: Combinatorial Control Example: Sequential Control

15

automation 2021

Structure of a Batch Operation

Process cellProcess unitProcess enhet

Process cell

Process unit

Process cell

automation 2021

Important Concepts

• Process cell• Process unit• Batch• General recipe• Control recipe• Phase

automation 2021

Batch – from the start• The customer has a

manufacturing procedure (recipe)

• How to structure the software ?

Add 10 l of waterAdd 5 l of ethanolMix 3 min, 300 rpmAdd 2 l of saltMix 2 min, 1000 rpmHeat until 45o CEmpty after 5 min

automation 2021

Batch (2)

Identify a sequence of operations in the unit

1

2

3

4

5

6

7

Page 16: Example: Combinatorial Control Example: Sequential Control

16

automation 2021

Batch (3)

• Identify phases and parameters for each unit– Raw material (sort, volume) – Mixing (time, speed) – Temperature control (setpoint value)– Empty (time)

• Write the executing of the recipe

automation 2021

US US US

Nedbrytning

Rening

Torkning

Batch (4) - several units

• Identify the equipment need• Write recipe• Start the production

Break down

Drying

Cleaning