Skip to content

Commit 3ac3f32

Browse files
author
andy
committed
merge pipette leveling
2 parents cf0bf66 + 82978a5 commit 3ac3f32

File tree

4 files changed

+32
-25
lines changed

4 files changed

+32
-25
lines changed

dist/Productions.exe

291 Bytes
Binary file not shown.

drivers/serial_driver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import serial
66
import serial.tools.list_ports
77

8-
ReceiveBuffer = 200
8+
ReceiveBuffer = 500
99

1010

1111
class SerialDriver:

ot3_testing/test_config/pipette_leveling_config.py

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,25 @@ class CalibrateMethod(enum.Enum):
77
Dichotomy = "dichotomy"
88

99

10-
SlotLocationCH96 = {"C1-Y": {"Point": Point(223, 203, 318), "compensation": 0.0},
11-
"C3-Y": {"Point": Point(207, 203, 318), "compensation": 0.0},
12-
"A2-Y": {"Point": Point(387, 421, 318), "compensation": 0.0},
13-
"C1-X": {"Point": Point(50, 91, 300), "compensation": 0.0},
14-
"C3-X": {"Point": Point(382, 91, 300), "compensation": 0.0},
15-
"A2-X": {"Point": Point(213, 305, 300), "compensation": 0.0},
16-
"D1-Z": {"Point": Point(51, 99, 318), "compensation": 0.0},
10+
SlotLocationCH96 = {"C1-Y": {"Point": Point(223, 203, 318), "compensation": {"left_rear": 0, "left_front": 0}},
11+
"C3-Y": {"Point": Point(207, 203, 318), "compensation": {"right_rear": 0, "right_front": 0}},
12+
"A2-Y": {"Point": Point(387, 421, 318), "compensation": {"left_rear": 0, "left_front": 0}},
13+
"C1-X": {"Point": Point(50, 91, 300), "compensation": {"left": 0, "right": 0}},
14+
"C3-X": {"Point": Point(382, 91, 300), "compensation": {"left": 0, "right": 0}},
15+
"A2-X": {"Point": Point(213, 305, 300), "compensation": {"left": 0, "right": 0}},
16+
"D1-Z": {"Point": Point(51, 99, 318),
17+
"compensation": {"rear_left": -0.56664, "rear_right": -0.6685, "front_left": -0.43876,
18+
"front_right": 0}},
1719
# "B2-Z": Point(213, 324, 317),
18-
"D3-Z": {"Point": Point(377, 99, 318), "compensation": 0.0},
19-
"C2-Z": {"Point": Point(214, 210, 318), "compensation": 0.0},
20-
"A2-Z": {"Point": Point(218, 424, 390.5), "compensation": 0.0},
20+
"D3-Z": {"Point": Point(377, 99, 318),
21+
"compensation": {"rear_left": -0.56664, "rear_right": -0.70712, "front_left": -0.41324,
22+
"front_right": 0}},
23+
"C2-Z": {"Point": Point(214, 210, 318),
24+
"compensation": {"rear_left": -0.60076, "rear_right": -0.679, "front_left": -0.32926,
25+
"front_right": 0}},
26+
"A2-Z": {"Point": Point(218, 424, 390.5),
27+
"compensation": {"rear_left": -0.57076, "rear_right": -0.694, "front_left": -0.40876,
28+
"front_right": 0}},
2129
"UninstallPos": {"Point": Point(223, 203, 500)}
2230
}
2331

@@ -46,4 +54,3 @@ class CalibrateMethod(enum.Enum):
4654
"Y-A2-Right": {"Point": Point(335.94, 412.22, 299.16), "compensation": -0.03},
4755
"UninstallPos": {"Point": Point(223, 203, 500), "compensation": 0}
4856
}
49-

ot3_testing/tests/pipette_leveling.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -366,22 +366,22 @@ async def run_96ch_test(self, flex_name: str, project_path=None):
366366
csv_title.append(time_str + flex_name)
367367
print("=" * 5 + "Test Result" + "=" * 5 + "\n")
368368
for key, value in test_result.items():
369+
result = [] # 本次写入结果
369370
distance_list = list(value.values())
370371
# differences
371-
if len(distance_list) <= 2:
372-
difference = distance_list[0] - distance_list[1]
373-
else:
374-
difference = max(distance_list) - min(distance_list)
375-
compensation = self.slot_location[key]["compensation"]
372+
difference = round(abs(max(distance_list) - min(distance_list)), 3)
373+
compensation: dict = self.slot_location[key]["compensation"]
376374
if ApplyCompensationFlag:
377-
print(f"apply offset {compensation} to {difference}, difference -> {difference - compensation}")
378-
difference = abs(difference - compensation)
379-
# max_value_idx = self.get_max_index(distance_list)
380-
# distance_list[max_value_idx] = distance_list[max_value_idx] - compensation
381-
print(f"{key} --> {value} (mm) --> difference: {round(difference, 3)}(mm)")
375+
compensation_idx = 0
376+
for compensation_key, compensation_value in compensation.items():
377+
print(f"apply offset {compensation_key} -> {compensation_value} to {distance_list[compensation_idx]}")
378+
result.append(compensation_value + distance_list[compensation_idx])
379+
compensation_idx += 1
380+
difference = round((abs(max(result) - min(result))), 3)
381+
print(f"{key} --> {value} (mm) \ndifference: {difference}(mm)\n")
382382
for item_key, item_value in value.items():
383383
csv_title.append(key + " " + item_key)
384-
for values in distance_list:
384+
for values in result:
385385
csv_list.append(values)
386386
if 'Z' not in key:
387387
csv_title.append(key + "-Result")
@@ -413,5 +413,5 @@ async def run_96ch_test(self, flex_name: str, project_path=None):
413413

414414
if __name__ == '__main__':
415415
import asyncio
416-
pipette_leveling = PipetteLeveling(SlotLocationCH96, ChannelDefinitionCH96, robot_ip="192.168.6.62")
417-
asyncio.run(pipette_leveling.run_96ch_test(""))
416+
pipette_leveling = PipetteLeveling(SlotLocationCH96, ChannelDefinitionCH96, )
417+
asyncio.run(pipette_leveling.run_96ch_test("FLXA1020240513001"))

0 commit comments

Comments
 (0)