Skip to content

Commit

Permalink
Allow positive Z nozzle to probe offset (MarlinFirmware#20344)
Browse files Browse the repository at this point in the history
* Allow a positive value for z offset from nozzle to probe without sanity checks
* Simplify menu_probe_offset.cpp (HOMING_Z_WITH_PROBE)
* Add some more explanation to Configuration Files
* Raise after probe_at_point as if homed

Co-authored-by: Scott Lahteine <[email protected]>
Co-authored-by: Jason Smith <[email protected]>
  • Loading branch information
3 people authored and chrisjenda committed Apr 8, 2021
1 parent 53fd47f commit b01c045
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
14 changes: 12 additions & 2 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -1157,10 +1157,20 @@
/**
* Nozzle-to-Probe offsets { X, Y, Z }
*
* - Use a caliper or ruler to measure the distance from the tip of
* X and Y offset
* Use a caliper or ruler to measure the distance from the tip of
* the Nozzle to the center-point of the Probe in the X and Y axes.
*
* Z offset
* - For the Z offset use your best known value and adjust at runtime.
* - Probe Offsets can be tuned at runtime with 'M851', LCD menus, babystepping, etc.
* - Common probes trigger below the nozzle and have negative values for Z offset.
* - Probes triggering above the nozzle height are uncommon but do exist. When using
* probes such as this, carefully set Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES
* to avoid collisions during probing.
*
* Tune and Adjust
* - Probe Offsets can be tuned at runtime with 'M851', LCD menus, babystepping, etc.
* - PROBE_OFFSET_WIZARD (configuration_adv.h) can be used for setting the Z offset.
*
* Assuming the typical work area orientation:
* - Probe to RIGHT of the Nozzle has a Positive X offset
Expand Down
3 changes: 2 additions & 1 deletion Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,8 @@
#if ENABLED(PROBE_OFFSET_WIZARD)
//
// Enable to init the Probe Z-Offset when starting the Wizard.
// Use the estimated nozzle-to-probe Z offset, plus a little more.
// Use a height slightly above the estimated nozzle-to-probe Z offset.
// For example, with an offset of -5, consider a starting height of -4.
//
//#define PROBE_OFFSET_WIZARD_START_Z -4.0

Expand Down
6 changes: 0 additions & 6 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -1307,12 +1307,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
static_assert(sanity_nozzle_to_probe_offset.x == 0 && sanity_nozzle_to_probe_offset.y == 0,
"NOZZLE_AS_PROBE requires the XY offsets in NOZZLE_TO_PROBE_OFFSET to both be 0.");
#else
static_assert(sanity_nozzle_to_probe_offset.z <= 0.25,
"Are you sure your Probe triggers above the nozzle? Set a negative Z value in the NOZZLE_TO_PROBE_OFFSET.");
#ifdef PROBE_OFFSET_WIZARD_START_Z
static_assert(PROBE_OFFSET_WIZARD_START_Z <= 0.25,
"Are you sure your Probe triggers above the nozzle? Set a negative value for PROBE_OFFSET_WIZARD_START_Z.");
#endif
static_assert(PROBING_MARGIN >= 0, "PROBING_MARGIN must be >= 0.");
static_assert(PROBING_MARGIN_BACK >= 0, "PROBING_MARGIN_BACK must be >= 0.");
static_assert(PROBING_MARGIN_FRONT >= 0, "PROBING_MARGIN_FRONT must be >= 0.");
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/lcd/menu/menu_probe_offset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ void probe_offset_wizard_menu() {

ACTION_ITEM(MSG_BUTTON_CANCEL, []{
set_offset_and_go_back(z_offset_backup);
// If wizard-homing was done by probe with with PROBE_OFFSET_WIZARD_START_Z
#if EITHER(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, USE_PROBE_FOR_Z_HOMING) && defined(PROBE_OFFSET_WIZARD_START_Z)
// If wizard-homing was done by probe with PROBE_OFFSET_WIZARD_START_Z
#if HOMING_Z_WITH_PROBE && defined(PROBE_OFFSET_WIZARD_START_Z)
set_axis_never_homed(Z_AXIS); // On cancel the Z position needs correction
queue.inject_P(PSTR("G28Z"));
#else // Otherwise do a Z clearance move like after Homing
Expand All @@ -122,7 +122,7 @@ void probe_offset_wizard_menu() {
void prepare_for_probe_offset_wizard() {
if (ui.wait_for_move) return;

#if defined(PROBE_OFFSET_WIZARD_XY_POS) || NONE(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, USE_PROBE_FOR_Z_HOMING)
#if defined(PROBE_OFFSET_WIZARD_XY_POS) || !HOMING_Z_WITH_PROBE
if (ui.should_draw()) MenuItem_static::draw(1, GET_TEXT(MSG_PROBE_WIZARD_PROBING));

#ifndef PROBE_OFFSET_WIZARD_XY_POS
Expand All @@ -133,7 +133,7 @@ void prepare_for_probe_offset_wizard() {

// Probe for Z reference
ui.wait_for_move = true;
z_offset_ref = probe.probe_at_point(wizard_pos, PROBE_PT_STOW, 0, true);
z_offset_ref = probe.probe_at_point(wizard_pos, PROBE_PT_RAISE, 0, true);
ui.wait_for_move = false;

#endif
Expand Down

0 comments on commit b01c045

Please sign in to comment.