Free
6 min

Pneu 01 — Single cylinder

pneumaticcylindersolenoidlimit-switchsequencingfundamentals

Ready to build this?

Sign up free — no credit card required. This scenario is included in the free tier.

Sign up to play this scenario →

Already have an account? Log in

Not ready to sign up? Run a live lab now — no signup →

Pneu 01 — Single cylinder

Briefing

A small pneumatic pusher: one double-acting cylinder driven by a 5/2 valve with two solenoids. EXTEND_SOL pushes the rod out, RETRACT_SOL pulls it back. If neither solenoid is on, or both are, the valve stays where it was and the rod holds still. Two reed switches report the ends of the stroke: RETRACT_LS is on when the rod is home, EXTEND_LS is on when it is fully out. They come from the cylinder, so they only change as the rod moves. Tap START once. The rod extends, and when it reaches EXTEND_LS it retracts by itself. When it is back on RETRACT_LS everything is off. START pressed while the rod is moving does nothing.

Objectives

  • START extends the rod: EXTEND_SOL on, RETRACT_SOL off
  • The extend command holds until the extended sensor closes
  • At the extended sensor the rod turns round: EXTEND_SOL off, RETRACT_SOL on
  • Back on the retracted sensor both solenoids are off
  • START is ignored while the rod is moving

Hints

  • Think of the cycle as two moves. Each move has a command, something that starts it, and a sensor that tells you it has finished.
  • A momentary START cannot hold the extend command by itself. Something has to remember "extending" until the extended sensor says the rod has arrived, and the same sensor is the moment the return begins.
  • Never drive both solenoids at once. At the extended sensor one command ends and the other begins, and at the retracted sensor the retract command ends.
  • Test START in the middle of the return stroke. If the rod stalls, START is being accepted when the cylinder is not at rest on the retracted sensor.

I/O Table

Inputs

START_PB

Start push-button (momentary NO)

BOOL · %I0.0

RETRACT_LS

Reed switch: rod fully retracted

BOOL · %I0.1

EXTEND_LS

Reed switch: rod fully extended

BOOL · %I0.2

Outputs

EXTEND_SOL

5/2 valve solenoid: extend

BOOL · %Q0.0

RETRACT_SOL

5/2 valve solenoid: retract

BOOL · %Q0.1

Your program will be tested against:

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

  1. #1START → extend only

    The cycle starts by driving the rod out

  2. #2Half a second later → still extending

    The extend command holds after START is released

  3. #3Rod fully out → retract only

    The extended sensor ends the extend and starts the return

  4. #4Rod home again → both solenoids off

    The retracted sensor ends the cycle

  5. #5START while the rod is returning → nothing changes

    START only begins a cycle when the cylinder is at rest on the retracted sensor

  6. #6START after a finished cycle → extends again

    A second cycle starts cleanly

Ready to build this?

Sign up free — no credit card required. This scenario is included in the free tier.

Sign up to play this scenario →

Already have an account? Log in

Not ready to sign up? Run a live lab now — no signup →