Skip to content

Commit e9b309e

Browse files
author
andy
committed
store fixture automation
1 parent 38f52ed commit e9b309e

File tree

11 files changed

+121
-36
lines changed

11 files changed

+121
-36
lines changed

oem_projects/burning_rock/examples/tc_control.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ async def _main():
1111
this_module_id = thermo_v2[0]
1212

1313
# await _thermo_module.set_lid_temperature(this_module_id, 90)
14+
# for i in range(30):
15+
# time.sleep(1)
16+
1417
# await _thermo_module.deactivate_all(this_module_id)
1518
# await _thermo_module.wait_for_lid_temperature(this_module_id)
1619
# await _thermo_module.set_block_temperature(this_module_id, 50)
@@ -27,13 +30,13 @@ async def _main():
2730

2831
# run profile
2932
await _thermo_module.run_profile(this_module_id, profile=[
30-
{"holdSeconds": 100, "celsius": 50},
31-
{"holdSeconds": 100, "celsius": 95},
32-
{"holdSeconds": 100, "celsius": 50},
33-
{"holdSeconds": 100, "celsius": 95}
33+
{"holdSeconds": 90, "celsius": 50},
34+
{"holdSeconds": 90, "celsius": 95},
35+
{"holdSeconds": 90, "celsius": 50},
36+
{"holdSeconds": 90, "celsius": 95}
3437
])
35-
36-
await _thermo_module.deactivate_all(this_module_id)
38+
#
39+
# await _thermo_module.deactivate_all(this_module_id)
3740

3841
await _thermo_module.open_lid(this_module_id)
3942
lid_status = await _thermo_module.get_lid_status(this_module_id)

oem_projects/burning_rock/examples/tc_load_slot8.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from modules.thermocycler import ThermocyclerModule
2-
from ot_type import ModuleName, Mount, Instrument, LabWare
1+
from oem_projects.burning_rock.modules.thermocycler import ThermocyclerModule
2+
from oem_projects.burning_rock.ot_type import ModuleName, Mount, Instrument, LabWare
33
import asyncio
4-
from solutions.reconstruct_protocol import ReconstructProtocolContext
4+
from oem_projects.burning_rock.solutions.reconstruct_protocol import ReconstructProtocolContext
55
import time
66

77
Init_Labaware = {
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
from oem_projects.burning_rock.modules.thermocycler import ThermocyclerModule
2+
from oem_projects.burning_rock.ot_type import ModuleName, Mount, Instrument, LabWare
3+
import asyncio
4+
from oem_projects.burning_rock.solutions.reconstruct_protocol import ReconstructProtocolContext
5+
import time
6+
7+
Init_Labaware = {
8+
"left": [{"labware_name": LabWare.TRASH_1100ML_FIXED, "slot_name": '1'},
9+
{"labware_name": LabWare.OPENTRONS_96_TIPRACK_300UL, "slot_name": '11'},
10+
{"labware_name": LabWare.OPENTRONS_PCR_PLATE, "slot_name": 'None'},
11+
]
12+
13+
}
14+
15+
16+
async def _main():
17+
# initial api & lab-ware
18+
api = ReconstructProtocolContext()
19+
mount_r = Mount.RIGHT
20+
mount_l = Mount.LEFT
21+
await api.build_context(clear=False)
22+
23+
# initial module
24+
_thermo_module = ThermocyclerModule(with_run_id=api.run_id)
25+
26+
# load module
27+
tc = await api.load_module(ModuleName.TC_V2, slot='7')
28+
pcr = await api.load_labware(LabWare.OPENTRONS_PCR_PLATE, module_id=tc)
29+
30+
# open lid
31+
"""
32+
you have to open lid for the first step, otherwise, the further HTTP API for moving to TC will raise error
33+
"""
34+
# await _thermo_module.open_lid(tc)
35+
36+
# p20s = await api.load_pipette(Instrument.PIPETTE_P20_SIGNAL_GEN2, mount_r)
37+
# p300m = await api.load_pipette(Instrument.PIPETTE_P300_MULTI_GEN2, mount_l)
38+
# tip_20ul = await api.load_labware(LabWare.OPENTRONS_96_TIPRACK_20UL, slot_name="8")
39+
# tip_300ul = await api.load_labware(LabWare.OPENTRONS_96_TIPRACK_300UL, slot_name="11")
40+
# reservoir = await api.load_labware(LabWare.NEST_12_RESERVOIR_15ML, slot_name="3")
41+
#
42+
# # run process
43+
# await api.home()
44+
#
45+
# # labware - calibration
46+
# await api.labware_calibration(Init_Labaware)
47+
#
48+
# await api.pick_up(p300m.pipette_id, tip_300ul.labware_id)
49+
# await api.aspirate(p300m.pipette_id, reservoir.labware_id, 10)
50+
# await api.dispense(p300m.pipette_id, pcr.labware_id, 10)
51+
# await api.drop(p300m.pipette_id)
52+
# await api.home()
53+
# await _thermo_module.close_lid(tc)
54+
55+
# run profile
56+
await _thermo_module.run_profile(tc, profile=[
57+
{"holdSeconds": 90, "celsius": 50},
58+
{"holdSeconds": 90, "celsius": 95},
59+
{"holdSeconds": 90, "celsius": 50},
60+
{"holdSeconds": 90, "celsius": 95}]) # using default profile setting
61+
time.sleep(5)
62+
await _thermo_module.deactivate_block(tc)
63+
64+
65+
if __name__ == '__main__':
66+
asyncio.run(_main())

oem_projects/burning_rock/http_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import requests
44

55
# Domain = "http://OT2CEP20230630R01-DEBUGGER:31950"
6-
Domain = "http://192.168.3.5:31950"
6+
Domain = "http://192.168.3.7:31950"
77
headers = {
88
"Content-Type": "application/json",
99
"Opentrons-Version": "3"

oem_projects/burning_rock/modules/thermocycler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ async def _post_run_profile(self, module_id, profile: list = None):
166166
{"holdSeconds": 10, "celsius": 30},
167167
{"holdSeconds": 10, "celsius": 30},
168168
{"holdSeconds": 10, "celsius": 30},
169-
{"holdSeconds": 10, "celsius": 30},
169+
{"holdSeconds": 10, "celsius": 30}
170170
]
171171

172172
_url = self._url

oem_projects/burning_rock/protocol/protocol_context.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import asyncio
22
import time
33

4-
from hardware_control.hardware_control import HardwareControl
5-
from http_client import HttpClient
6-
from ot_type import LabWare, Instrument, ModuleName, Mount, Target, Axis, Point, LabwareResult, PipetteResult
4+
from oem_projects.burning_rock.hardware_control.hardware_control import HardwareControl
5+
from oem_projects.burning_rock.http_client import HttpClient
6+
from oem_projects.burning_rock.ot_type import LabWare, Instrument, ModuleName, Mount, Target, Axis, Point, LabwareResult, PipetteResult
77
from typing import Union, List
88

99

oem_projects/burning_rock/solutions/reconstruct_protocol.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from protocol.protocol_context import ProtocolContext
2-
from ot_type import LabWare, LabwareResult, Axis, Mount, get_labware_name_by_value
1+
from oem_projects.burning_rock.protocol.protocol_context import ProtocolContext
2+
from oem_projects.burning_rock.ot_type import LabWare, LabwareResult, Axis, Mount, get_labware_name_by_value
33
import utils
44

55
FixedTrashSlot = 1

ot3_testing/test_config/pipette_leveling_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ class CalibrateMethod(enum.Enum):
7474
}
7575

7676
SlotLocationCH8 = {"Y-C1-Left": {"Point": Point(215.42, 198.33, 299.16), "compensation": {"rear": 0, "front": 0}},
77-
"Y-C1-Right": {"Point": Point(172.07, 197.18, 299.16), "compensation": {"rear": 0, "front": 0}},
78-
"Y-C3-Right": {"Point": Point(499.83, 197.18, 299.16), "compensation": {"rear": 0, "front": 0}},
79-
"Y-A2-Right": {"Point": Point(335.94, 412.22, 299.16), "compensation": {"rear": 0, "front": 0}},
77+
"Y-C1-Right": {"Point": Point(172.07, 197.18, 299.16), "compensation": {"rear": 0.024, "front": 0}},
78+
"Y-C3-Right": {"Point": Point(499.83, 197.18, 299.16), "compensation": {"rear": -0.014, "front": 0}},
79+
"Y-A2-Right": {"Point": Point(335.94, 412.22, 299.16), "compensation": {"rear": -0.013, "front": 0}},
8080
"UninstallPos": {"Point": Point(223, 203, 500), "compensation": 0}
8181
}

ot3_testing/test_config/zstage_leveling_config.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,35 @@ class CalibrateMethod(enum.Enum):
1111

1212
Mount.LEFT: {
1313

14-
"Z-C2": {"point": Point(215, 197, 357), "compensation": {"rear": 0, "front": 0},
14+
"Z-C2": {"point": Point(215, 197, 357), "compensation": {"rear": 0.036, "front": 0},
1515
"channel_definition": ["below_rear", "below_front"]},
1616

1717
},
1818
Mount.RIGHT: {
19-
"Z-A1": {"point": Point(5, 410, 357), "compensation": {"rear": 0, "front": 0},
19+
"Z-A1": {"point": Point(5, 410, 357), "compensation": {"rear": -0.008, "front": 0},
2020
"channel_definition": ["below_rear", "below_front"]},
21-
"Z-A2": {"point": Point(175, 410, 357), "compensation": {"rear": 0, "front": 0},
21+
"Z-A2": {"point": Point(175, 410, 357), "compensation": {"rear": 0.006, "front": 0},
2222
"channel_definition": ["below_rear", "below_front"]},
23-
"Z-A3": {"point": Point(335, 410, 357), "compensation": {"rear": 0, "front": 0},
23+
"Z-A3": {"point": Point(335, 410, 357), "compensation": {"rear": -0.01, "front": 0},
2424
"channel_definition": ["below_rear", "below_front"]},
25-
"Z-B1": {"point": Point(5, 305, 357), "compensation": {"rear": 0, "front": 0},
25+
"Z-B1": {"point": Point(5, 305, 357), "compensation": {"rear": -0.035, "front": 0},
2626
"channel_definition": ["below_rear", "below_front"]},
27-
"Z-B2": {"point": Point(175, 305, 357), "compensation": {"rear": 0, "front": 0},
27+
"Z-B2": {"point": Point(175, 305, 357), "compensation": {"rear": 0.022, "front": 0},
2828
"channel_definition": ["below_rear", "below_front"]},
29-
"Z-B3": {"point": Point(335, 305, 357), "compensation": {"rear": 0, "front": 0},
29+
"Z-B3": {"point": Point(335, 305, 357), "compensation": {"rear": -0.011, "front": 0},
3030
"channel_definition": ["below_rear", "below_front"]},
31-
"Z-C1": {"point": Point(5, 197, 357), "compensation": {"rear": 0, "front": 0},
31+
"Z-C1": {"point": Point(5, 197, 357), "compensation": {"rear": -0.007, "front": 0},
3232
"channel_definition": ["below_rear", "below_front"]},
33-
"Z-C2": {"point": Point(175, 197, 357), "compensation": {"rear": 0, "front": 0},
33+
"Z-C2": {"point": Point(175, 197, 357), "compensation": {"rear": 0.001, "front": 0},
3434
"channel_definition": ["below_rear", "below_front"]},
3535

36-
"Z-C3": {"point": Point(335, 197, 357), "compensation": {"rear": 0, "front": 0},
36+
"Z-C3": {"point": Point(335, 197, 357), "compensation": {"rear": -0.034, "front": 0},
3737
"channel_definition": ["below_rear", "below_front"]},
38-
"Z-D1": {"point": Point(5, 92, 357), "compensation": {"rear": 0, "front": 0},
38+
"Z-D1": {"point": Point(5, 92, 357), "compensation": {"rear": 0.032, "front": 0},
3939
"channel_definition": ["below_rear", "below_front"]},
40-
"Z-D2": {"point": Point(175, 92, 357), "compensation": {"rear": 0, "front": 0},
40+
"Z-D2": {"point": Point(175, 92, 357), "compensation": {"rear": -0.003, "front": 0},
4141
"channel_definition": ["below_rear", "below_front"]},
42-
"Z-D3": {"point": Point(335, 92, 357), "compensation": {"rear": 0, "front": 0},
42+
"Z-D3": {"point": Point(335, 92, 357), "compensation": {"rear": -0.034, "front": 0},
4343
"channel_definition": ["below_rear", "below_front"]},
4444

4545

ot3_testing/tests/pipette_leveling.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,16 +271,21 @@ async def run_8ch_test(self, flex_name: str, project_path=None):
271271
await self.move_to_test_slot("UninstallPos") # 复位拆卸
272272
# show result
273273
csv_list = []
274+
csv_list_no_compensation = []
274275
csv_title = []
275276
now = datetime.datetime.now()
276277
time_str = now.strftime("%Y-%m-%d %H:%M:%S ")
278+
277279
csv_list.append(time_str + flex_name)
280+
csv_list_no_compensation.append(time_str + flex_name)
278281
csv_title.append(time_str + flex_name)
279282
print("=" * 5 + "Test Result" + "=" * 5 + "\n")
280283
for key, value in test_result.items():
281284
result = []
282285
distance_list = list(value.values())
283286
difference = round(abs(distance_list[0] - distance_list[1]), 3)
287+
csv_list_no_compensation.extend([round(distance_list[0], 3), round(distance_list[1], 3), difference])
288+
284289
compensation = self.slot_location[key]["compensation"]
285290
if ApplyCompensationFlag:
286291
compensation_idx = 0
@@ -290,18 +295,20 @@ async def run_8ch_test(self, flex_name: str, project_path=None):
290295
result.append(compensation_value + distance_list[compensation_idx])
291296
compensation_idx += 1
292297
difference = round(abs(result[0] - result[1]), 3)
298+
csv_list.extend([round(result[0], 3), round(result[1], 3), difference])
299+
else:
300+
csv_list = csv_list_no_compensation
293301
print(f"{key} --> {value} (mm) --> difference: {difference}(mm)")
294302
for item_key, item_value in value.items():
295303
csv_title.append(key + " " + item_key)
296-
csv_list.append(item_value)
297304
csv_title.append(key + "-Result")
298-
csv_list.append(difference)
299305

300306
# save csv
301307
if project_path is not None:
302308
file_path = os.path.join(project_path, 'testing_data', 'pipette_8ch_leveling.csv')
303309
else:
304310
file_path = '../../testing_data/pipette_8ch_leveling.csv'
311+
self.save_csv(file_path, csv_title, csv_list_no_compensation)
305312
self.save_csv(file_path, csv_title, csv_list)
306313
self.laser_sensor.close()
307314

0 commit comments

Comments
 (0)