Proteox controller#

High-level controller for the Proteox cryostat system by Oxford Instruments, interfacing via WAMP.

Two classes are available:

  • AsyncProteox: asynchronous API, every method must be awaited.

  • Proteox: synchronous wrapper (an Instrument). It runs an AsyncProteox on an event loop in a daemon thread, so connect(), disconnect(), get_<sensor>(), set_<attribute>(value) and the recognized-state helpers are plain blocking calls. Errors raised by the WAMP calls propagate to the caller.

Credentials#

Both classes take url, realm, user and secret as arguments. Missing values are read in the constructor from the environment variables WAMP_ROUTER_URL, WAMP_REALM, WAMP_USER and WAMP_USER_SECRET, after loading a .env file with python-dotenv (searched from the calling script’s folder upwards). Nothing is read at import time. Example .env (keep it out of version control):

WAMP_USER="**********"
WAMP_USER_SECRET="*************"
WAMP_REALM="ucss"
WAMP_ROUTER_URL="ws://************:8080/ws"

Synchronous example#

from qtics import Proteox

with Proteox() as instrument:   # connect() / disconnect()
    mix = instrument.get_MC_T()
    pt1 = instrument.get_PT1_T1()
    print(f"MIX: {mix*1000:.2f} mK, PT1: {pt1:.2f} K")
    instrument.set_MC_T(0.1)    # K

Asynchronous example#

Warning

All AsyncProteox methods (including sensor accessors and recognized-state helpers) are coroutines and must be used with await inside an async function.

from asyncio import run
from qtics import AsyncProteox

async def myfun():
    instrument = AsyncProteox()
    await instrument.connect()

    mix = await instrument.get_MC_T()
    pt1 = await instrument.get_PT1_T1()
    pt2 = await instrument.get_PT2_T1()
    sti = await instrument.get_STILL_T()
    col = await instrument.get_CP_T()

    print("\nTEMPS:")
    print(f"MIX: {mix*1000:.2f} mK")
    print(f"STILL: {sti*1000:.2f} mK")
    print(f"COLD: {col*1000:.2f} mK")
    print(f"PT1: {pt1:.2f} K")
    print(f"PT2: {pt2:.2f} K")

    await instrument.close()

run(myfun())

Commands#

  • connect()

    Connect to the Proteox cryostat via WAMP.

  • close() (AsyncProteox) / disconnect() (Proteox)

    Cleanly disconnect from the cryostat session.

  • is_in_remote()

    Check if instrument is connected or the system is in remote, refusing connection.

  • get_<sensor>()

    Dynamic getter for supported sensors (see below). If the key is not recognized, raises an AttributeError.

  • set_<attribute>(<value>)

    Dynamic setter for supported control parameters (see below). If the key is not recognized, raises an AttributeError.

  • is_in_recognized_state()

    Return True if the current cryostat conditions match one of the recognized exclusive states.

  • get_recognized_states()

    Return a list of recognized states currently matched. In normal operation this should usually contain zero or one state, because matching is implemented as exclusive.

  • how_to_go_to_recognized_state(target_state=None)

    Return a human-readable suggestion describing what conditions are missing or conflicting in order to reach:

    • the closest recognized state, if target_state is None

    • a specific recognized state, if target_state is provided

Dynamic getters#

The following sensors are available via dynamic getter methods:

Temperatures#

  • get_SAMPLE_T() – Sample thermometer

  • get_MC_T() – Mixing chamber temperature

  • get_MC_T_SP() – Mixing chamber temperature setpoint

  • get_STILL_T() – Still temperature

  • get_CP_T() – Cold plate temperature

  • get_SRB_T() – Sorb temperature

  • get_DR2_T(), get_DR1_T() – DR stage temperatures

  • get_PT2_T1(), get_PT1_T1() – Pulse tube stage temperatures

  • get_MAG_T() – Magnet system temperature

Heaters and Powers#

  • get_MC_H() – Mixing chamber heater power

  • get_STILL_H() – Still heater power

Pressures#

  • get_OVC_P() – Outer vacuum chamber pressure

  • get_P1_P() to get_P6_P() – Various pressure gauges

Flows#

  • get_3He_F() – 3 He flowmeter

Magnetic Field Control#

  • get_MAG_VEC() – Magnetic field vector

  • get_MAG_STATE(), get_SWZ_STATE() – Magnet controller and sweep state

  • get_MAG_TARGET() – Field target

  • get_MAG_X_STATE(), get_MAG_Y_STATE(), get_MAG_Z_STATE() – Axis state

  • get_MAG_CURR_VEC(), get_CURR_TARGET() – Magnet current vector and targets

Cryostat State#

  • get_state() – Cryostat state (returns descriptive label, e.g. "CONDENSING")

