-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
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
Make probes independent of leveling #4021
Make probes independent of leveling #4021
Conversation
f33fe71
to
5a66aaf
Compare
I think we need to do this. But I have a question about whether it actually fixes the G28 Z case with a servo. At the tail end of G28, we have this code:
The code is going straight to the servo and not calling the stow_z_probe() function. Don't we need to change it to call stow_z_probe() to get the desired effect? Or alternatively, before this code messes with the servo, we need to call raise_z_after_probing() before it messes with the servo? |
5a66aaf
to
d463f9b
Compare
That code should only apply to XY servos in the case where you have a Z probe. The code above that block will have already called // Put away the Z probe with a function
#if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE)
if (axis == Z_AXIS && axis_home_dir < 0) {
stow_z_probe();
}
#endif For a servo-based Z probe, the second block ends up being reduced to… // Retract X, Y (or Z) Servo endstop if enabled
#if ENABLED(HAS_SERVO_ENDSTOPS)
if (axis != Z_AXIS && SERVO_ENDSTOP_EXISTS(axis)) {
STOW_SERVO_ENDSTOP(axis);
}
#endif // HAS_SERVO_ENDSTOPS |
I see what you are saying... But I put the Wow! |
I'm unsure. With your addition, it should have reduced to… // Retract Servo endstop if enabled
#if HAS_SERVO_ENDSTOPS
if (axis != Z_AXIS && servo_endstop_id[axis] >= 0) {
raise_z_after_probing();
STOW_SERVO_ENDSTOP(axis);
}
#endif …which would only run if you have an index set for X or Y servos. Did you leave these commented out?: //#define X_ENDSTOP_SERVO_NR 1
//#define Y_ENDSTOP_SERVO_NR 2 |
d463f9b
to
b05cbe2
Compare
It seems to be the right time to (remind) you that |
@Blue-Marlin Can you expand a little bit on that thought? It isn't quite coming across. But from what I did understand, I think I would agree if a probe is defined, it should be usable within the G28 command. I also think that G28 should not be concerned with how a probe does it's work. If the probe is implemented with a servo that work should be done at a lower level. |
Two stubs from What is done in |
Thank You for the explanation. This sounds like something that should not be done prior to the Release Candidate going 'Golden'. But we should try to do this as soon as we can after that happens. |
I'm not sure if we're all clear about these flags. So a quick review…
Yep, Marlin supports X and Y Servo Endstops (and Z Servo Endstops that are just endstops). |
No, it does not anymore. Take a look into |
Happy to see this code go, then. And why do we still have a three-element array for endstop servo angles, if we will only ever care about Z? Does this mean we could get rid of the other two elements now? #define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} …replaced with… #define Z_SERVO_ANGLES {70,0} |
Yes. |
For this extruder with a servo we need again two defined angles. Maybe we can reuse the array with an other meaning. |
No need to re-use. It can just have its own distinct 2-member array. |
b05cbe2
to
87d22df
Compare
Ok, I've inserted a commit removing support for the obsolete servo endstops, along with some sanity checks… #elif defined(SERVO_ENDSTOP_ANGLES)
#error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead."
#elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR)
#error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed."
#endif And, now I've added some more commits to allow probing if you have a probe, not requiring ABL. |
fef4796
to
ffa6520
Compare
59f21bc
to
7a7b2bd
Compare
7a7b2bd
to
d4134e6
Compare
The more I hear about other workarounds the more I like re-using endstop switches for simple inputs. On many machines, at least 2, if not 3 endstop plugs are unused, so making them into assignable push-buttons would be a cheap way to add up to 3 simple functions to your old RepRap. I suppose I could even warm up to the idea of using the endstops (when not homing) for other functions also, although until the endstops are clear of obstruction they are useless. You could wire NC switches in series, NO in parallel, but again, the endstops still need to be unpressed. |
I'm a bit afraid to say that's more a long therm project, because you usually immediately begin with the realization then. So in this case i'll try to say - yes a very good idea - we need it now. Maybe waiting will be easier for you then. An other good thing would be a Other projects could include
You kept me busy today. |
I can tell we are all hungry for simplification in this area! |
I like @thinkyhead idea, a "endstop input" if it has a endstop connected it will trigger endstop_stuff() other wise it will trigger button_stuff(), dead simple with no PIN #undefs and other crazy stuff. |
I think this will help a lot of people.
I believe this is very low risk and very easy. If the MANUALLY_DEPLOYED_PROBE is enabled, we just wait for an lcd_clicked() to continue in both stow and deploy of a probe. Later, we could do the extra work to make it flexible and use the CONTINUE_FEATURE.
Yes! And it is already coded and working in the Unified Bed Leveling code:
|
Very much so. I see a possibility of merger, top-down at first, to add automated MBL, and to generalize Grid and 3-point leveling. (In the direction of Universal Bed Leveling.) Basically the
The |
👍 |
Please hold off on doing anything with the Mesh object or adding 3-Point or Grid or Delta objects. What I've got cooking already embraces all of those. And all of the nested #ifdef's are gone. |
@Roxy-3D |
There are enough conceptual changes (mainly in |
How about in a couple of weeks? Basically, it is a high resolution (15x15) Mesh system that allows 3-Point and Grid Based to tilt the Mesh. Right now, I'm working on the Mesh editor to make it easy to update and/or fine tune your Mesh's. And it doesn't force you to prepare a Mesh. If you have a sufficiently flat piece of glass, you can just tell it to zero the entire Mesh and perform a tilt based on 3-Point or Grid probing. (So it is backwards compatible). I don't have everything working... And my coding style is kind of chaotic where I paste old functions and header files into my files just so I have easy reference. I have to do some clean up before I'm ready to share the code. What I'm trying to do is stay synchronized with ThinkyHead so when we promote the Release Candidate to 'Golden' status, we have a Development Branch ready to go with Unified Bed Leveling based on the Stable Branch. |
@thinkyhead @Roxy-3D |
No. You are wrong. I'm not under estimating you. I know your code is clean and I don't want to share anything that is not just as clean. |
I guess @thinkyhead has an other opinion about my style. |
This addresses enough bugs, logical errors, and especially compile issues, that I thought it best to merge it now. It's modular enough that we can backtrack on any section, should there be any unexpected behavior. |
Tried some things we talked about yesterday AnHardt#48 |
PR #4134 incorporates most of those changes, which are very sensible. |
…detected cleanup: remove unnecessary LCD update in `crashdet_detected()`
This PR makes probing independent of leveling, so you can use your Z probe for homing even if you don't have bed leveling enabled.
Already merged in separate PRs:
deploy_z_probe
/stow_z_probe
.zprobe_zoffset
dependent only onHAS_BED_PROBE
.M851
standard with no option to remap it, and only based onHAS_BED_PROBE
.HAS_BED_PROBE
.gcode_G29
. (Over-simplified?)And…
current_position
tohome_offset
on bootset_bed_level_equation_3pts
run_z_probe
probe_pt
for Allen Key or Sled probesendstop_move
functions for probes / endstopsdeploy_z_probe
after thesetup_for_probe_or_endstop_move
call inG29
sync_plan_position_delta
where needed using a macro