diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2020-09-04 12:39:11 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2020-09-04 15:47:52 -0400 |
commit | 3bcb6970f5297b11b9b6aef4cd312b58d6762c3c (patch) | |
tree | 76329941cf40512d5ee54d63460eb3e0b0c7349c /klippy | |
parent | 08adecd226b4d712eb900b1768a7a96294a89c20 (diff) | |
download | kutter-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.py | 10 |
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 |