mirror of
https://github.com/Klipper3d/klipper.git
synced 2026-01-27 19:31:08 -07:00
Merge 75bf767e18 into 8b58aa1302
This commit is contained in:
commit
8f59fc3bef
2 changed files with 33 additions and 5 deletions
|
|
@ -133,6 +133,10 @@ class ProbeCommandHelper:
|
|||
# Probe position
|
||||
probe_session.run_probe(fo_gcmd)
|
||||
probe_num += 1
|
||||
method = gcmd.get('METHOD', 'automatic').lower()
|
||||
if method in ('scan', 'rapid_scan'):
|
||||
# there is no move and no sense to retract
|
||||
continue
|
||||
# Retract
|
||||
pos = toolhead.get_position()
|
||||
liftpos = [None, None, pos[2] + params['sample_retract_dist']]
|
||||
|
|
|
|||
|
|
@ -265,6 +265,9 @@ class EddyGatherSamples:
|
|||
self._printer = printer
|
||||
self._sensor_helper = sensor_helper
|
||||
self._calibration = calibration
|
||||
self._is_scan_probe = False
|
||||
if z_offset is None:
|
||||
self._is_scan_probe = True
|
||||
self._z_offset = z_offset
|
||||
# Results storage
|
||||
self._samples = []
|
||||
|
|
@ -339,6 +342,11 @@ class EddyGatherSamples:
|
|||
if freq:
|
||||
sensor_z = self._calibration.freq_to_height(freq)
|
||||
self._probe_results.append((sensor_z, toolhead_pos))
|
||||
if self._is_scan_probe and sensor_z:
|
||||
epos = toolhead_pos
|
||||
gcode = self._printer.lookup_object('gcode')
|
||||
gcode.respond_info("probe at %.3f,%.3f is z=%.6f, freq=%.3f"
|
||||
% (epos[0], epos[1], sensor_z, freq))
|
||||
self._probe_times.pop(0)
|
||||
def pull_probed(self):
|
||||
self._await_samples()
|
||||
|
|
@ -350,6 +358,10 @@ class EddyGatherSamples:
|
|||
if sensor_z <= -OUT_OF_RANGE or sensor_z >= OUT_OF_RANGE:
|
||||
raise self._printer.command_error(
|
||||
"probe_eddy_current sensor not in valid range")
|
||||
if self._is_scan_probe:
|
||||
toolhead_pos[2] = sensor_z
|
||||
results.append(toolhead_pos)
|
||||
continue
|
||||
# Callers expect position relative to z_offset, so recalculate
|
||||
bed_deviation = toolhead_pos[2] - sensor_z
|
||||
toolhead_pos[2] = self._z_offset + bed_deviation
|
||||
|
|
@ -472,7 +484,11 @@ class EddyScanningProbe:
|
|||
self._printer = printer
|
||||
self._sensor_helper = sensor_helper
|
||||
self._calibration = calibration
|
||||
self._z_offset = z_offset
|
||||
self._is_probe = True
|
||||
if gcmd.get_command() in ('BED_MESH_CALIBRATE', 'Z_TILT_ADJUST'):
|
||||
self._is_probe = False
|
||||
else:
|
||||
z_offset = None
|
||||
self._gather = EddyGatherSamples(printer, sensor_helper,
|
||||
calibration, z_offset)
|
||||
self._sample_time_delay = 0.050
|
||||
|
|
@ -484,12 +500,20 @@ class EddyScanningProbe:
|
|||
start_time, start_time + self._sample_time, printtime)
|
||||
def run_probe(self, gcmd):
|
||||
toolhead = self._printer.lookup_object("toolhead")
|
||||
if self._is_rapid:
|
||||
if self._is_rapid and not self._is_probe:
|
||||
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
|
||||
if not self._is_probe:
|
||||
printtime = toolhead.get_last_move_time()
|
||||
toolhead.dwell(self._sample_time_delay + self._sample_time)
|
||||
start_time = printtime + self._sample_time_delay
|
||||
else:
|
||||
reactor = self._printer.get_reactor()
|
||||
curtime = reactor.monotonic()
|
||||
mcu = self._sensor_helper.get_mcu()
|
||||
printtime = mcu.estimated_print_time(curtime)
|
||||
start_time = printtime
|
||||
reactor.pause(curtime + self._sample_time)
|
||||
self._gather.note_probe_and_position(
|
||||
start_time, start_time + self._sample_time, start_time)
|
||||
def pull_probed_results(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue