A Klipper plugin for accurate Z homing

Overview

Stable Z Homing for Klipper

A Klipper plugin for accurate Z homing

This plugin provides a new G-code command, STABLE_Z_HOME, which homes Z repeatedly until the Z offset stabilizes. This is useful if you have a printer which homes by pushing the nozzle against the Z endstop, where any plastic on or oozing from the nozzle can affect the Z offset and hence cause variation in the height of your first layer. The plugin can optionally run a G-code script before each probe, allowing you to clean the nozzle immediately before the offset is measured.

Feed the Llama

This plugin is developed in my spare time. If you like it, please consider supporting further development and updates by making a donation.

Feed the Llama


Motivation

To illustrate the problem this plugin is designed to solve, here is an experiment run on a Voron V2.4, with the nozzle pushed against a pin connected to a microswitch used as the Z endstop. I measured the probed Z offset every 10 seconds, starting with the extruder cold, and heating the extruder to the printing temperature for ABS (250C here). The nozzle was not scrubbed or cleaned in any way before or during this run, for demonstration purposes.

You can see that the Z offset varies by as much as 0.15mm during the run. As the plastic on the nozzle melts and gets squashed, the nozzle appears to move 0.15mm closer to the bed. Then, the filament in the nozzle oozes, pushing the nozzle up by 0.10mm over the next minute. Finally, as the oozing subsides, the offset settles at around -0.10mm.

Graph

Installation

Clone the repo into the home directory of your Pi, then symlink stable_z_home.py into your Klipper installation, like this:

$ cd ~/klipper/klippy/extras
$ ln -s ~/Klipper-Stable-Z-Home/stable_z_home.py .

Add the following to your Klipper config file, adjusting the G-code, which will be run before each probe attempt, to your needs:

[stable_z_home]
gcode:
    # use nozzle brush to clean nozzle; requires PURGE parameter, see below
    CLEAN_NOZZLE PURGE=0  

You can then add STABLE_Z_HOME to your PRINT_START macro, to replace the final G28 Z you may have there. A good time to do this is between heating the extruder and your final purge, e.g.:

[gcode_macro PRINT_START]
gcode:
    # ...
    M104 S{EXTRUDER}
    M109 S{EXTRUDER}

    STABLE_Z_HOME  # instead of G28 Z

    CLEAN_NOZZLE PURGE=1
    # ...

Note that to use the CLEAN_NOZZLE macro, which is from edwardyeeks' excellent purge bucket and nozzle scrub macros which can be found here, you need to extend the macro with a PURGE argument which allows you to scrub the nozzle without purging. Skipping the purge before each probe attempt saves time and minimizes oozing. The macro is easily extended like this:

[gcode_macro clean_nozzle]
# Add a parameter at the top, with default value 1 (purge).
default_parameter_PURGE: 1

# ...

gcode:
      # ...

      # Replace the "if" condition around the purge section in the macro as follows.

      ## Check if user enabled purge option or not.
      {% if params.PURGE|int == 1 %}
      
        # ... perform the purge ...
      
      {% endif %}
      
      # ...

Configuration

The following parameters can be adjusted in the [stable_z_home] section:

[stable_z_home]
#gcode:
#  The G-code to run before each probe attempt. The default is none.
#retries:
#  The maximum number of probe attempts allowed. The default is 20.
#window:
#  The number of samples to use in the tolerance window. The default is 4.
#retry_tolerance:
#  The maximum range between the min and max values of the Z offset in the window
#  to consider the offset stable and complete the procedure. The default is
#  0.0025mm.

The parameters RETRIES, RETRY_TOLERANCE, and WINDOW, can also be passed to the STABLE_Z_HOME command, in which case they override the defaults set in the config section above.


Copyright (C) 2021 Matthew Lloyd

Owner
Matthew Lloyd
Matthew Lloyd
Find Transposon Element insertions using long reads (nanopore), by alignment directly. (minimap2)

find_te_ins find_te_ins is designed to find Transposon Element (TE) insertions using long reads (nanopore), by alignment directly. (minimap2) Install

Ming Wang 1 Feb 09, 2022
This is the community maintained fork of ungleich's cdist (after f061fb1).

cdist This is the community maintained fork of ungleich's cdist (after f061fb1). Work is split between three repositories: cdist - implementation of t

