Skip to content

Commit

Permalink
sensorless: dwell once for all rails
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerlz committed Jun 15, 2024
1 parent b1b62f1 commit 1f7a1ba
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions klippy/extras/homing.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,16 +261,16 @@ def _set_current_homing(self, homing_axes):
partial_rails = self.toolhead.get_active_rails_for_axis(axis_name)
affected_rails = affected_rails | set(partial_rails)

dwell_time = None
for rail in affected_rails:
chs = rail.get_tmc_current_helpers()
dwell_time = None
for ch in chs:
if ch is not None and ch.needs_home_current_change():
if dwell_time is None:
dwell_time = ch.current_change_dwell_time
ch.set_current_for_homing(print_time)
if dwell_time:
self.toolhead.dwell(dwell_time)
if dwell_time:
self.toolhead.dwell(dwell_time)

def _set_current_post_homing(self, homing_axes):
print_time = self.toolhead.get_last_move_time()
Expand All @@ -280,16 +280,16 @@ def _set_current_post_homing(self, homing_axes):
partial_rails = self.toolhead.get_active_rails_for_axis(axis_name)
affected_rails = affected_rails | set(partial_rails)

dwell_time = None
for rail in affected_rails:
chs = rail.get_tmc_current_helpers()
dwell_time = None
for ch in chs:
if ch is not None and ch.needs_run_current_change():
if dwell_time is None:
dwell_time = ch.current_change_dwell_time
ch.set_current_for_normal(print_time)
if dwell_time:
self.toolhead.dwell(dwell_time)
if dwell_time:
self.toolhead.dwell(dwell_time)

def home_rails(self, rails, forcepos, movepos):
# Notify of upcoming homing operation
Expand Down

0 comments on commit 1f7a1ba

Please sign in to comment.