[Feature Request] SCREWS_TILT_CALCULATE turn knob until probe triggers

Hi everyone,

It would be so nice if SCREWS_TILT_CALCULATE has an option to:

  1. Home all axis.

  2. Measure the height above each manual bed tilt screw.

  3. Move the print head to the first manual bed tilt screw that require adjustment. (lower or higher than Z0)

     3a. If lower than Z0 
         Move print head to (Z0 + Z offset) ask the user to turn the knob until the probe triggers.
    
     3b. If higher than Z0
         Move print head down until the probe triggers and move it up again and repeat.
         Stop moving up and down if the probe doesn't trigger anymore before (Z0 + Z offset). 
         Ask the user to lower the bed corner until moving up and down stops.
         When moving up and down stopped, go into the 3a routine.
    
  4. Repeat this process for every manual bed tilt screw that require adjustment.

Marlin has this feature (LEVEL_CORNERS_USE_PROBE) for a while now and it saves quite some time on corner leveling.

Check this Youtube video to see it in action:

Can this feature be added to Klipper too please?

I am not a coder but I’m happy to help testing :blush:

Kind regards,

Marknga

3 Likes

I second this request! That would be very very handy indeed :pray:

2 Likes

Here’s a temporary macro that may work until this feature is added. This is just a macro for 1 screw, so you’ll need to add multiple of these for each screw and change it accordingly.
It will:

  1. Home all axis
  2. Bring probe above screw, at a Z height of 10
  3. Deploy probe
  4. Move down to a Z height of 3.8
    At that point you should be able to tram your bed, and the light on the BLtouch will turn red when in a ‘triggered’ state, and have no light when not triggered.
    (Remember to change the coordinates to your own screw coordinates and make sure Z height for tramming is okay).

Because the goal is only to tram the bed, or to make it ‘level’, then the actual Z height doesn’t need to equal your actual probe Z-offset. I used 3.8 because it is just above my Z-offset, allowing me to tram with minimal adjustments.

[gcode_macro BedScrew1]
description: bed screw tram using BLtouch
gcode:
		G28
    G1 X75 Y43 Z10 F5000.0 		# Move 10mm above screw1 to allow probe to deploy
    BLTOUCH_DEBUG COMMAND=touch_mode
    BLTOUCH_DEBUG COMMAND=pin_down    #Deploy the BLtouch probe
    G1 Z3.8    #Move down to a Z height just above the probe 'trigger' point

do you think you could modify this for other probes?

Possibly, what probe do you have in mind? This macro uses the light on the BLtouch to let you know when it is triggered or untriggered. Depending on which probe it is, it might be better to make a new macro entirely that would use data from the probe to tell you when it is triggered or not.
Let me know what probe you have and I’ll see if I can modify this code.

If it’s light based then that might be an issue. Cus only inductive probes have lights on them other than the supported one. I have a inductive probe on my zonestar.

In that case, without a light/beep or any way to know when the probe is triggered visually, I think the best bet would be a new macro entirely. One that would call forth the probe status and tell you when the probe is triggered through the console, LCD, or other means. Unfortunately, I wont have the spare time to learn what I need to for a macro like that at the moment. Although I may try to figure it out in a couple months if no progress has been made.

I made the macro for all 4 corners, must run corner 1 first which will home the printer, when done run the DONE macro to reset the variable, not a bad Idea to add the DONE macro to the idle_timeout Gcode just to ensure if you walk away and motors time out then it will not crash!!

this is for my Ender 5 PRO with modified motion system, Microswiss NG DD / BLT

ADJUST THE X AND Y AND Z AS NEEDED!!!

Verify the coordinates in toolhead that the PIN is DIRECTLY ABOVE THE SCREW!!!

Home, set the coordinates, LOOK at the printer, adjust !

[gcode_macro BedScrew1]
variable_isrunning: 0
description: bed screw tram using BLtouch
gcode:
  {% if printer["gcode_macro BedScrew1"].isrunning == 0 %}         # check if already running, if so skip home and recheck screw1
    SET_GCODE_VARIABLE MACRO=BedScrew1 VARIABLE=isrunning VALUE=1  #if not running set to running and home printer and adjust z tilt
  	Z_TILT_ADJUST                                                  # if you have a single Z printer change to G28
    #G28 
  {% else %}                                                       # if already running reset the pin / raise pin / raise z 
    BLTOUCH_DEBUG COMMAND=reset
    BLTOUCH_DEBUG COMMAND=pin_up
    G1 Z10 F5000
  {% endif %}
    G1 X77 Y49 Z10 F5000.0 		                                   #move to screw 1 adjust screws x y for all 4 screws!!!! veryify with visual BEFORE RUNNING
    BLTOUCH_DEBUG COMMAND=touch_mode                              # set bltouch mode and deploy pin
    BLTOUCH_DEBUG COMMAND=pin_down 
    G1 Z3.9                                                        #adjust the z of 3.9 as needed, I moved z by .1MM until it triggered then subtracted .1

[gcode_macro BedScrew2]
description: bed screw tram using BLtouch
gcode:
 {% if printer["gcode_macro BedScrew1"].isrunning == 1 %}
	BLTOUCH_DEBUG COMMAND=reset
    BLTOUCH_DEBUG COMMAND=pin_up
    G1 Z10
    G1 X248 Y49 F5000.0 		
    BLTOUCH_DEBUG COMMAND=pin_down 
    G1 Z3.9    
  {% else %}
    M117 'Use <a class='command'>BedScrew1</a> first to home printer!!!'
  {% endif %}

[gcode_macro BedScrew3]
description: bed screw tram using BLtouch
gcode:
  {% if printer["gcode_macro BedScrew1"].isrunning == 1 %}
    BLTOUCH_DEBUG COMMAND=reset
    BLTOUCH_DEBUG COMMAND=pin_up
	G1 Z10
    G1 X77 Y220 F5000.0 	
    BLTOUCH_DEBUG COMMAND=pin_down  
    G1 Z3.9   
  {% else %}
    M117 'Use <a class='command'>BedScrew1</a> first to home printer!!!'
  {% endif %}
  
[gcode_macro BedScrew4]
description: bed screw tram using BLtouch
gcode:
  {% if printer["gcode_macro BedScrew1"].isrunning == 1 %} # screw 1 homes printer first
    BLTOUCH_DEBUG COMMAND=reset                            # reset sensor
    BLTOUCH_DEBUG COMMAND=pin_up                           # rasise sensor so it doesn't bend
  	G1 Z10                                                 # Move 10mm above screw to allow probe to deploy
    G1 X248 Y220 F5000.0 		                           # Move to 4th Screw Position / adjust as needed
    BLTOUCH_DEBUG COMMAND=pin_down                        #Deploy the BLtouch probe
    G1 Z3.9                                               #Move down to a Z height just above the probe 'trigger' point    
  {% else %}
    M117 'Use <a class='command'>BedScrew1</a> first to home printer!!!'
  {% endif %}
    
[gcode_macro BedScrew_Done]
description: bed screw tram using BLtouch
gcode:
  {% if printer.toolhead.homed_axes != "xyz" %}                  #check if homed in case clicked on accident
    G28
  {% endif %}
  BLTOUCH_DEBUG COMMAND=reset                                    #reset and raise pin
  BLTOUCH_DEBUG COMMAND=pin_up
  G1 X235 Y235 Z10 F5000.0 		                                 # Park Toolhead
  SET_GCODE_VARIABLE MACRO=BedScrew1 VARIABLE=isrunning VALUE=0  # set variable back to 0 or "not running"