jlas1 / Klicky-Probe

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

Homing issues #232

Open v0nsild opened 8 months ago

v0nsild commented 8 months ago

I just finished up my ender SW build with this probe and downloaded and edited the macros as per the instructions.

When I try to home X or Y separately, X moves down a fair bit and then moves like 10 mm to one side, and it's "homed". If I home it again, it will go to the end and stop there (sensorless). Y moves 10 mm every time I press home Y.

Inverting Z doesn't affect which way it moves when homing X, it only goes towards the bed.

If I home all axes, X homes fine, Y moves a bit and stops, and Z flys down towards the bed and crashes.

I'm really at a loss here, and would appreciate all the help I can get, this doesn't seem logical to me anymore.

############ PRINTER CFG

[stepper_x] step_pin: P2.2 dir_pin: P2.6 enable_pin: !P2.1 microsteps: 16 rotation_distance: 40 full_steps_per_rotation:400 endstop_pin: tmc2209_stepper_x:virtual_endstop position_endstop: 0 position_min: 0 position_max: 220 homing_speed: 40 homing_retract_dist: 0 #Normal 10

[stepper_y] step_pin: P0.19 dir_pin: P0.20 enable_pin: !P2.8 microsteps: 16 rotation_distance: 40 endstop_pin: tmc2209_stepper_y:virtual_endstop position_endstop: 0 position_min: 0 position_max: 220 homing_speed: 40 homing_retract_dist: 0 #Normal 10

[stepper_z] step_pin: P0.22 dir_pin: !P2.11 enable_pin: !P0.21 microsteps: 16 rotation_distance: 40 full_steps_per_rotation: 400 endstop_pin: probe:z_virtual_endstop #!P1.27 position_min: -8 position_max: 220 homing_speed: 10 second_homing_speed: 5 homing_retract_dist: 3

[probe] pin: ^P0.10

z_offset: 0 #Measure per your specific setup

x_offset: 1.7 # negative = left of the nozzle y_offset: 35.5 # negative = in front of of the nozzle speed: 5 lift_speed: 5 sample_retract_dist: 2 samples: 2 samples_tolerance_retries: 6

[extruder] step_pin: P2.13 dir_pin: !P0.11 enable_pin: !P2.12 microsteps: 16 rotation_distance: 7.48837 nozzle_diameter: 0.400 filament_diameter: 1.750 heater_pin: P2.7 sensor_type: EPCOS 100K B57560G104F sensor_pin: P0.24

control: pid

pid_Kp: 22.2

pid_Ki: 1.08

pid_Kd: 114

min_temp: -273 max_temp: 999999 max_extrude_only_distance: 100 max_extrude_cross_section: 30

[heater_bed] heater_pin: P2.5 sensor_type: EPCOS 100K B57560G104F sensor_pin: P0.25

control: pid

pid_Kp: 54.027

pid_Ki: 0.770

pid_Kd: 948.182

min_temp: -273 max_temp: 999999

[fan] pin: P2.3 max_power: 1 shutdown_speed: 0 kick_start_time: 0.5

[heater_fan heater_cooling_fan] pin: P2.4 max_power: 1.0 shutdown_speed: 0 kick_start_time: 0.5 heater: extruder heater_temp: 50.0 fan_speed: 0.6

[printer] kinematics: corexz max_velocity: 300 max_accel: 3000 max_accel_to_decel: 3000 max_z_velocity: 50 max_z_accel: 500 square_corner_velocity: 4.0

[bed_screws] screw1: 30, 30 screw2: 200, 30 screw3: 200, 200 screw4: 30, 200

########################################

TMC2209 configuration

########################################

[tmc2209 stepper_x] uart_pin: P1.10 diag_pin: P1.29 run_current: 0.800 stealthchop_threshold: 99999 driver_SGTHRS: 140

[tmc2209 stepper_y] uart_pin: P1.9 diag_pin: P1.28 run_current: 0.800 stealthchop_threshold: 99999 driver_SGTHRS: 140

[tmc2209 stepper_z] uart_pin: P1.8 run_current: 0.8 stealthchop_threshold: 99999

[tmc2209 extruder] uart_pin: P1.4 run_current: 0.800 stealthchop_threshold: 99999

[servo klicky_servo] pin: P2.0 maximum_servo_angle: 180 minimum_pulse_width: 0.00025 maximum_pulse_width: 0.0024

[gcode_macro _servo_test_angle] gcode: {% set ANGLE = params.ANGLE|int %}

SET_SERVO SERVO=klicky_servo ANGLE={ANGLE}
G4 P250
SET_SERVO SERVO=klicky_servo WIDTH=0.0

############ KLICKY VARIABLES

[gcode_macro _User_Variables] variable_verbose: True # Enable verbose output variable_debug: False # Enable Debug output variable_travel_speed: 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: 50 # how fast should the toolhead move when docking the probe for the final movement variable_release_speed: 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: 25 # 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: 220 # maximum Bed size avoids doing a probe_accuracy outside the bed variable_max_bed_x: 220 # 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 variable_z_endstop_y: 0

Check the printer specific documentation on klipper Dock/Undock configuration, these are dummy values

dock location

variable_docklocation_x: 180 # X Dock position variable_docklocation_y: 110 # 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: True # Set to true if your klicky dock is servo-controlled variable_servo_name: 'klicky_servo' # The name of the dock servo defined in printer.cfg under [servo] variable_servo_deploy: 40 # This EXAMPLE is the value used to deploy the servo fully variable_servo_retract: 105 # 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: 120 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: 1000 Variable_attachmove_y: 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: True # Enable toolhead parking variable_parkposition_x: 110 variable_parkposition_y: 220 variable_parkposition_z: 50

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: '' # 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

gcode: {% set Mx = printer['configfile'].config["stepper_x"]["position_max"]|float %} {% set My = printer['configfile'].config["stepper_y"]["position_max"]|float %} {% set Ox = printer['configfile'].config["probe"]["x_offset"]|float %} {% set Oy = printer['configfile'].config["probe"]["y_offset"]|float %} {% set Oz = printer['configfile'].config["probe"]["z_offset"]|float %}

# If x, y coordinates are set for z endstop, assign them
{% if z_endstop_x != 0 or z_endstop_y != 0 %}
    SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=z_endstop_x VALUE={ z_endstop_x }
    SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=z_endstop_y VALUE={ z_endstop_y }

# if no x, y coordinates for z endstop, assume probe is endstop and move toolhead to center of bed
{% else %}
    SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=z_endstop_x VALUE={ (Mx * 0.5) - Ox }
    SET_GCODE_VARIABLE MACRO=_Probe_Variables VARIABLE=z_endstop_y VALUE={ (My * 0.5) - Oy }
{% endif %}