How-to
Holding a pneumatic cylinder mid-stroke with reed switches
Short answer
Energizing both solenoids of a rodded cylinder extends it, because the rod-side area is smaller by the rod area. Drive to the reed switch, drop both outputs so a spring-centered 5-way, 3-position closed-center valve traps the air, and treat reed switches as arrival feedback. For tight tolerances, or wherever losing air could drop the load, use a mechanical stop or a rod lock.

On this page
If your plan is to energize both solenoids so the cylinder sits between the two reed switches, change one thing first: both coils on is not a hold. On a rodded cylinder the cap-side piston area is larger than the rod-side area by the rod's own cross-section, so equal pressure on both ports leaves a net extending force and the rod creeps outward. The fix costs one valve: a spring-centered, 5-way, 3-position, closed-center valve. Drive to the point, drop both outputs, and the spool centers and traps air in both chambers. The reed switches tell the controller when to drop the outputs; they never hold the load themselves.
Why both solenoids on extends the rod #
With gauge pressure P on both ports of a rodded cylinder:
- cap-side effective area = π × D² / 4, where D is the bore diameter
- rod-side effective area = π × (D² - d²) / 4, where d is the rod diameter
- net extending force = P × π × d² / 4, because the rod area is missing on the rod side
Worked example, calculated for these inputs and not a measured result: bore D = 50 mm, rod d = 20 mm, gauge pressure 0.6 MPa (6 bar), using 1 MPa = 1 N/mm².
- cap-side area = π × 50² / 4 = 1,963 mm²
- rod-side area = π × (50² - 20²) / 4 = 1,649 mm²
- net force = 0.6 N/mm² × (1,963 - 1,649) mm² = 188 N
At the same pressure the cap side alone pushes 0.6 × 1,963 = 1,178 N and the rod side 0.6 × 1,649 = 990 N. The 188 N difference, about 19 kgf, pushes the rod out whenever both ports are pressurized, whatever the load does. Piston-seal friction works against some of it, but it is not a brake you can design around. Energizing the two coils together is therefore an invalid state, and the controller should interlock against it rather than treat it as a hold command.
The valve that holds a mid stroke #
Use a 5-way, 3-position, double-solenoid valve that is spring-centered and closed-center. Spring centering is what makes both-outputs-off a real command: the spool returns to center with no coil energized, so a dropped signal, a broken wire or a controller fault all land in the hold state. Read the valve symbol before fitting anything, because the center box must show the supply, both cylinder ports and both exhausts blocked. The other common centers do the opposite of what you need:
| Center position connects | Rod behavior when both outputs drop |
|---|---|
| Closed center: supply, both cylinder ports and both exhausts blocked | Both chambers trap air and the rod stays approximately where it was |
| Pressure center: supply open to both cylinder ports | The larger cap area wins and the rod runs out |
| Exhaust center: both cylinder ports open to exhaust | Both chambers vent and the load moves the rod freely |
Only the closed center holds, and it holds approximately: trapped air is a pneumatic spring, so an external force compresses one chamber while the other expands, and the rod sits near the drop point rather than being rigidly regulated.
What the reed switches do #
A reed switch clamped to the barrel closes when the piston's magnet passes it. That is arrival feedback: it tells the controller when to stop driving and drop both outputs. It is not a brake and not a load support.
Mount each switch so it stays made through the whole dwell, including overshoot and stopping variation; if it opens mid-hold, the sequence believes the move is still running. Overshoot grows with approach speed, so estimate the arrival speed with how to estimate pneumatic cylinder end-of-stroke velocity, then place the switch so the made signal survives the overshoot with margin to whatever the rod must not hit.
Ladder sequence for two held positions #
Use example output addresses Y001 for up and Y002 for down, each driving one solenoid of the valve. The sequence:
- Create three mutually exclusive internal states: moving up, moving down, holding. Any new move request clears the opposing state before the outputs change.
- Map Y001 and Y002 in one place only, and add a scan-level interlock so both are never on together; that combination is the extending force calculated above, invalid as a hold.
- On an up request, set moving-up. While it is active and the upper reed switch is off, hold Y001 on and Y002 off.
- When the upper switch makes, clear moving-up. With neither move state active, the output map drives both coils off, the spring centers the spool and the closed center traps both chambers.
- On a down request, mirror the last two steps with Y002 and the lower switch.
- Give each direction a timeout sized from the measured travel time at normal pressure and load. If the destination switch has not made when it ends, drop both outputs, latch a diagnostic bit and run the machine's defined recovery instead of starting the opposite move.
- Commission the direction before trusting the labels: jog each output alone with the area clear and record which way the rod actually moves; if it disagrees with the sequence, swap the output mapping or the air tubing, not the names.
- During the dwell, confirm that both switches stay made and both coils stay off for the whole hold.
The arrival-then-release shape is the same one you would write when homing a double-acting pneumatic cylinder in ladder logic; the difference is that the release lands in the valve's center rather than at a mechanical end of travel.
Where a trapped-air hold stops being good enough #
What the closed center cannot remove is the physics of trapped air: it compresses under load, spool and piston seals leak past, temperature shifts chamber pressure, and the drop point varies with approach speed. Verify the hold the way it will run: cycle between the lightest and heaviest normal loads at normal speed and measure the stop position each time. If the spread sits inside what the product tolerates, the closed-center hold is the right cheap answer. If it does not, upgrade in this order:
- Adjustable mechanical stop. A stop block, or a set-screw turret the rod tab contacts, adjusted per product, repeats a position and keeps holding with the air off. It is the cheapest accurate fix when the tolerance tightens.
- Rod lock for drop protection. Wherever the axis is vertical or losing air could let the load fall, a closed-center valve is not a safeguard, because trapped air leaks away. Fit a rod lock or another mechanical restraint selected for the load and mounting orientation, and treat the choice as part of the machine's risk assessment, for which ISO 12100 gives the general method.
- Proportional valve with position feedback. For several positions or tighter repeatability, close the loop on a measured rod position so the valve modulates against drift instead of trapping a fixed volume of air.
For a vertical axis, compare the counterbalance approach in pneumatic counterbalance for a vertical Z axis before picking between the two: a counterbalance supports the weight continuously, while a rod lock clamps on demand.
The decision for each case #
- Two fixed positions on a horizontal axis with a loose tolerance: reed switches as arrival feedback plus a spring-centered closed-center valve, with the both-coils-on step deleted from the logic as an invalid state.
- Tighter tolerance than the measured spread: same valve and switches, plus an adjustable mechanical stop at each position.
- Vertical load or any exposure to the load falling when air is lost: the valve is convenience only; a rod lock or a counterbalance carries the load, and the risk assessment picks which.
- Several positions or tight repeatability: a proportional valve with rod position feedback, with the reed switches retired to end-of-travel confirmation.
Whichever case you are in, the interlock stays: on a rodded cylinder there is no way to hold a position by pressurizing both sides at once.
Questions asked
Does moving a reed switch change the cylinder's stroke?
No. The stroke is the mechanical travel between the cylinder's end positions and is fixed by its construction. Sliding a reed switch along the barrel only moves the point where the controller is told the piston has arrived, so it changes where you request a stop, not how far the cylinder can travel.
Would the both-sides-pressurized idea work on a rodless cylinder?
A rodless cylinder can have nearly equal effective areas on the two sides of its piston, so equal pressure produces little net force. The hold is still trapped air acting as a spring, drifting with leakage, temperature and load exactly as with a rodded cylinder. Use a closed-center valve and treat the achieved accuracy just as cautiously.
Why a spring-centered valve instead of a plain double-solenoid valve?
A two-position double-solenoid valve without springs is detented: it stays in whatever position it was last shifted to. With both outputs off, nothing commands a hold, so the result depends on where the spool happened to be. A spring-centered valve returns to the blocked center every time both outputs drop, which makes the hold repeatable and makes signal loss fail toward the center.
Can I hold more than two mid-stroke positions this way?
Yes, because each additional position is one more reed switch and one more state in the controller; the valve logic does not change. The accuracy stays bounded by the same trapped-air spring, so when several well-defined positions matter, an adjustable mechanical stop at each point or a proportional valve with rod position feedback holds better than a longer row of switches.
