How-to
Controlling a Stepper-Driven Hydraulic Valve Without Feedback
Short answer
Track an estimated pulse position in the controller and command only the signed difference between the new target and that estimate: 30 to 25 is five reverse pulses on a direct-drive, full-step axis. Round each absolute target once, and re-reference after any power loss, driver disable or stall, because counted command pulses prove nothing about actual valve position.

On this page
Counting the pulses a PLC sends is a request log, not position feedback. To position a hydraulic valve with a stepper and no encoder, keep an estimated pulse position in the controller, convert every screen demand into an absolute pulse target once, and command only the signed difference between that target and the estimate: with the demand moving from 30 to 25 on a pulse-counting axis, that is five reverse pulses issued as one move. Round each absolute target once rather than compounding rounded increments, and invalidate the estimate after any power loss, driver disable or stalled move, then re-reference the valve before automatic positioning resumes. The worked example below runs the numbers for a 1.8° motor on a 270° valve, and the steps after it turn that arithmetic into PLC logic you can prove on the saw.
Why counted pulses are an estimate, not feedback #
A pulse counter increments when the output circuit fires a pulse, so it records what the controller asked the drive to do. It keeps incrementing even when nothing mechanical answers: a rotor stalled under load, a loose coupling, or a valve spindle seized in its packing all leave the count climbing while the valve sits still. The train can also be wrong before it reaches the driver — a timer-driven output that issues the wrong total is its own failure mode, covered in why a timer-driven stepper pulse train delivers the wrong step count.
Treat the count as an estimate with a defined validity: it is correct only while the controller has watched every pulse since the last known reference and no step has been lost in between. Published research shows missed steps can be inferred from motor current, but that sensing lives in the drive, not in a plain step-and-direction input; until an encoder or a closed-loop drive watches the shaft, the estimate is all you hold, and the logic must be built to survive it being wrong.
Confirm what the screen number means before reversing pulses #
Read what the screen's numeric object feeds into the pulse command before writing any direction logic, because 30 falling to 25 asks for three different moves depending on its units. Separate the valve's mechanical travel from its permitted operating range too: a 270° spindle can be clamped in software to a smaller verified window, and the scaling must never confuse the two.
| The screen number represents | What 30 to 25 asks for | Check before moving |
|---|---|---|
| A pulse-count target | The difference command directly | That one driver input pulse produces the valve motion you expect |
| A valve-angle target | A 5° reduction, converted to pulses | The driver's step mode and the motor-to-valve coupling, because a 5° demand is not a five-pulse move |
| A percent or operating scale | Five scale units of demand | The mapping from scale numbers to valve angle, taken at two known positions |
Five degrees is not five full motor steps: at the motor's full-step angle, the 5° change works out to about 2.8 command pulses, which cannot be issued as an integer move on its own. Convert the angle to a pulse target, round that target once, and let the subtraction produce the integer difference. The conversion is the same arithmetic as in the pulse scaling calculation for step and direction axes; only the ratio between motor and valve changes it.
Worked example: 30 to 25 on a 270° valve driven at 1.8° per pulse #
Inputs for this axis:
- Motor step angle: 1.8° per full step, the motor's own rating.
- Valve travel: 0–270°, mechanical end to end.
- Drive mode: full step, so one command pulse equals one full step.
- Coupling: motor direct on the valve spindle, 1:1.
- Demand change: 30 to 25, entered on the screen.
- Estimated position before the change: 30 in pulse units for Case A, 30° for Case B.
The rule in words: valve degrees per command pulse equal the full-step angle divided by the product of the microstep factor and the transmission ratio; pulses for an angle target equal that angle divided by degrees per pulse, rounded once; the move equals the new target pulses minus the estimated position pulses, the sign giving direction and the magnitude the count.
Case A, the screen counting pulses:
- Degrees per pulse: 1.8° / (1 × 1) = 1.8° per pulse.
- Full travel: 270° / 1.8° per pulse = 150 pulses.
- Move: 25 - 30 = -5, so the axis issues five reverse pulses and the estimate becomes 25.
Case B, the screen counting degrees:
- Target for 30°: 30 / 1.8 = 16.67, rounded once to 17 pulses; 17 × 1.8° = 30.6°.
- Target for 25°: 25 / 1.8 = 13.89, rounded once to 14 pulses; 14 × 1.8° = 25.2°.
- Move: 14 - 17 = -3, so the axis issues three reverse pulses, a real change of 5.4° against the 5° requested.
The result: five reverse pulses when the screen counts pulses, three reverse pulses when it counts degrees on this full-step, direct-drive axis. The decision either way: command one move of the signed difference, never a fresh move to the new number, which would re-open the valve by the entire target. And round each absolute target once, never each increment — ten separate 5° nudges, each rounded to three pulses, deliver 54° of motion against a 50° request.
Build the difference move in the PLC #
The sequence assumes a plain step-and-direction pulse output. On controllers with dedicated positioning commands — DSZR for homing and DDRVI or DDRVA for incremental and absolute pulse moves, as documented for certain FX-series PLCs — the same logic maps onto those instructions, but take availability and operands from the positioning manual for the installed PLC.
- Read the driver's step-mode setting and inspect the motor-to-valve coupling. Record the microstep factor and the transmission ratio, compute valve degrees per command pulse from them, and compute the full-travel pulse count. If that resolution is too coarse for the blade feed, change the microstep setting or the coupling — not the logic.
- Reserve one integer register for the estimated position and one for the latched target. Give both meaning only after a completed reference.
- Convert each new screen demand to an integer pulse target once, at the moment it is entered, using the recorded scaling, and clamp it to the verified operating range.
- When no move is running, subtract the estimate from the target and issue the magnitude as one move, direction from the sign; a zero result means no move. While a move runs, latch any newer target and process it on completion.
- Trigger on a change of target, never on a comparison that stays true: a screen condition still true on the next scan would restart the same move indefinitely.
- Update the estimate only from completed commanded motion, never by copying the demand at entry.
- Verify physical direction before the first automatic move: with the machine in a controlled state, issue a small positive difference and confirm the valve opens; swap the sign convention if it closes.
- Prove larger, smaller and unchanged targets, then interrupt a move by disabling the driver or cutting controller power, and confirm the logic refuses to position until a re-reference is done.
Before steps 7 and 8 on the saw, support the blade head so a wrong command cannot drop it, and isolate the hydraulic pressure under your site's lockout practice; in the United States, 29 CFR 1910.147 requires isolating stored energy during servicing. That discipline belongs to the machine's risk assessment, not to this logic.
When the estimate is no longer valid #
An open-loop estimate dies silently, so treat each of these as a lost reference: controller power loss, because the register resets and motion during the outage was never counted; a driver disable or re-enable; a stalled or faulted move; manual turning of the coupling or spindle; and mechanical slip such as a loosened set screw. Keeping a number alive through a power dip is a separate problem — retaining stepper axis position through a power loss covers the retention side — but retention never recovers motion that happened while nobody was counting.
| Observed condition | What it means | Next action |
|---|---|---|
| The estimate changes but the spindle does not | The command count is not following the rotor | Check driver enable, pulse wiring and mechanical load before trusting any target |
| The setting differs after direction reversals | Lost motion between motor and valve | Approach from both directions, measure the gap, inspect the coupling |
| The valve moved during shutdown or manual adjustment | The stored reference is stale | Re-reference before automatic targets |
| The setting drifts across repeated moves | Missed steps or pulse-command errors | Compare issued pulses with observed spindle movement |
A stalled or faulted move must latch a fault that stops the axis and demands manual re-referencing. Automatic retry after a fault is exactly the failure described in a drive that re-engages after overcurrent because nothing latches; on this valve it would keep trimming the blade feed against your intent.
To re-reference, put the machine in a controlled state, jog the valve to a known physical position — a designed end stop or a verified mid-travel mark — write that position's pulse value into the estimate, and only then re-enable automatic targets. Do not jam the motor against a stop to find zero unless the mechanism and drive are built for that method: a completed reference and a motor stalled against the stop produce the same pulse count.
The decision for each case #
- Screen counts pulses: no conversion; subtract the estimate from the target and move the difference — five reverse pulses for the 30-to-25 demand on this axis.
- Screen counts degrees: convert each absolute target once and move the difference — three reverse pulses here, delivering 5.4° for the 5° requested.
- Step mode or gearing different from the example: the method is unchanged; recompute the degrees-per-pulse conversion from the driver setting and the coupling, and let the subtraction follow.
- Estimate invalid for any reason: re-reference before any automatic move; the difference arithmetic is only as good as the number it subtracts.
- Manual trimming keeps being needed: close the loop. Converting an open-loop stepper to closed-loop control starts that path on the drive side, and controlling hydraulic cylinder position from a 0-10 V analog input shows the feedback answer on the hydraulic side.
Until feedback exists, the estimate, the once-rounded targets and the signed difference are the whole method — keep them honest, and every request lands within one rounded pulse of the valve's true position.
Questions asked
How many pulses does one valve revolution take in full step?
At this motor's full-step angle, one revolution is 360° divided by 1.8°, which is 200 command pulses, and direct drive makes that 200 pulses per valve revolution. A microstep setting of 8 raises it to 1,600 pulses per revolution, and a gearbox multiplies the total again by its ratio. Take the active microstep setting from the driver's own configuration, because switch positions and defaults vary between drives.
Can I recover the valve position after a power loss by re-counting pulses?
No. Pulses issued while the controller was powered down or the driver was disabled were never seen by the counter, so the stored number no longer matches the shaft. Jog the valve to a known physical position — fully closed on a designed stop, or a verified mid-travel mark — write that position's pulse value into the estimate register, and only then accept automatic targets again.
My screen scale runs 0 to 50 while the valve travels much further. How do I map one to the other?
Establish two known points: the pulse value at the closed end and the pulse value at a verified maximum opening, then treat the scale as linear between them. On a scale that runs 0 to 50, each scale unit equals that pulse span divided by 50. Round the resulting target once, clamp it to the verified maximum, and never let automatic mode command past it.
Does microstepping break the difference logic?
No. Microstepping only changes how many command pulses represent the full-step angle, so it changes the degrees-per-pulse conversion and the pulse totals, not the method: keep the estimate, convert each absolute target once, subtract, and command the difference. With a microstep factor of 4, the worked example's full travel becomes 600 pulses instead of 150, and the direction and rounding logic are unchanged.
Why does the valve settle slightly differently depending on whether I opened or closed to the target?
That is lost motion between the motor and the valve: backlash in the coupling, the gearing or the valve's own linkage, which the pulse estimate cannot see. Quantify it by approaching the same target from the opening and the closing direction and recording the gap. Compensate by always approaching the operating point from the same side, or remove the play mechanically at the coupling.

