grafcet_2012

Embed Size (px)

Citation preview

  • 7/27/2019 grafcet_2012

    1/30

    GRAFCET: A Powerful Tool

    for Specification of Logic Controllers

    OS3URV 2012

  • 7/27/2019 grafcet_2012

    2/30

    History

    1975 Decision of the workgroup "Logical Systems" daAFCET (Association Franaise de Cyberntique Economiqueet Technique) on the creation of a committee to study astandard for the representation of logical systems andautomation

    1977 GRAFCET definition (Graphe Fonctionnel deCommande Etape-Transition).

    1979 Dissemination in schools and adopted as researcharea for the implementation of solutions of automation inthe industry.

    1988 - GRAFCET becomes an international standarddenominated as "Sequential Function Chart, IEC 60848, IEC1131-3

    GRAFCET is referred to as Sequential Function Charts (SFC).

  • 7/27/2019 grafcet_2012

    3/30

    Industry needs:

    Describe the sequence of states of a discrete-event system

    which may contain a very large number of states

    Take into account the concurrency (for both simplicity and

    easy understanding), since some subsystems may be partially

    independent.

    Generally, given a state of the system, only a few inputs affect

    the state, and only a few outputs may change. Then, describe

    only the behavior corresponding to these input changes.

    Have a clear understanding of the input-output behavior of a

    logic controller, i.e., what is the control applied to the process

    to be controlled (output of the PLC) as a function of a change

    of the process or its environnment (input of the PLC).

  • 7/27/2019 grafcet_2012

    4/30

    Motivation tank filling

  • 7/27/2019 grafcet_2012

    5/30

    Motivation tank filling

    A roman symbol represents a device (sensor or actuator)and an italic symbol the corresponding Boolean variable.

    Tank 1 is empty when the level is less than b1, i.e., b1 = 0,and is full when the level is greater than h1, i.e., h1 = 1.

    At the initial state, both tanks are empty.

    If push button m is pressed, both tanks are filled byopening valves V1 (V1=1 means that valve V1 is open) andV2.

    When a tank is full, e.g., tank 1, filling stops (by closing

    valve VI) and its contents start to be used (by opening valveW1). When tank 1 is empty, valve W1 is closed. Filling mayonly start up again when both tanks are empty and if thebutton m is pressed.

  • 7/27/2019 grafcet_2012

    6/30

  • 7/27/2019 grafcet_2012

    7/30

    Example

    Grafcet - The squares labeled 1 to 6 aresteps, i.e., components of states.

    At initial time, the steps in the set {1, 4}are active. Then transition (1) whichfollows these steps can be fired as soon

    as the Boolean variable m, associatedwith (1), has the value 1.

    After this firing, steps 2 and 5 are active.When step 2 is active, the output V1 = 1(represented by V1 written in a rectangleassociated with step 2). When step 2 is

    active, transition (2) can be fired ifh1 = 1.And so on

  • 7/27/2019 grafcet_2012

    8/30

    GRAFCET graphical syntax

    Grafcet has a graphicalsyntax

    Steps - drawn as squares,

    Transitions - represented asbars

    The initial step isrepresented as a double

    square Grafcet has support for

    alternative and parallelbranches

  • 7/27/2019 grafcet_2012

    9/30

  • 7/27/2019 grafcet_2012

    10/30

    Steps

    A step is represented by a square

    A step may have two states:

    active (this is represented by a token in thestep) as is the case of step 2

    inactive as is the case of step 1

    The steps which should be active when thesystem is started and represented by adouble square -initial steps (step 3).

    Actions are associated with the steps, andthese are the outputs of the grafcet.

    To each step one or several actions can beassociated. The actions are performedwhen the step is active.

    1

    2

    3

    Inactive

    Active

    Initial

  • 7/27/2019 grafcet_2012

    11/30

    Transitions

    The transition symbol is a bar, but thelatter must be preceded or/and followedby a double bar in some cases.

    It is preceded by a double bar when two ormore arcs join this transition [transitions(2) and (4)]; this implies that it involves

    waiting for multiple input steps to beactive before firing the transition.

    A transition is followed by a double barwhen two or more arcs leave thistransition [transitions (3) and (4)]; thisimplies that it involves activating multiple

    output steps when the transition is fired. A receptivity will be associated with

    each transition ().

  • 7/27/2019 grafcet_2012

    12/30

  • 7/27/2019 grafcet_2012

    13/30

    Firing of Transitions

    A transition is firable if both the following conditionsare met: All the steps preceding the transition are active (the

    transition is said to be enabled)

    The receptivity of the transition is true.

    These operations (activation and

    deactivation) are carried out

    simultaneously.

    Firing of (1) leads from the situation{ 1 } to the situation {2,3}.

    Then firing of (2) leads to the

    situation {2, 4}, and firing of (3) leads

    back to the initial situation

  • 7/27/2019 grafcet_2012

    14/30

    When a receptivity is true?

    Lets consider three cases: the receptivity is a:

    condition (i.e., a Boolean function),

    an event,

    or both a condition and an event.

  • 7/27/2019 grafcet_2012

    15/30

    Actions and Outputs

    There are two major categories of actions,

    Level action is modeled by a binary variable

    and has a finite duration. Action remains

    set all the time while the step, to which the

    action is associated, is active.Unconditional

    Conditional

    Impulse actions is responsible for changing

    the value of a variable. An impulse action iscarried out as soon as the step changes

    from being inactive to active.

  • 7/27/2019 grafcet_2012

    16/30

    Actions and Outputs

    Action B* is an impulse action.

    The asteriskwas recommended at the origin of Grafcet toindicate the impulse character of an action.

    It does not always, however, serve a purpose. For example,incrementing a counter C can be written as (C

  • 7/27/2019 grafcet_2012

    17/30

    Stable/unstable situations

    A situation can be stable or

    unstable.

    If the transition following a step is immediately fireable

    when the step becomes active, the situation is said tobe unstable.

    An impulse action is carried out even if the situation isunstable

    A level action is performed only if the situation isstable.

    Between two different external events it is assumedthat there is always enough time to reach a stablesituation.

  • 7/27/2019 grafcet_2012

    18/30

    Unconditional/Conditional

    Unconditional Conditional

  • 7/27/2019 grafcet_2012

    19/30

    Concurrency and Synchronization

    From the situation {1}, the situation{2, 3} is reached by firing transition(1) as soon as a

  • 7/27/2019 grafcet_2012

    20/30

    Dynamic behavior

    The dynamic behavior of Grafcet is defined by five rules

    1. The initial situation of a Grafcet is determined by its initialsteps.

    2. A transition is enabled if all of its previous steps are active.

    A enabled transition is fireable if its associated receptivityis true. A fireable transition is immediately fired.

    3. Firing of a transition results in deactivation of its previousstep and a simultaneous activation of its following steps.

    4. Simultaneously fireable transitions are simultaneously

    fired.5. If a step is to be simultaneously activated and deactivated

    it remains active.

  • 7/27/2019 grafcet_2012

    21/30

    Example tank filling

  • 7/27/2019 grafcet_2012

    22/30

    Tank Filling Modified The controlled system is the same. The control

    specifications are modified: The filling process is no longer allowed if the button m is

    pressed (i.e., ifm = 1) but it is triggered by pressing push buttonm (i.e., bym).

    A counter is added: the value C in the counter represents thenumber of cycles (emptying and filling of Tank 2).

  • 7/27/2019 grafcet_2012

    23/30

    Example

    A system consisting of a tank is shown. The tank has an inlet valve V1 and

    an outlet valve V2. There are two level sensors L0 and L1, one temperature

    sensor Tand one heater Q.

  • 7/27/2019 grafcet_2012

    24/30

    Example

    When the system is started, valve V1 should open and thefilling should start.

    When the level in the tank reaches L0, the heating shouldstart. The tank is now heated and filled in parallel.

    When the level in the tank reaches L1 the filling is stoppedand when the temperature reaches Tthe heating isstopped.

    When both the right level and the right temperature arereached, the tank is emptied. This is done by opening the

    outlet valve V2. When the system is empty, the sequence can be restarted.

  • 7/27/2019 grafcet_2012

    25/30

  • 7/27/2019 grafcet_2012

    26/30

    Formal Definition A Grafcet can be defined as a 5-tuple = {, , , , } where:

  • 7/27/2019 grafcet_2012

    27/30

    Example

  • 7/27/2019 grafcet_2012

    28/30

    Example: modeling a

    control/automation system

  • 7/27/2019 grafcet_2012

    29/30

  • 7/27/2019 grafcet_2012

    30/30