Stepper impulse width mod SOS
please help me!
I have a problem with the pulse width of stepping. I measured cca.2us, but the external controller like 5us.
Where can I mod in the source code?
RE: Stepper impulse width mod SOS - Added by jaap about 6 years ago
The pulse is created in stepper.cpp, part of the grbl code. There are relevant two routines:
set_step_pins(); // line 309 clear_all_step_pins(); // line 466
The time between the calling of those two in st_interrupt() determines the pulse width.
The comment on line 406 reads: clear the pins, assume that we spend enough CPU cycles in the previous statements for the steppers to react (>1usec)
. So much for "pulse timing" :-(
I suppose you could solve it by adding
just before line 406 (although adding a wait statement in interrupts is generally considered a Bad Thing)
RE: Stepper impulse width mod SOS - Added by minczer about 6 years ago
It's really a bad thing, but working!
1us wait enough for the stepper driver!