Instrument software

CryoSoft

Instrument control for a cryogenic transport bench: runs of 30 to 40 hours with nobody watching, safety limits enforced by the software, and a full instrument snapshot saved with every data point.

My role
Solo developer
Period
2024 to present
Status
In use; public on GitHub
30 to 40 h
unattended runs
1 week to 2 hours
onboarding
6
architecture layers

The problem

The lab's LabVIEW measurement code was a flat sequence of hardcoded commands: instrument parameters were scattered through it, swapping an instrument meant hours of rewriting, and the metadata needed to trace a measurement artefact was not saved. Overnight runs of 30 to 40 hours had no software safety net, so nothing would have stopped an unsafe magnet or temperature transition.

Why it matters

My measurement stack since 2024, behind the magnetoresistance and exchange-bias work, and the base that I2AS generalises. It turned a bench that needed someone watching it into one that runs, logs and protects itself overnight.

What came of it

  • Unattended runs of 30 to 40 hours on the cryogenic transport bench, with the safety limits enforced by a state machine rather than by an operator watching a screen.
  • Onboarding on that bench went from one week to two hours.
  • Swapping a core instrument, such as the magnet power supply or the temperature controller, went from hours of refactoring to a single config-file edit.
  • Public on GitHub and written to be reused by other groups, with a simulated driver beside every real one so the stack runs offline.
A line drawing in light grey on a dark ground: a cryostat, its outer vessel enclosing an inner chamber with a sample at the centre of a magnet bore, marked in maroon. Circuit-board traces run from the cryostat to five stacked instrument icons on the right: a computer display, a gauge, an oscilloscope, a control unit and a meter.A line drawing in light grey on a dark ground: a cryostat, its outer vessel enclosing an inner chamber with a sample at the centre of a magnet bore, marked in maroon. Circuit-board traces run from the cryostat to five stacked instrument icons on the right: a computer display, a gauge, an oscilloscope, a control unit and a meter.
One program between the cryostat and every instrument around it.

What I did

  • Split the stack into six layers: raw drivers, typed virtual instruments, a YAML station registry (ruamel.yaml), an orchestrator, measurement procedures and the GUI, each depending only on the one below, so an instrument swap is a config edit. Every real driver (Oxford Mercury iPS, ITC 503, ILM 200, Lakeshore 335, Keithley 6221 and 2182A, over PyVISA and PyMeasure) has a simulated twin for offline testing.
  • Put safety in a cryostat state machine ticked by one Qt QTimer. Per-tick checks force EMERGENCY on low helium or a stale sensor reading, and ramp targets are validated through a RampableVI interface that raises a CryoSoftSafetyError.
  • Generated the PyQt6 and pyqtgraph GUI by introspection of methods marked monitored or control, using Python's inspect and typing, so a new instrument's controls appear without GUI code.
  • Wrote one HDF5 file per run with h5py and numpy: metadata, timestamped data points and a full instrument snapshot per sweep point, enough for root-cause analysis of an artefact. Arrays trim cleanly on abort.
  • Kept it tested and typed with pytest, pytest-qt and mypy.

Recent work added a configuration editor and session management, and an agent harness for commissioning, new drivers and fault finding. I am extending it so that software agents can work with the system over MCP.