-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSC_gap_Moose.pl
More file actions
451 lines (359 loc) · 10.4 KB
/
SC_gap_Moose.pl
File metadata and controls
451 lines (359 loc) · 10.4 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
use v5.20;
use warnings;
use strict;
use Lab::Moose;
use Carp;
use Lab::Moose::Connection::VISA_GPIB;
# measure the time
use Time::HiRes qw/time/;
#--------preample---------
my $start_time = time();
#my $vorwiderstand = 100000;
my $ithaco_sens=1E-5; #die sensitivity am Ithaco
my $femto_DC=1000; #femtos
my $femto_AC=1000;
# my $preamp_ref_ac=10;
#---------device-init----------
# my $YOKO_SD = instrument(
# type => 'Yokogawa7651',
# connection_type => 'VISA_GPIB',
# connection_options => {
# pad => 7,
# },
# max_units_per_second => 0.05,
# max_units_per_step => 0.005,
# min_units => -1,
# max_units => 1
# );
my $YOKO_GATE = instrument(
type => 'Yokogawa7651',
connection_type => 'VISA_GPIB',
connection_options => {
pad => 5,
},
max_units_per_second => 0.05,
max_units_per_step => 0.005,
min_units => -3,
max_units => 7
);
# my $Multimeter_I = instrument( # misst Strom nach dem ithaco
# type => 'Agilent34410A',
# connection_type => 'VISA_GPIB',
# connection_options => {
# pad => 18
# }
# );
# $Multimeter_I->sense_nplc(value => 2); # integrationszeit 10x netzfrequenz
my $LOCKIN_AC = instrument( # misst strom
type => 'SignalRecovery7265',
connection_type => 'VISA_GPIB',
connection_options => {
pad => 15
}
);
# my $Multimeter_Sample_xx = instrument( # misst U_DC_4pt
# type => 'Agilent34420A',
# connection_type => 'VISA_GPIB',
# connection_options => {
# pad => 16
# }
# );
# $Multimeter_I->sense_nplc(value => 10); # integrationszeit 10x netzfrequenz
# my $LOCKIN_REF = instrument( # misst strom
# type => 'SignalRecovery7265',
# connection_type => 'VISA_GPIB',
# connection_options => {
# pad => 15
# }
# );
my $LOCKIN_SAMPLE_l = instrument(
type => 'SignalRecovery7265',
connection_type => 'VISA_GPIB',
connection_options => {
pad => 10
} #misst U_AC_4pt_l (4-punkt spannung links)
);
my $LOCKIN_SAMPLE_r = instrument(
type => 'SignalRecovery7265',
connection_type => 'VISA_GPIB',
connection_options => {
pad => 14
} #misst U_AC_4pt_r (4-punkt spannung rechts)
);
# KRYO1STEUERUNG -------------------------------------------------------
my $isobus = Lab::Moose::Connection::VISA_GPIB->new(pad => 24);
my $IPS = instrument(
type => 'OI_Mercury::Magnet',
connection_type => 'Socket',
connection_options => {
host => 'ip',
},
magnet => 'Z', # X, Y or Z. Z is default.
);
# The iPS continues the last sweep, if it is not on hold
# when this script starts the measurement.
$IPS->oim_set_activity(value => 'HOLD');
my $ITC = instrument(
type => 'OI_ITC503',
connection_type => 'IsoBus',
connection_options => {
base_connection => $isobus,
isobus_address => 0
}
);
# Für die Temperaturanzeige
my $LAKE = instrument(
type => 'Lakeshore340',
connection_type => 'VISA_GPIB',
connection_options => {
pad => 12
}
);
#----------------------------------------------------------
# my $sweep_dc = sweep(
# type => 'Step::Voltage',
# instrument => $YOKO_SD,
# interval => 2,
# points => [1, 0.5], #-0.3, 0.3
# steps => [0.05],
# rate => [0.005], #0.005, 0.0004 in V/s
# delay_before_loop => 10,
# backsweep => 2, #nur in eine richtung backsweep 0;
# );
my $gate_sweep = sweep(
type => 'Step::Voltage',
instrument => $YOKO_GATE,
delay_before_loop => 5,
backsweep => 0,
# step
# points => [0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0],
# steps => [1],
list => [0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0],
# continuous
# interval => 2,
# rates => [0.04]
);
my $magnet_sweep = sweep(
type => 'Continuous::Magnet',
instrument => $IPS,
delay_before_loop => 5,
backsweep => 1,
points => [-1, 1], #1 flussquant pro Antidot bei 0.005754T
# # step
# steps => [0.0015],
# continuous
intervals => [3],
rates => [0.1] #0.05
);
my $temp_sweep = sweep(
type => 'Step::Temperature',
instrument => $ITC,
sensor => $LAKE,
points => [7.5,2.5], #gap bei ??
steps => [0.5],
observation_time => 5*60,
tolerance_setpoint => 0.050, #gilt fürs ITC
tolerance_std_dev => 0.025, #gilt fürs ITC
sensor_std_dev => 0.05, #gilt fürs lakeshore
);
#-------------------------------------------------------
my $file = sweep_datafile(
filename => 'I_V_trace.dat',
columns => [qw/
TIME
T_VTI
T_SAMPLE
B
U_gate
U_AC
U_AC_CURRENT
U_AC_4PT_l
U_AC_4PT_r
I_AC
dR_l
dR_r
/]
# columns => [qw/ TIME T_VTI T_SAMPLE B U_gate U_AC U_AC_CURRENT U_AC_4PT_l U_AC_4PT_r I_AC dR_l dR_r HE U_DC U_CURRENT I U_DC_4PT_xx R_SAMPLE_xx /]
);
#-------------------------magnetic field plots------------------------
$file->add_plot(
x => 'B',
y => 'dR_l',
plot_options => {
title => 'dR_l vs B',
# type => 'point',
grid => 'xtics ytics',
format => {x => "'%1.3f'", y => "'%1.2f'"},
},
hard_copy => 'dR_l-vs-B.png'
);
$file->add_plot(
x => 'B',
y => 'dR_r',
plot_options => {
title => 'dR_r vs B',
# type => 'point',
grid => 'xtics ytics',
format => {x => "'%1.3f'", y => "'%1.2f'"},
},
hard_copy => 'dR_r-vs-B.png'
);
#---------------------------------current I plots -----------------------------------
# my $plot = {
# #'autosave' => 'last', # last, allways, never
# 'title' => 'R_SAMPLE_xy vs I',
# 'type' => 'point', #'lines', #'linetrace', #point
# 'x-axis' => 'I',
# 'x-format' => '%1.2e',
# #'x-min' => -1,
# #'x-max' => 1,
# 'y-axis' => 'R_SAMPLE_xy',
# 'y-format' => '%1.2f',
# #'y-min' => -1,
# #'y-max' => 1,
# 'grid' => 'xtics ytics',
# };
# $file->add_plot($plot);
# my $plot2 = {
# #'autosave' => 'last', # last, allways, never
# 'title' => 'dR_xy vs I',
# 'type' => 'point', #'lines', #'linetrace', #point
# 'x-axis' => 'I',
# #'x-min' => -1,
# #'x-max' => 1,
# 'y-axis' => 'dR_xy',
# 'y-format' => '%1.2e',
# #'y-min' => -1,
# #'y-max' => 1,
# # 'cb-axis' => 'U_DC_4PT',
# 'grid' => 'xtics ytics',
# };
# $file->add_plot($plot2);
# my $plot3 = {
# #'autosave' => 'last', # last, allways, never
# 'title' => 'R_SAMPLE_xx vs I',
# 'type' => 'point', #'lines', #'linetrace', #point
# 'x-axis' => 'I',
# 'x-format' => '%1.2e',
# #'x-min' => -1,
# #'x-max' => 1,
# 'y-axis' => 'R_SAMPLE_xx',
# 'y-format' => '%1.2f',
# #'y-min' => -1,
# #'y-max' => 1,
# 'grid' => 'xtics ytics',
# };
# $file->add_plot($plot3);
# my $plot4 = {
# #'autosave' => 'last', # last, allways, never
# 'title' => 'dR_xx vs I',
# 'type' => 'point', #'lines', #'linetrace', #point
# 'x-axis' => 'I',
# #'x-min' => -1,
# #'x-max' => 1,
# 'y-axis' => 'dR_xx',
# 'y-format' => '%1.2e',
# #'y-min' => -1,
# #'y-max' => 1,
# # 'cb-axis' => 'U_DC_4PT',
# 'grid' => 'xtics ytics',
# };
# $file->add_plot($plot4);
#-----------------------------------------------------
$file->add_plot(
x => 'TIME',
y => 'T_SAMPLE',
plot_options => {
title => 'T_SAMPLE vs TIME',
},
hard_copy => 'T_SAMPLE-vs-TIME.png'
);
# $file->add_plot(
# x => 'TIME',
# y => 'HE',
# plot_options => {
# title => 'HE vs TIME',
# },
# hard_copy => 'HE-vs-TIME.png'
# );
#-------------------------------------------------------------
my $measurement = sub {
my $sweep = shift;
my $time = time()-$start_time;
# Gets the current helium level
# The UID of the sensor can be obtained by running
# $IPS->get_catalogue()
# and has the form DEV:<UID>:L1:LVL
my $he_level = $IPS->get_he_level(channel => 'UID');
my $U_gate = $YOKO_GATE->get_level(); #topgate voltage
my $t_sample = $LAKE->get_value(channel =>'A');
my $t_vti = $ITC->get_value();
my $b =$IPS->oim_get_field();
# my $u_DC = $YOKO_SD->get_level(); # U I R R
# my $U_DC_current = $Multimeter_I->get_value();
# my $U_DC_4pt_xx = $Multimeter_Sample_xx->get_value(1);
# my $U_DC_4pt_xx = $U_DC_4pt_xx / $femto_DC;
# my $I_DC=$U_DC_current * $ithaco_sens;
# my $r_sample_xx = ($I_DC != 0) ? ($U_DC_4pt_xx / $I_DC) : '?';
my $u_AC = $LOCKIN_AC->cached_source_level();
my $u_AC_CURRENT = $LOCKIN_AC->get_value(channel => 'X');
# my $u_AC_ref = $u_AC_ref_1 / $preamp_ref_ac;
my $U_AC_4pt_l = $LOCKIN_SAMPLE_l->get_value(channel => 'X');
$U_AC_4pt_l = $U_AC_4pt_l / $femto_AC;
my $U_AC_4pt_r = $LOCKIN_SAMPLE_r->get_value(channel => 'X');
$U_AC_4pt_r = $U_AC_4pt_r / $femto_AC;
my $i_AC = $u_AC_CURRENT*$ithaco_sens;
my $dR_l = ($i_AC != 0) ? ($U_AC_4pt_l / $i_AC) : '?';
my $dR_r = ($i_AC != 0) ? ($U_AC_4pt_r / $i_AC) : '?';
$sweep->log(
TIME => $time,
T_VTI => $t_vti,
T_SAMPLE => $t_sample,
# HE => $he_level,
B => $b,
U_gate => $U_gate,
# U_DC => $u_DC,
# U_CURRENT => $U_DC_current,
# U_DC_4PT_xx=> $U_DC_4pt_xx,
# I => $I_DC,
# R_SAMPLE_xx => $r_sample_xx,
U_AC => $u_AC,
U_AC_CURRENT => $u_AC_CURRENT,
U_AC_4PT_l => $U_AC_4pt_l,
U_AC_4PT_r => $U_AC_4pt_r,
I_AC => $i_AC,
dR_l => $dR_l,
dR_r => $dR_r,
);
};
# This part should be obsolete, since the iPS handles
# the level control automatically
#-------- 5. Helium level control -------
# my $check_helium = sub {
# my $he_level = $IPS->get_he_level(channel => 'UID');
# print "\n\n\nHelium check: Level = $he_level ... ";
# if ($he_level <= 8) {
# print "\n\nLow Helium Level! Sweep to zero and enable persistent mode \n";
# $IPS->sweep_to_level(0);
# print "Pause... Press Enter to proceed\n";
# ReadMode('normal');
# <>;
# ReadMode('cbreak');
# }
# else {
# print "OK \n\n\n";
# }
# };
#-----------------------------------------------------------------------------
$temp_sweep->start(
slave => $magnet_sweep,
measurement => $measurement,
datafile => $file
);
# $YOKO_SD->config_sweep(0, 0.01);
# $YOKO_SD->trg();
# $YOKO_SD->wait();
# $ITC->set_T(60);
# $IPS->config_sweep(0.000, 0.100); # T/min
# $IPS->trg();
# $IPS->wait();