Using a CryoStat - NMGRL/pychron GitHub Wiki

Pychron currently supports the use of Lakeshore 33X style cryostat controllers

Setup

Basic setup requires editing your setupfiles/initialization.xml file, and adding a setupfiles/devices/cryostat.cfg configuration file

initialization.xml

...

<hardware>
 <plugin enabled="true">ExtractionLine

   ...

   <manager enabled="true">cryo_manager
      <device enabled="true">cryostat
        <klass>Model335TemperatureController</klass>
      </device>
   </manager>
 </plugin>
</hardware>

...

cryostat.cfg

[General]
name = Cryo

[Communications]
type = serial
port = USA19H1462P1.1
baudrate = 9600
terminator = CRLF
bytesize = 7
parity = odd
stopbits = 1

[Scan]
enabled = True
period = 5
record = False
units = s
graph = False
auto_start = True

[Range]
1 = v<10
2 = 10<v<30
3 = v>30

Scripting

You can control the cryo via Procedure or Automated Run extraction scripts using set_cryo

def main():
    setpoint = 50

    info('This is an example cryo procedure script')
    info(f'Set cryo to {setpoint} and wait until reached.')
    
    set_cryo(setpoint, block=2)  
    # block=2 means wait until abs(current_temp-setpoint) < 2
    # use the `delay` keyword to specify the check period in seconds. e.g delay=3 check if at temperature every 3 seconds
    

You can also start and stop the recording of the cryo temperature using the following

def main():
    start_cryo_recorder()  #### start recording to file
    
    setpoint = 50

    info('This is an example cryo procedure script')
    info(f'Set cryo to {setpoint} and wait until reached.')
    
    set_cryo(setpoint, block=2)  
    
    sleep(10)
    stop_cryo_recorder() ### stop recording

You can retrieve the cryo temp with get_cryo_temp. This leads to the possibility of writing your own is_at_setpoint function

def main():
    setpoint = 50
    set_cryo(setpoint, block=False)
    sleep(120)
    is_at_setpoint(setpoint)

    # do some stuff
    open('V1')
    sleep(5)
    close('V1')
  
    setpoint=15
    set_cryo(setpoint, block=False)
    sleep(120)
    is_at_setpoint(setpoint)


def is_at_setpoint(st, tol=1, delay=5):
   while 1:
       current_temp = get_cryo_temp()
       if abs(current_temp-st)<=tol:
           break
       sleep(delay)
   info(f'{setpoint} reached')
⚠️ **GitHub.com Fallback** ⚠️