-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Description
Describe the bug
The current step-dir implementation in step_dir_stepper_common
toggles in single_edge mode the step pin twice as fast as it can. For some board and stepper controller combinations (for example Teensy 4.0 board with a TI drv8424 stepper controller) this causes the pin to be toggled to fast and thus erroneous behavior - e.g. the motor not stepping.
To Reproduce
- Connect a
drv8424
stepper controller with aTeensy 4.0
board and use the counter timing source (didn't test work queue timing) - Test the driver via the shell, using microstep resolution of
1
and a microstep interval of5000000
- i.e. 200 steps/s - Observe the motor
Expected behavior
The motor should step correctly.
Possible solutions
One possible solution is to use a 50% duty cycle of the step signal - like the drv8424 driver before the step-dir generalization. This requires an internal doubling of the step signal frequency and step counting only on every second interrupt. In addition, the step signal needs to be explicitly set to low when stopping, possibly after a short delay after stopping the timing source.
These changes are only needed for single_edge mode. dual_step mode can remain like it is.
That said, this is only one possible solution and I am interested if there are other ideas on how to solve this.