Standardize cylinder movements, sensor feedback verification, and travel watchdog timeouts across your automation projects.
Pneumatic cylinders are the workhorses of automated machinery. Improperly modeled pneumatic logic causes mechanical collisions and obscure production stops.
This standard pattern covers:
N qualifier).S / R qualifiers).+-------------------------------------------------------------+
| PNEUMATIC ACTUATOR CONTROL LOOP |
| |
| [Step 10: Retracted (Home)] |
| | |
| (bCmd_Extend) |
| v |
| [Step 11: Extending] ----(Timeout > 2s)----> [Alarm Step] |
| | |
| (bSensor_Extended) |
| v |
| [Step 12: Work Position] |
+-------------------------------------------------------------+
| Variable Name | Type | Direction | Role |
|---|---|---|---|
bCyl_Extend_Cmd |
BOOL |
Output | Solenoid valve coil (Extend) |
bCyl_Retract_Cmd |
BOOL |
Output | Solenoid valve coil (Retract, bistable only) |
sCyl_Home_Sensor |
BOOL |
Input | Magnetic reed switch: Retracted position |
sCyl_Work_Sensor |
BOOL |
Input | Magnetic reed switch: Extended position |
tCyl_Extend_Watchdog |
TON |
Internal | Motion fault timer (Preset: 2000 ms) |
bCyl_Motion_Fault |
BOOL |
Output | Cylinder motion timeout alarm flag |
from automation_machine import Sequence, StepType, ActionInstruction
class PneumaticActuatorPattern(Sequence):
def setup(self):
s10 = self.add_step(StepType.INITIAL, name="Cylinder_Home")
s11 = self.add_step(name="Cylinder_Extending")
s12 = self.add_step(name="Cylinder_Work_Position")
s_fault = self.add_step(name="Cylinder_Motion_Fault")
self.add_transition(s10, s11, condition="bCmd_Extend_Request AND sCyl_Home_Sensor")
self.add_transition(s11, s12, condition="sCyl_Work_Sensor")
self.add_transition(s11, s_fault, condition="tCyl_Watchdog.Q")
self.add_transition(s_fault, s10, condition="bFault_Reset AND sCyl_Home_Sensor")
s11.add_action("bCyl_Extend_Cmd", "Energize valve solenoid")
s11.add_action("tCyl_Watchdog", "Travel watchdog", instruction=ActionInstruction.TON, duration=2000)
s_fault.add_action("bCyl_Motion_Fault", "Signal cylinder motion fault")
duration to 1.5x the normal mechanical stroke time.