Esempio n. 1
0
def heat_pumps(logfile, heat_temp=30, voltage=5, stable_voltage=3):
    sc.He4p.set_voltage(voltage)
    sc.He3ICp.set_voltage(voltage)
    sc.He3UCp.set_voltage(voltage)
    heating = True
    He4 = 0
    He3I = 0
    He3U = 0
    while heating is True:
        if He4 != 1:
            temp = gt.gettemp(logfile, 'He4 IC Pump')
            if temp > heat_temp:
                print('He4 pump has reached heat_temp.  Stabalizing.')
                sc.He4p.set_voltage(stable_voltage)
                He4 = 1
        if He3I != 1:
            temp = gt.gettemp(logfile, 'He3 IC Pump')
            if temp > heat_temp:
                print('IC pump has reached heat_temp.  Stabalizing.')
                sc.He3ICp.set_voltage(stable_voltage)
                He3I = 1
        if He3U != 1:
            temp = gt.gettemp(logfile, 'He3 UC Pump')
            if temp > heat_temp:
                print('UC pump has reached heat_temp.  Stabalizing.')
                sc.He3UCp.set_voltage(stable_voltage)
                He3U = 1
        if (He4 + He3I + He3U) == 3:
            heating = False
            print('done heating')
        else:
            time.sleep(60)
    return
Esempio n. 2
0
def finish_cycle(hex_filename):
	print 'Beginning the hex_watcher_3000 program to finish the cycle.'
	print gt.gettemp(hex_filename,'HEX')
	while float(gt.gettemp(hex_filename,'HEX'))<1.06:
		time.sleep(60)
		print datetime.datetime.now()
		print gt.gettemp(hex_filename,'HEX')
	time.sleep(60)

	print 'Turning off inter pump and ultra pump.'
	print datetime.datetime.now()

	sc.He3ICp.set_voltage(0.00)
	sc.He3UCp.set_voltage(0.00)

	time.sleep(60)

	print 'Turning on inter switch.'
	print datetime.datetime.now()
	sc.He3ICs.set_voltage(4.00)
	time.sleep(240)

	print 'Turning on ultra switch.'
	print datetime.datetime.now()
	sc.He3UCs.set_voltage(3.00)

	print 'Waiting one hour for cooling...'
	print datetime.datetime.now()

	time.sleep(3600)

	print 'The hex_watcher_3000 has done its duty.'
	print datetime.datetime.now()
def finish_cycle(hex_filename):
    print('Beginning the hex_watcher_3000 program to finish the cycle......')
    print(gt.gettemp(hex_filename, 'HEX'))
    while float(gt.gettemp(hex_filename, 'HEX')) < 1.06:
        time.sleep(120)
        print(
            str(datetime.datetime.now()) + ' HEX temp: ' +
            str(gt.gettemp(hex_filename, 'HEX')))
    time.sleep(60)

    print('Turning off inter pump and ultra pump. ' +
          str(datetime.datetime.now()))

    sc.He3ICp.set_voltage(0.00)
    time.sleep(1)
    sc.He3UCp.set_voltage(0.00)

    time.sleep(60)

    print('Turning on inter switch. ' + str(datetime.datetime.now()))
    sc.He3ICs.set_voltage(4.00)
    time.sleep(240)

    print('Turning on ultra switch. ' + str(datetime.datetime.now()))
    sc.He3UCs.set_voltage(3.00)

    print('Waiting 30 min for cooling... ' + str(datetime.datetime.now()))
    time.sleep(1800)

    print('The hex_watcher_3000 has done its duty. ' +
          str(datetime.datetime.now()))
Esempio n. 4
0
def pid_stage_temp_with_pump(logfile, set_temp=0.65):

    #array is min temp, max temp, uc pump heating voltage, uc pump maintenance voltage, ic pump heating voltage, ic pump maintenance voltage
    ucpump_settings = np.array([
        [0.5, 0.55, 3, 2, 0, 0],
        [0.55, 0.65, 3, 2.2, 0, 0, 0],
        [0.65, 0.7, 4.0, 2.5, 0,
         0],  #uc pump temp is ~ 27.7 K for this to work
        [0.7, 0.75, 4.0, 2.7, 0.5, 0.5]
    ])

    ginds = np.intersect1d(
        np.where(ucpump_settings[:, 0] <= set_temp)[0],
        np.where(ucpump_settings[:, 1] > set_temp)[0])[0]
    sc.He3UCp.set_voltage(ucpump_settings[gind, 2])
    print('He3 UC pump to heating voltage: ' + str(ucpump_settings[gind, 2]) +
          'V')
    time.sleep(120)
    while float(gt.gettemp(logfile, 'UC Stage')) < (set_temp - 0.01):
        time.sleep(60)
        print(gt.gettemp(logfile, 'UC Stage'))
    sc.ChaseLS.set_PID_temp(1, set_temp)
    sc.ChaseLS.set_heater_range(2)
    print(
        'Turning on PID on Heater, reducing pump temp to maintenance voltage, waiting 5 min for stability'
    )
    sc.He3UCp.set_voltage(ucpump_settings[gind, 3])
    print(time.datetime())
    time.sleep(60 * 5)
    iter = True
    while iter:
        if float(sc.ChaseLS.get_HTR_output()) > 95:
            print('adjusting pump up to help heater')
            sc.He3UCP.set_voltage(float(sc.He3UCp.read_voltage()) + .1)
        elif float(sc.ChaseLS.get_HTR_output()) < 5:
            print('adjusting pump down to prevent runaway')
            sc.He3UCP.set_voltage(float(sc.He3UCp.read_voltage()) - 0.1)
        else:
            iter = False
        time.sleep(60 * 5)
    return
def downward_sweep(lowtemp):
    print 'Running a downward sweep'
    starttime = time.time()
    print "start time: " + str(starttime)

    proc_ledgerman = subprocess.Popen(
        ['python', ledgerman_path, hwm, R_data_path, '-s'])

    while float(gt.gettemp(logfile, 'UC Head')) > lowtemp:
        time.sleep(10)

    proc_ledgerman.terminate()

    endtime = time.time()
    print "end time: " + str(endtime)

    startendtime = {'start_time': starttime, 'end_time': endtime}
    f = open(data_dir + 'rt_m2m1_up_times.pkl', 'w')
    pickle.dump(startendtime, f)
    f.close()
def upward_sweep(hightemp):
    print 'Running an upward sweep'
    starttime = time.time()
    print "start time: " + str(starttime)

    proc_ledgerman = subprocess.Popen(
        ['python', ledgerman_path, hwm, R_data_path, '-s'])
    #proc_ledgerman_0135 = subprocess.Popen(['python', ledgerman_path, hwm_0135, R_data_path_0135, '-s'])

    #settemp = PID_high_temp

    #while settemp > PID_low_temp:
    #    sc.ChaseLS.set_PID_temp(1, settemp)
    #    time.sleep(sleeptime)
    #    settemp -= 0.010

    #while float(gt.gettemp(logfile, 'UC Head'))>0.420:
    #	time.sleep(10)

    #sc.ChaseLS.set_PID_temp(1, 0.000)
    #time.sleep(1)
    #sc.ChaseLS.set_heater_range(0)

    while float(gt.gettemp(logfile, 'UC Head')) < hightemp:
        time.sleep(10)


