-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
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
Add probe offset XY edit limits #26267
Add probe offset XY edit limits #26267
Conversation
9acc105
to
4cf0660
Compare
…SET_YRANGE_MIN, Z_PROBE_OFFSET_YRANGE_MAX to make UIs nicer, and limit M851 XY offsets M851 would respect the limits, so the system would be safer. Fixes MarlinFirmware#26263
4cf0660
to
c867de5
Compare
Test fails for Apparently, if people "just modify Configuration.h", then Marlin can't add new properties and keep backward compatibility. What do you think if there was Then all subsequent logic (e.g. Unfortunately, it would cause duplication of the default values as:
I think that duplication would be a reasonable price for maintaining backward compatibility, however, if there are better alternatives I would be glad to hear them. I suggest that |
You'd normally submit a companion PR to Marlin's Configurations repo when creating PRs that touch these kinds of settings/features.
|
Frankly speaking, I find that GitHub does not support multi-repository PR. At the same time, I believe having explicit
I am afraid For instance: Marlin/Marlin/src/inc/Conditionals_post.h Lines 440 to 445 in 11f98ad
I had a similar issue with Imagine
Then, Just in case, my use case for It looks like "HAS_BED_PROBE" becomes a part of the API anyway, however, currently, it is hard to hell "in which files one can use HAS_BED_PROBE" since it is declared in Conditionals_LCD.h only (LCD?) WDYT? |
In any files, you just include MarlinConfig.h/MarlinConfigPre.h |
@EvilGremlin , would you please elaborate? Apparently, I can't include |
Yep, here you can't, gotta use macro from configs only. Else it'll circular dependency, which is illegal. |
What is your suggestion then? As I add Of course, in my case I have enough flash and RAM, so I might eventually fold it into a single firmware and make "z-probe type" configurable from the menu. Unfortunately, I'm not there yet, so I have to generate several firmwares, and I find conditional activation of |
ah, you can use config.ini then |
That is exactly what I do: I pass |
#if !HAS_LEVELING || ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL)
#undef PROBE_MANUALLY no problems here |
@EvilGremlin , frankly speaking, I think The error message is
Just in case: I do not need workarounds for "probe_manually" as I have enough of them and I have configured GitHub Actions for building several variants of the firmware for my machine. |
It works correctly, there is no issue. You don't have any valid leveling type enabled, thus PROBE_MANUALLY gets undefined becasue nothing can use it. |
@EvilGremlin , Could you clarify what you mean? I truly do not understand your words. If I un-comment The same goes for It might be I do not understand what |
Nope, undef condition is perfectly right. UBL and MESH has it's own manual probing routine |
How about adding a sanity error in case the user supplies both PROBE_MANUALLY and UBL/MESH at the same time? |
It it was necessary it would be there for years. Read docs first https://marlinfw.org/docs/gcode/G029.html |
Thanks for referencing the manual. I have read it previously, and I have refreshed it right now. I can't find where it says |
🤦 because MBL is already manual and in UBL it's always available, non-optionally. |
If it is always available, then I would expect |
As it's still not clear to you - PROBE_MANUALLY does not exist in UBL and MBL code, it's irrelevant to them! |
Would you please review #26271 ? |
This is about ready, methinks, with more consistency in the naming of the options, and so on. I would have combined them into a single option, such as… #define PROBE_OFFSET_LIMIT { { -50, 50 }, { -50, 50 }, { -20, 20 } } // (mm) Offset limits for XYZ …but it makes all the code more complicated – enough to pass on doing it that way. Your various suggestions about configuration are not unfamiliar. We've covered a lot of that ground before in looking for more maintainable and user friendly configuration options, and after evaluating all the trade-offs involved in each approach we have arrived at where we are. The focus going forward is not to abandon the Join the discussion on the Marlin Discord if you would like to get involved with the effort to build these tools. I'm just getting started on the configuration migration tool, so feedback will be helpful as that develops. |
The Meanwhile, |
A couple renames were missed, so I've submitted a PR: #26397 |
@thinkyhead Please clarify why you made the changes in "smaller Z range" 9186a73 static_assert_within("PROBE_OFFSET_ZMIN", PROBE_OFFSET_ZMIN, -(Z_MAX_POS), Z_MAX_POS); to static_assert_within("PROBE_OFFSET_ZMIN", PROBE_OFFSET_ZMIN, -20, 20); Later this was changed to the following, but the -20 to 20 limits remains. PROBE_OFFSET_ASSERT("PROBE_OFFSET_ZMIN", PROBE_OFFSET_ZMIN, -20, 20); These seem to be arbitrary constraints to -20,20 when some marlin provided example configs exceed these values Ie config/examples/delta/FLSUN/QQS-Pro/Configuration.h:#define PROBE_OFFSET_ZMIN -25 // (mm) |
Co-authored-by: Scott Lahteine <[email protected]>
Description
Previously, XY offset was allowed to have as high as
X_BED_SIZE
,Y_BED_SIZE
values, however it might be too big for a common case.I suggest adding explicit
Z_PROBE_OFFSET_XRANGE_MIN
,Z_PROBE_OFFSET_XRANGE_MAX
,Z_PROBE_OFFSET_YRANGE_MIN
, andZ_PROBE_OFFSET_YRANGE_MAX
so users have saner defaults.I keep existing
Z_PROBE_OFFSET_RANGE_MIN
andZ_PROBE_OFFSET_RANGE_MAX
for backward compatibility.Requirements
The change relates to bed probes only.
Benefits
UI will be better as min-max would be more reasonable than "machine size", and
M851
would reject invalid XY offsets.Samples of the newly added sanity checks
I've added several new sanity checks.
"Z_PROBE_OFFSET_RANGE_MAX=1000, Z_MAX_POS=200"
"NOZZLE_TO_PROBE_OFFSET.y exceeds Z_PROBE_OFFSET_YRANGE_MIN and Z_PROBE_OFFSET_YRANGE_MAX":
It would be nice to have the actual computed values, however, it seems to require
format(...)
function or moving to c++20.Configurations
Sample diff to trigger a sanity check
Related Issues
#26263