Closed dspears0809 closed 1 year ago
I have modified the function the following way:
def move_to_safe_z():
safe_z = None
if isKlicky:
safe_z = query_printer_objects("gcode_macro _User_Variables", "safe_z")
elif isTap:
settings = query_printer_objects("configfile", "settings")
if "safe_z_home" in settings:
safe_z = settings["safe_z_home"]["z_hop"]
if not safe_z:
print("Safe z has not been set in klicky-variables or in [safe_z_home]")
safe_z = input("Enter safe z height to avoid crash:")
send_gcode(f"G1 Z{safe_z}")
That way the script asks for a safe_z value and does not crash because safe_z_home
is not present
This seems a reasonable solution. Thanks!
While running:
Receive python exception for missing key name
safe_z_home
:I'm running sensorless homing using custom gcode in
homing_override
to handle custom movements and energizing Z-motors to combat gantry sag prior to homing procedures instead of having asafe_z_home
section.Code where it appears to fail:
What would you recommend to work-around the issue?