You are on page 1of 24

Chapter 9 : GRAFCET and Ladder Diagram

The GRAFCET is a tool for describing the specifications of the control unit of an
automated system.

The working of an automatic equipment may be described graphically by a group of:

• STEPS to which are associated certain ACTIONS


• TRANSITIONS which are conditions to be fulfilled
• DIRECTED LINKS linking steps and transitions

Transitions
step 0

Directed Links
input 1

step 1 output 1

input 2

step 2 output 2

input 3 Actions

step 3 output 3

input 4

step 4 output 4

input 5

step 5

input 6

GRAFCET & Ladder Diagram


The GRAFCET (cont’d)

Block Diagram of a PLC-controlled automatic system :

OPERATOR
INSTRUCTIONS
PILOT LIGHTS

COMMANDS

CONTROL OPERATIVE
UNIT UNIT
INFOMATION

PSA2 FP2-C1 XY64D2T XY64D2T

GRAFCET & Ladder Diagram


The GRAFCET (cont’d)

Initial Step (double box)


Initiated by First Cycle Bit

0 WAIT step ( - doing nothing, in this case )

Transitions
start

1 extend cylinder A

cylinder A extended Actions

2 extend cylinder B

cylinder B extended

retract cylinder A
3
retract cylinder B
cylinder A retracted cylinder B retracted

Two Actions
Transitions In One step
(AND operation)
These are sensors !

GRAFCET & Ladder Diagram


Different parts of a GRAFCET

Labelled Connector : indicating where


