qmi.instruments.montana.cryostation

Instrument driver for the Montana Cryostation.

Classes

Montana_Cryostation(context, name, transport)

Instrument driver for the Montana Cryostation.

class qmi.instruments.montana.cryostation.Montana_Cryostation(context: QMI_Context, name: str, transport: str)

Instrument driver for the Montana Cryostation.

The Montana Cryostation is a cryostat that is delivered with a Windows 10 laptop. On the laptop, a GUI application is running. The GUI application allows remote control via TCP (by default, port 7773).

IMPORTANT: the TCP server on the laptop’s GUI needs to be manually enabled. There is,

unfortunately, not a setting to do this automatically on startup.

The Cryostation is monitored and controlled by a simple ASCII-based protocol as described in [1].

The documentation lists 29 commands. Of these, 17 retrieve setpoints and sensor values; 12 are used to alter setpoints or start behavior (e.g. cooldown):

Getters:

GAS - Get Alarm State GCP - Get Chamber Pressure GMS - Get Magnet State GMTF - Get Magnet Target Field GPHP - Get Platform Heater Power GPIDF - Get PID Fi integral frequency GPIDK - Get PID Ki proportional gain GPIDT - Get PID Td derivative time GPS - Get Platform Stability GS1T - Get Stage 1 Temperature GS2T - Get Stage 2 Temperature GPT - Get Platform Temperature GSS - Get Sample Stability GST - Get Sample Temperature GTSP - Get Temperature Set Point GUS - Get User Stability GUT - Get User Temperature RPID - Reset PID parameters to their default values

Setters:

SCD - Start Cool Down SMD - Set Magnet Disabled SME - Set Magnet Enabled SMTF - Set Magnet Target Field SPIDF - Set PIDF Fi integral frequency SPIDK - Set PID proportional gain SPIDT - Set PID Td derivative time SSB - Start StandBy STP - SToP STSP - Set Temperature Set Point SWU - Start Warm Up SPHP - Set Platform Heater Power

We note that the three commands GPIDF, GPIDK, GPIDT that are used to retrieve PID control parameters do not work on our CryoStation.

Note: this driver assumes that the Montana software uses a locale with ‘.’ as decimal separator (e.g. “en_US”). The Montana software inherits this setting from the language settings of the operating system on the monitoring laptop.

References:

[1] Montana Cryostation Communication Specification, version 1.9

release_rpc_object() None

Make sure the platform heater is safely turned off before destroying this instrument driver instance.

The platform heater is normally turned off by the close() method. This function is only necessary to handle cases where the driver shuts down without properly calling close().

open() None

Opens a connection to the Cryostation instrument.

close() None

Closes a connection to the Cryostation instrument.

get_alarm_state() bool

Retrieves the alarm state, i.e., whether a system error is presently active.

get_chamber_pressure(unit: str | None = None) float

Retrieve the current chamber pressure.

The Cryostation always returns the pressure in [mTorr]. Since that is usually a pretty inconvenient unit, this method allows the specification of different units ([Pa], [atm]) that are usually more convenient, converting the retrieved value in [mTorr] to that unit is requested.

Parameters:

unit – the physical unit of pressure to return. This can be one of ‘mTorr’, ‘Pa’, or ‘atm’. The default if no unit is specified is mTorr.

Returns: current chamber pressure in the unit selected, or NaN if the chamber pressure is not available.

get_magnet_state() bool | None

Retrieves the current magnet state.

Returns: True if magnet is enabled; False if magnet is disabled;

None if the system cannot execute the command (activate the magnet first).

get_magnet_target_field() float

Retrieves the current set point for magnetic field.

Returns: current set point for magnetic field in [Tesla], or NaN if the magnet is not enabled or the magnet

module is not activated.

get_platform_heater_power() float

Retrieves the current platform heater power.

Returns: platform heater power in [Watt], or NaN if the platform heater power is not available.

get_pid_integral_frequency() float

Retrieves the current setting for PID Fi integral frequency.

Returns: PID Fi integral frequency in [Hz].

Warning: this function doesn’t work on our Cryostation and raises a QMI_InstrumentException.

set_pid_integral_frequency(i_freq_hz: float) None

Set the PID integral frequency value.

Note: 0 will result in no integral action.

Parameters:

i_freq – integral frequency in Hertz. (0.000 - 100.000)

get_pid_proportional_gain() float

Retrieves the current setting for PID Ki proportional gain.

Returns: PID Ki proportional gain in [Watt/Kelvin].

Warning: this function doesn’t work on our Cryostation and raises a QMI_InstrumentException.

set_pid_proportional_gain(p_gain: float) None

Set the PID proportional gain value.

Note: 0 will result in no derivative action.

Parameters:

p_gain – Proportional gain in Watts/Kelvin. (0.001 - 100.000)

get_pid_derivative_time() float

Retrieves the current setting for PID Td derivative time.

Returns: PID Td derivative time in [seconds].

