- Reconfigure the [stepper_z] section
- Add a new [probe] section
- Determine the correct pin configuration for [probe]
- Add a new [safe_z_home] section
- Configure the bed mesh
Reconfigure the [stepper_z] Section
[stepper_z]
step_pin: PB6
dir_pin: !PB5
enable_pin: !PC3
microsteps: 16
rotation_distance: 8
endstop_pin: ^PA7
position_endstop: 0.0
position_max: 250
[stepper_z]step_pin: PB6dir_pin: !PB5enable_pin: !PC3microsteps: 16rotation_distance: 8endstop_pin: probe:z_virtual_endstop #see note (1)position_max: 250position_min: -7 #see note (2)
- (1) The endstop_pin setting will be replaced with 'probe:z_virtual_endstop', which is described in the excellent Klipper documentation here. This basically tells the z axis that it will get it's endstop info from the probe section.
- (2) The position_min setting will allow the Z axis to descend below zero while printing, depending on bed height variation.
- If you followed the EZABL guide when you installed the sensor, you will remember that the sensor is positioned 1-2 mm above the nozzle. You will also remember that you had to calibrate the sensor during installation by raising the nozzle another 2mm off the bed. This means, if you followed all of the installation instructions, the sensor will be triggered when the nozzle is 2mm away from the bed. We will deal with this later.
[probe]# Pin for the z-min endstop inputpin: ^!PA7 #see note (1)# Offset between the nozzle and the EZABL sensor, see note (2)x_offset: 48.0 # (+) right of nozzley_offset: -2.0 # (-) behind nozzlez_offset: 2.0 # (+) 2 mm above nozzlespeed: 5.0lift_speed: 30.0sample_retract_dist: 1.0samples: 2samples_tolerance_retries: 6
- (1) the pin used for the Z-axis limit switch is used here. Note that we added an exclamation point so that it reads ^!PA7 now! We will determine the correct setting for the pin later, which is critical.
- (2)
I am using the Petsfang Bullseye cooling duct(went back to stock cooling in November, my updated config is linked below) and I also have a MicroSwiss printhead, so the position of my EZABL sensor is probably different from yours. Adjust these to match your setup!
Determine the correct pin configuration for [probe]
Send: M119Recv: x:open y:open z:TRIGGERED
Great, the pin is configured correctly!
If you see this instead:
Send: M119Recv: x:open y:open z:open
...then the pin configuration for the [probe] is incorrect. The Z axis will probably only move UP, thinking that the z limit has been reached. In this case, remove the exclamation from the pin configuration so that it reads: pin: ^PA7, restart Klipper, and try this exercise again. It should read z:TRIGGERED when the sensor detects an object.
Add a new [safe_z_home] section
[safe_z_home]home_xy_position: 110, 110 #see note (1)speed: 200z_hop: 10z_hop_speed: 60
- (1) you may want to adjust this for the size of your bed.
Perform z-axis offset calibration
Follow the steps here to calibrate the z probe offset. After following the z offset calibration steps, you will see something like this automatically added to your printer.cfg:
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [probe]
#*# z_offset = 2.700
Configure the bed mesh
⚠️ You may want to tweak the mesh_min and mesh_max points for your setup.
[bed_mesh]speed: 120 #how fast to move between pointshorizontal_move_z: 5 #how much the z axis rises between pointsmesh_min: 60, 20 #the x,y location of the first mesh pointmesh_max: 200, 200 #the x,y location of the last mesh pointprobe_count: 3 # 3x3 grid
Make Klipper understand the G29 command
[gcode_macro G29]gcode:BED_MESH_CALIBRATE
Update 28-May-2023; Improved G29 command
Update 19-Nov-2023
Here is my Klipper config file as a github.com gist.