-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcomplex_functions.py
1376 lines (981 loc) · 49.9 KB
/
complex_functions.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
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
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import time
from primitive_functions import *
#####################################################################
#general user functions
def set_option (parameter, menu, parameter_value):
move_cursor(parameter + " " + menu)
click (menu)
type_text (parameter_value)
type_text ('Enter')
def open_valve (valve, direction):
rotate(valve, "maximum possible turns", direction)
update_database(valve + ",State,OPEN")
def close_valve (valve, direction):
goto(valve)
rotate(valve, "maximum possible turns", direction)
update_database(valve + ",State,CLOSED")
def open_slightly (valve, direction):
rotate(valve, "minimum no of turns", direction)
update_database(valve + ",State,OPEN")
def move(obj, position):
'''Move obj to position'''
goto(obj)
hold(obj)
goto(position)
def remove(obj1, obj2):
'''Removes/separates obj1 from obj2'''
read_state ('Lab_Space,Sample_Table')
goto(obj2 + "." + obj1)
hold(obj2 + "." + obj1)
hold(obj2)
move(obj1, " away from " + obj2)
def hold_sample(Sample, Sample_Box):
'''Correctly hold a sample using tweezers'''
goto('Tweezers')
hold('Tweezers')
goto(Sample + ".Home_Coordinates")
hold(Sample + ".Terminal_1")
goto("Sample_Mounting_Coordinates")
update_database ("Lab_Space,Sample_Table,Sample_Boxes," + Sample_Box + "," + Sample + ",State,IN_USE")
def close_lid(obj):
'''close lid of object'''
move(obj + ".lid", obj)
update_database ("Lab_Space,Sample_Table,Sample_Boxes,Box_Zener,State,CLOSED")
def take_photo(obj):
'''Capture photograph of obj'''
move ("Camera", "camera_focal_length distance from " + obj)
face ("Camera", obj)
click("Capture Button")
#####################################################################
#runtime database checking functions
def wait(obj, condition):
check(obj, condition)
response = raw_input ("Is the " + obj + " " + condition + "? : y/n\n")
while ((response != 'y') and (response != 'n')):
response = raw_input ("Is the " + obj + " " + condition + "? : y/n\n")
if (response == 'n'):
write("\n########### WAITING ###########\n")
write("Waiting for " + obj + "->" + condition)
raw_input ("Press enter when the wait is complete")
write("\n######### WAIT COMPETE ########\n")
def ensure(key, value):
print ("Test : " + key + " --> " + value + "\n")
print ("Checking...........................\n")
if check_database (key, value):
write(key + " is " + value + " : Check Passed\n")
else:
throw_exception (key + " is not " + value + " : Check Failed\n")
###############################################################################
def rapid_movement():
write("***********Next few steps have to be performed rapidly********************")
def end_rapid_movement():
write("***********Rapid Movement period is over, steps can be performed at normal speed****************")
###############################################################################
#soldering iron related functions
def set_up_soldering_iron():
'''Set up soldering space and iron for use'''
goto('Soldering_Iron')
wait("Soldering_Iron", "Free")
leave("test_object")
switch_on("Soldering_Iron")
update_database ("Lab_Space,Sample_Table,Soldering,Soldering_Iron,Power,ON")
wait("soldering iron LED", "blinking.")
def solder (terminal_a, terminal_b):
'''Solder terminal_b onto terminal_b, given Sample from Sample_Box'''
update_database ("Lab_Space,Sample_Table,Soldering,Soldering_Iron,State,IN_USE")
move ("Soldering_Iron", "Flux.Home_Coordinates")
touch("Soldering_Iron.Tip", "Flux")
goto ("Solder_Wire.Tip")
touch("Soldering_Iron.Tip", "Solder_Wire.Tip")
goto("Juntion of " + terminal_a + " and " + terminal_b)
wait("soldering between " + terminal_a + " and " + terminal_b, "complete")
goto ('Cleaning_Pad.Home_Coordinates')
touch("Soldering_Iron.Tip", "Cleaning_Pad")
goto ('Soldering_Iron.Home_Coordinates')
leave('Soldering_Iron')
update_database ("Lab_Space,Sample_Table,Soldering,Soldering_Iron,State,NOT_IN_USE")
def desolder(terminal, Sample, Sample_Box):
'''Desolder terminal of Sample'''
update_database ("Lab_Space,Sample_Table,Soldering,Soldering_Iron,State,IN_USE")
move ("Soldering_Iron", "Flux.Home_Coordinates")
touch("Soldering_Iron.Tip", "Flux")
goto(Sample + "." + terminal)
wait("desoldering", "complete")
goto ("Cleaning_Pad.Home_Coordinates")
touch("Soldering_Iron.Tip", "Cleaning_Pad")
update_database ("Lab_Space,Sample_Table,Sample_Boxes," + Sample_Box + "," + Sample + ",Terminal_1,Soldered,NO")
update_database ("Lab_Space,PQMS,Insert_RT_Puck,Puck,Terminal_1,Soldered,NO")
update_database ("Lab_Space,Sample_Table,Soldering,Soldering_Iron,State,NOT_IN_USE")
#####################################################################
#clamp related functions
def clamp():
'''Clamp PQMS insert to Cryostat'''
read_state ('Lab_Space,PQMS,Clamp')
move ('Clamp.Home_Coordinates', 'PQMS.Clamp_Coordinates')
write ("execute : Use the other hand to revolve the clamp till 180 degrees")
write ("execute : Revolve the screw of the clamp till it is in closing position")
rotate ('Clamp Screw','required turns','clockwise')
update_database ("Lab_Space,PQMS,Clamp,State,LOCKED")
def unclamp():
'''Unclamp the PQMS insert to Cryostat'''
read_state("Lab_Space,PQMS,Clamp")
read_state("Lab_Space,PQMS,Insert_RT_Puck")
goto ("Clamp.Current_Coordinates")
hold ("the clamp with one hand")
rotate("Clamp Screw", "required turns", "anti-clockwise")
write ("execute : Revolve the screw of the clamp till it is in opening position")
write ("execute : Use the other hand to revolve the clamp till it's straight.")
update_database ("Lab_Space,PQMS,Clamp,State,UNLOCKED")
goto ("Clamp.Home_Coordinates")
leave ("Clamp")
#####################################################################
#cable related functions
def connect_cable (cable, test_object):
'''Connects 'cable' to its respective connector on test_object.'''
read_state('Lab_Space,PQMS,Cables,' + cable)
move (cable + ".Cryostat_End", test_object + "." + cable + "_Terminal")
align (cable + "'s connector", test_object + "'s connector")
write ("execute : Insert and fasten " + cable)
leave (cable)
update_database ("Lab_Space,PQMS,Cables," + cable + ",State,CONNECTED")
def disconnect_cable (cable):
'''Disconnects 'cable' from its respective connector on any test_object.'''
read_state ('Lab_Space,PQMS,Cables,' + cable)
goto (cable + ".Current_Coordinates")
hold (cable + ".Cryostat_End")
write ("execute : Unfasten and remove " + cable)
goto (cable + ".Home_Coordinates" )
update_database ("Lab_Space,PQMS,Cables," + cable + ",State,DISCONNECTED")
leave (cable)
#####################################################################
#sample unloading and loading functions
def mount_sample (Sample, Sample_Box, test_object):
'''Mount 'Sample' from 'Sample_Box' onto Sample Puck'''
read_state ('Lab_Space,Sample_Table')
read_state ('Lab_Space,PQMS')
if ((test_object == "Insert_RT_Puck") or (test_object == "Puck_Board")):
move ('Puck_Board','Sample_Mounting_Coordinates')
leave ('Puck_Board')
remove ('cap',Sample_Box)
update_database ("Lab_Space,Sample_Table,Sample_Boxes,"+Sample_Box+",State,OPEN")
hold_sample (Sample, Sample_Box)
close_lid (Sample_Box)
write ("execute : Remove Sticky Tape from " + Sample)
#Photograph prior to mounting
write ("execute : Cut and put a fresh sheet of tracing paper on sample_photography_area")
goto ('Sample_Photography_Area')
leave (Sample)
write ("execute : Light up the Sample_Photography_Area")
write ("execute : Put a Scale on the side of the photo")
take_photo (Sample)
write ("execute : Take sample back to Sample_Mounting_Coordinates")
write ("execute : Take Scale back to Scale.Home_Coordinates")
goto ('Puck_Board')
hold ('Puck_Board')
#SOLDERING PROCESS
set_up_soldering_iron()
move(Sample+'.Terminal_1', 'Insert_RT_Puck,Puck,Terminal_1')
solder(Sample +',Terminal_1', 'Insert_RT_Puck,Puck,Terminal_1')
write ("execute : Bend " + Sample + "'s terminals as required.")
move (Sample+"'s Terminal_2", "Insert_RT_Puck,Puck,Terminal_4")
solder(Sample + "'s,Terminal_2", "Insert_RT_Puck,Puck,Terminal_4")
############# 4-probe vs 2-probe topology selection ##############
response = raw_input ("Do you want to mount in 4-probe topology? : y/n")
while ((response != 'y') and (response != 'n')):
response = raw_input ("Do you want to mount in 4-probe topology? : y/n")
if response == 'y':
move ("copper_wire_1_terminal_1", "Insert_RT_Puck,Puck,Terminal_2")
solder ("copper_wire_1_terminal_1", "Insert_RT_Puck,Puck,Terminal_2")
move ("copper_wire_2_terminal_1", "Insert_RT_Puck,Puck,Terminal_3")
solder ("copper_wire_2_terminal_1", "Insert_RT_Puck,Puck,Terminal_3")
move ("copper_wire_1_terminal_2", Sample + ".Terminal_1_interior")
solder ("copper_wire_1_terminal_2", Sample + ".Terminal_1_interior")
move ("copper_wire_2_terminal_2", Sample + ".Terminal_2_interior")
solder ("copper_wire_2_terminal_2", Sample + ".Terminal_2_interior")
elif response == 'n':
solder ("Insert_RT_Puck,Puck,Terminal_1", "Insert_RT_Puck,Puck,Terminal_2")
solder ("Insert_RT_Puck,Puck,Terminal_3", "Insert_RT_Puck,Puck,Terminal_4")
update_database ("Lab_Space,PQMS,Insert_RT_Puck,Puck,Sample_Mounted,YES")
write("execute : Switch off the soldering iron")
update_database ("Lab_Space,Sample_Table,Soldering,Soldering_Iron,Power,OFF")
#SOLDERING PROCESS
read_state('Lab_Space,Sample_Table')
read_state('Lab_Space,PQMS')
move ('Puck_Board', 'Puck_Board.Home_Coordinates')
leave('Puck_Board')
take_photo('Mounted Sample')
elif (test_object == "Insert_RT_Old"):
remove ('cap',Sample_Box)
update_database ("Lab_Space,Sample_Table,Sample_Boxes,"+Sample_Box+",State,OPEN")
hold_sample (Sample, Sample_Box)
close_lid (Sample_Box)
write ("execute : Remove Sticky Tape from "+ Sample)
#####PHOTOGRAPH PRIOR TO MOUNTING
write ("execute : Cut and put a fresh sheet of tracing paper on sample_photography_area")
goto ('Sample_Photography_Area')
leave (Sample)
write ("execute : Light up the Sample_Photography_Area")
write ("execute : Put a meter scale on the side of the photo")
take_photo (Sample)
write ("execute : Take sample back to Sample_Mounting_Coordinates")
goto ("Insert_RT_Old")
hold ("Insert_RT_Old")
#SOLDERING PROCESS
set_up_soldering_iron()
move(Sample+'.Terminal_1', 'Insert_RT_Old,Terminal_1')
solder(Sample + ',Terminal_1', 'Insert_RT_Old,Terminal_1')
write ("execute : Bend " + Sample + "'s terminals as required.")
move(Sample+'.Terminal_2', 'Insert_RT_Old,Terminal_4')
solder(Sample+',Terminal_2', 'Insert_RT_Old,Terminal_4')
update_database ("Lab_Space,PQMS,Insert_RT_Old,Sample_Mounted,YES")
write("execute : Switch off the soldering iron")
update_database ("Lab_Space,Sample_Table,Soldering,Soldering_Iron,Power,OFF")
#SOLDERING PROCESS
write("execute : Stick " + Sample + "'s body to the mounting surface with Kapton tape")
goto("Insert_RT_Old.Home_Coordinates")
elif (test_object == "Insert_HiRes"):
remove ('cap',Sample_Box)
update_database ("Lab_Space,Sample_Table,Sample_Boxes," + Sample_Box + ",State,OPEN")
hold_sample (Sample, Sample_Box)
close_lid (Sample_Box)
write ("execute : Remove Sticky Tape from " + Sample)
#####PHOTOGRAPH PRIOR TO MOUNTING
write ("execute : Cut and put a fresh sheet of tracing paper on sample_photography_area")
goto ('Sample_Photography_Area')
leave (Sample)
write ("execute : Light up the Sample_Photography_Area")
write ("execute : Put a meter scale on the side of the photo")
take_photo (Sample)
write ("execute : Take sample back to Sample_Mounting_Coordinates")
goto (test_object)
hold (test_object)
#SOLDERING PROCESS
set_up_soldering_iron()
move(Sample+'.Terminal_1', 'Insert_HiRes,Terminal_1')
solder(Sample + ',Terminal_1', 'Insert_HiRes,Terminal_1')
write ("execute : Bend " + Sample + "'s terminals as required.")
move(Sample+'.Terminal_2', 'Insert_HiRes,Terminal_2')
solder(Sample+',Terminal_2', 'Insert_HiRes,Terminal_2')
update_database ("Lab_Space,PQMS,Insert_HiRes,Sample_Mounted,YES")
write("execute : Switch off the soldering iron")
update_database ("Lab_Space,Sample_Table,Soldering,Soldering_Iron,Power,OFF")
#SOLDERING PROCESS
goto("Insert_RT_Old.Home_Coordinates")
goto('Tweezers.Home_Coordinates')
leave('Tweezers')
take_photo('Mounted Sample')
def load_sample(Sample, Sample_Box, test_object, cryostat):
write ("Insert is being loaded to " + cryostat + " cryostat...\n")
if (test_object == "Insert_RT_Puck"):
response = raw_input ("\nIs the puck connected to the insert? : y/n \n")
while ((response != 'y') and (response != 'n')):
response = raw_input ("\nIs the puck connected to the insert? : y/n \n")
if (response == 'n'):
remove ('Puck','Puck_Board')
update_database ("Lab_Space,PQMS,Insert_RT_Puck,Puck,Puck_Board_Connection,DISCONNECTED")
goto('Puck_Screwing_Coordinates')
leave('Puck')
read_state('Lab_Space,PQMS,Insert_RT_Puck')
move(test_object, 'Cryostat.Exit_Coordinates')
goto('Puck_Screwing_Coordinates')
hold ('Puck')
align("Puck", "Insert_RT_Puck.Cavity")
rotate('Puck','14 turns','clockwise')
align ("Insert2Puck Cable", "Puck.Female_Connector")
write("execute : Insert the pin_holes into the puck pins")
update_database ("Lab_Space,PQMS,Insert_RT_Puck,Puck,Insert_Connection,CONNECTED")
update_database ("Lab_Space,PQMS,Insert_RT_Puck,Insert2Puck_Cable,State,CONNECTED")
flush_helium('Sample_Chamber', cryostat)
unclamp()
move ('Cryostat_Cover', 'Cryostat_Cover.Home_Coordinates')
leave('Cryostat_Cover')
move (test_object, 'Cryostat.Exit_Coordinates')
goto('Cryostat.Home_Coordinates')
clamp()
elif (test_object == "Puck_Board"):
write ("Sample Puck is already connected to Puck_Board")
move ("Puck_Board", "PQMS.Home_Coordinates")
elif (test_object == "Insert_RT_Old"):
flush_helium('Sample_Chamber', cryostat)
unclamp()
move ('Cryostat_Cover', 'Cryostat_Cover.Home_Coordinates')
leave('Cryostat_Cover')
move(test_object, 'Cryostat.Exit_Coordinates')
goto ("Cryostat.Home_Coordinates")
clamp()
elif (test_object == "Insert_Susceptibility"):
flush_helium('Sample_Chamber', cryostat)
unclamp()
move ('Cryostat_Cover', 'Cryostat_Cover.Home_Coordinates')
leave('Cryostat_Cover')
move(test_object, 'Cryostat.Exit_Coordinates')
goto ("Cryostat.Home_Coordinates")
clamp()
write("execute : Ensure that the sample positioner collar is in place")
write("execute : Insert the " + test_object + " sample platform into the " + test_object + ", through the collar")
move ("Collar_Screw, Sample_Positioner_Collar")
write("execute : Fasten the collar screw with the LN Key")
set_positioner(60)
def unmount_sample (Sample, Sample_Box, test_object):
'''Unmount Sample from puck and replace in Sample_Box'''
if ((test_object == "Insert_RT_Puck") or (test_object == "Puck_Board")):
goto ("Puck_Board", "Tweezers.Home_Coordinates")
hold ("Tweezers")
# Desoldering process
set_up_soldering_iron()
goto (Sample + ".Terminal_1")
hold (Sample + ".Terminal_1")
desolder("Terminal_1", Sample, Sample_Box)
goto (Sample + ".Terminal_2")
hold (Sample + ".Terminal_2")
desolder("Terminal_2", Sample, Sample_Box)
goto ('Soldering_Iron.Home_Coordinates')
leave ('Soldering_Iron')
update_database ("Lab_Space,PQMS,Insert_RT_Puck,Puck,Sample_Mounted,NO")
write ("execute : Switch off Soldering Iron")
update_database ("Lab_Space,Sample_Table,Soldering,Soldering_Iron,Power,OFF")
#Desoldering Process
move ("Puck_Board", "Puck_Board.Home_Coordinates")
leave ("Puck_Board")
goto ("Sample_Table.Sample_Mounting_Coordinates")
write ("execute : straighten sample")
write ("execute : put a sticky note on the sample")
leave (Sample)
read_state("Lab_Space,Sample_Table,Sample_Boxes,"+Sample_Box)
goto (Sample_Box +"'s Cap")
hold ("The Cap")
write ("execute : With other hand hold the " + Sample_Box + " and keep it fixed")
write ("execute : Pull the cap, and separate it from sample_box")
update_database ("Lab_Space,Sample_Table,Sample_Boxes,Box_Zener,State,OPEN")
goto (Sample+"_Terminal_1")
hold (Sample+"_terminal_1")
goto (Sample+".Home_Coordinates")
leave (Sample)
update_database ("Lab_Space,Sample_Table,Sample_Boxes,"+Sample_Box+","+Sample+",State,NOT_IN_USE")
write ("execute : close the lid of the box")
update_database ("Lab_Space,Sample_Table,Sample_Boxes,Box_Zener,State,CLOSED")
goto ("Tweezer.Home_Coordinates")
leave ("Tweezer")
elif (test_object == "Insert_RT_Old"):
goto ("Insert_RT_Old")
hold ("Insert_RT_Old")
goto ("Tweezers.Home_Coordinates")
hold ("Tweezers")
# Desoldering process
set_up_soldering_iron()
goto (Sample + ".Terminal_1")
hold (Sample + ".Terminal_1")
desolder("Terminal_1", Sample, Sample_Box)
goto (Sample + ".Terminal_2")
hold (Sample + ".Terminal_2")
desolder("Terminal_2", Sample, Sample_Box)
goto ('Soldering_Iron.Home_Coordinates')
leave ('Soldering_Iron')
update_database ("Lab_Space,PQMS,Insert_RT_Old,Sample_Mounted,NO")
write ("execute : Switch off Soldering Iron")
update_database ("Lab_Space,Sample_Table,Soldering,Soldering_Iron,Power,OFF")
#Desoldering Process
write ("execute : Remove tape from Zener Diode")
move ("Insert_RT_Old", "Insert_RT_Old.Home_Coordinates")
goto ("Sample_Table.Sample_Mounting_Coordinates")
write ("execute : straighten sample")
write ("execute : put a sticky note on the sample")
leave (Sample)
goto (Sample_Box +"'s Cap")
hold ("The Cap")
write ("execute : With other hand hold the " + Sample_Box + " and keep it fixed")
write ("execute : Pull the cap, and separate it from sample_box")
update_database ("Lab_Space,Sample_Table,Sample_Boxes,Box_Zener,State,OPEN")
goto (Sample + "_Terminal_1")
hold (Sample + "_terminal_1")
goto (Sample + ".Home_Coordinates")
leave (Sample)
update_database ("Lab_Space,Sample_Table,Sample_Boxes,"+Sample_Box+","+Sample+",State,NOT_IN_USE")
write ("execute : close the lid of the box")
update_database ("Lab_Space,Sample_Table,Sample_Boxes,Box_Zener,State,CLOSED")
goto ("Tweezer.Home_Coordinates")
leave ("Tweezer")
def unload_sample(Sample, Sample_Box, test_object, cryostat):
if (test_object == "Insert_RT_Puck"):
unclamp()
move("Insert_RT_Puck", "Cryostat.Exit_Coordinates")
hold("Insert_RT_Puck")
move ("Cryostat.cover", "Cryostat Opening")
leave("Cryostat.cover")
create_vaccum ("Sample_Chamber", cryostat)
if (cryostat == "Cryostat_Steel"):
create_vaccum('Heater_Chamber', cryostat)
goto("Sample_Table.Puck_Screwing_Coordinates")
remove("Insert2Puck_Cable", "Insert_RT_Puck")
update_database ("Lab_Space,PQMS,Insert_RT_Puck,Puck,Insert_Connection,DISCONNECTED")
update_database ("Lab_Space,PQMS,Insert_RT_Puck,Insert2Puck_Cable,State,DISCONNECTED")
read_state("Lab_Space,PQMS,Insert_RT_Puck,Puck")
goto("Puck")
hold("Puck")
rotate('Puck','14 turns','anticlockwise')
leave("Puck")
goto(test_object + ".Home_Coordinates")
leave(test_object)
goto("Sample_Table.Puck_Screwing_Coordinates")
hold("Insert_RT_Puck.Puck")
goto("Puck_Board.Home_Coordinates")
align ("Puck.pins", "Puck_Board")
write("execute : Insert Puck into Puck_Board")
leave("Puck")
clamp()
update_database ("Lab_Space,PQMS,Insert_RT_Puck,Puck,Puck_Board_Connection,CONNECTED")
elif (test_object == "Puck_Board"):
move(test_object, test_object + ".Home_Coordinates")
elif (test_object == "Insert_RT_Old"):
flush_helium('Sample_Chamber', cryostat)
unclamp()
move (test_object, test_object + ".Exit_Coordinates")
move ("Cryostat.cover", "Cryostat Opening")
leave("Cryostat.cover")
create_vaccum ("Sample_Chamber", cryostat)
if (cryostat == "Cryostat_Steel"):
create_vaccum('Heater_Chamber', cryostat)
clamp()
goto (test_object + ".Home_Coordinates")
elif (test_object == "Insert_Susceptibility"):
flush_helium('Sample_Chamber', cryostat)
move ("Collar_Screw, ", "away from Sample_Positioner_Collar")
write("execute : Unfasten the collar screw with the LN Key")
unclamp()
################################
write ("execute : Attention : 2 ROBOTS needed to complete procedure below. ROBOT_2 Must wear gloves!")
write ("execute : ROBOT_2 : Place a tissue paper on the Sample Mounting coordinates ")
write("execute : ROBOT_1 : Hold the sample positioner collar")
write("execute : ROBOT_1 : Remove the " + test_object + " sample platform from the " + test_object + ", through the collar\n")
write("execute : ROBOT_1 : Hand Over the sample platform to ROBOT_2\n \
ROBOT_2 : Goto Sample Mounting coordinates and immediately dry the sample and insert by wrapping delicately in tissue wipe.\n \
ROBOT_1 : Remove the sample positioner collar\n \
ROBOT_1 : Move " + test_object + "Cryostat.Exit_Coordinates\n \
ROBOT_1 : Place the cryostat cover on the opening ")
create_vaccum ("Sample_Chamber", cryostat)
if (cryostat == "Cryostat_Steel"):
create_vaccum('Heater_Chamber', cryostat)
clamp()
write ("execute : ROBOT_2 : Remove the sample from the sleeve by gently pulling with tweezer")
write ("execute : ROBOT_1 : Open the Dessicator Lid \n \
ROBOT_2 : Leave sample stage, Place the sample in its pouch, put it the dessicator and close the lid of the dessicator")
write ("execute : ROBOT_1 : Move insert to Insert_Susceptibility.Home_Coordinates")
write ("execute : ROBOT_2 move sample stage to Insert_Susceptibility.Home_Coordinates")
################################
#####################################################################
#PQMS setup functions
def switch_on_module(module):
goto (module + ",Power_Cable")
switch_on(module)
update_database ("Lab_Space,PQMS,"+module+",State,ON")
def switch_off_module(module):
goto (module + ",Power_Cable")
switch_on(module)
update_database ("Lab_Space,PQMS,"+module+",State,OFF")
def switch_on_PQMS_modules():
switch_on_module('Stabilizer')
switch_on_module('XPLORE_Power_Supply')
update_database ("Lab_Space,PQMS,XSMU,State,ON")
switch_on_module('XTCON')
switch_on_module('HiRes')
switch_on_module('XLIA')
switch_on_module('Sample_Positioner')
switch_on_module('Pump')
switch_on_module('Pirani_Gauge')
def pc_connect(module):
click (module)
move_cursor ("File")
click ("File")
click ("Connect")
def set_up_PQMS_modules ():
click ('Modules Manager')
pc_connect ("Temperature Controller")
pc_connect ("IV Source and Measurement")
pc_connect ("Lockin Amplifier")
pc_connect ("Hi-Res Measurement Unit")
pc_connect ("Sample Positioner")
def switch_off_PQMS_modules(cryostat):
switch_off_module("XPLORE_Power_Supply")
update_database ("Lab_Space,PQMS,XSMU,State,OFF")
switch_off_module("XTCON")
switch_off_module('XLIA')
switch_off_module('Sample_Positioner')
close_valve ("Lab_Space,PQMS,Pump,Main_Valve", "clockwise")
pre_pumping_checks(cryostat)
switch_off_module('Pump')
switch_off_module('Pirani_Gauge')
switch_off_module('Stabilizer')
###############################################################################
#Computer functions
def switch_on_computer():
switch_on("Computer.Switch")
press ("CPU Power Button")
switch_on("USB_Power_Adaptor")
write ("execute : Login to user account")
write ("execute : Open Qrius ")
def switch_off_computer():
write ("execute : Exit Qrius")
goto ("Top Right Corner of the screen")
click ("Power Button")
click ("Shut Down")
switch_off("USB_Power_Adaptor")
wait ("computer", "Shutdown")
switch_off("Computer")
###############################################################################
#Sample Positioner Functions
def set_positioner(position):
click ('Qrius Window->Modules Manager->Sample Positioner Window')
move_cursor ('Toolbar')
click ('Tools')
set_option ('Move Absolute', 'Text Box', str(position))
###############################################################################
#Temperature controller functions
def init_XTCON_isothermal (test_object):
click ('Temperature Controller Window')
move_cursor ('Control mode')
click ('drop down menu')
click ('Isothermal')
move_cursor ('Instrument Control')
click ('Cryostat and Insert')
click ('Cryostat Type')
write ('execute : select appropriate cryostat')
click ('Insert Type')
click (test_object)
click ('File->Hide')
click ('Start Button')
update_database ("Lab_Space,PQMS,XTCON,Running,True")
def set_XTCON_temperature (temperature_set_point):
click ('Temperature Controller Window')
move_cursor ('Toolbar')
click ('Settings->Isothermal Settings')
set_option ('Heater Setpoint', 'Text Box', str(temperature_set_point))
move_cursor ('Toolbar')
click ('File->Apply')
update_database ("Lab_Space,PQMS,XTCON,Mode,ISOTHERMAL")
wait ("Sample Temperature", "Stable")
def stop_XTCON_run():
click ('Temperature Controller Window')
move_cursor ('Stop Button')
click ('Stop')
update_database ("Lab_Space,PQMS,XTCON,Running,False")
def start_XTCON_monitor():
click ('Temperature Controller Window')
move_cursor ('Control mode')
click ('drop down menu')
click ('Monitor')
click ('Start Button')
update_database ("Lab_Space,PQMS,XTCON,Running,True")
def end_XTCON_monitor():
click ('Temperature Controller Window')
move_cursor ('Finish Button')
click ('Finish')
##############################################################################
# CV_isothermal functions
def init_XSMU_constant_volatge (test_object):
click ('IV Source and Measureent Unit Window')
move_cursor ('Run mode')
click ('drop down menu')
click ('V-Time')
click ('Start Button')
update_database ("Lab_Space,PQMS,XSMU,Running,True")
def set_XSMU_constant_volatge(voltage_set_point):
click ('IV Source and Measureent Unit Window')
move_cursor ('Toolbar')
click ('Settings->Source Parameters')
move_cursor ("Source Mode Drop Down Menu")
click ("Drop Down Menu")
click ("Constant Voltage")
move_cursor ("Top menu")
set_option ('Voltage Values', 'Text Box', str(voltage_set_point))
move_cursor ('Toolbar')
click ('File->Apply')
wait ("Voltage", "Stable")
def init_XLIA_isothermal_constant_voltage(test_object):
click('Lock-In Amplifier Window')
move_cursor ('Run mode')
click ('drop down menu')
click ('V-F')
def set_XLIA_isothermal_constant_voltage(initial_frequency,final_frequency,frequency_step,reference_amplitude,reference_frequency,reference_phase,run_mode):
click ('Lock-In Amplifier Window')
move_cursor ('Toolbar')
click ('Settings -> V-F Ramp Settings')
set_option ('Initial Frequency', 'Text Box', str(initial_frequency))
set_option ('Final Frequency', 'Text Box', str(final_frequency))
set_option ('Frequency Step', 'Text Box', str(frequency_step))
click ('File -> Apply')
move_cursor ('Toolbar')
click ('Settings -> Reference Settings')
set_option ('Frequency', 'Text Box', str(reference_frequency))
set_option ('Amplitude', 'Text Box', str(reference_amplitude))
set_option ('Phase', 'Text Box', str(reference_phase))
click ('File -> Apply')
move_cursor ('Run control')
click ('Start Button')
###############################################################################
#XT_step_ramp_functions
def set_XL_measurement_settings(final_temperature, ramp_rate, max_depth, step_size, amplitude, frequency, phase, delay, filter_length, drive_mode, drive_value):
move_cursor ('Run control')
click ('drop down menu')
click ('X-L')
move_cursor ('Toolbar')
click ('Settings->XL Acquisition Settings')
set_option ("Max Depth", "Text Box" , max_depth)
set_option ("Step Size", "Text Box" , step_size)
click ('File->Apply')
move_cursor ('Toolbar')
click ('Settings->Lock-In Amplifier->Reference Settings')
set_option ('Frequency', 'Text Box', frequency)
set_option ('Amplitude', 'Text Box', amplitude)
set_option ('Phase', 'Text Box', phase)
click ("\'File->Apply\'")
move_cursor ("Toolbar")
click ('Settings->Lock-In Amplifier->Acquisition Settings')
set_option ('Delay', 'Text Box', delay)
set_option ('Filter_Length', 'Text Box', filter_length)
set_option ('Drive Mode', 'Text Box', drive_mode)
set_option (drive_mode, 'Text Box', drive_value)
move_cursor ("Toolbar")
click ('Settings->Lock-In Amplifier->Measurement Settings')
move_cursor ("Coupling Drop Down Menu")
click ("Drop Down Menu")
click ("AC")
click ("\'File->Apply\'")
################################
def set_XT_linear_ramp_measurement_settings(final_temperature, ramp_rate, max_depth, step_size, amplitude, frequency, phase, delay, filter_length, drive_mode, drive_value):
##### set linear ramp settings here
move_cursor ('Run control')
click ('drop down menu')
click ('X-T (linear ramp)')
move_cursor ('Toolbar')
click ('Settings->Temperature controller')
click ('Linear ramp settings')
set_option ('Final Temperature', "Text Box", str(final_temperature))
set_option ('Ramp Rate', 'Text Box', str(ramp_rate))
click ('File->Apply')
move_cursor ('Toolbar')
click ('Settings->Lock-In Amplifier->Reference Settings')
set_option ('Frequency', 'Text Box', frequency)
set_option ('Amplitude', 'Text Box', amplitude)
set_option ('Phase', 'Text Box', phase)
click ("\'File->Apply\'")
move_cursor ("Toolbar")
click ('Settings->Lock-In Amplifier->Acquisition Settings')
set_option ('Delay', 'Text Box', delay)
set_option ('Filter_Length', 'Text Box', filter_length)
set_option ('Drive Mode', 'Text Box', drive_mode)
set_option (drive_mode, 'Text Box', drive_value)
move_cursor ("Toolbar")
click ('Settings->Lock-In Amplifier->Measurement Settings')
move_cursor ("Coupling Drop Down Menu")
click ("Drop Down Menu")
click ("AC")
click ("\'File->Apply\'")
################################
def start_XL_run (final_temperature, ramp_rate, max_depth, step_size, amplitude, frequency, phase, delay, filter_length, drive_mode, drive_value):
goto ("Qrius Main Window")
click ('Measurement Mode settings')
click ('Magnetic AC Susceptibility')
set_XL_measurement_settings(final_temperature, ramp_rate, max_depth, step_size, amplitude, frequency, phase, delay, filter_length, drive_mode, drive_value)
update_database ("Lab_Space,PQMS,XTCON,Mode,Linear_Ramp")
click ('Start Button')
update_database ("Lab_Space,PQMS,XLIA,Running,True")
wait ("Run", "Finished")
update_database ("Lab_Space,PQMS,XLIA,Running,False")
def start_XT_linear_ramp_run (final_temperature, ramp_rate, max_depth, step_size, amplitude, frequency, phase, delay, filter_length, drive_mode, drive_value):
goto ("Qrius Main Window")
click ('Measurement Mode settings')
click ('Magnetic AC Susceptibility')
set_XT_linear_ramp_measurement_settings(final_temperature, ramp_rate, max_depth, step_size, amplitude, frequency, phase, delay, filter_length, drive_mode, drive_value)
update_database ("Lab_Space,PQMS,XTCON,Mode,Linear_Ramp")
click('Start Button')
update_database ("Lab_Space,PQMS,XLIA,Running,True")
wait ("Run", "Finished")
update_database ("Lab_Space,PQMS,XSMU,Running,False")
###############################################################################
#IV_step_ramp functions functions
def set_IV_step_ramp_measurement_settings(initial_temperature, final_temperature, temperature_step, V_range, V_step, I_range, I_step, max_power, pre_stabilization_delay, post_stabilization_delay, monitoring_period, tolerance):
move_cursor ('Run control')
click ('drop down menu')
click ('I-V (Step ramp)')
move_cursor ('Toolbar')
click ('Settings->Temperature controller-Step ramp settings')
##### set step ramp settings here
set_option ("Ramp Index", "Text Box", "0")
set_option ("Initial Temperature", "Text Box", str(initial_temperature))