#Avoid running CALIBRATE_Z every time I start printer?

15 messages · Page 1 of 1 (latest)

alpine mulch
#

Hey Everyone, I'm currently running [ https://github.com/protoloft/klipper_z_calibration ] on a v2.4 with sex bolt/klicky probe. I'm getting variance in distance from bed every run and I can't for the life of me figure out why. What I'd like to do is be able to run CALIBRATE_Z whenever I make a change to the machine/nozzle, manually adjust the z-offset to make sure it is perfect, then store then store that distance from bed value for use for future prints. I removed the CALIBRATE_Z command, ran it manually, SAVE_CONFIG, restart , the distance from the bed is like 10mm. Is it possible to do what I am trying. Honestly I don't really understand how all the setting values work together/are stored. Here is my original setup scripts, I run PRINT_SETUP_PLA when I start the machine up and PRINT_START at the start of every individual print. Any thoughts/ideas would be appreciated.

[gcode_macro PRINT_SETUP_PLA]
gcode:
    STATUS_HEATING
    M117 Heating Bed
    {action_respond_info("Heating Bed")}
    M190 S55                ; set & wait for bed temp
    G28
    QUAD_GANTRY_LEVEL
    G28 Z
    BED_MESH_PROFILE LOAD=BED_MESH_PLA
    M109 S150
    CLEAN_NOZZLE
    CALIBRATE_Z
    M117 PLA Print Setup Complete
    {action_respond_info("PLA Print Setup Complete")}
    
    
[gcode_macro PRINT_START]
gcode:
    {% set bedtemp = params.BED|int %}
    {% set hotendtemp = params.HOTEND|int %}
    SET_PIN PIN=caselight VALUE=1 ; turn on LEDs
    STATUS_HEATING
    M117 Heating Bed    
    {action_respond_info("Heating Bed")}
    
    M190 S{bedtemp}                ; set & wait for bed temp
    
    M117 Heating Hotend
    {action_respond_info("Heating Hotend")}
    M109 S{hotendtemp}             ; set & wait for hotend temp
    
    CLEAN_NOZZLE

    {action_respond_info("Print Start Complete")}
    STATUS_READY    

GitHub

Klipper plugin for self-calibrating z-offset. Contribute to protoloft/klipper_z_calibration development by creating an account on GitHub.

opaque hamlet
#

Want more accuracy? Use Tap, Beacon, or Cartographer. Basically directly measure the nozzle <> bed distance at every print start. But that does not appear to be the issue.

The Print_Start macro is called when you start a new print. There isn't anywhere in that macro that calls Home or QGL.

Your PLA macro does that, but it's not called inside Print_Start. You manually run the PLA macro, then start the print? (why?)

The stuff inside the PLA macro really need to be embeded in the Print_Start macro.

I would (re)start your macro creation with this:
https://github.com/jontek2/A-better-print_start-macro

GitHub

This document aims to help you get a simple but powerful start_macro for your voron printer! - jontek2/A-better-print_start-macro

alpine mulch
#

@opaque hamlet : Setup takes a long time...if I am printing 10 items in a row, I would like to not waste the time measuring over and over again. I've been running this setup for about 6 months without issue...except the fact that my z-offset needs to be adjusted every time I start the machine...which didn't happen prior to the auto_z_calibration implementation.

opaque hamlet
#

I guess you can do it that way, but know that the printer will expand thermally with consecutive prints. IMHO, you are adding complexity where it doesn't need to be added. QGL and G28 takes a few minutes at most.

G28+QGL can also be done conditionally. As long as your printer doesn't disable the motors after the print is done, then it will remember them. That way you don't need to two step the print start process.

You can do it however you want, but there are (more or less) standards for how to setup the macros and print start. This way, there's no two step that is subject to Operator Error. Your way can start a print without running a prep-macro.

Place the _CG28 and _CQGL near the start of the print_start macro. Then if you do a heat soak, a "G28 Z" just before the printer starts.

