Learning phase 2: Step sequences¶
In programmable logic controllers (PLCs), which are used to control the sequence of machines and systems, the control program is called up cyclically. In the example "Motor On/Off" in Section , the motor can be started and stopped repeatedly, because the initial step is returned to from the pit element. This learning phase introduces and applies cyclical applications and the delayed steps option.
- Cyclical Sequence
- Using step variables
- Time-delayed steps using time-dependent transition conditions
Things you should know¶
If you combine the last transition with the initial step over a directed link, the GRAFCET is processed cyclically. Fig. 3.74 represents a cyclical sequence with two steps. A transition with a time-dependent transition condition follows each step here. What is striking here is the up arrow inside the backward sequence. This up arrow indicates the direction of the sequence. The 'normal' sequence takes place from top to bottom; therefore, no arrow is necessary here. If the sequence deviates from the usual direction, the direction needs to be indicated by an arrow.
For the sake of completeness, we should mention that a backward sequence does not necessarily have to connect to the initial step. The backward sequence can also connect to a subsequent step in the sequence, for instance, to exclude the steps above it from the cycle. This will be discussed in detail later on.
Fig. 3.74 Formation of a loop to the initial step with time-dependent transition conditions
Syntax used for the time delay in the steps: Time callout in seconds followed by a slash and the step variable (e.g. 1s/X1)
In a transition condition, you cannot just use the step variable for the immediately preceding step. The step variable is composed of the prefix X and the step label.
Wrong, for instance, would be 2s/1, because here, the X is missing in the callout for the step variables for step 1.
In the example shown in, each step is active for one second. In Fig.3.75 the signal sequence is depicted as a function of time, if each time set within the transition conditions is two seconds (2s/X1 and 2s/X2).
Fig. 3.75 Signal sequence for the time-limited transition condition
A valve should switch on for three seconds and switch off for three seconds (pulses). If the valve has the value True, then it opens. If the valve has the value False, it is closed. The valve is addressed via the operand Y1.
Fig. 3.76 Diagram of the technology for pulsing valve application
The GRAFCET solution is shown in . The option of attaching an action right at the initial step is used here, which switches valve Y1 to open. The delay time for the transition condition (3s/X1) for the first transition elapses after three seconds, thus initiating the advance to step 2. Step 2 is now active and step 1 idle. This also makes the continuing action at step 1 idle. Valve Y1 therefore has the value False and closes. After the time-dependent transition condition (3s/X2) for the transition to step 2 has expired, the transition to step 1 takes place and the procedure starts again from the beginning.
Fig. 3.77 Pulse mode for a valve
Testing the application¶
If the simulation is started in PLC Lab and Grafcet-Studio, the valve, controlled by the GRAFCET, starts to pulse. The next figure represents the two phases of the pulse operation.
Fig. 3.78 Test valve pulse operation: The valve is open on the right, on the left, it is closed.
- With a cyclical sequence, the step to which the backward sequence leads is reactivated following the pit transition.
- It has been demonstrated how to realise a time-delayed step with the help of a time-dependent transition condition using a step variable.
When the Start button is pressed, a press cylinder should extend out and press a bushing into a sleeve for two seconds. After the time has elapsed, the cylinder retracts and a five-second rest phase begins. After this time, a signal lamp should indicate that the work-piece can be removed from the press. Removal is confirmed by pressing a confirmation button and a new work-piece can be inserted into the press. The cylinder end positions are not controlled.
Fig. 3.79 Diagram of the technology for the crimper
Definition of the operands:
|S1Start||"Start" button, value = True if pressed|
|S2Confirm||"Confirm" button, value = True if pressed|
|A1Crimp||Press cylinder actuator forward/backward, True = go forward|
If the initial step is active and the transition condition S1Start is fulfilled for the subsequent transition, the cylinder is extended for two seconds (2s/X2) by the continuing action A1Crimp. The cylinder is certainly fully extended after two seconds and has pressed the bolt into the sleeve.
Fig. 3.80 Solution for the crimper
The transition condition 2s/X2 causes the transition to step 3 after two seconds, which remains active for five seconds (5s/X3). After the five seconds have elapsed, the transition condition is fulfilled and the transition to step 4 takes place. This sets the signal lamp with the continuing action P1Unload and waits with the transition condition S2Confirm until the "Confirmation" button is pressed. The cycle then begins anew.
This exercise does not take into account that the "Start" button could remain permanently pressed!
- Define a transition condition to delay the step with the label "35" by four seconds.
- Is the transition condition 1s/3X correctly defined if the step labelled with "3" is to be delayed by one second?