diff --git a/config/example.cfg b/config/example.cfg index 5b9b3264..b8531691 100644 --- a/config/example.cfg +++ b/config/example.cfg @@ -55,6 +55,10 @@ position_max: 200 # Distance to backoff (in mm) before homing a second time during # homing. Set this to zero to disable the second home. The default # is 5mm. +#homing_retract_speed: +# Speed to use on the retract move after homing in case this should +# be different from the homing speed, which is the default for this +# parameter #second_homing_speed: # Velocity (in mm/s) of the stepper when performing the second home. # The default is homing_speed/2. diff --git a/klippy/homing.py b/klippy/homing.py index be940447..f681e26b 100644 --- a/klippy/homing.py +++ b/klippy/homing.py @@ -130,7 +130,7 @@ class Homing: retract_r = min(1., hi.retract_dist / move_d) retractpos = [mp - ad * retract_r for mp, ad in zip(movepos, axes_d)] - self.toolhead.move(retractpos, hi.speed) + self.toolhead.move(retractpos, hi.retract_speed) # Home again forcepos = [rp - ad * retract_r for rp, ad in zip(retractpos, axes_d)] diff --git a/klippy/stepper.py b/klippy/stepper.py index d4fe63ba..8b3f943b 100644 --- a/klippy/stepper.py +++ b/klippy/stepper.py @@ -236,6 +236,8 @@ class PrinterRail: self.homing_speed = config.getfloat('homing_speed', 5.0, above=0.) self.second_homing_speed = config.getfloat( 'second_homing_speed', self.homing_speed/2., above=0.) + self.homing_retract_speed = config.getfloat( + 'homing_retract_speed', self.homing_speed, above=0.) self.homing_retract_dist = config.getfloat( 'homing_retract_dist', 5., minval=0.) self.homing_positive_dir = config.getboolean( @@ -254,11 +256,11 @@ class PrinterRail: return self.position_min, self.position_max def get_homing_info(self): homing_info = collections.namedtuple('homing_info', [ - 'speed', 'position_endstop', 'retract_dist', 'positive_dir', - 'second_homing_speed'])( + 'speed', 'position_endstop', 'retract_speed', 'retract_dist', + 'positive_dir', 'second_homing_speed'])( self.homing_speed, self.position_endstop, - self.homing_retract_dist, self.homing_positive_dir, - self.second_homing_speed) + self.homing_retract_speed, self.homing_retract_dist, + self.homing_positive_dir, self.second_homing_speed) return homing_info def get_steppers(self): return list(self.steppers)