Available state labels:

  • IDLE

  • PUMPING

  • CONDENSING

  • CIRCULATING

  • WARM UP

  • CLEAN COLD TRAP

  • SAMPLE EXCHANGE

Dynamic setters#

The following control parameters are available via dynamic setter methods. Each setter corresponds to a WAMP procedure call (awaited with AsyncProteox).

Example#

# Change the mixing chamber setpoint and heater power
await instrument.set_MC_T(0.1)   # set MC temperature setpoint to 100 mK

Note

Temperature values are expected in kelvin.

Temperature and Heater Control#

  • set_MC_T(value) – Set mixing chamber temperature setpoint

  • set_MC_H(value) – Set mixing chamber heater power

  • set_MC_H_OFF() – Turn off mixing chamber heater

  • set_STILL_H(value) – Set still heater power

  • set_STILL_H_OFF() – Turn off still heater

Magnet Control#

  • set_MAG_TARGET((coord, x, y, z, mode, param, persist)) – Set magnetic field target

  • set_MAG_STATE(value) – Set magnet controller state: 0 Hold, 10 Enter Persistent Mode, 20 Leave Persistent Mode, 30 Sweep Field, 40 Sweep PSU Output

  • set_MAG_X_STATE(value), set_MAG_Y_STATE(value), set_MAG_Z_STATE(value) – Set state for each magnet axis

Note

AsyncProteox setters must always be awaited (Proteox setters block), and they raise if the WAMP call fails. Parameters follow the Proteox manual (MAN-NS-0002) Appendix D: a tuple value is passed as the list of call parameters. Example: await instrument.set_MAG_STATE(30)

Recognized states#

The Proteox driver also provides a recognized-state evaluator.

This system compares a set of measured cryostat conditions (pressures, temperatures, valve states, pumps, etc.) against an internal exclusive truth table of known operational states.

This is useful to:

  • check whether the cryostat is currently in a valid known configuration

  • identify the current recognized operating state

  • determine the closest valid state

  • obtain a list of suggested actions to reach a target state

Recognized state table#

The state recognition logic is based on the following operational truth table:

Proteox recognized states truth table

Note

Matching is exclusive.

This means that a state is considered matched only if:

  • all conditions expected to be True are actually True

  • all conditions expected to be False are actually False

In other words, extra active conditions can invalidate a state match.

Available high-level methods#

You can access the recognized-state API directly from the AsyncProteox object (awaited, as below) or from the Proteox wrapper (same names, without await).

Check whether the current state is recognized

ok = await instrument.is_in_recognized_state()
print(ok)

Example output:

True

Get the currently recognized state(s)

states = await instrument.get_recognized_states()
print(states)

Example output:

['Circulating Compressor Bypassed']

Get instructions to reach the closest recognized state

suggestion = await instrument.how_to_go_to_recognized_state()
print(suggestion)

Example output:

Closest target state: 'Circulating'
Total mismatches: 1

Required actions:
 - 3CL-CP-01 is On -> Turn ON compressor (3CL-CP-01).

Get instructions to reach a specific recognized state

suggestion = await instrument.how_to_go_to_recognized_state("Circulating")
print(suggestion)

Example output:

Target state: 'Circulating'
Total mismatches: 1

Required actions:
 - 3CL-CP-01 is On -> Turn ON compressor (3CL-CP-01).

Full example#

from asyncio import run
from qtics import AsyncProteox

async def myfun():
    instrument = AsyncProteox()
    await instrument.connect()

    ok = await instrument.is_in_recognized_state()
    print("Recognized:", ok)

    states = await instrument.get_recognized_states()
    print("Matched states:", states)

    suggestion = await instrument.how_to_go_to_recognized_state()
    print("\nClosest-state suggestion:")
    print(suggestion)

    suggestion_specific = await instrument.how_to_go_to_recognized_state("Circulating")
    print("\nHow to reach 'Circulating':")
    print(suggestion_specific)

    await instrument.close()

run(myfun())

Internal recognized-state manager#

The AsyncProteox object internally exposes a recognized-state manager:

instrument.recognized_states

This helper is mainly useful for advanced debugging, diagnostics, or future GUI integration.

It currently supports internal methods such as:

  • evaluate_conditions()

  • get_condition_report()

  • match_all_states()

  • get_closest_state()

  • get_state_gap(target_state)

  • get_transition_plan(target_state=None)

These methods are generally intended for advanced users and internal tooling rather than routine control scripts.

Typical usage pattern#

A practical workflow is:

  1. read the current cryostat status

  2. check whether it is recognized

  3. if not, ask for the nearest valid state

  4. optionally request how to reach a specific target state

Example:

ok = await instrument.is_in_recognized_state()

if not ok:
    print(await instrument.how_to_go_to_recognized_state())

This is especially useful when building:

  • monitoring dashboards

  • operator guidance tools

  • automated safety or recovery procedures

  • state-aware experiment orchestration