diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2024-06-06 17:09:02 -0400 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2024-06-19 13:47:32 -0400 |
commit | 0a14e3315084065b19163104c3604d13a7c2dbc8 (patch) | |
tree | 9282f69171f38c44c7889f426b67b2bcf6f5590e /klippy/extras | |
parent | 11f04ba1bae774d32fd43bed4a0772c58d8df199 (diff) | |
download | kutter-0a14e3315084065b19163104c3604d13a7c2dbc8.tar.gz kutter-0a14e3315084065b19163104c3604d13a7c2dbc8.tar.xz kutter-0a14e3315084065b19163104c3604d13a7c2dbc8.zip |
probe_eddy_current: Add support for "rapid_scan" mode
Add a scanning mode that does not require pausing the toolhead at each
probe point.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras')
-rw-r--r-- | klippy/extras/probe_eddy_current.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/klippy/extras/probe_eddy_current.py b/klippy/extras/probe_eddy_current.py index de1f8447..345096e6 100644 --- a/klippy/extras/probe_eddy_current.py +++ b/klippy/extras/probe_eddy_current.py @@ -373,15 +373,27 @@ class EddyScanningProbe: self._gather = EddyGatherSamples(printer, sensor_helper, calibration, z_offset) self._sample_time_delay = 0.050 - self._sample_time = 0.100 + self._sample_time = gcmd.get_float("SAMPLE_TIME", 0.100, above=0.0) + self._is_rapid = gcmd.get("METHOD", "scan") == 'rapid_scan' + def _rapid_lookahead_cb(self, printtime): + start_time = printtime - self._sample_time / 2 + self._gather.note_probe_and_position( + start_time, start_time + self._sample_time, printtime) def run_probe(self, gcmd): toolhead = self._printer.lookup_object("toolhead") + if self._is_rapid: + toolhead.register_lookahead_callback(self._rapid_lookahead_cb) + return 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): + if self._is_rapid: + # Flush lookahead (so all lookahead callbacks are invoked) + toolhead = self._printer.lookup_object("toolhead") + toolhead.get_last_move_time() results = self._gather.pull_probed() # Allow axis_twist_compensation to update results for epos in results: @@ -418,7 +430,7 @@ class PrinterEddyProbe: return self.cmd_helper.get_status(eventtime) def start_probe_session(self, gcmd): method = gcmd.get('METHOD', 'automatic').lower() - if method == 'scan': + if method in ('scan', 'rapid_scan'): z_offset = self.get_offsets()[2] return EddyScanningProbe(self.printer, self.sensor_helper, self.calibration, z_offset, gcmd) |