#time.sleep(60)

    proc_ledgerman.terminate()
    #proc_ledgerman_0135.terminate()

    endtime = time.time()
    print "end time: " + str(endtime)

    startendtime = {'start_time': starttime, 'end_time': endtime}
    f = open(data_dir + 'rt_m2m1_times.pkl', 'w')
    pickle.dump(startendtime, f)
    f.close()
Esempio n. 7
0
def autocycle(logfile=''):
    '''
        This is a function to run a fridge cycle.  Note that it takes 6+ hours to run.
        '''
    try:
        #loggy=raw_input('What is the logfile?  /home/spt3g/he10_logs/')
        #logfile=os.path.join('/home/spt3g/he10_logs/', str(loggy))
        '''
                hwm_d=raw_input('What is the full path to the hardware map yml?  /home/spt3g/hardware_maps/')
                hwm_dir=os.path.join('/home/spt3g/hardware_maps/' , str(hwm_d))

                print(hwm_dir)
                hwm=pydfmux.load_session(open(hwm_dir, 'r'))['hardware_map']
                ds=hwm.query(pydfmux.Dfmux)
                
                print("Turning off mezzanines.")
                ds.set_mezzanine_power(False,1)
                ds.set_mezzanine_power(False,2)
                
                raw_input('Please press enter if the mezzanines are actually off (for testing).')
                print("Mezzanines off, ready to go.")
                '''

        # turn off mezzanines

        sc.He4p.remote_set()
        sc.He3ICp.remote_set()
        sc.He3UCp.remote_set()

        print('Setting the heater, switches, and pumps to 0.')

        zero_everything()

        print('Waiting for switches to cool.')

        while float(gt.gettemp(logfile, 'He3 IC Switch')) > 5.00:
            time.sleep(10)
        while float(gt.gettemp(logfile, 'He3 UC Switch')) > 5.00:
            time.sleep(10)
        while float(gt.gettemp(logfile, 'He4 IC Switch')) > 5.00:
            time.sleep(10)
        print('Switches are cool, beginning heating.')

        print('')

        print('Turning He4 pump to 12.00 V.')
        sc.He4p.set_voltage(12.00)

        print('Turning inter pump to 9.60 V.')
        sc.He3ICp.set_voltage(9.60)

        print('Turning ultra pump to 6.30 V.')
        sc.He3UCp.set_voltage(6.30)

        print('')

        print('Waiting 30 minutes for pumps to heat.')
        t = 0
        while t < 1800:
            time.sleep(60)
            t = t + 60
            minutes = str(t / 60)
            print('%s minutes elapsed so far.' % minutes)

        print('Turning He4 pump to 9.50 V.')
        sc.He4p.set_voltage(9.50)

        print('Turning IC pump to 5.10 V.')
        sc.He3ICp.set_voltage(5.10)

        print('Turning UC pump to 5.30 V.')
        sc.He3UCp.set_voltage(5.30)

        print('Waiting 20 minutes.')
        t = 0
        while t < 1200:
            time.sleep(60)
            t = t + 60
            minutes = str(t / 60)
            print('%s minutes elapsed so far.' % minutes)

        print('Turning He4 pump to 5.0 V.')
        sc.He4p.set_voltage(5.0)

        print('Waiting for He4 pump temperature to reach 43 K.')
        while float(gt.gettemp(logfile, 'He4 IC Pump')) < 43:  #43:
            time.sleep(10)

        print('Turning He4 pump to 3.0 V.')
        sc.He4p.set_voltage(3.00)

        print('Waiting 5 minutes.')
        time.sleep(300)

        print('Setting He4 pump to 0.0 V.')
        sc.He4p.set_voltage(0.00)

        print('Sleeping for 3 minutes.')
        time.sleep(180)

        print('Setting He4 switch to 4.00 V.')
        sc.He4s.set_voltage(4.00)

        print('Waiting for He3 IC Pump temperature to be above 52 K')
        while float(gt.gettemp(logfile, 'He3 IC Pump')) < 52:
            time.sleep(10)

        print('Setting inter pump to 3.0 V.')
        sc.He3ICp.set_voltage(3.00)

        print('Waiting for He3 UC Pump temperature to be above 52 K.')
        while float(gt.gettemp(logfile, 'He3 UC Pump')) < 52:
            time.sleep(10)

        print('Setting ultra pump to 5.00 V.')
        sc.He3UCp.set_voltage(5.00)

        finish_cycle(logfile)

        print('Cycle is complete.')
        return

    except:
        print('Crashed!')
        print(datetime.datetime.now())
        print('Zeroing everything for safety.')
        zero_everything()
# pydfmux stuff
hwm_file = '/home/spt3g/hardware_maps/hwm_anl_20161115_w109/hwm_anl_complete.yml'
y = pydfmux.load_session(open(hwm_file, 'r'))
rc=y['hardware_map'].query(pydfmux.ReadoutChannel)
bolos = y['hardware_map'].query(pydfmux.Bolometer)
ds = y['hardware_map'].query(pydfmux.Dfmux)

sc.He3UCs.remote_set()
sc.He3ICs.remote_set()

# unlatch the switches
print('Turning off switches...')
sc.He3UCs.set_voltage(0.0)
sc.He3ICs.set_voltage(0.0)

while float(gt.gettemp(logfile, 'He3 UC Switch'))>2.00:
	time.sleep(10)
while float(gt.gettemp(logfile, 'He3 IC Switch'))>2.00:
	time.sleep(10)

print('Heating up fridge...')
sc.He3UCp.set_voltage(3.0)

sc.ChaseLS.set_PID_temp(1, 0.500)
time.sleep(1)
sc.ChaseLS.set_heater_range(2)

time.sleep(1)

while float(gt.gettemp(logfile, 'UC Head')) < 0.500:
	print gt.gettemp(logfile, 'UC Head')
Esempio n. 9
0
def start_of_day(logfile, heating_type, set_squid_feedback=False, set_gain=False):
	'''
	Starts things for you by heating the UC Stage, initializing the board, tuning squids, and taking a rawdump.
	'''
	# set voltages to 0, let the switches cool
	print 'Setting the switches to zero to cool.'
	sc.He3ICp.remote_set()
	sc.He3UCp.remote_set()

	sc.He3ICp.set_voltage(0)
	sc.He3ICs.set_voltage(0)
	sc.He3UCp.set_voltage(0)
	sc.He3UCs.set_voltage(0)

    gt.gettemp(logfile, 'He3 IC Switch'); gt.gettemp(logfile, 'He3 UC Switch')
	while float(gt.gettemp(logfile, 'He3 UC Switch'))>1:
		while float(gt.gettemp(logfile, 'He3 IC Switch'))>1:
			gt.gettemp(logfile, 'He3 UC Switch'); gt.gettemp(logfile, 'He3 IC Switch')
			time.sleep(10)

    if heating_type=='PID':
    	# set UC pump voltage and start the heater to get above Tc
    	print 'Setting ultra pump to 3.00 V.'
    	sc.He3UCp.set_voltage(3.00)
    	time.sleep(60)
    	print 'Setting the heater to 500 mK at 1.5 mW.'
    	sc.ChaseLS.set_PID_temp(1,0.500)
    	time.sleep(1)
    	sc.ChaseLS.set_heater_range(2)
    	time.sleep(1)
