digiexchris / SurfaceGrinderAutomaton

Automatic traverse and grinding cycles for simple manual surface grinders
1 stars 0 forks source link

Switch PIO to a complete high/low step per sent delay #4

Open digiexchris opened 4 months ago

digiexchris commented 4 months ago

Right now, update() will send 2 delays defining the interval for the high pulse, and one for the interval for the low pulse. Which means the 4 entry fifo can only hold at most 2 steps at a time. It should be possible to send one delay and reuse it for both the high and low segments. see pio/stepper.pio

digiexchris commented 4 months ago

It wasn't easy to figure out the first iteration so be sure someone checks the output with an oscilloscope before merging

digiexchris commented 4 months ago

this might not be ideal if the stepper driver executes a step on each edge of the pulse, because this will always give 2 edges.

Though, the original implementation was already doing that, just sending two delays per step.

digiexchris commented 3 months ago

looks like the drv8825 and my reference hardware driver both send a pulse on the low to high transition but not the high to low transition, so all good there.