{"id":21499707,"url":"https://github.com/frap129/qidi_auto_z_offset","last_synced_at":"2025-07-15T21:31:46.882Z","repository":{"id":232451684,"uuid":"784350082","full_name":"frap129/qidi_auto_z_offset","owner":"frap129","description":"Auto Z-Offset Calibration for the QIDI Q1 Pro","archived":false,"fork":false,"pushed_at":"2024-07-21T13:45:03.000Z","size":55,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-07-21T15:10:00.060Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/frap129.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-09T17:15:30.000Z","updated_at":"2024-07-21T13:45:06.000Z","dependencies_parsed_at":"2024-07-21T15:13:36.942Z","dependency_job_id":null,"html_url":"https://github.com/frap129/qidi_auto_z_offset","commit_stats":null,"previous_names":["frap129/qidi_auto_z_offset"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frap129%2Fqidi_auto_z_offset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frap129%2Fqidi_auto_z_offset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frap129%2Fqidi_auto_z_offset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frap129%2Fqidi_auto_z_offset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frap129","download_url":"https://codeload.github.com/frap129/qidi_auto_z_offset/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226071006,"owners_count":17569103,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-23T17:17:34.254Z","updated_at":"2025-07-15T21:31:46.871Z","avatar_url":"https://github.com/frap129.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Auto Z-Offset Calibration for the QIDI Q1 Pro\n\nThis is a plugin for Klipper that makes use of the QIDI Q1 Pro's bed sensors to automatically set the toolheads Z-Offset.\n\n\u003e [!IMPORTANT]\n\u003e This adapts changes from the QIDI Q1 stock klipper to work with mainline klipper. This is not for use with the stock Q1 firmware.\n\n### Install\n\n```\ncd ~\ngit clone https://github.com/frap129/qidi_auto_z_offset\nln -s ~/qidi_auto_z_offset/auto_z_offset.py ~/klipper/klippy/extras/auto_z_offset.py\n```\n\n### Command Reference\n\n**AUTO_Z_PROBE**: Probe Z-height at current XY position using the bed sensors\n\n**AUTO_Z_HOME_Z**: Home Z using the bed sensors as an endstop\n\n**AUTO_Z_MEASURE_OFFSET** Z-Offset measured by the inductive probe after AUTO_Z_HOME_Z\n\n**AUTO_Z_CALIBRATE**: Set the Z-Offset by averaging multiple runs of AUTO_Z_MEASURE_OFFSET\n\n**AUTO_Z_LOAD_OFFSET**: Apply the calibrated_z_offset saved in the config file\n\n**AUTO_Z_SAVE_GCODE_OFFSET**: Save the current gcode offset for z as the new calibrated_z_offset\n\n### Basic Usage\n\n`auto_z_offset` helps calibrate the z_offset of the inductive probe on the Q1 using the piezo electric sensors under the bed.\nIt allows for finetuning, saving, and loading the calibrated offset.\n\n⚠️ **NOTE** ⚠️\n`AUTO_Z_CALIBRATE` should not be used in a `PRINT_START` macro! On rare occasion, the bed sensors can fail to trigger or\ntrigger too late. If this happens when a print is started, you can end up grinding the nozzle into the bed. Instead, you\nshould calibrate it prior to your first print, and load the offset in `PRINT_START`.\n\nFirst, calibrate the z_offset:\n\n1. Heat the extruder to a reasonable temperature that wont ooze (160+)\n2. Home all axes\n3. Run `AUTO_Z_CALIBRATE`\n4. Move Z to 0\n5. Verify that you can slide a piece of paper under the nozzle\n6. Run `SAVE_CONFIG` to save the measured offset.\n   - Note, this does not modify the `z_offset` of the inductive probe in your config. This value is only used by\n     `auto_z_offset`\n\nAdd `AUTO_Z_LOAD_OFFSET` to your `PRINT_START` macro to load the value every time you start a print. If you make adujstments to\nthe offset by micro-stepping durring a print, you can save that with `AUTO_Z_SAVE_GCODE_OFFSET` and `SAVE_CONFIG`\n\n### Config Reference\n\n```\n[auto_z_offset]\npin:\n#   Pin connected to the Auto Z Offset output pin. This parameter is required.\nz_offset:\n#   The offset between measured 0 and when the bed sensors trigger.\n#   default is -0.1\nprepare_gcode:\n#   gcode script to run before probing with auto_z_offset. This is required, and an\n#   example script is provided below.\n#probe_accel:\n#   If set, limits the acceleration of the probing moves (in mm/sec^2).\n#   A sudden large acceleration at the beginning of the probing move may\n#   cause spurious probe triggering, especially if the hotend is heavy.\n#   To prevent that, it may be necessary to reduce the acceleration of\n#   the probing moves via this parameter.\n#probe_hop:\n#   The amount to hop between probing with bed sensors and probing with probe.\n#   default is 5.0, min is 4.0 to avoid triggering the probe early\n#offset_samples:\n#   The number of times to probe with bed sensors and inductive probe when running\n#   AUTO_Z_CALIBRATE. Note this is not the same as `samples`.\n#   default is 3\n#speed:\n#samples:\n#sample_retract_dist:\n#samples_result:\n#samples_tolerance:\n#samples_tolerance_retries:\n#activate_gcode:\n#deactivate_gcode:\n#deactivate_on_each_sample:\n#   See the \"probe\" section for more information on the parameters above.\n```\n\n### Example Configuration from OpenQ1\n\nThis example config also includes the control pin for the bed sensors and the config for the inductive probe. Use them as shown for the best compatiblity.\n\n```\n[output_pin bed_sensor]\npin: !U_1:PA14\nvalue:0\n\n[probe]\npin: !gpio21\nx_offset: 17.6\ny_offset: 4.4\nz_offset: 0.0\nspeed:10\nsamples: 3\nsamples_result: average\nsample_retract_dist: 4.0\nsamples_tolerance: 0.05\nsamples_tolerance_retries: 5\n\n[auto_z_offset]\npin: U_1:PC1\nz_offset: -0.1\nspeed: 10\nprobe_accel: 50\nsamples: 5\nsamples_result: average\nsamples_tolerance: 0.05\nsamples_tolerance_retries: 5\nprepare_gcode:\n    SET_PIN PIN=bed_sensor VALUE=0\n    G91\n    {% set i = 4 %}\n    {% for iteration in range(i|int) %}\n        G1 Z1 F900\n        G1 Z-1 F900\n    {% endfor %}\n    G90\n    SET_PIN PIN=bed_sensor VALUE=1\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrap129%2Fqidi_auto_z_offset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrap129%2Fqidi_auto_z_offset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrap129%2Fqidi_auto_z_offset/lists"}