I'll highlight that your printer should re-zero the Z after the bed and chamber have heat soaked. If you direct probe the bed with the nozzle (i.e., Tap) then re-calibrate Z at 150c then bring the hotend up to print temp.

Even if you are printing PLA, you should let the bed stabalize for ~5-10 min.

The underscore hides the macro from appearing in Fluid/Mainsal GUIs.

Conditional Home

[gcode_macro _CG28]
description: Conditional Home
gcode:
{% if "xyz" not in printer.toolhead.homed_axes %}
G28
{% endif %}

[gcode_macro _CQGL]
description: Conditional QGL
gcode:
{% if not printer.quad_gantry_level.applied %}
SET_DISPLAY_TEXT MSG="Conditional Quad Gantry Leveling" # Displays info
RESPOND TYPE=echo MSG="Conditional Quad Gantry Leveling"
QUAD_GANTRY_LEVEL # Levels the buildplate via QGL
{% endif %}

Then take out autoZ - which is basically a klicky.

You are probably running into the inherent limits of the mechanical switches. Maybe a little bit of lube on the Z probe.

But really need to move to Tap or a hall effect sensor for a more accurate Z.

alpine mulch
#

@opaque hamlet Thanks for taking the time to explain everything. I will revist my setup and pay attention to timing. If it is only a few minutes I don't mind that. I'm still a little lost on my original question. Are you saying it is the lack of 'G28 Z' that made my print 10mm+ off the bed when I removed CALIBRATE_Z from my current scripts?

opaque hamlet
#

There's a few reasons why you are 10mm off. Need to see your print_end macro as well.

Also need to see your macros for the klicky.

You followed the Voron Startup guide?

The home command - G28 - is in your PLA macro as well as the bed mesh. If the motors where turned off in your Print_End macro - which they are in a default provided print_end macro - then the home position was lost.

"G28 Z" will only home Z and that would be used to re-zero the print head just before the print actually starts and the print and after the chamber / bed / hotend are all up to temp.

M84 command is the "turn off the steppers" command. Its in the Print_End macros by default.

Basically why I'd recommend doing a "default" Print_Start (link above), so that you are guaranteed that your print start macro has all the commands that are required to get the toolhead zeroed correctly.

alpine mulch
#

@opaque hamlet I'm not sure I'm being clear. My Voron was working great prior with a fixed value for distance to bed. I implemented the auto z script and it works basically perfect using CALIBRATE_Z in my setup script. I just don't want to run CALIBRATE_Z every time, I want to have a fixed distance to bed and then run CALIBRATE_Z when I make changes.

#

[gcode_macro PRINT_END]
#   Use PRINT_END for the slicer ending script - please customise for your slicer of choice
gcode:
    # safe anti-stringing move coords
    {% set th = printer.toolhead %}
    {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %}
    {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %}
    {% set z_safe = [th.position.z + 2, th.axis_maximum.z]|min %}
        
    M400                           ; wait for buffer to clear
    G92 E0                         ; zero the extruder
    G1 E-5.0 F1800                 ; retract filament
    
    TURN_OFF_HEATERS
    
    G90                                      ; absolute positioning
    G0 X{x_safe} Y{y_safe} Z{z_safe} F20000  ; move nozzle to remove stringing
    FRONT_CENTER
    M107                                     ; turn off fan
    SET_PIN PIN=caselight VALUE=0 ; turn off LEDs
    STATUS_OFF
    
    M117 Print Complete
    {action_respond_info("Print Complete")}    
#

klicky-variables.cfg

opaque hamlet
#

You do a SAVE_CONFIG after you do CALIBRATE_Z?

That's the only reason why it won't save the settings - Unless there's something else non-standard with your setup and macro structure.

But running "non-standard" start macro structure isn't helping you either.

alpine mulch
#

Yes I ran SAVE_CONFIG. I think the auto z calibrate is assigning some setting that is required to work.

tulip ginkgo
#

did you check the bottom of your printer config, to see if you z offset was saved. i change my z offset in the printer.cfg all the time.