How to add some delay to dir toggle after last step pulse

before, my printer works well with tmc2209.
now I’m using an external stepper driver module with opto-isolator like CWD556, I have set all step_pulse_duration to 0.000007, but there is still timing issue, when the toolhead moving back and forth, I get inclined model, this is the step and dir pulse I captured, the interval between dir and last step pulse is less than one microsecond, how can I add some delay to dir toggle after last step pulse

this is xyzCalibration model I printed
everything is well with tmc2209, and the model get tilted with external stepper driver

Moved this thread into the right category.

1 Like

Klipper uses step_pulse_duration for both step pin timing and dir pin timing. The dir pin timing is always enforced relative to the rising edge of the step pulse. So, for example, if you need a ten microsecond gap between step pin rising edge and dir pin change, then you’d need to set step_pulse_duration to 10us. There is currently no capability to enforce timing between step pin falling edge and dir pin change.

-Kevin

EDIT: The above is assuming the step pin is set to trigger on a rising edge. If the stepper driver triggers on a falling edge, then one can invert the step pin (eg, step_pin: !PA2) and Klipper would then enforce the delays relative to the falling edge.

I have uploaded the picture of my printed model
also, I have checked the jumper settings on the external stepper driver board, there are trigged on rising edge and normal pulse mode
and my cfg

[stepper_x]
step_pin: PB0
dir_pin: !PB1
enable_pin: !PC15
microsteps: 16
rotation_distance: 40
endstop_pin: ^!PB2
position_endstop: 0
position_min: 0
position_max: 250
homing_speed: 40
homing_retract_dist: 4
second_homing_speed: 2
step_pulse_duration: 0.000020

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.