cdist community edition 0 Aug 02, 2022
Random Turkish name generator with realistic probabilities.

trnames Random Turkish name generator with realistic probabilities. Based on Trey Hunner's names package. Installation The package can be installed us

Kaan Öztürk 20 Jan 02, 2023
My tools box script for sigma

sigma_python_toolbox My tools box script for sigma purpose My goal is not to replace sigma but to put at disposal the scripts that I think to help me

4 Jun 20, 2022
This bot uploads telegram files to MixDrop.co,File.io.

What is about this bot ? This bot uploads telegram files to MixDrop.co, File.io. Usage: Send any file, and the bot will upload it to MixDrop.co, File.

Abhijith NT 3 Feb 26, 2022
Python binding to rust zw-fast-quantile

zw_fast_quantile_py zw-fast-quantile python binding Installation pip install zw_fast_quantile_py Usage import zw_fast_quantile_py

Paul Meng 1 Dec 30, 2021
200 LeetCode problems

LeetCode I classify 200 leetcode problems into some categories and upload my code to who concern WEEK 1 # Title Difficulty Array 15 3Sum Medium 1324 P

Hoang Cao Bao 108 Dec 08, 2022
For my Philips Airpurifier AC3259/10

Philips-Airpurifier For my Philips Airpurifier AC3259/10 I will try to keep this code

AcidSleeper 7 Feb 26, 2022
Thumbor-bootcamp - learning and contribution experience with ❤️ and 🤗 from the thumbor team

Thumbor-bootcamp - learning and contribution experience with ❤️ and 🤗 from the thumbor team

Thumbor (by @globocom) 9 Jul 11, 2022
kurwa deska ADB

kurwa-deska-ADB kurwa-deska Запуск Linux -- python3 kurwa_deska.py Termux -- python3 kurwa_deska.py Встановлення cd kurwa_deska ADB і зразу запуск pyt

1 Jan 21, 2022
🍬️🦇️ Open source Trick or Treat! 🦇️🍬️

Open Source Halloween! What's an easy way to have fun, and celebrate an open source Halloween? Open source trick or treating, of course! The repositor

Research Software Engineers 3 Oct 18, 2021
Rename and categorize your DMOJ solutions

DMOJ Downloader What is this for? DMOJ lets you download the code for all your solutions, however the files are just named as numbers

Evan Wild 1 Dec 04, 2022
Is a util for xferring skinning from one mesh to another

maya_pythonplugins skinTo: Is a util for xferring skinning from one mesh to another args: :param maxInfluences: is the number of max influences on the

James Dunlop 2 Jan 24, 2022
IOP Support for Python (Experimental)

TAGS Experimental IOP Framework for Python WARNING: Currently, this project has NO EXCEPTION HANDLING. USE AT YOUR OWN RISK! I. Introduction to Interf

1 Oct 22, 2021
The repository for AnyMacro: a Fusion360 Add-In

AnyMacro AnyMacro is an Autodesk® Fusion 360™ add-in for chaining multiple commands in a row to form Macros. Macros are created from a set of commands

1 Jan 07, 2022
Collection of system-wide scripts that I use on my Gentoo

linux-scripts Collection of scripts that I use on my Gentoo machine. I tend to put all scripts in /scripts directory. It is not likely that you would

Xoores 1 Jan 09, 2022
validation for pre-commit.ci configuration

pre-commit-ci-config validation for pre-commit.ci configuration installation pip install pre-commit-ci-config api pre_commit_ci_config.SCHEMA a cfgv s

pre-commit.ci 17 Jul 11, 2022
Webcash is an experimental e-cash (electronic cash)

Webcash Webcash is an experimental new electronic cash ("e-cash") that enables decentralized and instant payments to anyone, anywhere in the world. Us

Mark Friedenbach 0 Feb 26, 2022
🤖🧭Creates google-like navigation menu using python-telegram-bot wrapper

python telegram bot menu pagination Makes a google style pagination line for a list of items. In other words it builds a menu for navigation if you ha

Sergey Smirnov 9 Nov 27, 2022
Python communism - A module for initiating the communist revolution in each of our python modules

Python communist revolution A man once said to abolish the classes or something

758 Jan 03, 2023