Mach3 Dir Pulse: Kernel Period Sets 35 µs, Not the Field

Claire Rousseau7 min read
Motion ControlOther ManufacturerTroubleshooting
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Dir Pulse Field: 0-5 µs, Resolved to Whole Kernel Ticks

The Dir Pulse box in Mach3 Motor Tuning takes microseconds and accepts 0 to 5. Larger entries are not clamped cleanly - they are mangled, which is why 35 comes back as 15 after a save. Stop fighting the field. It asks the parallel-port driver to place the direction edge that many microseconds ahead of the step edge, but the driver builds the entire step/dir waveform on a fixed-frequency kernel and snaps every edge to a whole tick. The smallest non-zero DIR-to-clock separation the driver can produce is one kernel period.

That makes kernel speed, not the Dir Pulse number, the parameter that buys the 35 µs the PD4-C clock/direction timing note on page 61 of the technical manual (V1.4.1) demands.

Kernel speed Period = 1/f One-tick separation vs. 35 µs
25 kHz 40.0 µs Meets the spec
35 kHz 28.6 µs Short
45 kHz 22.2 µs Short
65 kHz 15.4 µs Short
100 kHz 10.0 µs Short

The selectable list varies by Mach3 build; read the actual options in Config > Ports and Pins. Only the 25 kHz kernel clears 35 µs in a single tick.

What a Short Direction Setup Actually Costs

The drive samples the direction level at the active clock edge. If the DIR line is still settling inside the manufacturer's setup window, the drive latches the previous direction for that edge and takes one step the wrong way. Open-loop step/dir gives you no feedback, so the controller never knows. The error is one step per reversal and it is silent.

Symptom Mechanism Check that separates it
Apparent backlash larger than the mechanics justify One step consumed at every direction change Measure apparent backlash at two kernel speeds - mechanical backlash does not change, timing error does
Circles come out lobed at the quadrant crossings Each quadrant is a reversal on one axis Dry-run a test circle, indicate the path
Error appeared after raising kernel speed for faster rapids Tick period dropped below the drive's setup requirement Recheck kernel speed against the table above
Position holds in air, drifts under cut Torque or acceleration limit, not timing Reduce accel and retest; timing faults are load-independent

Options for Delivering 35 µs - and One That Delivers Nothing

Option DIR setup produced Max step rate per axis Hardware change Verdict
Parallel port, 25 kHz kernel, Dir Pulse = 5 One tick = 40 µs 25,000 steps/s None Meets spec; verify on a scope
Parallel port, 35 kHz or higher 28.6 µs or less 35,000 steps/s and up None Violates the 35 µs requirement
Add a 4-axis opto breakout board Unchanged Unchanged BOB only Adds propagation delay, adds no setup time
External motion controller with Mach3 plugin Set in the plugin, independent of the PC Well above parallel-port limits Controller + rewire Best fit for a 4-axis build
One-shot delaying clock after a DIR change As designed Unchanged Custom board per axis Last resort

The third row is the one that catches people replanning their interface. A breakout board - passive, buffered, or optoisolated - has no pulse engine. It cannot insert direction setup time. It only shifts both signals by its own propagation delay, and because DIR transitions are typically slower through an optocoupler than the sharp clock edges, the setup time measured at the drive terminals can be smaller than what leaves the PC. Only a controller with its own hardware pulse generator moves the timing problem off the PC.

Recommended Path and Commissioning Order

Since a four-axis interface is on the shopping list anyway, buy an external motion controller with a Mach3 plugin and set the direction setup and hold times there. Until it arrives, commission on the parallel port at 25 kHz - the timing is legal and the machine moves today.

  1. Open Config > Ports and Pins, select the 25 kHz kernel, apply, then close and restart Mach3. The kernel change does not take effect until the restart.
  2. Open Config > Motor Tuning. Set Dir Pulse = 5 and Step Pulse to the minimum clock high time from the PD4-C manual timing section, rounded up to a legal 1-5 value.
  3. Click SAVE AXIS SETTINGS before selecting the next axis. Switching axes without saving discards the edit - this is the single most common reason a change appears not to stick.
  4. Confirm DIR polarity and active-low pin state in Ports and Pins so the direction line idles at the level the drive expects, not mid-transition.
  5. Check the step-rate budget against the 25 kHz ceiling before you rely on it.
