Continuous movements in a new way
-
Hello,
It would be very nice to have a new way to control the movement of the drivers on the duet by giving a speed per axis instead of a destination coordinate/offset.
The current implementation makes it quite cumbersome to use a playstation / xbox controller in a responsive way: you have to decide on the speed before the move which makes the movements discreet by definition. What I would like instead is to be able to do set the speed depending on the position of the control sticks and taking into account the actual position of the stick instead of just triggering a move when an axis of the stick is beyond a certain threshold.
I haven't found a GCode that would enable that but I think it would be super useful for that particular case. I guess there are other cases where this would be useful for some non conventional machines (for example to control a coil winder to make guitar pickup...).
I had a cursory look at the firmware code (I'm an experienced C/C++ dev) but it goes a bit over my head and I'll like your inputs before (may be) diving in :-).
-
While it is not nearly as good as a real implementation in firmware would be, you could have a look on how I did an implemented for continuous mode in my Duet-USB-CNC-Pendant project.
The rough principle is described here: https://github.com/hurzhurz/Duet-USB-CNC-Pendant/blob/master/doc/ContinuousMode.md#working-principle
Changing the speed while moving would be possible,
though I have not actually implemented that for the basic PS3 controller support.EDIT: just implemented it (in a separat branch for now) -
-
Hey @hurzhurz thanks for your reply, I don't know why I didn't get a notification .
I looked at your code and it makes sense but it implies to have rather complex setup with the pendant and Arduino. I'd rather have a solution that works directly without additional hardware like the joystick plugins for DWC. This is why I'd like to have an actual solution that works with Gcode.
-
@meeloo You don't need to use my whole project, you could just look how I implemented the continuous mode in a G code way: via macros and especially the usage of the daemon.g.
If you want to try that (without Arduino etc.), you can prepare the macros like described here:
https://github.com/hurzhurz/Duet-USB-CNC-Pendant/blob/master/doc/ContinuousMode.md#preparationThen, to command a continuous movement, you have to send this command every 500ms (or more often):
M98 P"pendant-continuous-run.g" A"X" F1000 D1 # for moving the X axis in the positive direction with a feedrate of 1000
If the regularly sending of this command stops, the movement will automatically stop after a short time.
To immediately stop, you can send:
M98 P"pendant-continuous-stop.g"
Again, this not a perfect solution and you will notice a little delay, but I think it is working well enough.