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

[BUG] Latest bugfix won't compile due to excessive Z_Probe_Zmin and Zmax values #26417

Closed
1 task done
rq3 opened this issue Nov 11, 2023 · 6 comments
Closed
1 task done

Comments

@rq3
Copy link

rq3 commented Nov 11, 2023

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

The latest bugfix won't successfully compile due to a minor error in configuration.h:

#define PROBE_OFFSET_ZMIN -30 // (mm)
#define PROBE_OFFSET_ZMAX 30 // (mm)

default values are in excess of 20, so an error is thrown because sanity check specifies nothing larger than 20 is allowed.

Bug Timeline

new

Expected behavior

I expected a clean compile.

Actual behavior

Compile throws an error due to new, excessively large z probe offset values.

Steps to Reproduce

  1. Compile latest Marlin bugfix under Vscode.
  2. Observe error.

Version of Marlin Firmware

latest bugfix November 11, 2023

Printer model

Anycubic Predator

Electronics

stock, Trigorilla Pro with STM32F103

LCD/Controller

stock

Other add-ons

none

Bed Leveling

None

Your Slicer

None

Host Software

None

Don't forget to include

  • A ZIP file containing your Configuration.h and Configuration_adv.h.

Additional information & file uploads

Configuration.zip

@ellensp
Copy link
Contributor

ellensp commented Nov 12, 2023

In Marlin/src/inc/SanityCheck.h

PROBE_OFFSET_ASSERT("PROBE_OFFSET_ZMIN", PROBE_OFFSET_ZMIN, -20, 20);
PROBE_OFFSET_ASSERT("PROBE_OFFSET_ZMAX", PROBE_OFFSET_ZMAX, -20, 20);

Added in #26267 commit 9186a73

Will trigger on all these Marlin provided example Configs

config/examples/delta/FLSUN/QQS-Pro/Configuration.h:#define PROBE_OFFSET_ZMIN -25 // (mm)
config/examples/delta/FLSUN/Q5-nano_v2/Configuration.h:#define PROBE_OFFSET_ZMIN -40 // (mm)
config/examples/delta/FLSUN/Q5-nano_v1/Configuration.h:#define PROBE_OFFSET_ZMIN -40 // (mm)
config/examples/delta/Anycubic/Predator/Configuration.h:#define PROBE_OFFSET_ZMIN -30 // (mm)
config/examples/delta/Anycubic/Predator/Configuration.h:#define PROBE_OFFSET_ZMAX 30 // (mm)
config/examples/delta/Anycubic/Kossel/Configuration.h:#define PROBE_OFFSET_ZMIN -40 // (mm)
config/examples/delta/Anycubic/Kossel Linear Plus/Configuration.h:#define PROBE_OFFSET_ZMIN -40 // (mm)
config/examples/AnyCubic/Chiron/Configuration.h:#define PROBE_OFFSET_ZMIN -30 // (mm)

defaults in Marlin source Config files are -20, 20, So do not trigger this assert

@CRCinAU
Copy link
Contributor

CRCinAU commented Jan 31, 2024

For what its worth, this same problem affects the X/Y offsets too.

Multiple users require offsets greater than 50mm, and setting higher will cause a build failure.

@ellensp
Copy link
Contributor

ellensp commented Jan 31, 2024

yes these PROBE_OFFSET min and max setting are just a PITA from a user experience point of view

In my view the defaults should be enabled and set to

#define PROBE_OFFSET_XMIN -X_BED_SIZE // (mm)
#define PROBE_OFFSET_XMAX X_BED_SIZE // (mm)
#define PROBE_OFFSET_YMIN -Y_BED_SIZE // (mm)
#define PROBE_OFFSET_YMAX Y_BED_SIZE // (mm)
#define PROBE_OFFSET_ZMIN -Z_MAX_POS // (mm)
#define PROBE_OFFSET_ZMAX Z_MAX_POS // (mm)

Then if you wish to tie your hands up with reducing them, you can, but it is not the default.

NB this wont work currently, as bed sizes are defined after the PROBE_OFFSETS, so a reordering of the config file would be needed

@CRCinAU
Copy link
Contributor

CRCinAU commented Jan 31, 2024

Tagging @thinkyhead for awareness / input.

@ellensp
Copy link
Contributor

ellensp commented Jan 31, 2024

actually they are in Conditionals_post.h if not set in Configs, so setting the defaults to be full size is easy

ie

#if ANY(MESH_BED_LEVELING, HAS_BED_PROBE)
  #ifndef PROBE_OFFSET_ZMIN
    #define PROBE_OFFSET_ZMIN -Z_MAX_POS
  #endif
  #ifndef PROBE_OFFSET_ZMAX
    #define PROBE_OFFSET_ZMAX  Z_MAX_POS
  #endif
#endif
#if HAS_BED_PROBE
  #ifndef PROBE_OFFSET_XMIN
    #define PROBE_OFFSET_XMIN -X_MAX_POS
  #endif
  #ifndef PROBE_OFFSET_XMAX
    #define PROBE_OFFSET_XMAX  X_MAX_POS
  #endif
  #ifndef PROBE_OFFSET_YMIN
    #define PROBE_OFFSET_YMIN -Y_MAX_POS
  #endif
  #ifndef PROBE_OFFSET_YMAX
    #define PROBE_OFFSET_YMAX  Y_MAX_POS
  #endif
  

Copy link

github-actions bot commented Apr 6, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants