pylabrobot.centrifuge.highres.microspin_backend.MicroSpinBackend.wait_for_spindle_stopped#
- async MicroSpinBackend.wait_for_spindle_stopped(*, timeout: float | None = 1800.0, poll_interval: float = 60.0) Dict[str, str]#
Block until the firmware confirms the rotor is fully stopped.
The MicroSpin firmware queues
statusbehind any active motion and only answers once the rotor has spun down, so a singlestatusis sufficient as a “we are stopped” gate. This method issuesstatusrepeatedly with a short per-call timeout until one returns successfully (the rotor stopped) – or until the overalltimeoutbudget expires.Retrying matters in practice because long decels can take well over a poll interval (a worst-case observed spin was
spin 1000 100 10 5taking >17 min to spin down on the slow-decel curve). With a single long timeout, you have to either pick a value that’s too short and raise spuriously, or one that’s so long it would mask a genuine hang forever. Polling gives you both bounded latency and tolerant patience.- Parameters:
timeout (float | None) – Total time budget in seconds.
Nonemeans “wait indefinitely” (only do this if you’re sure the device isn’t stuck – see the low-G hang warning inspin()). Defaults toDEFAULT_SPINDLE_STOP_TIMEOUT(30 min).poll_interval (float) – Per-
statuscall timeout in seconds. Each individualstatuscall may legitimately time out (because the rotor is still moving); the loop catches those and tries again. Defaults toDEFAULT_SPINDLE_POLL_INTERVAL(60 s).
- Returns:
The parsed status report ({key – value} dict) from the first
statuscall that succeeds.- Raises:
asyncio.TimeoutError – If the overall
timeoutexpires before anystatuscall returns successfully.MicroSpinError – If a
statuscall returnsERROR!(this is not retried – anERROR!fromstatusmeans the device itself thinks something is wrong, not that motion is still in progress).
- Return type: