diff options
author | redstone99 <redstone@gmail.com> | 2022-11-22 18:55:43 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-22 18:55:43 -0500 |
commit | 14eec15267d395d0f72109838bf67c4080f30d4e (patch) | |
tree | 8d0d70517a7ca8c9bfea1aa7027acb9f5c60a21a /klippy/extras | |
parent | c51f169c06921152a2e9c386016660d0bb09f767 (diff) | |
download | kutter-14eec15267d395d0f72109838bf67c4080f30d4e.tar.gz kutter-14eec15267d395d0f72109838bf67c4080f30d4e.tar.xz kutter-14eec15267d395d0f72109838bf67c4080f30d4e.zip |
safe_z_home: Fix final z hop to use relative z coordinates (#5879)
After a G28 z-axis homing, there is a final z hop.
It was hoping to height z_hop as an absolute z height rather than relative.
If the z-axis home leaves the head at a z height higher than z_hop,
e.g. because you were using a probe to do z homing,
this meant that it was z hopping in the negative z direction, which
could result in crashing the toolhead.
Signed-off-by: Joshua Redstone <redstone@gmail.com>
Diffstat (limited to 'klippy/extras')
-rw-r--r-- | klippy/extras/safe_z_home.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/klippy/extras/safe_z_home.py b/klippy/extras/safe_z_home.py index 581c9878..ca9b8eb5 100644 --- a/klippy/extras/safe_z_home.py +++ b/klippy/extras/safe_z_home.py @@ -79,7 +79,10 @@ class SafeZHoming: self.prev_G28(g28_gcmd) # Perform Z Hop again for pressure-based probes if self.z_hop: - toolhead.manual_move([None, None, self.z_hop], self.z_hop_speed) + pos = toolhead.get_position() + if pos[2] < self.z_hop: + toolhead.manual_move([None, None, self.z_hop], + self.z_hop_speed) # Move XY back to previous positions if self.move_to_previous: toolhead.manual_move(prevpos[:2], self.speed) |