Skip to content

Commit 65c9758

Browse files
works but messy
1 parent fe16ba4 commit 65c9758

File tree

6 files changed

+19
-8
lines changed

6 files changed

+19
-8
lines changed

api/src/opentrons/hardware_control/ot3api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3050,7 +3050,7 @@ async def dispense_while_tracking(
30503050
dispense_spec.instr.set_current_volume(0)
30513051
raise
30523052
else:
3053-
dispense_spec.instr.add_current_volume(dispense_spec.volume)
3053+
dispense_spec.instr.remove_current_volume(dispense_spec.volume)
30543054

30553055
@property
30563056
def attached_subsystems(self) -> Dict[SubSystem, SubSystemState]:

api/src/opentrons/protocol_engine/execution/movement.py

+1
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ async def move_to_well(
138138
force_direct=force_direct,
139139
minimum_z_height=minimum_z_height,
140140
operation_volume=operation_volume,
141+
is_tracking=is_tracking
141142
)
142143

143144
speed = self._state_store.pipettes.get_movement_speed(

api/src/opentrons/protocol_engine/execution/pipetting.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,12 @@ async def aspirate_while_tracking(
179179
aspirate_z_distance = self._state_view.geometry.get_liquid_handling_z_change(
180180
labware_id=labware_id,
181181
well_name=well_name, # make sure the protocol engine actually has the well name atp ?
182-
operation_volume=volume,
182+
operation_volume=volume * -1, # try this tomorrow
183183
)
184184
with self._set_flow_rate(pipette=hw_pipette, aspirate_flow_rate=flow_rate):
185185
await self._hardware_api.aspirate_while_tracking(
186186
mount=hw_pipette.mount,
187-
z_distance=aspirate_z_distance,
187+
z_distance=aspirate_z_distance * -1,
188188
flow_rate=flow_rate,
189189
volume=adjusted_volume,
190190
)
@@ -216,7 +216,7 @@ async def dispense_while_tracking(
216216
with self._set_flow_rate(pipette=hw_pipette, dispense_flow_rate=flow_rate):
217217
await self._hardware_api.dispense_while_tracking(
218218
mount=hw_pipette.mount,
219-
z_distance=dispense_z_distance,
219+
z_distance=(dispense_z_distance * -1),
220220
flow_rate=flow_rate,
221221
volume=adjusted_volume,
222222
push_out=push_out,

api/src/opentrons/protocol_engine/state/frustum_helpers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def find_volume_at_well_height(
362362
volumetric_capacity = get_well_volumetric_capacity(well_geometry)
363363
max_height = volumetric_capacity[-1][0]
364364
if target_height < 0 or target_height > max_height:
365-
raise InvalidLiquidHeightFound("Invalid target height.")
365+
raise InvalidLiquidHeightFound(f"Invalid target height {target_height}.")
366366
# volumes in volumetric_capacity are relative to each frustum,
367367
# so we have to find the volume of all the full sections enclosed
368368
# beneath the target height
@@ -423,7 +423,7 @@ def find_height_at_well_volume(
423423
volumetric_capacity = get_well_volumetric_capacity(well_geometry)
424424
max_volume = sum(row[1] for row in volumetric_capacity)
425425
if target_volume < 0 or target_volume > max_volume:
426-
raise InvalidLiquidHeightFound("Invalid target volume.")
426+
raise InvalidLiquidHeightFound(f"Invalid target volume {target_volume}, max vol {max_volume}.")
427427

428428
sorted_well = sorted(well_geometry.sections, key=lambda section: section.topHeight)
429429
# find the section the target volume is in and compute the height

api/src/opentrons/protocol_engine/state/geometry.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Geometry state getters."""
22

33
import enum
4+
# import logging
45
from numpy import array, dot, double as npdouble
56
from numpy.typing import NDArray
67
from typing import Optional, List, Tuple, Union, cast, TypeVar, Dict
@@ -1422,7 +1423,8 @@ def get_liquid_handling_z_change(
14221423
initial_height=initial_handling_height,
14231424
volume=operation_volume,
14241425
)
1425-
# make sure we handle aspirate and dispense both directions
1426+
# uncomment this
1427+
# return final_height - initial_handling_height
14261428
return initial_handling_height - final_height
14271429

14281430
def get_well_offset_adjustment(
@@ -1445,6 +1447,10 @@ def get_well_offset_adjustment(
14451447
well_location=well_location,
14461448
well_depth=well_depth,
14471449
)
1450+
# _log = logging.getLogger(__name__)
1451+
# raise ValueError(
1452+
# f"initial handling height {initial_handling_height} \n is_tracking {is_tracking}"
1453+
# )
14481454
if is_tracking:
14491455
return initial_handling_height
14501456
if isinstance(well_location, PickUpTipWellLocation):
@@ -1473,6 +1479,9 @@ def get_meniscus_height(
14731479
well_liquid = self._wells.get_well_liquid_info(
14741480
labware_id=labware_id, well_name=well_name
14751481
)
1482+
# raise ValueError(f"well = {well_liquid}")
1483+
# raise ValueError(f"prbed_height not none{well_liquid.probed_height is not None}\n \
1484+
# height.height is not None {well_liquid.probed_height.height is not None}")
14761485
if (
14771486
well_liquid.probed_height is not None
14781487
and well_liquid.probed_height.height is not None
@@ -1515,6 +1524,7 @@ def get_well_handling_height(
15151524
elif well_location.origin == WellOrigin.CENTER:
15161525
handling_height = well_depth / 2.0
15171526
elif well_location.origin == WellOrigin.MENISCUS:
1527+
# baddie here
15181528
handling_height = self.get_meniscus_height(
15191529
labware_id=labware_id, well_name=well_name
15201530
)

api/src/opentrons/protocol_engine/state/motion.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def get_movement_waypoints_to_well(
131131
extra_waypoints = self._geometry.get_extra_waypoints(
132132
location=location, to_slot=destination_slot
133133
)
134-
134+
# baddie here
135135
try:
136136
return motion_planning.get_waypoints(
137137
move_type=move_type,

0 commit comments

Comments
 (0)