1
$\begingroup$

I am currently writing (software) and building (printing) a little control panel for my printer. I have some 2D joysticks that I want to use for X/Y and Z/E movement. The idea is that when I move the joystick in X direction the printer starts moving to the right/left and when released it should stop. For now it should just be constant speed, so the amount of tilting the joystick should not matter. I have been looking through the GCode reference (Marlin) but I all the movement related GCodes seem to be moving to specific position, but not simply starting to move until further notice.

When using positioning I can think of two possible issues.

  • Moving too much per iteration -> it will continue to move after releasing the joystick
  • Moving too little per iteration -> it will jerk around (stop, start, stop, start, ...) which is probably not too good for the motors

Is there a way to have the printer head just start and stop moving without having to give a target coordinate? If it makes any difference: I am only talking about having this for a Creality CR-20.

$\endgroup$
4
  • 1
    $\begingroup$ If iterating like you're doing, you could time each successive command to happen just before the deceleration from the previous move would begin, based on acceleration profile. But I'm not sure if the planner will react that quickly. You may instead be able to just send a long move, then a command to abort as needed, but there still may be high latency. Printer firmware isn't made for interactive control. $\endgroup$ – R.. GitHub STOP HELPING ICE Mar 5 '20 at 18:26
  • 2
    $\begingroup$ You'd be better off with each nudge of the joystick equaling a set movement. I don't know of a way to just kick off movement without an endpoint. $\endgroup$ – Davo Mar 5 '20 at 21:11
  • $\begingroup$ Those are both good ideas, I think I will implement it in a way that moving it into a direction causes a movement to the end of the platform and when released I will abort the last command. It doesn't matter if there is just a small delay between releasing and stopping $\endgroup$ – Yanick Salzmann Mar 6 '20 at 6:44
  • $\begingroup$ Obviously there's no Gcode to "move until instructed otherwise," as that leads to nasty hard-stop collisions. Your thought about "Move to Max_X" followed by an Abort command should work, but be cautious about speed since the limit switches may not cut the drive off in time. $\endgroup$ – Carl Witthoft Mar 6 '20 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.