Skip to content

Commit

Permalink
fix(api): ensure critical points are acceptable for a 96 channel (#11890
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Laura-Danielle committed Dec 27, 2022
1 parent 65a9940 commit 5ae4276
Show file tree
Hide file tree
Showing 3 changed files with 362 additions and 157 deletions.
34 changes: 26 additions & 8 deletions api/src/opentrons/hardware_control/instruments/ot3/pipette.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
SupportedTipsDefinition,
TipHandlingConfigurations,
PipetteModelType,
PipetteChannelType,
)
from ..instrument_abc import AbstractInstrument
from .instrument_calibration import (
Expand Down Expand Up @@ -138,6 +139,10 @@ def __init__(
def config(self) -> PipetteConfigurations:
return self._config

@property
def channels(self) -> PipetteChannelType:
return self._max_channels

@property
def tip_overlap(self) -> Dict[str, float]:
return self._tip_overlap
Expand Down Expand Up @@ -253,6 +258,21 @@ def critical_point(self, cp_override: Optional[CriticalPoint] = None) -> Point:
"""
instr = Point(*self._pipette_offset.offset)
offsets = self.nozzle_offset
# Temporary solution for the 96 channel critical point locations.
# We should instead record every channel "critical point" in
# the pipette configurations.
if self.channels.value == 96:
NUM_ROWS = 12
NUM_COLS = 8
elif self.channels.value == 8:
NUM_ROWS = 1
NUM_COLS = 8
else:
NUM_ROWS = 1
NUM_COLS = 1

x_offset_to_right_nozzle = INTERNOZZLE_SPACING_MM * (NUM_ROWS - 1)
y_offset_to_front_nozzle = INTERNOZZLE_SPACING_MM * (NUM_COLS - 1)

if cp_override in [
CriticalPoint.GRIPPER_JAW_CENTER,
Expand All @@ -271,19 +291,17 @@ def critical_point(self, cp_override: Optional[CriticalPoint] = None) -> Point:
tip_length = self.current_tip_length
if cp_override == CriticalPoint.XY_CENTER:
mod_offset_xy = [
offsets[0],
offsets[1]
- (INTERNOZZLE_SPACING_MM * (self._config.channels.as_int - 1) / 2),
offsets[0] - x_offset_to_right_nozzle / 2,
offsets[1] - y_offset_to_front_nozzle / 2,
offsets[2],
]
cp_type = CriticalPoint.XY_CENTER
elif cp_override == CriticalPoint.FRONT_NOZZLE:
# front left nozzle of the 96 channel and
# front nozzle of the 8 channel
mod_offset_xy = [
0,
(
offsets[1]
- INTERNOZZLE_SPACING_MM * (self._config.channels.as_int - 1)
),
offsets[0],
offsets[1] - y_offset_to_front_nozzle,
offsets[2],
]
cp_type = CriticalPoint.FRONT_NOZZLE
Expand Down
Loading

0 comments on commit 5ae4276

Please sign in to comment.