Python Control Software

From Ug11bm
Jump to navigationJump to search

Cryostat Python Control Software

SetupCryostat()

in robot.py

Set up Oxford ITC503 Cryostat to default parameters

def SetupCryostat(sensor=2, tries=5)
   sensor: sensor # to control against: 1=gas inlet; 2=cold block (default); 3=spare
   tries: number of repeats to try when sending the command before giving up (default is 5)


GetCryostatT()

in robot.py

Read Oxford ITC503 cryostat temperatures

def GetCryostatT(tries=5)
     input: number of times to attempt read (defaults to 5)
     returns a list of 3 temperatures: sensor1, sensor2, sensor3


SetCryostatT()

in robot.py

Set Oxford ITC503 setpoint and optionally hold for temperature

def SetCryostatT(setpoint, WaitFlag=True, Delay=5, MaxWait=120, DeltaT=2, tries=5):
   setpoint (K) -- desired end T
   WaitFlag (default=True) -- if True the routine will return once the temperature is reached (default), 
                              False means return immediately after setting the ramp to begin
   Delay (min) -- period of time to wait after initially reaching the desired temperature in min (default is 5)
   MaxWait (min) -- maximum period to wait for the selected sensor to reach the Set Point in min.
                    If this period expires, an exception is thrown (defaults to 120)
   DeltaT (K) -- allowed discrepancy between the selected sensor and the desired T to start the delay period (defaults to 2)
   tries -- number of repeats to try when sending the command before giving up (defaults to 5)


SweepCryostatT()

in robot.py

Sets Oxford ITC503 setpoint and optionally hold for temperature

def SweepCryostatT(startpoint, endpoint, sweeptime, WaitFlag=False, MaxWait=1.25, tries=5):
   startpoint (K) -- desired start T for Temp
   endpoint (K) -- desired end T
   sweeptime (min) -- desired time for change from startpoint to endpoint (minutes)
   WaitFlag (default=False) -- if True the routine will return once the temperature is reached,
                               False means return immediately after setting the ramp to begin (default)
   MaxWait (ratio) -- maximum period to wait for the sweep to complete as a ratio of the sweep time.
                      Default is 1.25, meaning to wait 125% of sweeptime,
                      If this period expires, an exception is thrown.
   tries -- number of repeats to try when sending the command before giving up (defaults to 5)


Example Code

s11bmwork% /APSshare/bin/python
Python 2.5.2 (r252:60911, Jan 28 2009, 15:33:22) 
[GCC 4.1.2 20070626 (Red Hat 4.1.2-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path.append('/local/11BMcontrol/MailIn')
>>> import robot
>>> robot.GetCryostatT()
(1.3999999999999999, 407.80000000000001, 273.39999999999998)
>>> 
>>> robot.gui.Sleep(1)
>>> robot.SweepCryostatT(1,2,1)
False
True
False
>>> robot.SweepCryostatT(1,2,1,WaitFlag=True)
True
False
>>>