wafer_high_temp = 0.650
wafer_low_temp = 0.400
K_per_sec = 1e-4
update_time = 10

#######################################################################
print 'Starting R(T) script.'

# unlatch the switches
print('Turning off switches...')
sc.He3UCs.set_voltage(0.0)
sc.He3ICs.set_voltage(0.0)

# wait for switches to cool
while float(gt.gettemp(logfile, 'He3 UC Switch')) > 2.00:
    time.sleep(10)
while float(gt.gettemp(logfile, 'He3 IC Switch')) > 2.00:
    time.sleep(10)

# heat the fridge to the high temperature
print('Heating up fridge...')
sc.He3UCp.set_voltage(2.0)
sc.He3ICp.set_voltage(2.0)
time.sleep(3 * 60)
sc.ChaseLS.set_PID_temp(1, 0.500)
time.sleep(1)
sc.ChaseLS.set_heater_range(2)

time.sleep(1)
Esempio n. 11
0
sleeptime = 60

logfile = '/home/spt3g/he10_logs/20170302_again_read.h5'

ledgerman_path = '/home/spt3g/spt3g_software/dfmux/bin/ledgerman.py'
data_dir = '/home/spt3g/output/20170316/'
R_data_path_0137 = data_dir + 'rt0137.nc'
R_data_path_0135 = data_dir + 'rt0135.nc'

hwm_0137 = '/home/spt3g/hardware_maps/hwm_anl_20170306_W169_and_Rboards/hwm_0137.yml'
hwm_0135 = '/home/spt3g/hardware_maps/hwm_anl_20170306_W169_and_Rboards/hwm_0135.yml'

sc.ChaseLS.set_heater_range(2)
sc.ChaseLS.set_PID_temp(1, PID_high_temp)

while float(gt.gettemp(logfile, 'UC Head')) < 0.650:
    #while float(gt.gettemp(logfile, 'UC Head'))<PID_low_temp:
    print "UC Head temp is " + str(gt.gettemp(logfile, 'UC Head'))
    time.sleep(10)

starttime = time.time()
print "start time: " + str(starttime)

proc_ledgerman_0137 = subprocess.Popen(
    ['python', ledgerman_path, hwm_0137, R_data_path_0137, '-s'])
proc_ledgerman_0135 = subprocess.Popen(
    ['python', ledgerman_path, hwm_0135, R_data_path_0135, '-s'])

settemp = PID_high_temp

while settemp > PID_low_temp:
Esempio n. 12
0
def run_cooldown(logfile='', set_temp=39, cycle_type='short'):
    '''
    speeds up cooldown by heating switches and pumps for improved thermal conductivity until IC and UC are reasonably cold
    
    logfile = path to fridge logging file where function can read current fridge temps
    set_temp = temperature in K to which we heat the pumps
    cycle_type = "short" or "long".  "long" takes ~7-8 hours and gives a ~80 hour hold time.  "short" takes ~5 hours and gives a ~50 hour hold time.
    
    '''
    sc.He4p.remote_set()
    sc.He3ICp.remote_set()
    sc.He3UCp.remote_set()
    zero_everything()
    if len(logfile) == 0:
        raise ValueError('No logfile specified')

    if gt.gettemp(logfile, 'He3 UC Pump') < 25 or gt.gettemp(
            logfile, 'He3 IC Pump') < 25 or gt.gettemp(logfile,
                                                       'He4 IC Pump') < 25:
        sc.He4p.set_voltage(4)
        sc.He3ICp.set_voltage(4)
        sc.He3UCp.set_voltage(4)
        print('Heating pumps, waiting 5 min')
        time.sleep(300)
    i = True
    while i is True:
        if (gt.gettemp(logfile, 'mainplate') < 9.2):
            if gt.gettemp(logfile, 'IC Stage') > 10:
                if gt.gettemp(logfile, 'He3 UC Pump') < 40 and gt.gettemp(
                        logfile, 'He3 IC Pump') < 40 and gt.gettemp(
                            logfile, 'He4 IC Pump') < 40:
                    print('main plate is cool, heating pumps a little bit: ' +
                          str(datetime.datetime.now()))
                    heat_pumps(logfile,
                               heat_temp=set_temp,
                               voltage=5,
                               stable_voltage=2.0)
                    print('Heated pumps, waiting a bit ' +
                          str(datetime.datetime.now()))
                    time.sleep(120)  #240
                else:
                    print('pumps are already hot, waiting')
                    sc.He4p.set_voltage(1.9)
                    sc.He3ICp.set_voltage(1.9)
                    sc.He3UCp.set_voltage(1.8)
                    time.sleep(300)
            else:
                print('IC Stage is below 10K')
                i = False

        else:
            print('Mainplate is still hot: ' + str(datetime.datetime.now()) +
                  ' ' + str(gt.gettemp(logfile, 'mainplate')))
            time.sleep(300)

    #time.sleep(3600)
    time.sleep(60)

    i = True
    while i is True:
        print('IC Stage below 10K. Keeping main plate cold')
        if gt.gettemp(logfile, 'mainplate') < 6:
            print('heating pumps')
            heat_pumps(logfile,
                       heat_temp=set_temp,
                       voltage=5,
                       stable_voltage=2)
            time.sleep(120)
        if gt.gettemp(logfile, 'mainplate') > 9:
            print('Mainplate>9.  Zeroing pumps')
            sc.He4p.set_voltage(0)
            sc.He3ICp.set_voltage(0)
            sc.He3UCp.set_voltage(0)
            while gt.gettemp(logfile, 'mainplate') > 9:
                time.sleep(60)
        if gt.gettemp(logfile, 'He3 IC Pump') > 40:
            print('IC pump > 40, zeroing pumps')
            sc.He4p.set_voltage(0)
            sc.He3ICp.set_voltage(0)
            sc.He3UCp.set_voltage(0)
            while gt.gettemp(logfile, 'He3 IC Pump') > 40:
                time.sleep(100)
        if gt.gettemp(logfile, 'UC Stage') < 6:
            print('UC Stage < 6, zeroing pumps')
            sc.He4p.set_voltage(0)
            sc.He3ICp.set_voltage(0)
            sc.He3UCp.set_voltage(0)
            i = False
        else:
            print('UC Stage is at ' + str(gt.gettemp(logfile, 'UC Stage')) +
                  '. Waiting a little longer')
            time.sleep(300)
    sc.He4p.set_voltage(0)
    sc.He3ICp.set_voltage(0)
    sc.He3UCp.set_voltage(0)

    time.sleep(360)
    print('Starting the He10 cycle: ' + str(datetime.datetime.now()))

    if cycle_type == "long":
        autocycle(logfile=logfile)
    elif cycle_type == "short":
        autocycle_short(logfile=logfile)
    elif cycle_type == "skip":
        print('contnuing without cycle')
    else:
        print('WARNING: incorrect cycle_type: ' + str(cycle_type) +
              '. Aborting.')
    return
