Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api): maintain speed state after collision recovery #1953

Merged
merged 2 commits into from
Jul 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions api/opentrons/drivers/smoothie_drivers/driver_3_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,8 +872,8 @@ def _home_x(self):
log.debug("_home_x")
# move the gantry forward on Y axis with low power
self._save_current({'Y': Y_BACKOFF_LOW_CURRENT})
self.push_speed()
self.set_speed(Y_BACKOFF_SLOW_SPEED)
self.push_axis_max_speed()
self.set_axis_max_speed({'Y': Y_BACKOFF_SLOW_SPEED})

# move away from the Y endstop switch, then backward half that distance
relative_retract_command = '{0} {1}Y{2} {3}Y{4} {5}'.format(
Expand All @@ -888,13 +888,11 @@ def _home_x(self):
command = '{0} {1}'.format(
self._generate_current_command(), relative_retract_command)
self._send_command(command, timeout=DEFAULT_MOVEMENT_TIMEOUT)
self.pop_speed()
self.dwell_axes('Y')

# now it is safe to home the X axis
try:
# override firmware's default XY homing speed, to avoid resonance
self.push_axis_max_speed()
self.set_axis_max_speed({'X': XY_HOMING_SPEED})
self.activate_axes('X')
command = '{0} {1}'.format(
Expand Down
4 changes: 3 additions & 1 deletion api/opentrons/tools/gantry_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
"""

from opentrons import robot
from opentrons.drivers.smoothie_drivers.driver_3_0 import SmoothieError
from opentrons.drivers.smoothie_drivers.driver_3_0 import \
SmoothieError, DEFAULT_AXES_SPEED


def setup_motor_current():
# only set the current, keeping all other settings at the driver's default
robot._driver.set_speed(DEFAULT_AXES_SPEED)
x_current = robot.config.high_current['X'] * 0.85
y_current = robot.config.high_current['Y'] * 0.85
robot._driver.set_active_current(
Expand Down
3 changes: 1 addition & 2 deletions api/tests/opentrons/drivers/test_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,8 @@ def _parse_position_response(arg):
expected = [
['M907 A0.8 B0.5 C0.5 X0.3 Y0.3 Z0.8 G4P0.005 G28.2.+[ABCZ].+ M400'],
['M907 A0.1 B0.05 C0.05 X0.3 Y0.3 Z0.1 G4P0.005 M400'],
['G0F3000 M400'],
['M203.1 Y50 M400'],
['M907 A0.1 B0.05 C0.05 X0.3 Y0.8 Z0.1 G4P0.005 G91 G0Y-28 G0Y10 G90 M400'], # NOQA
['G0F24000 M400'],
['M203.1 X80 M400'],
['M907 A0.1 B0.05 C0.05 X1.25 Y0.3 Z0.1 G4P0.005 G28.2X M400'],
['M203.1 A125 B50 C50 X600 Y400 Z125 M400'],
Expand Down