-
Notifications
You must be signed in to change notification settings - Fork 0
/
biascooling.py
110 lines (83 loc) · 3.06 KB
/
biascooling.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 19 11:08:03 2012
Program for Bias Cooling
This program will apply a large voltage to the sample gates while cooling.
Ideally, this depletes the sample meaning no unwanted charging occurs.
It will also record the temperature and conductance data.
Changelog:
- Created 7/19/2012
-
@author: Brraaaam
"""
import time
import matplotlib
import SRS830
import DAC488
import lakeshore332
import winsound
# Program Parameters
rampTime = 10.0 # (minutes)
maxBias = -2.5
steps = int(rampTime*60)
biasVoltage = -0.0
stepTime = float(rampTime*60/steps)
stepVoltage = float(maxBias/steps)
timeout = 120.0 #(minutes)
timeout #(seconds)
# Initialize the devices
lockin = SRS830.device('GPIB1::8')
bias = DAC488.device('GPIB1::10')
temp = lakeshore332.device('GPIB1::12')
bias.set_range(1,3)
t_start = time.time()
out_file = open ('test.dat', 'w')
# First we need to slowly rampt to our bias voltage
print "Ramping up the Bias Voltage"
out_file.write("Sample: VA150InSn2\n Measuring with 0.05V/500k (100nA)\n")
out_file.write("Ramping up the Bias Voltage\n")
print("...")
print("...")
print("Temp(K) \t Time(s) \t Bias(V) \t X-Value(V)")
out_file.write("Temp(K) \t Time(s) \t Bias(V) \t X-Value(V) \n")
for i in range(steps+1):
bias.set_voltage(1,biasVoltage)
time.sleep(stepTime)
currTemp = float(temp.read('b'))
xValue = lockin.read_input(1)
currTime = (time.time()-t_start)/60
print "%f \t %f \t %f \t %r" % (currTemp, currTime, biasVoltage, xValue)
out_file.write("%f \t %f \t %f \t %r \n" % (currTemp, currTime, biasVoltage, xValue))
biasVoltage = biasVoltage + stepVoltage
print("Finished Ramping")
Freq = 2500 # Set Frequency To 2500 Hertz
Dur = 300 # Set Duration To 1000 ms == 1 second
winsound.Beep(Freq,Dur)
print("Begin Cooling Sample")
out_file.write("\n---------------------------------------------------- \n")
out_file.write("Temp(K) \t Time(s) \t Bias(V) \t X-Value(V) \n")
out_file.write("Cooling at Bias Voltage %f from Temperature %f \n" % (biasVoltage,currTemp))
time.sleep(30)
while(currTemp>2 and currTime<timeout):
currTemp = float(temp.read('b'))
xValue = lockin.read_input(1)
currTime = (time.time()-t_start)/60
print "%f \t %f \t %f \t %r" % (currTemp, currTime, biasVoltage, xValue)
out_file.write("%f \t %f \t %f \t %r \n" % (currTemp, currTime, biasVoltage, xValue))
print("Cooldown Finished!")
print("...")
print("Ramping Voltage back to zero")
winsound.Beep(Freq,Dur)
out_file.write("\n---------------------------------------------------- \n")
out_file.write("Temp(K) \t Time(s) \t Bias(V) \t X-Value(V) \n")
for i in range(steps+1):
bias.set_voltage(1,biasVoltage)
time.sleep(stepTime)
currTemp = float(temp.read('b'))
xValue = lockin.read_input(1)
currTime = (time.time()-t_start)/60
print "%f \t %f \t %f \t %r" % (currTemp, currTime, biasVoltage, xValue)
out_file.write("%f \t %f \t %f \t %r \n" % (currTemp, currTime, biasVoltage, xValue))
biasVoltage = biasVoltage - stepVoltage
print("Finished Ramping")
winsound.Beep(Freq,Dur)