Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sanity check for Z_CLEARANCE_FOR_HOMING #27370

Conversation

DerAndere1
Copy link
Contributor

Description

Certain configs require Z_CLEARANCE_FOR_HOMING <= 0 to prevent a crash into Z max during homing. This adds another sanity check

Requirements

#define Z_HOME_DIR 1
#define HOME_Z_FIRST

Benefits

prevent a crash into Z max during homing

Configurations

None

Related Issues

None

@DerAndere1
Copy link
Contributor Author

MarlinFirmware/Configurations#1094 must be merged first to pass CI tests

@thinkyhead
Copy link
Member

Especially when homing Z first, there should probably never be any instance where Z_CLEARANCE_FOR_HOMING is less than 0 because this would inevitably cause the toolhead to dig into the bed or workpiece. So the only change I would suggest is to assert that it must be == 0 instead of <= 0.

@thinkyhead
Copy link
Member

While we're ruminating on homing and raises, I believe we need a z_min_trusted flag to avoid unnecessary raises. Here is a common scenario:

  • Start a 3D printer and before using Home All use Home X.
  • The machine raises Z before homing X because Z is "not homed" and "not trusted."
  • Click on Home X again.
  • The machine raises Z before homing X because Z is "not homed" and "not trusted."
  • …and on it goes…

With the new flag we can get the desired effect…

  • Start a 3D printer and before using Home All use Home X.
  • The machine raises Z before homing X because z_min_trusted is false.
  • As soon as the Z motor is powered set z_min_trusted.
  • Click on Home X again.
  • The machine doesn't raises Z because z_min_trusted Is true.

The z_min_trusted flag would be cleared only when the Z motors go to sleep on a delta or other machine where the consequence would be a smaller (possibly zero) Z coordinate. If the steppers were powered off and back on in such a scenario, the Z position would be meaningless, so we would want to keep z_min_trusted set to false until the machine was re-homed. In any case, the situation with z_min_trusted would need to be evaluated on a case-by-case basis, but basically it will either track with axes_trusted or it won't depending on the mechanics.

@thinkyhead thinkyhead merged commit 3743980 into MarlinFirmware:bugfix-2.1.x Sep 2, 2024
63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants