aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/force_move.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-12-04 18:42:59 -0500
committerKevin O'Connor <kevin@koconnor.net>2020-01-06 11:49:41 -0500
commit97d976fc53f897ad57db963078bcbf5018d34968 (patch)
tree9482958a4ed8bbab214e7d1eb74011bbd063b788 /klippy/extras/force_move.py
parentbcf10aa99037843dfccd83ab44b38b61d5747720 (diff)
downloadkutter-97d976fc53f897ad57db963078bcbf5018d34968.tar.gz
kutter-97d976fc53f897ad57db963078bcbf5018d34968.tar.xz
kutter-97d976fc53f897ad57db963078bcbf5018d34968.zip
stepper: Track if using units of radians instead of millimeters
The STEPPER_BUZZ command needs to know if the axis is using radians instead of millimeters so that it can move a more appropriate distance. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/force_move.py')
-rw-r--r--klippy/extras/force_move.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/klippy/extras/force_move.py b/klippy/extras/force_move.py
index 0f58ad03..d051622f 100644
--- a/klippy/extras/force_move.py
+++ b/klippy/extras/force_move.py
@@ -6,7 +6,10 @@
import math, logging
import chelper
-BUZZ_VELOCITY = 4.
+BUZZ_DISTANCE = 1.
+BUZZ_VELOCITY = BUZZ_DISTANCE / .250
+BUZZ_RADIANS_DISTANCE = math.radians(1.)
+BUZZ_RADIANS_VELOCITY = BUZZ_RADIANS_DISTANCE / .250
STALL_TIME = 0.100
# Calculate a move's accel_t, cruise_t, and cruise_v
@@ -95,10 +98,13 @@ class ForceMove:
logging.info("Stepper buzz %s", stepper.get_name())
was_enable = self.force_enable(stepper)
toolhead = self.printer.lookup_object('toolhead')
+ dist, speed = BUZZ_DISTANCE, BUZZ_VELOCITY
+ if stepper.units_in_radians():
+ dist, speed = BUZZ_RADIANS_DISTANCE, BUZZ_RADIANS_VELOCITY
for i in range(10):
- self.manual_move(stepper, 1., BUZZ_VELOCITY)
+ self.manual_move(stepper, dist, speed)
toolhead.dwell(.050)
- self.manual_move(stepper, -1., BUZZ_VELOCITY)
+ self.manual_move(stepper, -dist, speed)
toolhead.dwell(.450)
self.restore_enable(stepper, was_enable)
cmd_FORCE_MOVE_help = "Manually move a stepper; invalidates kinematics"