ExamRobotic

GRAFCET and sequences

Level: Intermediate 5 min read 32 questions

Almost every machine does the same thing: a sequence of steps. Lower, close the gripper, raise, move across, open. GRAFCET is the standardised way of drawing that sequence before programming it, and it is the best cure for programs where nobody knows which step the machine is in. It is defined in IEC 60848, and the SFC language of IEC 61131-3 is derived from it; in Siemens it is called S7-GRAPH.

The elements

0 1 2 Start · Part present Drill down Drill up Lower drill · Spin Raise drill · Spin Idle
GRAFCET of a drill: when idle it waits for start and a part; it goes down spinning until the lower limit switch; it goes up spinning until the upper one and returns to idle.

The evolution rules

A GRAFCET is not a free drawing: it evolves according to five rules.

  1. Initial situation: at start-up, the initial steps are active.
  2. Clearing a transition: a transition is enabled when all the steps immediately before it are active. It is cleared when it is enabled and its receptivity is true.
  3. Evolution: when a transition is cleared, all the following steps are activated and all the preceding ones are deactivated.
  4. Simultaneity: if several transitions can be cleared at the same time, they are cleared at the same time.
  5. Activation has priority: if a step must be activated and deactivated at the same time, it stays active.
A practical consequenceA receptivity is only taken into account if the step before it is active. In the drill, the “drill down” limit switch may turn on for any reason, but it only advances the sequence when the machine is in step 1.

Structures

Linear sequence

One step after another, like the drill. There is only one active step at any time.

OR divergence and convergence (selection)

Several branches leave a step, each with its own transition, and only one is followed. For example, depending on the type of part, it goes to station A or station B. The receptivities of the branches must be mutually exclusive: if two could be true at once, the simultaneity rule would activate both branches, and that is almost never what you want.

AND divergence and convergence (parallel)

They are drawn with a double horizontal line. When the transition is cleared, all the branches are activated at once and evolve separately. At the end, the AND convergence waits for every branch to finish before continuing: it is a synchronisation. For example, while one cylinder places the part, another opens the door, and no drilling happens until both are done.

Jumps and loops

A transition can lead back to an earlier step (repeat) or skip steps that are not needed in a particular case.

Types of actions

From GRAFCET to the PLC

There are three common ways of turning a GRAFCET into a program:

1. One memory bit per step, with set and reset (LAD)

Each step is a bit. Each transition is a network: if the previous step is active and the receptivity is true, the next step is set and the previous one is reset.

Network "Transition 0 → 1":
   X0   Start    Part           X1
 --| |----| |------| |----------(S)--
                                X0
                              --(R)--

The outputs are calculated separately, once each, from the steps: Spin = X1 OR X2. That way each output has a single coil. At start-up, a start-up block (OB100) sets X0 and resets the rest.

2. A step number with CASE (SCL)

For linear sequences, an integer variable stores the active step and a CASE runs its transitions. It is very compact, but it only allows one active step: parallel branches have to be handled with several sequences.

3. S7-GRAPH or SFC

The GRAFCET is drawn directly in the PLC’s sequential language, which handles the evolution rules by itself and shows online which step is active. In Siemens, S7-GRAPH is available on the S7-1500 (not on the S7-1200).

Typical mistakes

Summary

Test what you have learned

32 practical questions with explained answers. Free, no sign-up.

Start the test