-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathloading_wafer_with_temperature_OnAxis.py
317 lines (245 loc) · 10.1 KB
/
loading_wafer_with_temperature_OnAxis.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
from sentio_prober_control.Sentio.ProberSentio import *
from sentio_prober_control.Communication.CommunicatorTcpIp import CommunicatorTcpIp
from sentio_prober_control.Sentio.Enumerations import *
import datetime
import time
import csv
# this script will execute wafer transfer to chuck with Target temperature #
_prober = SentioProber(CommunicatorTcpIp.create("127.0.0.1:35555"))
_test_folder_path = "D:\\Temperature_test\\"
_interval_wait_target_temp = 10 # seconds
_temperatures = [25, 150, -40, 25]
_wafer_slot = [1]
_cassette = LoaderStation.Cassette1
_re_setting_interval_in_soaking = 10 # min.
_contact_time = 600 # sec.
_test_dies_seq = [0, 1, 2, 3, 4]
_focus_data_file = r'{}'.format(_test_folder_path)
_debug = False
_tip_offset = [0, 0, 0]
_project_path = ['celadon_probe_card']
#
# main function
#
def main():
# prepare_wafer_from_cassette()
# looping for temperature
for target_temp in _temperatures:
prepare_test_folder(target_temp)
# looping for wafer slot
for slot in _wafer_slot:
load_project(slot)
precondition_check()
# load_wafer_to_chuck(slot)
wafer_pre_setting(True)
chang_to_target_temperature(target_temp)
soaking_processing(target_temp)
wafer_setting_after_soaking()
stepping(target_temp, slot)
# unload_wafer()
def load_project(slot_number):
_prober.open_project(_project_path[slot_number - 1], True)
def precondition_check():
# check if home and contact is set
hasHome, hasContact, overtravelActive, vacuumOn = _prober.get_chuck_site_status(ChuckSite.Wafer)
if not hasHome: raise Exception("Home position must be set to execute this script!")
if not hasContact: raise Exception("Contact must be set for stepping!")
if not len(_wafer_slot) == len(_project_path):
raise Exception("Please make sure the Project number and Slot number is correct")
def prepare_wafer_from_cassette():
print('prepare_wafer_from_cassette')
if _debug == False:
# Scan cassette and verify the slot data
ret = _prober.loader.scan_station(_cassette)
for slot in _wafer_slot:
if ret[25-slot] != '1':
raise Exception("Slot: {0} is incorrect!".format(slot))
def load_wafer_to_chuck(slot):
print(f'load_wafer_to_chuck:{slot}')
if _debug == True:
return
# load wafer
ret = _prober.loader.load_wafer(_cassette, slot, 0)
def wafer_pre_setting(is_move_chuck = False, is_execute_find_tips = False ):
print('wafer_pre_setting')
if _debug == True:
return
# switch Vision
_prober.select_module(Module.Vision)
# separation
if is_move_chuck :
contact, _, _, _ = _prober.get_chuck_site_height(ChuckSite.Wafer)
_prober.move_chuck_z(ChuckZReference.Zero, contact - 500)
# Move to Home
_prober.move_chuck_home()
# Get to Focus
_prober.comm.send('step_scope_site clear_area')
_prober.comm.read_line()
_prober.vision.auto_focus(AutoFocusCmd.GoTo)
scope_z =_prober.vision.auto_focus(AutoFocusCmd.Focus)
print(f'AF:{scope_z}')
_prober.comm.send('step_scope_site home')
_prober.comm.read_line()
# Auto Align with update die size
_prober.vision.align_wafer(AutoAlignCmd.UpdateDieSize)
# Find Home
_prober.vision.find_home()
if is_execute_find_tips :
_tip_offset[0], _tip_offset[1], _tip_offset[2] = _prober.vision.ptpa_find_tips(PtpaFindTipsMode.OnAxis)
def chang_to_target_temperature(target_temperature):
print(f'chang_to_target_temperature:{target_temperature}')
if _debug == True:
return
# go to target temperature
_prober.status.set_chuck_temp(target_temperature)
current_temp = _prober.status.get_chuck_temp()
isCooling, isHeating, isControlling, isStandby, isError, isUncontrolled = _prober.status.get_chuck_thermo_state()
time.sleep(_interval_wait_target_temp)
# waiting system at target temperature
while isHeating or isCooling:
# print current temp and status
current_temp = _prober.status.get_chuck_temp()
print(f"Current Temperature = {current_temp:.2f}")
# check status
isCooling, isHeating, isControlling, isStandby, isError, isUncontrolled = _prober.status.get_chuck_thermo_state()
time.sleep(_interval_wait_target_temp)
def soaking_processing(target_temp):
print(f'soaking_processing:{target_temp}')
if _debug == False:
soaking_time = _prober.status.get_soaking_time(target_temp)
else:
soaking_time = 10
print(f'Target Temperature:{target_temp}, Soaking time: {soaking_time}')
if soaking_time == 0:
return
# waiting system soaking time
soaking_time = int(soaking_time)
while soaking_time:
mins, secs = divmod(soaking_time, 60)
timer = '{:02d}:{:02d}'.format(mins, secs)
print(f'Elapsed time:{timer}')
time.sleep(1)
if soaking_time % (_re_setting_interval_in_soaking * 60) == 0:
prepare_wafer_in_soaking()
soaking_time -= 1
def prepare_wafer_in_soaking():
print('execute prepare wafer!')
if _debug == False :
wafer_pre_setting(False, True)
# save Chuck Scope pos
save_temperature_data()
def wafer_setting_after_soaking():
print('wafer_setting_after_soaking')
if _debug == False:
wafer_pre_setting()
# Topography - Synchronize command
_prober.comm.send('step_scope_site topo')
_prober.comm.read_line()
cmd_id = _prober.map.execute_topogrphy(ExecuteAction.Execute)
_prober.wait_complete(cmd_id, 3600)
_prober.comm.send('step_scope_site home')
_prober.comm.read_line()
def stepping(target_temp, slot):
print('Stepping for dies')
# _prober.map.step_first_die()
for die_sqe in _test_dies_seq:
# col, row ,sub_index =_prober.map.step_die_seq(die_sqe, 0)
# _prober.move_chuck_contact()
# save image
# now = datetime.datetime.now()
# fn = f"{_test_folder}\Slot_{slot}_Die_Seq_{die_sqe}_col_{col}_row_{row} @ {target_temp}°C in {now.strftime('%Y-%m-%d %H-%M-%S')}.png"
# _prober.vision.snap_image(fn)
# Contact looping
recoder_contact_separation_condition(target_temp, slot, die_sqe)
_prober.move_chuck_home()
def unload_wafer():
print('unload_wafer')
if _debug == False:
_prober.loader.unlaod_wafer()
def prepare_test_folder(target_temp):
folder: str = r'{}'.format(_test_folder_path)
if not os.path.exists(folder):
os.mkdir(folder)
global _test_folder
_test_folder = r'{}\{}'.format(_test_folder_path, f'{target_temp}_degree_test')
if os.path.isdir(_test_folder):
_test_folder = r'{}\{}'.format(_test_folder_path, f'{target_temp}_1_degree_test')
# shutil.rmtree(_test_folder)
os.mkdir(_test_folder)
time.sleep(1)
else:
os.mkdir(_test_folder)
global _focus_data_csv_file
_focus_data_csv_file = r'{}\{}.csv'.format(_test_folder, "Temperature Data")
condition = ['Time', 'ScopePosX', 'ScopePosY', 'ScopePosZ', 'ChuckPosX', 'ChuckPosY', 'ChuckPosZ', 'TipOffsetX', 'TipOffsetY', 'TipOffsetZ', 'DieSizeX', 'DieSizeY']
with open(_focus_data_csv_file, 'w', newline='') as file:
writer = csv.writer(file)
writer.writerow(condition)
file.flush()
def recoder_contact_separation_condition(target_temp, slot, die_sqe):
print('recoder_contact_separation_condition')
col, row, sub_index = _prober.map.step_die_seq(die_sqe, 0)
for i in range(3):
_prober.move_chuck_separation()
_prober.vision.auto_focus()
cur_z = _prober.get_chuck_z(ChuckZReference.Zero)
now = datetime.datetime.now()
fn = f"{_test_folder}\Slot_{slot}_Die_Seq_{die_sqe}_col_{col}_row_{row}_Contact_Cycle_{i}_Separation_{cur_z} @ {target_temp}°C in {now.strftime('%Y-%m-%d %H-%M-%S')}.png"
_prober.vision.snap_image(fn)
_prober.move_chuck_contact()
_prober.vision.auto_focus()
cur_z = _prober.get_chuck_z(ChuckZReference.Zero)
now = datetime.datetime.now()
fn = f"{_test_folder}\Slot_{slot}_Die_Seq_{die_sqe}_col_{col}_row_{row}_Contact_Cycle_{i}_Contact_{cur_z} @ {target_temp}°C in {now.strftime('%Y-%m-%d %H-%M-%S')}.png"
_prober.vision.snap_image(fn)
time.sleep(_contact_time)
_prober.move_chuck_separation()
# Capture image for Tips -- Not yet done
_prober.move_chuck_contact()
_prober.vision.auto_focus()
_prober.vision.enable_follow_mode(False)
_prober.move_chuck_separation()
time.sleep(3)
now = datetime.datetime.now()
fn = f"{_test_folder}\Slot_{slot}_Tip image_Die_Seq_{die_sqe}_col_{col}_row_{row} @ {target_temp}°C in {now.strftime('%Y-%m-%d %H-%M-%S')}.png"
_prober.vision.snap_image(fn)
_prober.move_chuck_contact()
_prober.vision.enable_follow_mode(True)
_prober.move_chuck_separation()
def save_temperature_data():
now = datetime.datetime.now()
scope_z_pos = _prober.get_scope_z()
scope_x_pos, scope_y_pos= _prober.get_scope_xy()
chuck_z_pos = _prober.get_chuck_z(ChuckZReference.Zero)
chuck_x_pos, chuck_y_pos = _prober.get_chuck_xy_pos()
_prober.comm.send("map:get_prop die_size")
resp = Response.check_resp(_prober.comm.read_line())
tok = resp.message().split(",")
die_size_x = tok[0]
die_size_y = tok[1]
data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
with open(_focus_data_csv_file, 'a', newline='') as file:
writer = csv.writer(file)
data[0] = now
data[1] = scope_x_pos
data[2] = scope_y_pos
data[3] = scope_z_pos
data[4] = chuck_x_pos
data[5] = chuck_y_pos
data[6] = chuck_z_pos
data[7] = _tip_offset[0]
data[8] = _tip_offset[1]
data[9] = _tip_offset[2]
data[10] = die_size_x
data[11] = die_size_y
writer.writerow(data)
file.flush()
if __name__ == "__main__":
try:
main()
_prober.comm.send("*LOCAL")
now = datetime.datetime.now()
print(f'{now}, Processing Finish')
except Exception as e:
_prober.comm.send("*LOCAL")
print(e)