f_step [steps/s] = (F_max [mm/min] / 60) x steps_per_mm

Example (not your machine - substitute your own numbers):
  800 steps/rev, 5 mm/rev screw  -> steps_per_mm = 160
  F_max = 3000 mm/min            -> f_step = (3000/60) x 160 = 8,000 steps/s   OK
  Ceiling at 25 kHz              -> F_max = 25000 x 60 / 160 = 9,375 mm/min

If the required rate exceeds 25,000 steps/s, lower the step resolution in the drive and recompute Mach3 steps-per-unit, or move the axis to the external controller. Do not buy the rapid speed back by raising the kernel.

Pitfalls That Recur on Step/Dir Retrofits

  • Once a plugin-driven motion controller is installed, the Motor Tuning pulse-width fields no longer govern the output. Set setup and hold in the plugin configuration and re-verify.
  • Check whether the drive specifies a direction hold time after the last clock edge as well as setup before the first. Mach3's single Dir Pulse parameter addresses the leading side only.
  • Record the 25 kHz constraint in the machine notes. A future "let's try 100 kHz for faster rapids" silently reintroduces the fault.
  • Run twisted pair per signal with the return tied to the drive's input common. Ringing on a long unshielded clock line double-triggers the input and produces the same accumulating position error as a timing violation.
  • After changing the drive's step resolution, recompute steps-per-unit in Motor Tuning. A mismatch here looks like a timing fault and is not one.
  • Run Mach3's driver test utility on the commissioning PC. A kernel that cannot hold its tick rate under load makes every timing number on the port meaningless.

Verification at the Drive Terminals

  1. Probe at the drive's clock and direction inputs, not at the parallel port. Reference both channels to the drive's input common.
  2. Trigger on the direction edge. Jog a short reversing move at the highest feed the axis will run.
  3. Measure from the DIR transition to the next active clock edge. Accept only if the reading is at least 35 µs on every axis, in both directions, with margin - target 1.5x if the pulse train allows it.
  4. On the same capture, measure clock high time and low time against the drive's minimum from the manual. A legal direction setup with an undersized clock pulse still drops steps.
  5. Run the differential reversal test: indicate the axis, measure apparent backlash at the 25 kHz kernel, then at the highest kernel speed, then restore 25 kHz. Mechanical backlash reads the same at both speeds; any increase at the faster kernel is direction-latch error and confirms the mechanism.
  6. Finish with a reversal-heavy dry run - a program full of small circles - then re-home and indicate against a fixed stop. Residual error must be under one step.

FAQ

How do I enter more than 5 µs in the Mach3 Dir Pulse field?

You cannot. The field is limited to 0-5 µs and out-of-range entries are corrupted rather than clamped, which is why 35 saves as 15. Get the additional direction setup time from a lower kernel speed or from an external motion controller's plugin settings.

How do I measure the direction setup time my drive actually sees?

Scope the clock and direction inputs at the drive terminals with the probe ground on the drive's input common, trigger on the DIR edge, and measure to the next active clock edge while jogging a reversing move at maximum feed. Compare the reading to the 35 µs figure in the PD4-C manual timing section.

How do I stop the 25 kHz kernel from limiting my rapids?

Compute f_step = (F_max / 60) x steps_per_mm and keep it under 25,000 steps/s by lowering the drive's step resolution and recomputing steps-per-unit in Motor Tuning. If the axis still needs more, move to an external motion controller instead of raising the kernel speed.

Does a new 4-axis breakout board fix the direction timing?

No. A breakout board has no pulse engine - it only adds propagation delay to both signals, and a slower DIR path can shrink the setup time the drive sees. Only a motion controller that generates its own step and direction waveform changes the timing.

Back to blog