aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2024-05-31 16:48:55 -0400
committerKevin O'Connor <kevin@koconnor.net>2024-06-14 13:38:07 -0400
commitfcf064ba6851042a12a71975c229a9670b34cf31 (patch)
treecf5a55bb92027452dfcfa1007a950371d50c21d1
parentaa0dbf6ee652fe87b4fcc828482309c6830f0efb (diff)
downloadkutter-fcf064ba6851042a12a71975c229a9670b34cf31.tar.gz
kutter-fcf064ba6851042a12a71975c229a9670b34cf31.tar.xz
kutter-fcf064ba6851042a12a71975c229a9670b34cf31.zip
probe_eddy_current: Add support for probing in "scan" mode
When probing in "scan" mode, the toolhead will pause at each position, but does not descend. This can notably reduce the total probing time. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--klippy/extras/probe.py2
-rw-r--r--klippy/extras/probe_eddy_current.py33
2 files changed, 34 insertions, 1 deletions
diff --git a/klippy/extras/probe.py b/klippy/extras/probe.py
index 6a69d1b5..88aed25f 100644
--- a/klippy/extras/probe.py
+++ b/klippy/extras/probe.py
@@ -438,7 +438,7 @@ class ProbePointsHelper:
def_move_z = self.default_horizontal_move_z
self.horizontal_move_z = gcmd.get_float('HORIZONTAL_MOVE_Z',
def_move_z)
- if probe is None or method != 'automatic':
+ if probe is None or method == 'manual':
# Manual probe
self.lift_speed = self.speed
self.probe_offsets = (0., 0., 0.)
diff --git a/klippy/extras/probe_eddy_current.py b/klippy/extras/probe_eddy_current.py
index 7ec2305e..de1f8447 100644
--- a/klippy/extras/probe_eddy_current.py
+++ b/klippy/extras/probe_eddy_current.py
@@ -363,6 +363,34 @@ class EddyEndstopWrapper:
def get_position_endstop(self):
return self._z_offset
+# Implementing probing with "METHOD=scan"
+class EddyScanningProbe:
+ def __init__(self, printer, sensor_helper, calibration, z_offset, gcmd):
+ self._printer = printer
+ self._sensor_helper = sensor_helper
+ self._calibration = calibration
+ self._z_offset = z_offset
+ self._gather = EddyGatherSamples(printer, sensor_helper,
+ calibration, z_offset)
+ self._sample_time_delay = 0.050
+ self._sample_time = 0.100
+ def run_probe(self, gcmd):
+ toolhead = self._printer.lookup_object("toolhead")
+ printtime = toolhead.get_last_move_time()
+ toolhead.dwell(self._sample_time_delay + self._sample_time)
+ start_time = printtime + self._sample_time_delay
+ self._gather.note_probe_and_position(
+ start_time, start_time + self._sample_time, start_time)
+ def pull_probed_results(self):
+ results = self._gather.pull_probed()
+ # Allow axis_twist_compensation to update results
+ for epos in results:
+ self._printer.send_event("probe:update_results", epos)
+ return results
+ def end_probe_session(self):
+ self._gather.finish()
+ self._gather = None
+
# Main "printer object"
class PrinterEddyProbe:
def __init__(self, config):
@@ -389,6 +417,11 @@ class PrinterEddyProbe:
def get_status(self, eventtime):
return self.cmd_helper.get_status(eventtime)
def start_probe_session(self, gcmd):
+ method = gcmd.get('METHOD', 'automatic').lower()
+ if method == 'scan':
+ z_offset = self.get_offsets()[2]
+ return EddyScanningProbe(self.printer, self.sensor_helper,
+ self.calibration, z_offset, gcmd)
return self.probe_session.start_probe_session(gcmd)
def load_config_prefix(config):