jlas1 / Klicky-Probe

Microswitch probe with magnetic attachement, primarily aimed at CoreXY 3d printers
GNU General Public License v3.0
1.23k stars 279 forks source link

ZMax Endstop Excessive Travels #189

Open the1snm opened 1 year ago

the1snm commented 1 year ago

I've been using the klicky-probe on my V2.4 for about a year now with great results. During that time I've converted my other machines to klipper and now made a custom klicky mount for my Qidi XPlus. This is a dual screw bed where the bed moves up and down sort of like the Trident. My dual Z endstops are on the bottom or max position for the bed. Prior to klicky, home would do X, Y and Z to the bottom and stay there. I like this because it allows easy removal of prints etc. After switching to klicky and getting it enough to be working I find it never stays at the bottom anymore. A home all or G28 Z drops the bed 10 away from the nozzle then proceeds to go to the floor to hit the endstops before shooting back up to Z10 again. Is there a way to setup the macro or variables to exhibit the same behavior as before? My first concern is the excessive up and down, for example: my print_start macro kicks off a G28 which sends it down and back up, followed be a tilt adjust which sends it down and back up then a bed mesh calibrate which sends it back down and backup again. (I did find the attach_probe_lock comments in here and this helps alleviate some but all those ups and downs I feel are introducing slight inaccuracies in my Z height which I see as needing more live stepping in the beginning vs no klicky. Second I'm concerned about the wear now on the Z assembly with so much action. Last and also quite important is when a print is finished if I try to G28 Z in order to have clearance to remove a print through the door and from the X gantry it shoots to the bottom and right back up sending my print into the gantry.

The other thing I noticed is now if my bed is manually lowered to the endstops and I trigger a home it seems to ignore the already triggered endstops and tries to push my bed through the floor of my printer out under my desk :) I understand the importance of this lift or drop especially like on my V24 so the gantry moves up and out of the way (although on a tall print there I did have a problem with the gantry crashing the top of the frame necessitating a number of printer repairs) but is there a way for the macro to first validate the endstop is triggered before engaging in a 10mm or more drop to clear the extruder? The stock configuration of klipper does this as if the endstops aren't triggered the bed just goes down to the endstops. If they are already triggered it just goes up a little and does a quick secondary home.

I know I have a little bit of a less common setup with the bed moving up and down (with max endstops) but I feel like this is not a crazy way to do it and that I must be missing something in the variables to allow this. Thanks for all the time and effort going into this project I really do appreciate it.

Here's my setup configs:

klicky-probe.cfg
[include ./klicky-variables.cfg]                #Required
[include ./klicky-macros.cfg]                   #Required
[include ./klicky-bed-mesh-calibrate.cfg]      #bed mesh, requires klipper configuration
[include ./klicky-z-tilt-adjust.cfg]           #level 2 or 3 Z motors
[gcode_macro _User_Variables]
variable_verbose:             False    # Enable verbose output
variable_debug:              False    # Enable Debug output
variable_travel_speed:         100  #200    # how fast all other travel moves will be performed when running these macros
variable_move_accel:          1000    # how fast should the toolhead accelerate when moving
variable_dock_speed:            100 #50    # how fast should the toolhead move when docking the probe for the final movement
variable_release_speed:         100 #75    # how fast should the toolhead move to release the hold of the magnets after docking
variable_z_drop_speed:          20    # how fast the z will lower when moving to the z location to clear the probe

variable_safe_z:                10     # Minimum Z for attach/dock and homing functions
# if true it will move the bed away from the nozzle when Z is not homed
variable_enable_z_hop:        True    # set this to false for beds that fall significantly under gravity (almost to Z max)

variable_max_bed_y:            200  #120    # maximum Bed size avoids doing a probe_accuracy outside the bed
variable_max_bed_x:            270  #120    # maximum Bed size avoids doing a probe_accuracy outside the bed

# if a separate Z endstop switch is in
# use, specify the coordinates of the switch here (Voron).
# Set to 0 to have the probe move to center of bed
variable_z_endstop_x:         0 #1000
variable_z_endstop_y:         0 #1000

#Check the printer specific documentation on klipper Dock/Undock configuration, these are dummy values
#dock location
variable_docklocation_x:      264   #1000    # X Dock position
variable_docklocation_y:      0.5   #1000    # Y Dock position
variable_docklocation_z:      -128    # Z dock position (-128 for a gantry/frame mount)

#The following variables are used if the dock is deployed and retracted via a servo motor
variable_enable_dock_servo:  False    # Set to true if your klicky dock is servo-controlled
variable_servo_name:        'NAME'    # The name of the dock servo defined in printer.cfg under [servo]
variable_servo_deploy:          10    # This EXAMPLE is the value used to deploy the servo fully
variable_servo_retract:         11    # This EXAMPLE is the value used to retract the servo fully (initial_angle in [servo] config)
variable_servo_delay:          250    # This is a delay to wait the servo to reach the requested position, be carefull with high values

#Dock move, final toolhead movement to release the probe on the dock
#it's a relative move
Variable_dockmove_x:          -50    #1000
Variable_dockmove_y:             0
Variable_dockmove_z:             0

#Attach move. final toolhead movement to attach the probe on the mount
#it's a relative move
Variable_attachmove_x:        0     #1000
Variable_attachmove_y:        -50     #0
Variable_attachmove_z:        0

#Umbilical to help untangle the umbilical in difficult situations
variable_umbilical:          False    # should we untangle the umbilical
variable_umbilical_x:           15    # X umbilical position
variable_umbilical_y:           15    # Y umbilical position

# location to park the toolhead
variable_park_toolhead:      False    # Enable toolhead parking
variable_parkposition_x:       135  #125
variable_parkposition_y:       100  #125
variable_parkposition_z:       30

variable_version:                1    # Helps users to update the necessary variables, do not update if the variables above are not updated

#Below this remark, you normally do not need to configure
#Attach move2
Variable_attachmove2_x:          0    # intermediate toolhead movement to attach
Variable_attachmove2_y:          0    # the probe on the dock
Variable_attachmove2_z:          0    # (can be negative)

variable_home_backoff_x:        10    # how many mm to move away from the X endstop after homing X
# this is useful for the voron v0 to enable the toolhead to move out of the way to allow an unstricted Y homing
variable_home_backoff_y:        10    # how many mm to move away from the Y endstop after homing Y

variable_override_homing:       'Y'   #'' # configures what axis to home first
                                      #  '' = default klicky behavior (tries to avoid the hitting the dock)
                                      # 'X' = forces X to home first
                                      # 'Y' = forces Y to home first

variable_dock_on_zhome:       True    # docks the probe on Z Homing if not necessary (avoids hitting the bed on some printers                                      

# Do not modify below