aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2020-09-04 12:39:11 -0400
committerKevin O'Connor <kevin@koconnor.net>2020-09-04 15:47:52 -0400
commit3bcb6970f5297b11b9b6aef4cd312b58d6762c3c (patch)
tree76329941cf40512d5ee54d63460eb3e0b0c7349c /klippy
parent08adecd226b4d712eb900b1768a7a96294a89c20 (diff)
downloadkutter-3bcb6970f5297b11b9b6aef4cd312b58d6762c3c.tar.gz
kutter-3bcb6970f5297b11b9b6aef4cd312b58d6762c3c.tar.xz
kutter-3bcb6970f5297b11b9b6aef4cd312b58d6762c3c.zip
probe: Make sure z is homed before probing
Warn if the Z axis is not homed before attempting to probe. This improves the error message. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy')
-rw-r--r--klippy/extras/probe.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/klippy/extras/probe.py b/klippy/extras/probe.py
index 9b4f1cb0..e3fdb81c 100644
--- a/klippy/extras/probe.py
+++ b/klippy/extras/probe.py
@@ -8,10 +8,9 @@ import pins, homing
from . import manual_probe
HINT_TIMEOUT = """
-Make sure to home the printer before probing. If the probe
-did not move far enough to trigger, then consider reducing
-the Z axis minimum position so the probe can travel further
-(the Z minimum position can be negative).
+If the probe did not move far enough to trigger, then
+consider reducing the Z axis minimum position so the probe
+can travel further (the Z minimum position can be negative).
"""
class PrinterProbe:
@@ -107,6 +106,9 @@ class PrinterProbe:
return self.x_offset, self.y_offset, self.z_offset
def _probe(self, speed):
toolhead = self.printer.lookup_object('toolhead')
+ curtime = self.printer.get_reactor().monotonic()
+ if 'z' not in toolhead.get_status(curtime)['homed_axes']:
+ raise self.printer.command_error("Must home before probe")
homing_state = homing.Homing(self.printer)
pos = toolhead.get_position()
pos[2] = self.z_position