Skip to content

Add Z clearance step before XY homing in homing override#97

Merged
suchmememanyskill merged 11 commits intomainfrom
copilot/force-move-bed-down-5mm
Apr 7, 2026
Merged

Add Z clearance step before XY homing in homing override#97
suchmememanyskill merged 11 commits intomainfrom
copilot/force-move-bed-down-5mm

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 6, 2026

When a Z home is requested through the homing override, the printer should establish Z clearance before starting the X/Y homing sequence. This updates the macro so the bed/nozzle is lifted to a safe minimum height first, whether Z is already homed or not.

  • Homing override behavior

    • Detect when the current G28 request includes Z homing (G28, G28 Z, etc.)
    • Before any X/Y homing:
      • If Z is already homed and below 8mm, move to Z=8
      • If Z is not homed, force-move Z upward by 8mm to create clearance
  • Macro cleanup

    • Keep the clearance height and normal move feedrate as named variables
    • Inline the single-use Z-home condition instead of storing it in a separate variable
    • Derive the unhomed FORCE_MOVE velocity from safe_z_feedrate / 60
    • Document the printer-specific assumptions around the unhomed Z FORCE_MOVE
    • Wait for the Z clearance move to complete before continuing into the existing XY homing flow
  • Resulting macro path

    {% if home_all or 'Z' in params %}
      {% if 'z' in printer.toolhead.homed_axes %}
        {% if printer.gcode_move.gcode_position.z|float < safe_z %}
          G90
          G0 Z{safe_z} F{safe_z_feedrate}
        {% endif %}
      {% else %}
        FORCE_MOVE STEPPER=stepper_z DISTANCE={safe_z} VELOCITY={safe_z_feedrate / 60}
      {% endif %}
      M400
    {% endif %}

Copilot AI and others added 9 commits April 6, 2026 20:50
Agent-Logs-Url: https://github.com/OpenCentauri/yocto-opencentauri/sessions/bc8c7802-1a67-4a63-8604-ccf3eb6461fd

Co-authored-by: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com>
Agent-Logs-Url: https://github.com/OpenCentauri/yocto-opencentauri/sessions/bc8c7802-1a67-4a63-8604-ccf3eb6461fd

Co-authored-by: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com>
Agent-Logs-Url: https://github.com/OpenCentauri/yocto-opencentauri/sessions/bc8c7802-1a67-4a63-8604-ccf3eb6461fd

Co-authored-by: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com>
Agent-Logs-Url: https://github.com/OpenCentauri/yocto-opencentauri/sessions/bc8c7802-1a67-4a63-8604-ccf3eb6461fd

Co-authored-by: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com>
Agent-Logs-Url: https://github.com/OpenCentauri/yocto-opencentauri/sessions/bc8c7802-1a67-4a63-8604-ccf3eb6461fd

Co-authored-by: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com>
Agent-Logs-Url: https://github.com/OpenCentauri/yocto-opencentauri/sessions/bc8c7802-1a67-4a63-8604-ccf3eb6461fd

Co-authored-by: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com>
Agent-Logs-Url: https://github.com/OpenCentauri/yocto-opencentauri/sessions/bc8c7802-1a67-4a63-8604-ccf3eb6461fd

Co-authored-by: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com>
Agent-Logs-Url: https://github.com/OpenCentauri/yocto-opencentauri/sessions/bc8c7802-1a67-4a63-8604-ccf3eb6461fd

Co-authored-by: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com>
Agent-Logs-Url: https://github.com/OpenCentauri/yocto-opencentauri/sessions/bc8c7802-1a67-4a63-8604-ccf3eb6461fd

Co-authored-by: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com>
Copilot AI changed the title [WIP] Add logic to control bed movement based on z position Add Z clearance step before XY homing in homing override Apr 6, 2026
Copilot AI requested a review from suchmememanyskill April 6, 2026 20:56
Agent-Logs-Url: https://github.com/OpenCentauri/yocto-opencentauri/sessions/0f0b6b25-9374-44dd-9dd1-09ac06c8f4bb

Co-authored-by: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

✅ Build Artifacts

Branch: copilot/force-move-bed-down-5mm
Build: 046132b (merge into main)

Artifact Size
CC1 Firmware 89.86 MB

View workflow run

@suchmememanyskill
Copy link
Copy Markdown
Contributor

Can't properly test this til tomorrow evening

@jaimbo
Copy link
Copy Markdown
Contributor

jaimbo commented Apr 7, 2026

Just tested these changes and it seems to work well.

  • If z is not homed, G28 will force drop the Z axis before homing
  • If Z is homed but within 5mm of the nozzle, Z is dropped an amount before homing
  • If Z is homed but more than 5mm away from the nozzle, homing proceeds as normal.
  • I don't expect there is a way to avoid this, but if the bed is at max Z, not homed - it will force move the Z by 5mm and give some pretty miserable grinding sounds...

I think I prefer that to the bed being destroyed though :)

This all seems to work whether using G28 to home all or G28 Z for just Z

@Atomique13 Atomique13 marked this pull request as ready for review April 7, 2026 15:50
@Atomique13 Atomique13 removed the request for review from suchmememanyskill April 7, 2026 15:51
@suchmememanyskill suchmememanyskill merged commit 0e552eb into main Apr 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

if a z home was requested, force move the bed down 5mm

4 participants