Esempio n. 13
0
###### user parameters ######
logfile = '/home/spt3g/he10_logs/20170302_again_read.h5'
setpoints = np.linspace(0.300, 0.600, 12)
wafertemps_filename = '/home/spt3g/output/20170406/GofT_temps.pkl'

###### THIS IS THE PART WHERE IT DOES THINGS ########
print 'Starting G(T)'

sc.He3ICp.set_voltage(0)
sc.He3UCp.set_voltage(0)
sc.He3ICs.set_voltage(0)
sc.He3UCs.set_voltage(0)
sc.ChaseLS.set_PID_temp(1, 0.500)
time.sleep(1)
sc.ChaseLS.set_heater_range(2)
while float(gt.gettemp(logfile, 'UC Stage'))<0.450:
    time.sleep(10)
sc.ChaseLS.set_PID_temp(1,0.650)
time.sleep(1)
sc.ChaseLS.set_heater_range(3)
time.sleep(1)
while float(gt.gettemp(logfile, 'UC Stage'))<0.650:
    time.sleep(20)
time.sleep(300)

print 'Zeroing combs'
nts.run_do_zero_combs()

print 'Overbiasing'
nts.run_overbias_bolos()
Esempio n. 14
0
def bring_stage_above_tc(logfile, set_temp=0.65):
    # set voltages to 0, let the switches cool
    print('Setting the switches to zero to cool.')
    sc.He3ICp.remote_set()
    sc.He3UCp.remote_set()

    sc.He3ICp.set_voltage(0)
    sc.He3ICs.set_voltage(0)
    sc.He3UCp.set_voltage(0)
    sc.He3UCs.set_voltage(0)
    gt.gettemp(logfile, 'He3 IC Switch')
    gt.gettemp(logfile, 'He3 UC Switch')

    while float(gt.gettemp(logfile, 'He3 UC Switch')) > 5:
        while float(gt.gettemp(logfile, 'He3 IC Switch')) > 5:
            gt.gettemp(logfile, 'He3 UC Switch')
            gt.gettemp(logfile, 'He3 IC Switch')
            time.sleep(10)

    time.sleep(2)
    print('Setting ultra pump to 3.50 V.')
    sc.He3UCp.set_voltage(3.50)  #3.5
    time.sleep(60)
    print('Setting the heater to 500 mK at 15 mW.')
    sc.ChaseLS.set_PID_temp(1, 0.500)
    time.sleep(3)
    sc.ChaseLS.set_PID_temp(
        1, 0.500
    )  #try again because sometimes it silently fails the first time (AEL 8/17)
    time.sleep(1)
    sc.ChaseLS.set_heater_range(2)
    time.sleep(1)
    gt.gettemp(logfile, 'UC Stage')
    while float(gt.gettemp(logfile, 'UC Stage')) < 0.500:
        time.sleep(10)
        gt.gettemp(logfile, 'UC Stage')
    time.sleep(1)

    print('Setting the heater to ' + str(set_temp) + ' K at 15 mW')
    sc.ChaseLS.set_PID_temp(1, set_temp)
    time.sleep(1)
    sc.ChaseLS.set_PID_temp(
        1, set_temp
    )  #try again because sometimes it silently fails the first time (AEL 8/17)
    time.sleep(1)
    sc.ChaseLS.set_heater_range(2)
    time.sleep(1)

    print('Setting the ultra pump to 3 V')
    sc.He3UCp.set_voltage(3.0)  #3.5
    while float(gt.gettemp(logfile, 'UC Stage')) < set_temp:
        time.sleep(20)
        gt.gettemp(logfile, 'UC Stage')
        print(gt.gettemp(logfile, 'UC Stage'))

    print('Setting the ultra pump to 1.9 V')
    sc.He3UCp.set_voltage(1.9)  #2.1
    print('Waiting...')
    time.sleep(300)

    return
