homing: Add a small delay before each homing operation

The homing operation can be cpu intensive for the host software.  Add
a small (250ms) delay before homing so that the host has additional
time to process the command before it is due on the mcu.  This is
intended to work around some reports of "timer too close" errors
during Z homing on RPi2 hosts and printers with high precision Z
positioning.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-08-29 11:39:57 -04:00
parent 002dc0dfaf
commit 78f4c25a14
1 changed files with 5 additions and 1 deletions

View File

@ -1,10 +1,12 @@
# Code for state tracking during homing operations # Code for state tracking during homing operations
# #
# Copyright (C) 2016 Kevin O'Connor <kevin@koconnor.net> # Copyright (C) 2016,2017 Kevin O'Connor <kevin@koconnor.net>
# #
# This file may be distributed under the terms of the GNU GPLv3 license. # This file may be distributed under the terms of the GNU GPLv3 license.
import logging import logging
HOMING_DELAY = 0.250
class Homing: class Homing:
def __init__(self, toolhead, changed_axes): def __init__(self, toolhead, changed_axes):
self.toolhead = toolhead self.toolhead = toolhead
@ -29,6 +31,8 @@ class Homing:
# Alter kinematics class to think printer is at forcepos # Alter kinematics class to think printer is at forcepos
self.toolhead.set_position(self._fill_coord(forcepos)) self.toolhead.set_position(self._fill_coord(forcepos))
# Start homing and issue move # Start homing and issue move
if not second_home:
self.toolhead.dwell(HOMING_DELAY)
print_time = self.toolhead.get_last_move_time() print_time = self.toolhead.get_last_move_time()
endstops = [] endstops = []
for s in steppers: for s in steppers: