Skip to content

Commit 5ce210e

Browse files
author
andy
committed
modified z-axis compensation
1 parent 8214d30 commit 5ce210e

File tree

2 files changed

+29
-22
lines changed

2 files changed

+29
-22
lines changed

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.25},
11-
"C3-Y": {"Point": Point(207, 203, 318), "compensation": 0.01},
12-
"A2-Y": {"Point": Point(387, 421, 318), "compensation": 0.26},
13-
"C1-X": {"Point": Point(50, 91, 300), "compensation": 0.30},
14-
"C3-X": {"Point": Point(382, 91, 300), "compensation": 0.27},
15-
"A2-X": {"Point": Point(213, 305, 300), "compensation": 0.3},
16-
"D1-Z": {"Point": Point(51, 99, 318), "compensation": 0.5},
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.44},
19-
"C2-Z": {"Point": Point(214, 210, 318), "compensation": 0.46},
20-
"A2-Z": {"Point": Point(218, 424, 390.5), "compensation": 0.31},
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: 11 additions & 11 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)")
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")

0 commit comments

Comments
 (0)