def run():
    '''
	This function runs the first cycle of a cooldown.  Note that it takes more than
	24 hours to run.
	'''
    # set the power supplies to remote mode
    sc.He4p.remote_set()
    sc.He3ICp.remote_set()
    sc.He3UCp.remote_set()

    # ask the user for the name of the logfile
    logfile = raw_input('The path to the logfile is: /home/spt3g/')
    logfile = str(logfile)

    # wait for the main plate to cool down enough to start a cycle
    print 'Waiting for Main Plate to be below 10 K...'
    while float(gt.gettemp(logfile, 'mainplate')) > 10:
        time.sleep(600)

    # wait for switches to cool enough to not blow the cycle you are about to start
    print 'Waiting for switches to be below 10 K...'
    while float(gt.gettemp(logfile, 'He3 UC Switch')) > 10:
        time.sleep(600)
    while float(gt.gettemp(logfile, 'He3 IC Switch')) > 10:
        time.sleep(600)
    while float(gt.gettemp(logfile, 'He4 IC Switch')) > 10:
        time.sleep(600)

    # start a cycle
    print 'Starting cycle...'

    # heat up the pumps
    print 'Setting pump voltages.'
    he4v = 9.50
    he3icv = 6.50
    he3ucv = 6.50
    sc.He4p.set_voltage(he4v)
    sc.He3ICp.set_voltage(he3icv)
    sc.He3UCp.set_voltage(he3ucv)

    print 'Waiting for pumps to heat (this will take a long time)'
    print datetime.datetime.now()
    try:
        # heat up the pumps at a high voltage to help accelerate the process
        while float(gt.gettemp(logfile, 'He4 IC Pump')) < 30.00:
            time.sleep(600)
        he4v = 7.50
        sc.He4p.set_voltage(he4v)

        while float(gt.gettemp(logfile, 'He3 UC Pump')) < 35.00:
            time.sleep(60)
        he3ucv = 5.00
        sc.He3UCp.set_voltage(he3ucv)

        while float(gt.gettemp(logfile, 'He3 IC Pump')) < 35.00:
            time.sleep(60)
        he3icv = 4.00
        sc.He3ICp.set_voltage(he3icv)

        # wait to help the pump temperatures keep rising to where we want them
        print 'Waiting one hour for pumps to heat'
        print datetime.datetime.now()
        time.sleep(60 * 60)

        # set stabilizing voltages
        he4v = 3.00
        sc.He4p.set_voltage(he4v)
        he3icv = 3.20
        sc.He3ICp.set_voltage(he3icv)
        he3ucv = 4.60
        sc.He3UCp.set_voltage(he3ucv)

        # wait 2 hours for temperatures to hopefully settle
        print 'Setting maintenance voltages, waiting 2 hours'
        print datetime.datetime.now()
        time.sleep(2 * 60 * 60)

        # wait for UC Head and IC Head to get cold
        while float(gt.gettemp(logfile, 'UC Head')) > 4.00:
            # monitor temperatures and adjust voltage if needed
            if float(gt.gettemp(logfile,
                                'He4 IC Pump')) > 42.50 and he4v > 2.50:
                he4v -= 0.05
                sc.He4p.set_voltage(he4v)
            elif float(gt.gettemp(logfile,
                                  'He4 IC Pump')) < 40.00 and he4v < 3.50:
                he4v += 0.05
                sc.He4p.set_voltage(he4v)

            if float(gt.gettemp(logfile,
                                'He3 IC Pump')) > 46.00 and he3icv > 2.50:
                he3icv -= 0.05
                sc.He3ICp.set_voltage(he3icv)
            elif float(gt.gettemp(logfile,
                                  'He3 IC Pump')) < 44.00 and he3icv < 4.00:
                he3icv += 0.05
                sc.He3ICp.set_voltage(he3icv)

            if float(gt.gettemp(logfile,
                                'He3 UC Pump')) > 46.00 and he3ucv > 4.00:
                he3ucv -= 0.05
                sc.He3UCp.set_voltage(he3ucv)
            elif float(gt.gettemp(logfile,
                                  'He3 UC Pump')) < 44.00 and he3ucv < 5.00:
                he3icv = +0.05
                sc.He3UCp.set_voltage(he3ucv)

            print datetime.datetime.now()
            print "He4p: %s\r\nHe3ICp: %s\r\nHe3UCp: %s\r\n" % (he4v, he3icv,
                                                                he3ucv)
            time.sleep(60 * 60)

        while float(gt.gettemp(logfile, 'IC Head')) > 4.00:
            if float(gt.gettemp(logfile,
                                'He4 IC Pump')) > 42.50 and he4v > 2.50:
                he4v -= 0.05
                sc.He4p.set_voltage(he4v)
            elif float(gt.gettemp(logfile,
                                  'He4 IC Pump')) < 40.00 and he4v < 3.50:
                he4v += 0.05
                sc.He4p.set_voltage(he4v)

            if float(gt.gettemp(logfile,
                                'He3 IC Pump')) > 46.00 and he3icv > 2.50:
                he3icv -= 0.05
                sc.He3ICp.set_voltage(he3icv)
            elif float(gt.gettemp(logfile,
                                  'He3 IC Pump')) < 44.00 and he3icv < 3.50:
                he3icv += 0.05
                sc.He3ICp.set_voltage(he3icv)

            if float(gt.gettemp(logfile,
                                'He3 UC Pump')) > 46.00 and he3ucv > 4.00:
                he3ucv -= 0.05
                sc.He3UCp.set_voltage(he3ucv)
            elif float(gt.gettemp(logfile,
                                  'He3 UC Pump')) < 44.00 and he3ucv < 5.00:
                he3icv = +0.05
                sc.He3UCp.set_voltage(he3ucv)

            print datetime.datetime.now()
            print "He4p: %s\r\nHe3ICp: %s\r\nHe3UCp: %s\r\n" % (he4v, he3icv,
                                                                he3ucv)
            time.sleep(60 * 60)

    except:
        # in case of crash, step the voltage down to zero after waiting for a fix
        print datetime.datetime.now()
        print "An error occurred!  Setting all pumps to nominally correct voltages for 12 hours."
        print "Will begin stepping down voltages after 12 hours of waiting."

        sc.He4p.set_voltage(3.00)
        sc.He3ICp.set_voltage(3.20)
        sc.He3UCp.set_voltage(4.60)
        errortime = 0
        while errortime < (12 * 60 * 60):
            time.sleep(60 * 60)
            errortime += 1
            print "INTERVENTION NEEDED! Waited %s of 12 hours so far." % (
                errortime)

        print datetime.datetime.now()
        print "Setting all pumps to 1.5 V for 3 hours."

        sc.He4p.set_voltage(1.50)
        sc.He3ICp.set_voltage(1.50)
        sc.He3UCp.set_voltage(1.50)
        errortime = 0
        while errortime < (3 * 60 * 60):
            time.sleep(60 * 60)
            errortime += 1
            print "INTERVENTION NEEDED! Waited %s of 3 hours so far." % (
                errortime)

        print "Setting all pumps to 0 V."

        sc.He4p.set_voltage(0.00)
        sc.He3ICp.set_voltage(0.00)
        sc.He3UCp.set_voltage(0.00)

        print "Voltages stepped down to zero and cycle stopped.  Please do something."
        print datetime.datetime.now()
        quit()

    # heat up the He4 pump to help with condensing
    print "Ramping He4 Pump up to 44 K."
    he4v = 5.00
    sc.He4p.set_voltage(he4v)
    while float(gt.gettemp(logfile, 'He4 IC Pump')) < 44.00:
        time.sleep(10 * 60)

    # sleeping at (semi-)stable temperature to allow for condensing
    print "Waiting 1 hour for He-4 to condense."
    condense_time = 0
    while condense_time < 60:
        time.sleep(10 * 60)
        if float(gt.gettemp(logfile, 'He4 IC Pump')) < 43.00 and he4v < 5.50:
            he4v += 0.10
            sc.He4p.set_voltage(he4v)
        else:
            pass
        condense_time += 10
        print "Time elapsed: %s minutes" % (condense_time)

    # turning off He4 pump and turning on switch
    print "Turning off the He4 Pump."
    sc.He4p.set_voltage(0.00)
    time.sleep(2)
    print "Turning on the He4 Switch to 4 V."
    sc.He4s.set_voltage(4.00)

    # heat the He3 pumps to help with condensing
    print "Ramping He3 IC Pump to 54 K and He3 UC Pump to 51 K."
    he3icv = 5.20
    sc.He3ICp.set_voltage(he3icv)
    he3ucv = 5.80
    sc.He3UCp.set_voltage(he3ucv)
    while (float(gt.gettemp(logfile, 'He3 UC Pump')) < 51.00
           and float(gt.gettemp(logfile, 'He3 IC Pump')) < 54.00):
        time.sleep(60 * 60)
    while (float(gt.gettemp(logfile, 'He3 UC Pump')) < 51.00
           or float(gt.gettemp(logfile, 'He3 IC Pump')) < 54.00):
        if float(gt.gettemp(logfile, 'He3 UC Pump')) > 52.00:
            he3ucv -= 0.20
            sc.He3UCp.set_voltage(he3ucv)
        if float(gt.gettemp(logfile, 'He3 IC Pump')) > 55.00:
            he3icv -= 0.20
            sc.He3ICp.set_voltage(he3icv)
        time.sleep(60 * 60)

    # wait for HEX to rise, turn off pumps, turn on switches
    finish_cycle(logfile)
Esempio n. 16
0
def autocycle(logfile, start=False):
	'''
	This is a function to run a fridge cycle.  Note that it takes 6+ hours to run.
	'''
	try:
		print "Turning off mezzanines."
		ds.set_mezzanine_power(False,1)
		ds.set_mezzanine_power(False,2)
		time.sleep(60)

		print "Mezzanines off, ready to go."

		sc.He4p.remote_set()
		sc.He3ICp.remote_set()
		sc.He3UCp.remote_set()

		print 'Setting the heater, switches, and pumps to 0.'

		zero_everything()

		print 'Waiting for switches to cool.'

		while float(gt.gettemp(logfile, 'He3 IC Switch'))>2.00:
			time.sleep(10)
		while float(gt.gettemp(logfile, 'He3 UC Switch'))>2.00:
			time.sleep(10)
		while float(gt.gettemp(logfile, 'He4 IC Switch'))>4.00:
			time.sleep(10)
		print 'Switches are cool, beginning heating.'

		print ''

		print 'Turning He4 pump to 12.00 V.'
		sc.He4p.set_voltage(12.00)

		print 'Turning inter pump to 9.60 V.'
		sc.He3ICp.set_voltage(9.60)

		print 'Turning ultra pump to 6.30 V.'
		sc.He3UCp.set_voltage(6.30)

		print ''

		print 'Waiting 30 minutes for pumps to heat.'
		t=0
		while t<1800:
			time.sleep(60)
			t=t+60
			minutes=str(t/60)
			print ('%s minutes elapsed so far.' % minutes)

		print 'Turning He4 pump to 9.50 V.'
		sc.He4p.set_voltage(9.50)

		print 'Turning IC pump to 5.10 V.'
		sc.He3ICp.set_voltage(5.10)

		print 'Turning UC pump to 5.30 V.'
		sc.He3UCp.set_voltage(5.30)

		print 'Waiting 20 minutes.'
		t=0
		while t<1200:
			time.sleep(60)
			t=t+60
			minutes=str(t/60)
			print ('%s minutes elapsed so far.' % minutes)

		print 'Turning He4 pump to 5.0 V.'
		sc.He4p.set_voltage(5.0)

		print 'Waiting for He4 pump temperature to reach 43 K.'
		while float(gt.gettemp(logfile, 'He4 IC Pump'))<43:
			time.sleep(10)

		print 'Turning He4 pump to 3.0 V.'
		sc.He4p.set_voltage(3.00)

		print 'Waiting 5 minutes.'
		time.sleep(300)

		print 'Setting He4 pump to 0.0 V.'
		sc.He4p.set_voltage(0.00)

		print 'Sleeping for 3 minutes.'
		time.sleep(180)

		print 'Setting He4 switch to 4.00 V.'
		sc.He4s.set_voltage(4.00)

		print 'Waiting for He3 IC Pump temperatures to change.'
		while float(gt.gettemp(logfile, 'He3 IC Pump'))<52:
			time.sleep(10)

		print 'Setting inter pump to 3.0 V.'
		sc.He3ICp.set_voltage(3.00)

		print 'Waiting for He3 UC Pump temperature to change.'
		while float(gt.gettemp(logfile, 'He3 UC Pump'))<52:
			time.sleep(10)

		print 'Setting ultra pump to 5.00 V.'
		sc.He3UCp.set_voltage(5.00)

		finish_cycle(logfile)

		if start==True:
			start_of_day()
		else:
			print 'Cycle is complete.'
			return

	except:
		print 'Crashed!'
		print datetime.datetime.now()
		zero_everything()
Esempio n. 17
0
def start_of_day(logfile, set_squid_feedback=False, set_gain=False):
	'''
	Starts things for you by heating the UC head (using PID and pump), initializing the board, tuning squids, and taking a rawdump.
	'''
	# set voltages to 0, let the switches cool
	print 'Setting the switches to zero to cool.'
	sc.He3ICp.remote_set()
	sc.He3UCp.remote_set()

	sc.He3ICp.set_voltage(0)
	sc.He3ICs.set_voltage(0)
	sc.He3UCp.set_voltage(0)
	sc.He3UCs.set_voltage(0)

	gt.gettemp(logfile, 'He3 IC Switch'); gt.gettemp(logfile, 'He3 UC Switch')
	while float(gt.gettemp(logfile, 'He3 UC Switch'))>1:
		while float(gt.gettemp(logfile, 'He3 IC Switch'))>1:
			gt.gettemp(logfile, 'He3 UC Switch'); gt.gettemp(logfile, 'He3 IC Switch')
			time.sleep(10)

	# set UC pump voltage and start the heater to get above Tc
	print 'Setting ultra pump to 3.00 V.'
	sc.He3UCp.set_voltage(3.00)
	time.sleep(60)
	print 'Setting the heater to 500 mK at 1.5 mW.'
	sc.ChaseLS.set_PID_temp(1,0.500)
	time.sleep(1)
	sc.ChaseLS.set_heater_range(2)
	time.sleep(1)
	gt.gettemp(logfile, 'UC Head')
	while float(gt.gettemp(logfile, 'UC Head'))<0.500:
		time.sleep(20)
		gt.gettemp(logfile, 'UC Head')
	time.sleep(1)
	print 'Setting the heater to 650 mK at 15 mW.'
	sc.ChaseLS.set_PID_temp(1, 0.650)
	time.sleep(1)
	sc.ChaseLS.set_heater_range(3)
	time.sleep(1)

	print 'Setting the ultra pump to 1.50 V'
	sc.He3UCp.set_voltage(1.00)
	while float(gt.gettemp(logfile, 'UC Head'))<0.650:
		time.sleep(20)
		gt.gettemp(logfile, 'UC Head')

	sc.He3UCp.set_voltage(1.50)
	print 'Waiting...'
	time.sleep(300)

	# initialize the board
	print 'Initializing the board.'
	try:
		ds.initialize_iceboard(use_test_IRIG=True)
		sqcbs.initialize_squidcontroller()
		time.sleep(5)
		ds.set_fir_stage(6)
		ds.align_sampling()
	except URLError:
		print 'Could not initialize because the power is not on!  Waiting...'
		initboard = raw_input("Type 'done' when the power is set to 17 V.    ")
		if initboard == 'done':
			ds.initialize_iceboard(use_test_IRIG=True)
			sqcbs.initialize_squidcontroller()
			time.sleep(5)
			ds.set_fir_stage(6)
			ds.align_sampling()

	# zero combs
	ds.clear_all()
	ds.clear_dan()

	# heat the squids
	print 'Heating SQUIDs.'
	sqcbs.heat_squids(heat_time_sec=15,heat_voltage=4.0,wait_time_sec=1200)

	# tune the squids
	print 'Tuning SQUIDs.'
	sq_results=squids.tune_squid(squid_bias_reference=[1.6],squid_bias_start=0.8,flux_start=0,flux_stop=2.0,minap2p=0.05)

	# squid feedback (optional)
	if set_squid_feedback:
		print 'Setting SQUID feedback.'
		for squid in squids.all():
			squid.module.set_squid_feedback('SQUID_LOWPASS')

	# set gain (optional)
	if set_gain:
		print 'Setting gain.'
		rm.set_mezzanine_gain(15,'CARRIER')
		rm.set_mezzanine_gain(15,'NULLER')

	# take a rawdump
	print 'Taking a rawdump.'
	results=rm.take_rawdump(num_samples=50000)

	print 'Startup is complete.  Start whatever you want to do today!'
def start_of_day(logfile,
                 heating_type,
                 set_squid_feedback=False,
                 set_gain=False):
    '''
    Starts things for you by heating the UC Stage, initializing the board, tuning squids, and taking a rawdump.
    '''
    # set voltages to 0, let the switches cool
    print('Setting the switches to zero to cool.')
    sc.He3ICp.remote_set()
    sc.He3UCp.remote_set()

    sc.He3ICp.set_voltage(0)
    sc.He3ICs.set_voltage(0)
    sc.He3UCp.set_voltage(0)
    sc.He3UCs.set_voltage(0)

    while float(gt.gettemp(logfile, 'He3 UC Switch')) > 1:
        while float(gt.gettemp(logfile, 'He3 IC Switch')) > 1:
            gt.gettemp(logfile, 'He3 UC Switch')
            gt.gettemp(logfile, 'He3 IC Switch')
            time.sleep(10)
    if heating_type == 'PID':
        # set UC pump voltage and start the heater to get above Tc
        print('Setting ultra pump to 3.00 V.')
        sc.He3UCp.set_voltage(3.00)
        time.sleep(60)
        print('Setting the heater to 500 mK at 1.5 mW.')
        sc.ChaseLS.set_PID_temp(1, 0.500)
        time.sleep(1)
        sc.ChaseLS.set_heater_range(2)
        time.sleep(1)
        gt.gettemp(logfile, 'UC Head')
        while float(gt.gettemp(logfile, 'UC Head')) < 0.500:
            time.sleep(20)
            gt.gettemp(logfile, 'UC Head')
        time.sleep(1)
        print('Setting the heater to 650 mK at 15 mW.')
        sc.ChaseLS.set_PID_temp(1, 0.650)
        time.sleep(1)
        sc.ChaseLS.set_heater_range(3)
        time.sleep(1)

        print('Setting the ultra pump to 1.50 V')
        sc.He3UCp.set_voltage(1.00)
        while float(gt.gettemp(logfile, 'UC Head')) < 0.650:
            time.sleep(20)
            gt.gettemp(logfile, 'UC Head')

        sc.He3UCp.set_voltage(1.50)
        print('Waiting...')
        time.sleep(300)

    elif heating_type == 'pumps':
        print('Setting the He3 UC pump to 3.00 V')
        sc.He3UCp.set_voltage(3.00)
        print('Setting the He3 IC pump to 3.00 V')
        sc.He3ICp.set_voltage(3.00)

        print('Waiting for IC Head temperature to rise')
        while float(gt.gettemp(logfile, 'IC Head')) < 0.650:
            time.sleep(20)
        print('Setting He3 IC pump to 0.50 V')
        sc.He3ICp.set_voltage(0.50)

        print('Waiting for UC Head temperature to rise')
        while float(gt.gettemp(logfile, 'UC Head')) < 0.650:
            time.sleep(20)
        print('Setting He3 UC pump to 1.80 V')
        sc.He3UCp.set_voltage(1.80)

        print('Waiting 5 minutes...')
        time.sleep(300)

    # initialize the board
    print('Initializing the board.')
    try:
        nts.run_initialize()
    except URLError:
        print('Could not initialize because the power is not on!  Waiting...')
        initboard = input("Type 'done' when the power is set to 17 V.    ")
        if initboard == 'done':
            nts.run_initialize()

    # zero combs
    print('Zeroing combs')
    nts.run_do_zero_combs()

    # heat the squids
    print('Heating SQUIDs.')
    nts.run_heat_squids()

    # tune the squids
    print('Tuning SQUIDs.')
    nts.run_tune_squids()

    # squid feedback (optional)
    if set_squid_feedback:
        print('Setting SQUID feedback.')
        nts.run_enable_feedback()

    # set gain (optional)
    if set_gain:
        print('Setting gain.')
        nts.run_set_gain()

    # take a rawdump
    print('Taking a rawdump.')
    nts.run_take_rawdump()

    print('Startup is complete!')
Esempio n. 19
0
sc.He3ICp.set_voltage(0)
sc.He3ICs.set_voltage(0)
sc.He3UCp.set_voltage(0)
sc.He3UCs.set_voltage(0)

for jtemp in range(len(setpoints)):
    print setpoints[jtemp]
    print('Setting UC head to %f mK.' % (setpoints[jtemp]*1e3))

    sc.ChaseLS.set_PID_temp(1, setpoints[jtemp])
    time.sleep(1)
    sc.ChaseLS.set_heater_range(2)
    time.sleep(1)
    sc.He3UCs.set_voltage(3.00)
    sc.He3ICs.set_voltage(4.00)
    while float(gt.gettemp(logfile, 'UC Head'))>(setpoints[jtemp]+0.05):
	time.sleep(60)
    sc.He3UCs.set_voltage(0.00)
    sc.He3ICs.set_voltage(0.00)
    time.sleep(5*60)

    # wait until the wafer holder temperature is stable up to 1mK;
    # give up after waiting 15 minutes
    recenttemps = [-4, -3, -2, -1]
    nAttempts = 0
    while np.abs(recenttemps[-1] - recenttemps[-4]) > 0.001 and nAttempts < 45:
        time.sleep(20)
        recenttemps.append(int(float(gt.gettemp(logfile, 'UC Head')*1e3)))
        nAttempts += 1
        print('{:%Y-%m-%d %H:%M:%S}'.format(datetime.datetime.now()))
        print('Wafer holder drifted %f mK.' % 1e3*np.abs(recenttemps[-1] - recenttemps[-4]))
def get_temp(logfile,therm):
    return float(gt.gettemp(logfile,therm))
def autocycle_short(logfile=''):
    '''
    This is a function to run a fridge cycle.  It runs in about 5 hours,
    and gives a fridge hold time of about 50 hours with no stage heating or 
    other extra loads.
    
    logfile = path to temperature logging file where the function can look up current fridge temps
    target_temp is the temperature in K the IC and UC pumps hit before moving on to the He4 pump
    condense_time is the time in seconds after the He4 pump is up to temperature and before hitting the He4 switch
    This script is based on autocycle.py, but was significantly edited by AEL in late 2018 
    to provide a shorter cycle time at the expense of hold time. It still holds for a couple 
    days under normal loading
    '''
    target_temp = 35
    condense_time = 70

    try:
        sc.He4p.remote_set()
        sc.He3ICp.remote_set()
        sc.He3UCp.remote_set()

        print('Setting the heater, switches, and pumps to 0. ' +
              str(datetime.datetime.now()))
        zero_everything()

        print('Waiting for switches to cool.')
        while float(gt.gettemp(logfile, 'He3 IC Switch')) > 5.00:
            time.sleep(10)
        while float(gt.gettemp(logfile, 'He3 UC Switch')) > 5.00:
            time.sleep(10)
        while float(gt.gettemp(logfile, 'He4 IC Switch')) > 5.00:
            time.sleep(10)
        print('Switches are cool, begin pump heating. ' +
              str(datetime.datetime.now()))

        #start pre-warming IC and UC pumps
        print('Turning inter pump to 10 V.')
        sc.He3ICp.set_voltage(10.0)
        print('Turning ultra pump to 7.50 V.')
        sc.He3UCp.set_voltage(7.50)
        time.sleep(2)
        #watch IC and UC pump temps, when one reaches 35K, turn down the voltage
        print('Waiting for IC and UC pumps to reach 35 K')

        print(gt.gettemp(logfile, 'He3 UC Pump'))
        while float(gt.gettemp(logfile, 'He3 UC Pump')) < target_temp or float(
                gt.gettemp(logfile, 'He3 IC Pump')
        ) < target_temp:  #if either IC or UC is still below target_temp
            if float(
                    gt.gettemp(logfile, 'He3 UC Pump')
            ) > target_temp and float(
                    sc.He3UCp.read_voltage()
            ) > 6.11:  #if UC over target_temp and the pump voltage is still high
                print('Turning UC pump to 6.10 V.')
                sc.He3UCp.set_voltage(6.10)
                time.sleep(3)
            if float(
                    gt.gettemp(logfile, 'He3 IC Pump')
            ) > target_temp and float(sc.He3ICp.read_voltage(
            )) > 5.51:  #if IC over target_temp and pump voltage is still high
                print('Turning IC pump to 5.50 V.')
                sc.He3ICp.set_voltage(5.50)
                time.sleep(3)
            time.sleep(20)

        #make sure both UC and IC pumps got turned down
        print('Turning IC pump to 5.20 V.')
        sc.He3ICp.set_voltage(5.20)
        time.sleep(3)
        print('Turning UC pump to 6.10 V. ' + str(datetime.datetime.now()))
        sc.He3UCp.set_voltage(6.10)

        time.sleep(3)

        #Start heating He4 pump
        print('Turning He4 pump to 12.0 V.')
        sc.He4p.set_voltage(12.0)
        time.sleep(1)
        #wait for He4 to hit 37.  If IC or UC hit 52 while waiting, turn them down
        print(
            'Waiting for He4 pump temperature to reach 37 K. Monitoring IC and UC pumps'
        )
        while float(gt.gettemp(logfile, 'He4 IC Pump')) < 37:  #43   38
            if float(gt.gettemp(logfile, 'He3 UC Pump')) > 52 and float(
                    sc.He3UCp.read_voltage()
            ) > 6.0:  #if UC over temp and the pump voltage is still high
                print('Turning UC pump to 5.2 V.')
                sc.He3UCp.set_voltage(5.2)
                time.sleep(3)
            if float(gt.gettemp(logfile, 'He3 IC Pump')) > 52 and float(
                    sc.He3ICp.read_voltage(
                    )) > 5.1:  #if IC over temp and pump voltage is still high
                print('Turning IC pump to 4 V.')
                sc.He3ICp.set_voltage(4.0)
                time.sleep(3)
            time.sleep(10)
        time.sleep(1)
        #turn off He4 pump in two steps
        print('Turning He4 pump to 3.0 V. ' + str(datetime.datetime.now()))
        sc.He4p.set_voltage(3.00)
        time.sleep(10)  #300 #180
        print('Setting He4 pump to 0.0 V.')
        sc.He4p.set_voltage(0.00)

        #condense He4 for a short time and then hit the He4 switch
        #this condense time is the domanint parameter in setting the
        #cycle time and the hold time
        print('Sleeping for ' + str(condense_time) + ' seconds.')
        time.sleep(condense_time)  #70 #100 #80
        print('Setting He4 switch to 4.00 V.')
        sc.He4s.set_voltage(4.00)
        time.sleep(2)

        #turn IC and UC pumps back up incase temps are sagging
        print('turning IC and UC pumps back up')
        sc.He3ICp.set_voltage(5.2)
        time.sleep(2)
        sc.He3UCp.set_voltage(6.1)
        time.sleep(2)

        #wait for the IC to slowly work its way up to 52 and then turn down to equilibrium voltage
        #watch IC and UC pump temps, when one reaches 52K, turn down the voltage
        target_temp = 52
        ICtargetReached = False
        UCtargetReached = False
        print('Waiting for IC and UC pumps to reach 52 K')
        while ICtargetReached == False or UCtargetReached == False:  #if either IC or UC hasn't yet hit target_temp
            if float(gt.gettemp(
                    logfile,
                    'He3 UC Pump')) > target_temp:  #if UC over target_temp
                UCtargetReached = True
                if float(sc.He3UCp.read_voltage()
                         ) > 5.2:  #if the pump is still high
                    print('Turning UC pump to 5.1 V. ' +
                          str(datetime.datetime.now()))
                    sc.He3UCp.set_voltage(5.1)
                    time.sleep(3)
            if float(gt.gettemp(
                    logfile,
                    'He3 IC Pump')) > target_temp:  #if IC over target_temp
                ICtargetReached = True
                if float(sc.He3ICp.read_voltage()
                         ) > 3.1:  #if the pump is still high
                    print('Turning IC pump to 3 V. ' +
                          str(datetime.datetime.now()))
                    sc.He3ICp.set_voltage(3.0)
                    time.sleep(3)
            time.sleep(20)

        #make sure both UC and IC pumps got turned down
        print('Turning IC pump to 3 V.')
        sc.He3ICp.set_voltage(3.0)
        time.sleep(2)
        print('Turning UC pump to 5.1 V.')
        sc.He3UCp.set_voltage(5.1)
        time.sleep(2)

        #Make sure the He4 pump has dropped before moving to the HEX watcher
        #this ensures you don't move on when the HEX hasn't yet dropped below 1K
        print('Waiting for the He4 Pump to cool below 4 K ' +
              str(datetime.datetime.now()))
        while float(gt.gettemp(logfile, 'He4 IC Pump')) > 4:
            time.sleep(30)

        #waits for the HEX to go above 1 K and then does final UC switch throw
        finish_cycle(logfile)

        print('Cycle is complete. ' + str(datetime.datetime.now()))
        return

    except:
        print('Crashed!')
        print(datetime.datetime.now())
        print('Zeroing everything for safety.')
        zero_everything()