aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/G-Codes.md28
-rw-r--r--klippy/extras/manual_stepper.py10
2 files changed, 23 insertions, 15 deletions
diff --git a/docs/G-Codes.md b/docs/G-Codes.md
index 1f8e77c8..97b9a878 100644
--- a/docs/G-Codes.md
+++ b/docs/G-Codes.md
@@ -255,18 +255,22 @@ The following command is available when a "manual_stepper" config
section is enabled:
- `MANUAL_STEPPER STEPPER=config_name [ENABLE=[0|1]]
[SET_POSITION=<pos>] [SPEED=<speed>] [ACCEL=<accel>]
- [MOVE=<pos> [STOP_ON_ENDSTOP=[1|2|-1|-2]]`: This command will alter
- the state of the stepper. Use the ENABLE parameter to enable/disable
- the stepper. Use the SET_POSITION parameter to force the stepper to
- think it is at the given position. Use the MOVE parameter to request
- a movement to the given position. If SPEED and/or ACCEL is specified
- then the given values will be used instead of the defaults specified
- in the config file. If an ACCEL of zero is specified then no
- acceleration will be performed. If STOP_ON_ENDSTOP=1 is specified
- then the move will end early should the endstop report as triggered
- (use STOP_ON_ENDSTOP=2 to complete the move without error even if
- the endstop does not trigger, use -1 or -2 to stop when the endstop
- reports not triggered).
+ [MOVE=<pos> [STOP_ON_ENDSTOP=[1|2|-1|-2]] [SYNC=0]`: This command
+ will alter the state of the stepper. Use the ENABLE parameter to
+ enable/disable the stepper. Use the SET_POSITION parameter to force
+ the stepper to think it is at the given position. Use the MOVE
+ parameter to request a movement to the given position. If SPEED
+ and/or ACCEL is specified then the given values will be used instead
+ of the defaults specified in the config file. If an ACCEL of zero is
+ specified then no acceleration will be performed. If
+ STOP_ON_ENDSTOP=1 is specified then the move will end early should
+ the endstop report as triggered (use STOP_ON_ENDSTOP=2 to complete
+ the move without error even if the endstop does not trigger, use -1
+ or -2 to stop when the endstop reports not triggered). Normally
+ future G-Code commands will be scheduled to run after the stepper
+ move completes, however if a manual stepper move uses SYNC=0 then
+ future G-Code movement commands may run in parallel with the stepper
+ movement.
## Probe
diff --git a/klippy/extras/manual_stepper.py b/klippy/extras/manual_stepper.py
index 743c6e23..24d83e28 100644
--- a/klippy/extras/manual_stepper.py
+++ b/klippy/extras/manual_stepper.py
@@ -58,7 +58,7 @@ class ManualStepper:
self.sync_print_time()
def do_set_position(self, setpos):
self.rail.set_position([setpos, 0., 0.])
- def do_move(self, movepos, speed, accel):
+ def do_move(self, movepos, speed, accel, sync=True):
self.sync_print_time()
cp = self.rail.get_commanded_position()
dist = movepos - cp
@@ -73,7 +73,8 @@ class ManualStepper:
self.trapq_free_moves(self.trapq, self.next_cmd_time + 99999.9)
toolhead = self.printer.lookup_object('toolhead')
toolhead.note_kinematic_activity(self.next_cmd_time)
- self.sync_print_time()
+ if sync:
+ self.sync_print_time()
def do_homing_move(self, movepos, speed, accel, triggered, check_trigger):
if not self.can_home:
raise self.gcode.error("No endstop for this manual stepper")
@@ -115,6 +116,7 @@ class ManualStepper:
if 'SET_POSITION' in params:
setpos = self.gcode.get_float('SET_POSITION', params)
self.do_set_position(setpos)
+ sync = self.gcode.get_int('SYNC', params, 1)
homing_move = self.gcode.get_int('STOP_ON_ENDSTOP', params, 0)
speed = self.gcode.get_float('SPEED', params, self.velocity, above=0.)
accel = self.gcode.get_float('ACCEL', params, self.accel, minval=0.)
@@ -124,7 +126,9 @@ class ManualStepper:
homing_move > 0, abs(homing_move) == 1)
elif 'MOVE' in params:
movepos = self.gcode.get_float('MOVE', params)
- self.do_move(movepos, speed, accel)
+ self.do_move(movepos, speed, accel, sync)
+ elif 'SYNC' in params and sync:
+ self.sync_print_time()
def load_config_prefix(config):
return ManualStepper(config)