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>
This commit is contained in:
parent
c51f169c06
commit
14eec15267
|
@ -8,6 +8,12 @@ All dates in this document are approximate.
|
||||||
|
|
||||||
## Changes
|
## Changes
|
||||||
|
|
||||||
|
20221114: Previously, with safe_z_home, it was possible that the
|
||||||
|
z_hop after the g28 homing would go in the negative z direction.
|
||||||
|
Now, a z_hop is performed after g28 only if it results in a positive
|
||||||
|
hop, mirroring the behavior of the z_hop the occurs before
|
||||||
|
the g28 homing.
|
||||||
|
|
||||||
20220616: It was previously possible to flash an rp2040 in bootloader
|
20220616: It was previously possible to flash an rp2040 in bootloader
|
||||||
mode by running `make flash FLASH_DEVICE=first`. The equivalent
|
mode by running `make flash FLASH_DEVICE=first`. The equivalent
|
||||||
command is now `make flash FLASH_DEVICE=2e8a:0003`.
|
command is now `make flash FLASH_DEVICE=2e8a:0003`.
|
||||||
|
|
|
@ -79,7 +79,10 @@ class SafeZHoming:
|
||||||
self.prev_G28(g28_gcmd)
|
self.prev_G28(g28_gcmd)
|
||||||
# Perform Z Hop again for pressure-based probes
|
# Perform Z Hop again for pressure-based probes
|
||||||
if self.z_hop:
|
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
|
# Move XY back to previous positions
|
||||||
if self.move_to_previous:
|
if self.move_to_previous:
|
||||||
toolhead.manual_move(prevpos[:2], self.speed)
|
toolhead.manual_move(prevpos[:2], self.speed)
|
||||||
|
|
Loading…
Reference in New Issue