pylabrobot.centrifuge.highres.microspin_backend.MicroSpinBackend.reset#
- async MicroSpinBackend.reset(*, abort_timeout: float | None = None, settle_timeout: float | None = None, swallow_abort_errors: bool = True, wait_for_settle: bool = True) Dict[str, str] | None#
Bring the device back to a clean, ready-to-command state.
Issues the canonical recovery sequence:
abort()– request a decel + stop.clear_button_abort()– release the latched abort state so that subsequent motion commands (home,open,spin, …) are accepted again.wait_for_spindle_stopped()– a singlestatuscall that the firmware will not answer until the rotor is genuinely stopped.
Steps 1 and 2 both return
OK!immediately on the wire – they are just acknowledgements of the request, not confirmation that motion has ceased. Step 3 is the real “we are stopped” gate, because the firmware queues astatusrequest behind any active motion and only answers once that motion completes.- Parameters:
abort_timeout (float | None) – Override the timeout for the
abortstep. Pass a generous value if you’ve configured a very tight backend timeout. Defaults toabort()’s own default.settle_timeout (float | None) – Override the timeout for the final
statuspoll that waits for the spindle to actually spin down. Defaults towait_for_spindle_stopped()’s own default (max(self.timeout, 300s)).swallow_abort_errors (bool) – If
True(the default), errors raised by theabortstep are logged and ignored so thatclear_button_abort()is still attempted. This is usually what you want for a recovery routine – e.g.abortcan legitimately fail with “nothing to abort” depending on firmware state. Set this toFalseif you want any abort failure to propagate.wait_for_settle (bool) – If
True(the default), block on step 3 and return the final status dict. IfFalse, skip step 3 and returnNoneimmediately afterclear_button_abort()– useful when you only want to clear the firmware’s abort latch and don’t care whether the rotor has stopped yet.
- Returns:
The parsed status report from step 3 (a
{field: value}dict), orNoneifwait_for_settle=False.- Raises:
MicroSpinError – If
clear_button_abort()fails, or if the finalstatuspoll returnsERROR!. Either case indicates the device is in a state that the normal recovery sequence can’t get out of – a power-cycle is usually required at that point.asyncio.TimeoutError – If the rotor doesn’t stop within
settle_timeout(i.e. the spindle is genuinely stuck).
- Return type:
Note
resetdoes NOT verify that the resulting state is homed. Follow up withis_homed()(and re-home()if needed) before issuing the next motion command. The MicroSpin firmware also keeps a persistent error stack which is unaffected by reset; userequest_errors()to inspect it.