Warning: this function doesn’t work on our Cryostation and raises a QMI_InstrumentException.

set_pid_derivative_time(d_time_s: float) None

Set the PID derivative time value.

Parameters:

d_time – derivative time in seconds. (0.000 - 100.000)

get_platform_stability() float

Retrieves the current platform stability.

Returns: platform stability in [Kelvin].

get_stage_1_temperature() float

Retrieves the current stage 1 temperature.

Returns: stage 1 temperature in [Kelvin], or NaN if the stage 1 temperature is not available.

get_stage_2_temperature() float

Retrieves the current stage 2 temperature.

Returns: stage 2 temperature in [Kelvin], or NaN if the stage 2 temperature is not available.

get_platform_temperature() float

Retrieves the current platform temperature.

Returns: platform temperature in [Kelvin], or NaN if the platform temperature is not available.

get_sample_stability() float

Retrieves the current sample stability.

Returns: sample stability in [Kelvin], or NaN if the sample stability is not available.

get_sample_temperature() float

Retrieves the current sample temperature.

Returns: sample temperature in [Kelvin], or NaN if the sample temperature is not available.

get_temperature_setpoint() float

Retrieves the current temperature setpoint.

Returns: temperature setpoint in [Kelvin], or NaN if the temperature setpoint is not available.

set_temperature_setpoint(setpoint_k: float) None

Set temperature setpoint.

Parameters:

setpoint_k – Temperature setpoint in Kelvin. (2.00 - 350.00)

get_user_stability() float

Retrieves the current user stability (whatever that may be).

Returns: user stability in [Kelvin], or NaN if the user stability is not available.

get_user_temperature() float

Retrieves the current user temperature.

Returns: user temperature in [Kelvin], or NaN if the user temperature is not available.

start_standby() None

Start standby.

start_cooldown() None

Start the cooldown.

start_warmup() None

Start the warmup.

stop_system() None

Stop either the standby, cooldown or warmup of the system.

set_platform_heater_power(power: float) None

Set the platform heater power.

This function sets the platform heater to the specified power. The heater will remain at the requested power until explicitly turned off via another call to this function.

This function only allows limited heater power levels. If you need more power, use set_platform_heater_power_burst() to set a high power level for a limited duration.

Calling this function while a time-limited power burst is active, stops the burst timer and sets the new requested power without any time limit. The platform heater can always be turned off by calling this function and specifying 0 Watt power.

Parameters:

power – Heater power in Watt (max 1 W).

Raises:

QMI_InstrumentException – If the Montana does not accept the command.

set_platform_heater_power_burst(power: float, duration: float) None

Set the platform heater to high power for a limited duration.

This function sets the platform heater to the specified power, starts a timer, then returns while the timer keeps running in the background. If the timer reaches the specified duration, the heater power is automatically reset to 0 Watt.

Calling this function while a background timer is running, restarts the timer for the specified new duration. It is thus possible to keep the heater at high power for a long time by repeatedly calling this function. A script that uses this technique, should also monitor temperatures and stop heating when temperatures reach a limit.

A heating burst can always be stopped by calling this function (or set_platform_heater_power) and specifying 0 Watt power.

WARNING: Setting the heater to high power for a long time can cause damage to the cryostat or the sample. Do not call this function unless you understand the risks.

Parameters:
  • power – Heater power in Watt (max 10 W).

  • duration – Maximum duration for the specified power in seconds (max 30 s).

Raises:

QMI_InstrumentException – If the Montana does not accept the command.

force_unlock() None

Forcefully unlock the remote object.

This unlocks the object, regardless of who owns the lock. This allows you to unlock an object if the locking proxy has been destroyed without unlocking.

Use this with care.

Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.

classmethod get_category() str | None

Return the optional name of the category this object belongs to.

A category name is a free-form string that has no special significance. Its purpose is to distinguish between groups of RPC objects that fulfill similar roles.

get_name() str

Return the name of this object.

Returns:

name attribute.

get_signals() list[SignalDescription]

Return a list of signals that can be published by this object.

Returns:

List consisting of qmi_signals attributes.

is_locked() bool

Query if the remote object is locked.

Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.

is_open() bool

Return True if the instrument is open (ready for interaction).

lock(timeout: float = 0.0, lock_token: str | None = None) bool

Lock the remote object. If timeout is given, try every 0.1s within the given timeout value. The remote object can be locked with an optional custom lock token by giving a string into lock_token keyword argument.

If successful, this proxy is the only proxy that can invoke RPC methods on the remote object; other proxies will receive an “object is locked” response. The return value indicates if the lock was granted; a denied lock means the object was already locked by another proxy.

Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.

unlock(lock_token: str | None = None) bool

Unlock the remote object.

Without optional parameters, this is only allowed by the proxy that initially locked the object. By giving the lock token as an input parameter, the specific object locked by this token can be unlocked. The return value indicates if the unlocking was successful.

Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.