Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Abstract
Grafcet is a powerful tool to specify sequential behaviours. However some limits of this formalism may be reached when dealing
with complex systems. The aim of this paper is to present new mechanisms that have been proposed in order to extend specication
capabilities of Grafcet and that have been taken up by the revision process of the IEC 61848 standard: enclosed step and stored
actions. The consistency of these extensions with basic formalism is shown and their usefulness is illustrated by an example.
Theoretical denitions of Grafcet and its extensions are given in Appendix A. # 2001 Elsevier Science Ltd. All rights reserved.
0967-0661/01/$ - see front matter # 2001 Elsevier Science Ltd. All rights reserved.
PII: S 0 9 6 7 - 0 6 6 1 ( 0 1 ) 0 0 0 3 3 - 8
744 H. Gueguen, N. Bouteille / Control Engineering Practice 9 (2001) 743756
partial Grafcet, named enclosure, is associated. The can be the case in Fig. 9, when steps 0 and 1 are active
semantic of enclosing is that when the enclosing step is and input a becomes true, is step 1/2 activated whereas
active all its enclosures are active, that is, at least one of step 1/3 is already active?
their steps is active. Symmetrically an enclosed step Another problematic case is the one where an
cannot be active if its enclosing step is not. An enclosing enclosing step must be activated and deactivated in the
step is a step and it must be considered as other steps in same atomic reaction. According to the evolution rules
order to determine enabled transitions, the activity of of Grafcet, this step remains active after the reaction.
the enclosing step alone is considered without taking But what is the evolution of the activity of enclosed
into account the activity of enclosed steps. The enclosure steps? This is the case in Fig. 9 when steps 0, 1 and 1/3
is graphically symbolised by marks in the corner of the are active when inputs a and b change from false to true:
square of the enclosing step (see e.g. step 1 in Fig. 8) and which is then the active enclosed step 1/3 (no evolution)
by including the drawing of the enclosed graph in a or 1/2 (deactivation of the enclosure and use of the
rectangle with the name of the enclosing step on the activation link)? This is also the case when steps 0, 1 and
upper side and, if needed, on the lower side the name of 1/3 are active when inputs a, b and d change from false
the graph. The complete designation of an enclosed step to true: can then the transition from 1/3 to 1/1 be
is determined by making up the designation of the cleared?
enclosing step, the partial graph name and the label of The answers to these questions cannot be arbitrarily
the enclosed step, in accordance with the following chosen as they have to be consistent with each other and
syntax nG
=s where n is the designation of the enclosing with the behaviour of Grafcet without enclosing. The
step, G the name of the graph and s the label of the step. denition of enclosing which is proposed (see Appendix
The symbol * on the left side of some steps of enclosure A) leads to three operational rules to specify the
is the activation link. It indicates the enclosed steps that behaviour of enclosing and enclosed steps.
are active when the enclosing step becomes active. The Enclosing rule 1: if a transition just preceding an
general rule is that, if an enclosing step is active at least enclosing step is cleared in a reaction, activation links of
one enclosed step must be active and this is also true for enclosure are used if and only if the enclosing step is not
the initial situation. That is the reason why if an active before the reaction.
enclosing step is an initial step, there must be at least one Enclosing rule 2: if a transition just succeeding an
initial step in each enclosure, but nothing imposes that enclosing step is cleared in a reaction, enclosed steps
this initial step should belong to the set of steps active before the reaction are inactive after it, if and only
indicated by the activation link. if the enclosing step is inactive after the reaction.
In Fig. 8, when enclosing step 1 is active one step of Enclosing rule 3: if a transition just succeeding an
each partial Grafcet G1 and G2 is also active. If it is enclosing step is cleared in a reaction no enclosed
considered that step 0 is active and input a becomes true transition can be cleared in this reaction.
as input b remains false, step 1 becomes active and also Rule 1 expresses that the activation links of enclosure
step 2 of G1 1G1
=2 and step 1 of G2 1G2
=1. These are used only in the reactions when the enclosing step is
two graphs evolve according to their transition-condi- activated and are not equivalent with the clearing of
tions as long as step 1 is active. As soon as b becomes preceding transitions. This is consistent with Grafcet
true step 1 is deactivated and so are all active steps of G1 where steps can be active or inactive but not active
and G2. several times. Rules 1 and 2 are consistent with the rule
This mechanism is very powerful and simple to of Grafcet, which say that when a step is activated and
understand. However its semantic has to be specied deactivated it remains active, so if the enclosing step is
in special cases. The rst problem concerns the deactivated and activated it remains active and nothing
behaviour of the specication when an enclosing step happens in the enclosure. Rule 3 is consistent with rule
is already active and one of its preceding transitions is 2, as if a transition could be cleared, steps would be
cleared: should the activation link be used or not? This deactivated. It is also consistent with the constraint
H. Gueguen, N. Bouteille / Control Engineering Practice 9 (2001) 743756 749
that if an enclosed transition was cleared, its succeeding 4. Stored actions and events
steps should be active after the reaction, which is
impossible if the transition succeeding the enclosing step As explained in Section 2, standard actions in Grafcet
deactivated it. are continuous actions that dene the value of output
These rules give the solutions to the problems variables by means of sets of equations that depend on
that were previously presented in the example in the active steps. For example the sequence of Fig. 11b is
Fig. 9. In the rst case rule 1 gives the solution and consistent with the model of Fig. 11a, if step 3 is active,
as step 1 is already active before the reaction, the the output S is true even if step 2 is active and input a is
activation link is not used and after the reaction step 1/3 true. However it is sometimes useful to be able to specify
remains the only active step of the enclosure. The sequences, as the one in Fig. 11c, where a value is
answer to the second question is given by rules 1 and 2. assigned to a variable at specic instants and where the
As step 1 is still active after the reaction, no step of the variable retains its value between two subsequent
enclosure is deactivated in the reaction and as the assignments. The actions of this type are then impulses
enclosing step is active before the reaction the activation and their results are stored in the variable. They are
link is not used, after the reaction step 1/3 remains associated with events that dene the instants when they
active. Finally the answer to the third question is given take place and not with state as continuous actions.
by rule 3. As the transition succeeding step 1 is cleared in This type of actions have been introduced at the
the reaction, the transition from step 1/3 to 1/1 cannot origin of Grafcet (see e.g. David, 1995) and was
be cleared. The Grafcet reacts as if the negation of associated with activation of steps. However it was not
transition-conditions of transition succeeding the en- always clear whether these actions were included in the
closing step was added by conjunction to all transition- model or not (see e.g. Bouteille et al., 1992), what was
conditions of the enclosure. the relationship with continuous actions and what was
The use of enclosing steps causes no particular their behaviour according to the evolution of activities
problem with transient evolutions as from users point of steps. Moreover it appeared that the constraint to
of view the global reaction is a chain of reactions where express event by activation of steps only, may lead to the
each atomic reaction is determined by evolution and introduction of specic steps that makes the specica-
enclosing rules and from a formal point of view tion more complex. In order to remedy these drawbacks,
transient evolution is taken into account at the level of Guillemaud, Grave, and Gu!eguen (1998) introduced a
the state machine which is at without a notion of new representation of stored actions with an unambig-
enclosing. uous semantic. This concept is based on two main
Nevertheless the use of transient evolution can be very considerations. Firstly, output variables are split into
useful when using enclosing steps, as it allows choosing two sets, assigned variables, which are used in contin-
of the situation when activating the enclosing step uous action and allocated variables, which are used in
according to the value of a predicate. Fig. 10 is an stored actions. Secondly, stored actions are associated
example of this use of transient evolution, as step 1/1 with internal events which are the conjunction of a
that is indicated by the activation link is never active. It specic situation and an input event. Four representa-
is just used in order to dierentiate two activated steps tions of internal events are dened and four symbols are
according to the value of input e. It can also be seen in introduced in order to specify actions associated with
this example that the deactivation of the enclosing step them. These symbols are shown in Fig. 12. Symbol (a)
can be limited by the activity of enclosed step by using
step variables. In this example the transition succeeding
step 1 is enabled as soon as it is active but its transition-
condition is true when b rises from false to true or c is
true when enclosed step 1/4 is active.
Fig. 10. Advance activation and deactivation. Fig. 11. Continuous and stored actions.
750 H. Gueguen, N. Bouteille / Control Engineering Practice 9 (2001) 743756
(c:d) is false, only one transition of the Grafcet of in the system in the following section, the presence of
Fig. 14b is cleared and so the value of the output pallets has to be memorised and queued at the instant
variable is changed. It can also be noticed that according when the line requests it and the belt is free. If Grafcet is
to this semantic the initial value of all allocated variables used to specify the sequential part of control it is
is false. possible to extend stored actions to specify triggering of
The relationship between allocation and transient these actions on non-Boolean variables because the
evolutions is taken into account very easily. This is notion of event that they introduce in Grafcet is
based on the denition of the clearing of a transition, consistent with the need to distinguish specic instants
which is, that a transition is cleared when its preceding at which these take place.
steps are active and its transition-condition is true. So Even if the action is simple and specied inside the
the expression ClrT can be expressed as the logical action rectangle (as on Fig. 15) it is considered as
AND of its transition-condition and the step variables external to the Grafcet specication and so asynchro-
of its preceding steps (e.g. in Fig. 14 Clr1 X0 :E). As nous with Grafcet evolution. This has two main
activation and deactivation of steps are linked to consequences. Firstly if an action is triggered at an
clearing of transition they can also be expressed by instant its result is not taken into account at this instant,
conjunction of steps variables and transition-conditions especially for transient evolution analysis, but later; if
(e.g. in Fig. 14 Act1 :X1 :X0 :E). The behaviour of the the completion of the action must be awaited in order to
specication that use stored actions is then given by determine the correct behaviour of the sequential part it
rstly substituting Grafcets as the one in Fig. 14b for all has to be explicitly reported by an event (Guillemaud,
stored actions and then replacing events (Clr, Act, and 1998). Secondly, if several actions are triggered at the
Dac) by these expressions. Transient evolution is then same instant, even if this is the result of transient
studied on this new version of the specication that is a evolution, they are synchronously triggered. Moreover,
classical one with assigned variables and transition no interpretation is associated to these action, it means
condition dened by input and step variables. The that the output of the formal model is the fact that the
practical result is that actions associated with activation triggering event of the action has occurred but the result
or deactivation of a step are performed even if this step of this action is not taken into account. This may be
belongs to a path of transient evolution and is not really crucial when conicting allocations are made especially
activated. in transient evolution. For example Fig. 15, what can be
The stored actions, which have been considered here, assured is that if step 0 is active and input E and D are
are actions on Boolean variables that are entirely in the true, the two actions will be triggered simultaneously but
scope of Grafcet. As the semantic of stored actions is neither the fact that this is a mistake nor the nal value
given by a Grafcet with continuous actions this of A are in the scope of the model, this is left to the user.
mechanism does not enlarge the capabilities of the basic
formalism, but it provides a means to make specica-
tions simpler because Grafcets as the one in Fig. 14b 5. Example
need not be explicitly specied as they are included in
the formalism. However, from a practical point of view, In order to illustrate the use of these extensions of
control applications not only have Boolean inputs and Grafcet, the system in Fig. 16 will be considered. In this
outputs and are not purely sequential. In these applica- handling system a shuttle is used in order to take pallets
tions the sequential part interacts with other parts by at the end of three production lines and put them on an
triggering actions on non Boolean variables, such as output belt. When a line sends a request, if the
incrementation of counters, allocation of the result of corresponding input belt is free, its motor is switched
calculus to numeric registers or closing of the loop of
PID controllers, . . . . These actions have to be triggered
at specic instants according to changes of input
variables and the situation of the system. For example
Table 1
Inputs and outputs of the handling system
equations are associated with steps and initialisation is always possible to determine the active situation
with events (Guillemaud & Gu!eguen, 1999). from the list of active steps.
These extensions are useful to full the needs of * M : QII ! PS associates with each internal
specication of complex systems as it has been noticed in event the set of steps which are left when the event
various examples and they have been proposed for occurs with the constraints
industrial standardisation (IEC, 2000). Moreover as s 2 Mq; i 1 ; i 2 ) q 2 s;
they are formally dened, it is possible to automatically
q 2 s ^ Eq; i 1 ; i 2 2= s ) s 2 Mq; i 1 ; i 2 : A:3
calculate the underlying state machine from a given
specication as shown by a demonstration tool that has
been developed. Of course this state machine is not
* V : QII ! PS associates with each internal
intended to be shown to the nal user but only as an event the set of steps which are entered when the
example, to be checked out in order to assure the quality event occurs with the constraints
of the specication. These formal denitions are mainly s 2 Vq; i 1 ; i 2 ) Eq; i 1 ; i 2 2 s;
given in Appendix A. From them it is possible to Eq; i 1 ; i 2 2 s ^ q 2= s ) s 2 Vq; i 1 ; i 2 : A:4
determine the evolution and enclosing rules that have
been presented in this paper and that express the
practical semantic of Grafcet and its extensions that Denition A.3. A transition t is a directed link from the
are useful to users. set of steps Ut to the set of steps Dt , the set of transitions
Future works are focused on the use of the is denoted by T
hierarchical structuring of the specication in order to
improve the eciency of checking algorithms and on the Denition A.4. A partial graph is (S 0 ,T 0 ) where S 0 S
transition from specication to safe control software. is a set of steps T 0 T is a set of transitions such as
8t 2 T 0 Ut [ Dt S0
Appendix A. Denition and theoretical building of the Denition A.5. A step se is an enclosing step if and only
semantic if there exists a partial graph (S0 ,T 0 ) such as
[
se s;
A.1. Denitions
s2S 0
which expresses that if there is no change in the input Denition A.6. The transition-condition of a transition t
vector the situation cannot change, Init : I ! Q is the is the characteristic predicate of the set of events
initialisation function which species the initial situation specied by (A.7), simplied by the context of the
according to the initial value of input vector, Val : transition
QI ! O is the output function. fq; i 1 ; i 2 =Ut Mq; i 1 ; i 2 and Dt Vq; i 1 ; i 2 g: A:7
Denition A.2. An abstract specication of a sequential As the activity of the situation can be expressed by
machine is S; M; V where activities of steps, the characteristic predicate can be
expressed with characteristic variables of steps and input
* S PQ is a set of sets of situations, named steps, variables. It is simplied by the context of the transition
such as because some pieces of information, such as the value of
8q1 ; q2 2 QQ 9s 2 S such as characteristic variables of steps in Ut or consequences of
enclosing (A.6) may be implicit.
q1 2 s and q2 2= s or q1 2= s and q2 2 s A:2
a step is said to be active if the active situation is one Denition A.7. Clrt is the characteristic predicate
of its components. The constraint A.2 ensures that it of the set (A.7). Acts is the characteristic predicate
H. Gueguen, N. Bouteille / Control Engineering Practice 9 (2001) 743756 755
fq; i 1 ; i 2 =q 2 s and Eq; i 1 ; i 2 2= sg A:9 Q^ Q=UE^ where UE^ is the set of situations of Q which
are not reachable by E. ^
from these denitions it is possible to express these Of course the problem is the calculus of E * q; i 1 ; i 2
predicates with characteristic variables of steps and but if it exists, its calculus is nite as the number of
input variables iterations is lower than the number of situations in Q. If
0 0 11
Y X X there exists some q; i 1 ; i 2 such that this calculus does
Clrt tct: Xsi ::@ @ Clrd AA; A:10 not nish there is a loop of transient evolution and the
si 2Ut s2Art d=s2Ud specication is not correct.
internationnal conference on Automation of Mixed Processes tions on System Man and Cybernetics, Part A: System and Human,
ADPM98, Reims, France (pp. 209215),. 29(3).
Guillemaud, L., & Gu!eguen, H. (1999). Extending Grafcet for the Lesage, J. J., & Roussel, J. M. (1993). Hierarchical approach to
specication of control of hybrid systems. Proceedings of IEEE Grafcet using forcing order. APII, 27, 2538.
SMC 99. Tokyo, Japan. Roussel, J. M. & Lesage, J. J. (1996). Validation and verication of
Harel, D. (1987). Statecharts a visual formalism for complex systems. Grafcets using nite state machine. Proceedings of IMACSIEEE
Science of Computer Programming, 8(3), 231274. conference on computational engineering in systems applications
IEC (1992). CEI 601131-3: Programmable controllers, part 3: CESA96, Lille, France.
Programming languages. Zaytoon, J., De Loor, P., & Villermain-Lecolier, G. (1995). Giving
IEC (2000). Document 3B/304/CDV: Specication language GRAF- semantics to the extended Grafcet by means of timed transition
CET for sequential function charts, proposed for revision of IEC model. Seventh IFAC/IFORS/IMACS symposium on large scale
60848 Edition 2. systems, London, UK (pp. 913918).
Le Parc, P., LHer, D., Scharbarg, J. L., & Marc!e, L. (1999). Grafcet
revisited with a synchronous Data-Flow Language. IEEE Transac-