I’ll try and write something up a bit better, but here’s the code. Beware, this is really really really really really bad code written at the workbench that was the definition of “keep throwing stuff at the wall and see if it sticks”. I really need to refactor.
Also, happy to collaborate on this if anyone is interested. @Julien I took some inspiration from your pendant code to get this thing running!
My prototype setup has a joystick and an MPG connected to an Arduino Pro Micro. You either use one mode or the other. There’s a button and OLED screen to change the axis for the MPG and step distance.
I find myself using the Joystick to get roughly where I need and then switch over to the MPG to quickly dial it in.
Entrypoint (mainly for processing lines over USB from the Arduino):
This method doesn’t use
\x85 directly from the pendant for cancelling the jog, it uses a custom cncjs jogCancel command that is sent only after cncjs’s feeder is empty:
The point I’ve had a lot of trouble with is figuring out the right step distance and feed rate for a low latency joystick interface: cncjs-pendant-joystick/joystick.js at mingle/spike · minglecm/cncjs-pendant-joystick · GitHub
I’ve got it kinda dialed in, but I still wish for a smoother less stepper-motor-noisy jog.
Sorry to derail your post @theworkshope <3