diff --git a/api/src/opentrons/drivers/smoothie_drivers/driver_3_0.py b/api/src/opentrons/drivers/smoothie_drivers/driver_3_0.py index c88444f00cb..540efbbde31 100755 --- a/api/src/opentrons/drivers/smoothie_drivers/driver_3_0.py +++ b/api/src/opentrons/drivers/smoothie_drivers/driver_3_0.py @@ -5,6 +5,9 @@ from time import sleep, time from threading import Event, RLock from typing import Any, Dict, Optional, Union, List, Tuple, cast +from typing import Any, Dict, Optional, Union, List, Tuple, cast +from typing_extensions import Final + from math import isclose from serial.serialutil import SerialException # type: ignore @@ -33,14 +36,15 @@ # TODO (artyom, ben 20171026): move to config -HOMED_POSITION: Dict[str, float] = { - 'X': 418, - 'Y': 353, - 'Z': 218, - 'A': 218, - 'B': 19, - 'C': 19 +HOMED_POSITION: Final = { + 'X': 418.0, + 'Y': 353.0, + 'Z': 218.0, + 'A': 218.0, + 'B': 19.0, + 'C': 19.0 } +Y_BOUND_OVERRIDE: Final = 370 PLUNGER_BACKLASH_MM = 0.3 @@ -415,9 +419,15 @@ def gpio_chardev(self, gpio_chardev): self._gpio_chardev = gpio_chardev @property - def homed_position(self): + def homed_position(self) -> Dict[str, float]: return self._homed_position.copy() + @property + def axis_bounds(self) -> Dict[str, float]: + bounds = {k: v for k, v in self._homed_position.items()} + bounds['Y'] = Y_BOUND_OVERRIDE + return bounds + def _update_position(self, target): self._position.update({ axis: value diff --git a/api/src/opentrons/hardware_control/controller.py b/api/src/opentrons/hardware_control/controller.py index 80d3c01480e..63ba9bf098b 100644 --- a/api/src/opentrons/hardware_control/controller.py +++ b/api/src/opentrons/hardware_control/controller.py @@ -263,7 +263,7 @@ async def connect(self, port: str = None): def axis_bounds(self) -> Dict[Axis, Tuple[float, float]]: """ The (minimum, maximum) bounds for each axis. """ return {Axis[ax]: (0, pos) for ax, pos - in self._smoothie_driver.homed_position.items() + in self._smoothie_driver.axis_bounds.items() if ax not in 'BC'} @property diff --git a/api/src/opentrons/hardware_control/simulator.py b/api/src/opentrons/hardware_control/simulator.py index 81e2dd7a5cd..a021a5f9510 100644 --- a/api/src/opentrons/hardware_control/simulator.py +++ b/api/src/opentrons/hardware_control/simulator.py @@ -36,7 +36,10 @@ MODULE_LOG = logging.getLogger(__name__) -_HOME_POSITION = {'X': 418.0, 'Y': 353.0, 'Z': 218.0, +_HOME_POSITION: Final = {'X': 418.0, 'Y': 353.0, 'Z': 218.0, + 'A': 218.0, 'B': 19.0, 'C': 19.0} + +_BOUNDS: Final = {'X': 418.0, 'Y': 370.0, 'Z': 218.0, 'A': 218.0, 'B': 19.0, 'C': 19.0} @@ -288,7 +291,7 @@ async def build_module( @property def axis_bounds(self) -> Dict[Axis, Tuple[float, float]]: """ The (minimum, maximum) bounds for each axis. """ - return {Axis[ax]: (0, pos) for ax, pos in _HOME_POSITION.items() + return {Axis[ax]: (0, pos) for ax, pos in _BOUNDS.items() if ax not in 'BC'} @property diff --git a/api/src/opentrons/tools/overnight_test.py b/api/src/opentrons/tools/overnight_test.py index c1a93beadf9..5efd4902393 100644 --- a/api/src/opentrons/tools/overnight_test.py +++ b/api/src/opentrons/tools/overnight_test.py @@ -29,8 +29,8 @@ attempts_to_home = 1 too_many_attempts_to_home = 3 -XY_TOLERANCE = 30 -ZA_TOLERANCE = 10 +XY_TOLERANCE = 30.0 +ZA_TOLERANCE = 10.0 AXIS_TEST_SKIPPING_TOLERANCE = 0.5