homing: Base homing cpu delay on estimated number of steps needed
Instead of adding 250ms to each homing operation add a time relative to the number of estimated steps that are to be generated. This scales the delay to really large axes without adding a delay for normal users. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
6bbb84326d
commit
6930a7de8d
|
@ -5,7 +5,7 @@
|
||||||
# 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
|
HOMING_STEP_DELAY = 0.00000025
|
||||||
ENDSTOP_SAMPLE_TIME = .000015
|
ENDSTOP_SAMPLE_TIME = .000015
|
||||||
ENDSTOP_SAMPLE_COUNT = 4
|
ENDSTOP_SAMPLE_COUNT = 4
|
||||||
|
|
||||||
|
@ -34,7 +34,13 @@ class Homing:
|
||||||
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:
|
if not second_home:
|
||||||
self.toolhead.dwell(HOMING_DELAY)
|
est_move_d = sum([abs(forcepos[i]-movepos[i])
|
||||||
|
for i in range(3) if movepos[i] is not None])
|
||||||
|
est_steps = sum(
|
||||||
|
[est_move_d / mcu_stepper.get_step_dist()
|
||||||
|
for s in steppers
|
||||||
|
for mcu_endstop, mcu_stepper, name in s.get_endstops()])
|
||||||
|
self.toolhead.dwell(est_steps * HOMING_STEP_DELAY, check_stall=False)
|
||||||
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:
|
||||||
|
|
|
@ -329,10 +329,11 @@ class ToolHead:
|
||||||
self._check_stall()
|
self._check_stall()
|
||||||
def home(self, homing_state):
|
def home(self, homing_state):
|
||||||
self.kin.home(homing_state)
|
self.kin.home(homing_state)
|
||||||
def dwell(self, delay):
|
def dwell(self, delay, check_stall=True):
|
||||||
self.get_last_move_time()
|
self.get_last_move_time()
|
||||||
self.update_move_time(delay)
|
self.update_move_time(delay)
|
||||||
self._check_stall()
|
if check_stall:
|
||||||
|
self._check_stall()
|
||||||
def motor_off(self):
|
def motor_off(self):
|
||||||
self.dwell(STALL_TIME)
|
self.dwell(STALL_TIME)
|
||||||
last_move_time = self.get_last_move_time()
|
last_move_time = self.get_last_move_time()
|
||||||
|
|
Loading…
Reference in New Issue