I’d like to improve responsiveness for manual jogging, as well as for other robotics-related purposes. The easiest solution would be if the system could respond to M220 and PAUSE commands much faster, or if there was a way to somehow control the speed of the clock.
For manual jogging, I could just send a command to go to X_AXIS_MAX (or whatever) at X_AXIS_MAX_SPEED, then I could control the actual speed of it by controlling system speed, like M220 would. But, from what I’ve seen, neither M220 or PAUSE take effect until after some number of previously-queued move commands execute. Also, this would require being able to cancel a motion, once started, and I don’t know that there’s a way to do that.
I’d like to be able to have these things respond at least as fast as 20ms, or whatever would be imperceptible from instant to a human. I wouldn’t mind if I had to give up 10x the possible speed, or maybe even 100x - I can use a faster PC and a STM32F4, if I need to.
Is there a smart way to do this? I’m presently looking at, more or less, just porting over a stepper library as a Klipper host program, and using it to create stepper commands. I’ve already found that these libraries (ie: AccelStepper, FastAccelStepper) are good for manual control, but I’ve been experimenting with Klipper because I was having difficulty with synchronized motion, reliable communication between PC and microcontrollers, etc. But, doing this would only give me part of what I want - manual control of individual motors - and I really also want the ability to run G-code commands, but to have more or less instant access to controlling their speed or pausing them entirely.
I found this post, which seems like it’s pretty much confronting the same problem for different reasons Fast closed-loop controllers on the MCU? - so I don’t guess the outlook is too good, as far as a simple solution goes, unless the idea of controlling the clock’s speed or the willingness to lose a lot of speed make things easier.