9 control has come from (source

Initial Step : defining the initial situation of


the automated system.
1

Transition : between steps and with which


logic conditions are associated.
Step : a steady state with
which command or actions 2 Directed Link : connecting steps to
may be associated. transitions, and transitions to steps.

Simultaneous Activation :
indicated by transition followed
by a double horizontal line.
3 ACTIONS 6 ACTIONS

Start of Sequence Selection :


indicated by a single horizontal
line followed by two or more
transitions.
4 ACTIONS 7 ACTIONS

End of Sequence Selection :


indicated by one or more
transitions followed by a
single Horizontal line.
5 8

Simultaneous De-activation :
9 indicated a double horizontal line
followed by transition.

Labelled Connector :
1 indicating where control is going
to (destination Connector).

GRAFCET & Ladder Diagram


Grafcet Design – Sequence

How to do the sequence.

1. Represent the steps (step_1 and step_2) by internal


Relay bits R1 and R2.
1
R1 and R2 will either be “1” (active) or “0” (inactive).

2. Only 1 step should be active at any one time. START

3. Do not worry about outputs at the moment.


2
4. The initial step should be activated by the PLC
internal scan cycle (the very first cycle). After STOP
which it will be activated by step_2 and stop_PB
(during the return loop).

Step_1 activated by 1st cycle bit, but it will turn


off during the 2nd cycle onwards. Hence, the 1st_cycle_bit Step-1
need to on to the avtive state (therefore latch
It) using step_1. Occurs only once
upon PLC power
on
Step_1 latched. 1st_cycle_bit
Step-1
Step-1
When step_1 is active and start_PB is pressed, step_2
will be active and need to be latched (because
start_PB will eventually be released!) Step-1 Start
Step-2
Step-2

(But then there will be 2 active steps: step_1 and 1st_cycle_bit Step-1
step_2.We want to have only one active step. Therfore,
when step_2 becomes active, step_2 should de-activate Step-1 Step-2
(kill-off) step_1.
Step-2 Stop
Similarly, the step after step_2, that is step_1, should be
used to de-activate (kill-off) step-2.
Step-1 Start Step-2
Provision must be made to go back to step_1 again when
Step_2 is active and stop_PB is pressed.(This is to loop
Step-2 Step-1
back).
To kill Step 2
when Step 1
is active

GRAFCET & Ladder Diagram


Grafcet Design – Output

How to do the output:

1 ON RED
1. Now that we have got the sequence, (sequence
Ensures that step_1 and start_PB goes to step_2,
And step_2 and stop_PB goes back to step_1, START
And so on) we can determine the outputs (i.e.
What happens at each step).
2 ON GREEN

2. We can decide to turn on red_light in step_1 STOP


And turn on green_light in step_2 (if that is
What is required).
Step-1 ON RED
3. That means upon powering up of PLC (remember
1st_ cycle_ bit → hence the initial step : step_1),
the red light turns. When start_PB is pressed,
green_light turns on. When stop_PB is pressed,
red light turns on, and so on. Step-2 ON GREEN
(Remember : no change in sequence, only the output).

OR

We can decide to turn on the buzzer in step_2 and turn on both the lights in step_1.
So that when start_PB is pressed, the red_light and green_light will turn on.
(Remember : still no change in sequence, only the output).
Work the
Outputs from
right to left

Step-1 ON RED
ON RED
1 ON GREEN
ON GREEN
START

Step-2 ON BUZZER

2 ON BUZZER

STOP

GRAFCET & Ladder Diagram


OR

Other examples.

Step-1 ON GREEN

ON RED
1 ON GREEN
Step-2 ON BUZZER
START

Step-1 ON RED
2 ON RED
ON BUZZER
Step-2
STOP

Outputs may be
in any order
Inputs may
be repeated
Outputs
Step-1 ON RED

ON RED
1 ON BUZZER Step-2 ON GREEN

START
Step-1 ON BUZZER

Step-2
2 ON GREEN
ON BUZZER
STOP
No Repeated
Outputs !!

Note : Beware of repeated output in the ladder diagram program.

Even though the GRAFCET contains two instances of ON BUZZER


The OUTPUT ladder diagram should contain only one instance of ON BUZZER.
It is wise therefore to state the output first and see which steps need this output.
That is work the output part of the ladder diagram from right to left.

GRAFCET & Ladder Diagram


GRAFCET of the Press
Stamp Start PB

Done manually by operator


UNPROCESSED
1 MATERIAL
IN POSITION Stamp
Die

Material in position and cycle start


( steps )
LOWER STAMP
2
Stamp

End of compression ( input = sensor )

RAISE STAMP
3
Stamp

Stamp in high position

LOWER DIE
4
Die
( outputs / actions )

Die in low position

EVACUATE PART
5

Stamp

Evacuation completed

RAISE DIE
6
Die

Die in high position

GRAFCET & Ladder Diagram


SEQUENCE Ladder Diagram of the Press

1st_cycle_bit Step-1

Step-6 Die-High

Step-1 Step-2

Step-1 Material Start Step-2

Step-2 Step-3

Step-2 End-High Step-3

Step-3 Step-4

Step-3 Stamp-High Step-4

Step-4 Step-5

Step-4 Die-Low Step-5

Step-5 Step-6

Step-5 Evacuate Step-6

Step-6 Step-1

OUTPUT

Step-2
Lower Stamp
Step-3
Raise Stamp
Step-4
Lower Die
Step-5
Evacuate part
Step-6
Raise Die
GRAFCET & Ladder Diagram
Project 1 - Moving a Wagon

Left Side Right Side

Start PB
1

Start PB pressed Moving A Wagon

2 Move Wagon to the Right

Right Side
reached
Move Wagon to the Left
3

Left Side
reached

OUTPUT
SEQUENCE

1st_cycle_bit Step-1 Step-2 Move-right

Step-1 Step-2 Step-3 Move-left

Step-3 Left-side

Step-1 Start Step-2

Step-2 Step-3

Step-2 Right-side Step-3

Step-3 Step-1

GRAFCET & Ladder Diagram


Convert GRAFCET Ladder Diagram

Use On Red

Use R1 or Step 1 Use Ext_A

Use A+

Sequence Output

GRAFCET & Ladder Diagram


GRAFCET of the Drill

1
System initialization :

Retract Cylinder A
Run & System initialised Retract Cylinder B
Off Green Light

2 On Green Light
Extend Cylinder A

Cylinder A extended

3 Extend Cylinder B

Cylinder B extended

4 Lower Drill

Step 4 / TIM001 / 3s . Drill_low

5 Raise Drill

Drill_ high

6 Retract Cylinder A
Retract Cylinder B
Cylinder A retracted . Cylinder B retracted
sensors

Drill-high
Drill

Cylinder A and Cylinder B hold the Drill-Low


material (part to be drilled) tightly while
the drilling machine drills the hole.
Part / Material

Cylinder A Cylinder B

A+ B+
A- sensors B-

GRAFCET & Ladder Diagram


Project 2

Ladder Diagram of the Drill

SEQUENCE OUTPUT

1st_cycle_bit Step-1 Step-2 ON GREEN LIGHT

Step-1 Step-2 Ext . Cyl A

Step-6 Cyl.A ret Cyl.B ret

Step-3 Ext . Cyl B

Step-1 Run Initialise ? Step-2


d
Step-2 Step-3 Step-4 LOWER -DRILL

Step-2 Cyl.A ext Step-3 Step-5 RAISE-DRILL

Step-3 Step-4

Step-6 Ret . Cyl A

Step-3 Cyl.B ext Step-4 Ret . Cyl B

Step-4 Step-5

Step-4
Step-5 TIM
Step-4 Tim001 Drill-Low
001
Step-5 Step-6
3s

Step-5 Drill-high Step-6

Step-6 Step-1

GRAFCET & Ladder Diagram


Grafcet Design

Automatic Hand Dryer

The system incorporates a diffuse sensor to detect the the presence of a pair of hands. When a pair
of hands are placed just below the the Automatic Hand Dryer, heated air flow is turned on. When
the person has completed drying his hands, the removal or absence of hands will be detected. The
heated air will continue to flow for a further 3 seconds before the heated air flow is turned off.

Fill in the blanks :

Step 3 / Timer5 / 3s

Inputs Outputs
Presence of Hands Off Hand Dryer
Absence of Hands On Hand Dryer

Automatic Hand Dryer

GRAFCET & Ladder Diagram


Automatic Hand Dryer

SEQUENCE

1st_cycle_bit Step-0

Step-0 Step-1

Step-2 Tim005

Presence
Step-0 DIF Step-1

Step-1 Step-2

Absence
Step-1 DIF Step-2

Step-2 Step-0

DIF (=ON) = Presence of hands


OUTPUT

Step-0
OFF HAND DRYER

Step-1
ON HAND DRYER
Step-2

Step-2 Timer5

3s

GRAFCET & Ladder Diagram


GRAFCET with multiple selections

A Grafcet is generally made up of several sequences (several series of steps that


execute one after the other) and it is often necessary to exclusively select one of
these sequences.

Example:

x y z

6 Action A 8 Action C 9

a c b

7 Action G 10 Action D
g d

11 Action E

The above GRAFCET consists of a switch which allow to select one out of three
possible sequences depend on the transition conditions x, y and z. The different
transitions corresponding with their conditions x, y and z may be enable
simultaneously and they could be cleared simultaneously if the transition conditions
x, y and z were true at the same time. In order to avoid this from happening, the
transition conditions must be mutually exclusive. It is also possible to introduce the
priorities among the different sequences.

GRAFCET & Ladder Diagram


GRAFCET with multiple selections
12
The transition conditions a.b
and a.b are mutually exclusive.
a.b a.b
If a and b are both present, the
transition from step 12 will not
be cleared. 13 14

12
The transition 12-13 has higher
priority than 12-14: the
a a.b
transition 12-13 will be cleared
if both a and b are true at the
same time. 13 14

12 Action E 16 Action K

k
f.e f.e

13 Action G 17 Action L

g l

14 Action H 18 Action M

h n.m
n.m

15 Action J 19 Action P

j p

Jump from step 12 to step 15 Repeat 17-18 if condition n.m


if condition f.e is true. is not obtained and n.m is true.

GRAFCET & Ladder Diagram


SEQUENCE OUTPUT

Step-4 ? Step-5 Step-6 A

Step-5 Step-6 Step-8 Step-9


Step-7 G
Step-5 x Step-6

Step-6 Step-7 Step-8 C

Step-6 a Step-7 Step-10 D

Step-7 Step-11
Step-11 E
Step-5 y Step-8

Step-8 Step-11

Step-5 z Step-9

Step-9 Step-10

Step-9 b Step-10

Step-10 Step-11

Step-7 g Step-11

Step-8 c

Step-10 d

Step-11 Step-12

GRAFCET & Ladder Diagram


GRAFCET : COIN TOSSER

TOSS
1
COIN

HEAD TAIL

ON ON
2 3
GREEN RED

STEP-2-3/ Timer7 / 3s

Input Output
Label Addr Label Addr IO Listing or
Head X1 TOSS COIN Y1 IO Address Assignment Table
Tail X2 GREEN Y2
RED Y3

SEQUENCE OUTPUT

Step-1 Step-1 TOSS COIN


1st_cycle_bit

Step-1 Step-2 Step-3


Step-2 ON GREEN
Step-2 Timer7

Step-3
Step-3 ON RED

Step-2
Step-1 Head
Step-2
Timer7
Step-2 Step-1
Step-3
3s
Step-3
Step-1 Tail

Step-3 Step-1

GRAFCET & Ladder Diagram


GRAFCET: COMPONENT INSPECTION

START

PASS FAIL
EXTEND EXTEND
3 PASS-PUSHER 4 FAIL-PUSHER

PASS-PUSHER-EXT FAIL-PUSHER-EXT

LOAD NEXT
5 COMPONENT

MATERIAL (IN POSITION)

SOLUTION : Sequence & Output

GRAFCET & Ladder Diagram


(c) Design a GRAFCET for the following system in Fig 1 (initial step = step 1):

Detection of clasps on cardboard box:

The system incorporates a through-beam (TB) optical sensor, an inductive


sensor (IND ) and a counter.

The presence of a new clasp increments the counter (INCR_CTR).

The counter serves only to show the number of clasps on each box that
passes by. No other action need to be taken by the system based on the
number of clasps detected.

The counter is reset (RESET_CTR) for every new box that arrives.

TB
PLC INCR_CTR

IND RESET_CT
R
(inputs) (outputs)

PLC input-output diagram

Counter

Fig. 1 : Detection of clasps on cardboard box

GRAFCET & Ladder Diagram


Solution :

GRAFCET & Ladder Diagram


(d) Design a GRAFCET for the following system in Fig Q3d (initial step = step 1):

Automatic gauge level monitoring: The system incorporates two through-


beam (TB) optical sensors to monitor the level of the fluid in the stationary
glass gauge as shown in Fig Q3d. When the level falls below the lower limit,
a valve situated on top of the gauge is turned on automatically to add more
fluid. When the fluid level reaches above the upper limit, the valve is turned
on for a further 10 seconds before it is turned off.

Note : The control of filling level through glass gauge makes use of the laws of refraction. The
fluid, being the optically denser medium, breaks the light beam. Without the fluid the sensor is
activated.

TB_Top On Valve
PLC
TB_Bottom Off Valve

(inputs) (outputs)

PLC input-output diagram

Automatic On/Off Valve

Emitters Detectors

TB_Top

TB_Bottom

Fig. Q3d : Automatic Gauge Level Monitoring

GRAFCET & Ladder Diagram


Solution :

GRAFCET & Ladder Diagram

You might also like