Basic
15 min

Pneu 02 — Cylinder sequence

pneumaticcylindersequencestep-bitslimit-switchstate-machine

Ready to build this?

Sign up free — no credit card required. This scenario requires the Basic plan.

Sign up to play this scenario →

Already have an account? Log in

Pneu 02 — Cylinder sequence

Briefing

A clamp and a stamp. Cylinder A holds the part, cylinder B stamps it. Each has a 5/2 valve with two solenoids (EXTEND and RETRACT) and two reed switches (home and fully out). With neither or both solenoids on, a cylinder simply holds position. One tap of START runs the sequence A out, B out, B back, A back. Each move starts only when the sensor of the move before it closes: the machine never guesses with a timer. Only one cylinder moves at a time, and A stays clamped out while B stamps. STOP drops every solenoid and clears the sequence. The valves have no springs, so the cylinders stay where they are; use the simulator's Reset button to send the machine home. START mid-cycle does nothing.

Objectives

  • START extends A alone
  • When A is fully out, B extends while A stays out
  • When B is fully out, B retracts while A stays out
  • When B is home, A retracts; then everything is off
  • STOP ends the cycle at any moment; START mid-cycle is ignored

Hints

  • List the four moves in order and ask of each one: what starts it, which sensor says it is finished, and which command it uses. The machine only needs to remember which move it is on.
  • The sensor that ends one move is the same event that starts the next, and that moment must also switch the finished move off. A move you leave on keeps its valve energised after its job is done.
  • The last move starts nothing: it ends on its own sensor. STOP has to end every move, wherever the cycle has got to.
  • Press START in the middle of the cycle. If the machine runs a second cycle afterwards, START is being accepted while a move is still active.

I/O Table

Inputs

START_PB

Start push-button (momentary NO)

BOOL · %I0.0

STOP_PB

Stop push-button (TRUE = pressed)

BOOL · %I0.1

A_RET_LS

Cylinder A reed switch: home

BOOL · %I0.2

A_EXT_LS

Cylinder A reed switch: fully out

BOOL · %I0.3

B_RET_LS

Cylinder B reed switch: home

BOOL · %I0.4

B_EXT_LS

Cylinder B reed switch: fully out

BOOL · %I0.5

Outputs

A_EXT_SOL

Cylinder A valve: extend solenoid

BOOL · %Q0.0

A_RET_SOL

Cylinder A valve: retract solenoid

BOOL · %Q0.1

B_EXT_SOL

Cylinder B valve: extend solenoid

BOOL · %Q0.2

B_RET_SOL

Cylinder B valve: retract solenoid

BOOL · %Q0.3

Your program will be tested against:

All test cases run automatically when you submit. Assertions are hidden until you pass.

  1. #1START → A extends alone

    The first move is A out; B waits

  2. #2A fully out → B extends

    A's extended sensor starts the second move

  3. #3B fully out → B retracts, A stays out

    B comes home first while A stays clamped

  4. #4B home → A retracts

    B being home starts the last move

  5. #5A home → everything off

    The last sensor ends the cycle

  6. #6STOP during B's stroke → everything off, and stays off

    STOP ends the cycle at any step

  7. #7START while A is returning → one cycle only

    START only begins a cycle when both cylinders are home and no move is active

  8. #8START after a finished cycle → A extends alone

    A second cycle starts cleanly

Ready to build this?

Sign up free — no credit card required. This scenario requires the Basic plan.

Sign up to play this scenario →

Already have an account? Log in