Always move back to expected focus after failed autofocus

This commit is contained in:
Joe Knapper 2025-04-23 09:15:54 +00:00
parent 3bcc71304e
commit 283a10c560

View file

@ -632,7 +632,7 @@ class SmartScanThing(Thing):
if autofocus_sharp_enough:
return True, self._stage.position["z"]
else:
z = this_xyz[2] - dz / 2 if attempts < max_attempts else this_xyz[2]
z = this_xyz[2]
self._stage.move_absolute(z=z)
self._scan_logger.warning("Could not autofocus after 3 attempts.")