-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Klippy-Tools-Bot
committed
Oct 27, 2024
1 parent
da2d849
commit cf71b6c
Showing
5 changed files
with
19 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
9a2e079 | ||
13cea1c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Helper code for implementing homing operations | ||
# | ||
# Copyright (C) 2016-2021 Kevin O'Connor <[email protected]> | ||
# Copyright (C) 2016-2024 Kevin O'Connor <[email protected]> | ||
# | ||
# This file may be distributed under the terms of the GNU GPLv3 license. | ||
import logging, math | ||
|
@@ -29,10 +29,17 @@ def __init__(self, stepper, endstop_name): | |
self.endstop_name = endstop_name | ||
self.stepper_name = stepper.get_name() | ||
self.start_pos = stepper.get_mcu_position() | ||
self.start_cmd_pos = stepper.mcu_to_commanded_position(self.start_pos) | ||
self.halt_pos = self.trig_pos = None | ||
def note_home_end(self, trigger_time): | ||
self.halt_pos = self.stepper.get_mcu_position() | ||
self.trig_pos = self.stepper.get_past_mcu_position(trigger_time) | ||
def verify_no_probe_skew(self, haltpos): | ||
new_start_pos = self.stepper.get_mcu_position(self.start_cmd_pos) | ||
if new_start_pos != self.start_pos: | ||
logging.warning( | ||
"Stepper '%s' position skew after probe: pos %d now %d", | ||
self.stepper.get_name(), self.start_pos, new_start_pos) | ||
|
||
# Implementation of homing/probing moves | ||
class HomingMove: | ||
|
@@ -121,6 +128,9 @@ def homing_move(self, movepos, speed, probe_pos=False, | |
haltpos = trigpos = self.calc_toolhead_pos(kin_spos, trig_steps) | ||
if trig_steps != halt_steps: | ||
haltpos = self.calc_toolhead_pos(kin_spos, halt_steps) | ||
self.toolhead.set_position(haltpos) | ||
for sp in self.stepper_positions: | ||
sp.verify_no_probe_skew(haltpos) | ||
else: | ||
haltpos = trigpos = movepos | ||
over_steps = {sp.stepper_name: sp.halt_pos - sp.trig_pos | ||
|
@@ -130,7 +140,7 @@ def homing_move(self, movepos, speed, probe_pos=False, | |
halt_kin_spos = {s.get_name(): s.get_commanded_position() | ||
for s in kin.get_steppers()} | ||
haltpos = self.calc_toolhead_pos(halt_kin_spos, over_steps) | ||
self.toolhead.set_position(haltpos) | ||
self.toolhead.set_position(haltpos) | ||
# Signal homing/probing move complete | ||
try: | ||
self.printer.send_event("homing:homing_move_end", self) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters