Moving Z before homing or other

My bed goes to full extents when power off or klipper disconnect/restart. I use a probe for Z and need the Z_safe_home to z hop during G28. However, this is a problem (Z_SAFE_HOME) when the bed is at the full extent of travel.
Core XY system where nozzle is at the top of machine and Z moves up to the nozzle.

So I need to detect the homing state with {% if printer.homed_axes != ‘XYZ’ %} and make a Z move off the mechanical stop, then G28.

If I could jog the Z during not homed status with a macro it would work. Or if I could use the homing override along with Z safe home, but homing override only active with {% if printer.homed_axes != ‘XYZ’ %}.
OR… is there a way to accomplish in another way?

Not sure I fully understand what you need, but have you looked into Force movement?

Yes, the force move works. However, force move only works with one stepper at a time and I have 2 steppers for Z. I made a macro that moves each side a small amount until up 6mm from the bottom. There must be a better way!
Also, I used boolean to try and prohibit this function when the axis are homed:
[gcode_macro HOME]
{% if printer.homed_axes != ‘XYZ’ %}
force_move stepper=stepper_z1 distance=-.9 velocity=100 accel=300
force_move stepper=stepper_z distance=-.125 velocity=100 accel=300
{% endif %}

It still performs the funciton even after homed.

I have a similar CoreXY machine with dual Z steppers, and sometimes need to lower the bed before it’s safe to home after a failed print.

Here’s my macro for moving the bed down/Z up without homing.

# Enable commands that force potentially unsafe movement
enable_force_move: True

[gcode_macro UNSAFE_LOWER_BED]
description: Lower the bed 10mm without homing
  G0 Z10 F600

SET_KINEMATIC_POSITION tells the machine to consider Z to already be homed, and the current position to be 0. Then move Z up (bed down) 10mm. The M84 at the end disables steppers - which makes the machine consider itself unhomed again, so you won’t accidentally start moving it around without properly homing it.

Sineos: Edit formating


Yes, thanks. I ended up, when I posted this, reverting back to screw drive. I did solve the issue, similar to what you posted. Now I went back to belt drive and use again.

FYI: printer.homed_axes isn’t a thing but printer.toolhead.homed_axes is. And unfortunately this fails silently as if it did exist. Also the axis letters are lower case.

    {% if not 'xyz' in printer.toolhead.homed_axes %}
        G32                             ; home all axes if not homed
    {% endif %}
1 Like

For i3 style printers you’ll need to move gantry down after tall prints and homing will crash the Z in upper frame before go down. The macro from @grant gave out or range when I try to move the gantry down so I change the approach: SET_KINEMATIC_POSITION to desire distance and move to “zero”

[gcode_macro UNSAFE_MOVE_Z]
description: Move the Z without homing
    {% set MOVE_MM = params.MM|default(-30)|float * (-1) %}
    G0 Z0 F600