-
-
Notifications
You must be signed in to change notification settings - Fork 151
How To Use It
☝️ NOTE: If you calibrate Z within a
SAVE_GCODE_STATE
andRESTORE_GCODE_STATE
, the calibrated offset will be lost after runningRESTORE_GCODE_STATE
!
💡 NEW: The configured position for probing on the bed can now be overridden by using the new "BED_POSITION" parameter.
The z-offset calibration is started by:
CALIBRATE_Z [BED_POSITION=<X mm, Y mm>]
The optional "BED_POSITION" parameter can be used to specify a different position on the bed to be probed. However, if the "bed_xy_position" is not configured and there is no bed mesh or relative reference index, this parameter becomes mandatory.
The "BED_POSITION" argument overrides any configured bed position.
If the probe is not attached to the printhead, calibration will be aborted (if a normally closed configuration is used). So, macros can help here to attach and detach the probe like this:
[gcode_macro CALIBRATE_Z]
rename_existing: BASE_CALIBRATE_Z
gcode:
{% set bed_position = params.BED_POSITION|default('None') %}
G28 # can also be a conditional homing macro
M117 Z-Calibration..
ATTACH_PROBE # a macro for fetching the probe first
{% if bed_position != 'None' %}
BASE_CALIBRATE_Z BED_POSITION={bed_position}
{% else %}
BASE_CALIBRATE_Z
{% endif %}
DETACH_PROBE # and parking it afterwards (or DOCK_PROBE in klicky macros)
M117
💡 INFO: Meanwhile, it's possible to use the "start_gcode" or "before_switch_gcode" and the "end_gcode" instead of rewriting the
CALIBRATE_Z
command!
Then the CALIBRATE_Z
command needs to be added to the PRINT_START
macro.
❗ And remove any z-offset adjustments here (like SET_GCODE_OFFSET
) ❗
The print start sequence might look like this:
- Home all axes
- Heat up the bed and nozzle (and chamber)
- Get probe, make QGL or Z-Tilt, park probe if needed
- Purge and clean the nozzle if available
- (Get probe), CALIBRATE_Z, (park probe)
- (Adjust z-offset if needed (e.g. textured plates))
- create/load mesh if used
- Print intro line
- Start printing...
For textured plates, it might be necessary to adjust the offset to be closer to the bed.
This can be done from the slicers start GCode by adding a parameter to the PRINT_START
macro
after the Z calibration:
# Adjust the G-Code z-offset if needed
SET_GCODE_OFFSET Z_ADJUST={params.Z_ADJUST|default(0.0)|float} MOVE=1
Then, you can use PRINT_START Z_ADJUST=0.0
in your slicer. This does not reset the
offset set by the calibration but adjusts it by the given value!
☝️ NOTE: Do not home Z again after performing this calibration or it will need to be performed again!
Now, I wish you happy printing with a perfect first layer every time - no matter what you have just modded on your printhead or bed, or what nozzle and flex plate you plan to use for your next project. It's just perfect 😃
The calibration can be reset by executing this GCode command:
SET_GCODE_OFFSET Z=0.0
The CALIBRATE_Z
command also prints an adjusted position endstop value for the Z axis according
to the offset just determined. This value can be used to adjust the position_endstop
value in
the configuration. This ensures that larger offsets do not occur.
There is also a PROBE_Z_ACCURACY command to test the accuracy of the z endstop:
PROBE_Z_ACCURACY [PROBE_SPEED=<mm/s>] [LIFT_SPEED=<mm/s>] [SAMPLES=<count>] [SAMPLE_RETRACT_DIST=<mm>]
It calculates the maximum, minimum, average, median and standard deviation of multiple probe samples at the endstop by taking the configured nozzle position at the endstop. The optional parameters default to their corresponding settings in the z_calibration config section.
This command is new. It is intended to help you find the correct switch-offset by manually calibrating the Z offset.
- Set the
switch_offset
to any value greater 0.0 (for example: 0.5) - Restart the Klipper firmware
- Run a
CALIBRATE_Z
- Without the probe, move the nozzle to the center of the bed and perform a manual Z offset calibration by moving the nozzle down, step by step, until it barely touches the print surface.
- Then, run the
CALCULATE_SWITCH_OFFSET
- If everything is correct, it will print an estimated switch offset. Set this given value as
switch_offset
in the configuration and test it. - After verifying the switch offset, you can fine tune the the first layer by actually printing tests.
If the calculated switch-offset would be negative, a warning will be printed. This means that the nozzle is still too far away from the surface or something else is wrong with the setup.
It may still be necessary to fine-tune the switch-offset afterwards to get a perfect first layer.
📌 Note: Again, the smaller the switch-offset, the further the nozzle is away from the bed!