Skip to content

Fix G28 with non-BLTouch probes#14381

Merged
thinkyhead merged 2 commits intobugfix-2.0.xfrom
unknown repository
Jun 24, 2019
Merged

Fix G28 with non-BLTouch probes#14381
thinkyhead merged 2 commits intobugfix-2.0.xfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Jun 23, 2019

TESTED, can be MERGED but QUESTIONs (see below).

Part of the BLTOUCH cleanup. In preparation for later changes in motion.cpp.

Refer also to issue #14328.

A combination of two things prompted this change:

History: The bltouch.init() call before homing was deemed necessary to bring the probe into a defined state before doing any movement. At that time, bltouch.init() was still causing the pin to down-up-down, which prompted moving it to the code place where z-homing would take place. There are actually other places which were missed in the hurry - so that's the first error. Then later on, the down-up-down was abandoned as it was considered an annoyance and the bltouch.init() could have been moved back to the beginning of the G28 - it only does a RESET and then a STOW anymore.

But what about other kinds of probes? It is a good idea to STOW all kinds of probes before G28 goes moving all over the place (X, Y). It will be deployed in the lower level code before homing Z anyway.

And this also fixes the M401 problem #14328 (only applies to USES_Z_MIN_PROBE_ENDSTOP, separate pins for probe and ZMIN), where a deployed probe would be inadvertently stowed by the bltouch.init() but leaving the endstops configured for the probe - which crashes into the bed (stowed probe).

With this fix, all homing via G28 will unconditionally use the ZMIN endstop.

Is there a desire to have a M401 (deploy) set a mode where subsequent G28s, G34s(contains G28s) use the probe when homing instead of the Z-MIN endstop?

I don't really believe that. It can be done, but many more code changes and HOMING_Z_WITH_PROBE would have to be made a bool instead of #defined.

Currently
#define HOMING_Z_WITH_PROBE (Z_HOME_DIR < 0 && !USES_Z_MIN_PROBE_ENDSTOP)
limits homing with a probe to probes that are attached to the ZMIN pin.

Is this what was intended when a user connects BOTH the ZMIN switch AND the probe? The current logic then turns off HOMING_Z_WITH_PROBE and homes with the ZMIN endstop switch.

BigIronGuru added 2 commits June 23, 2019 15:40
bltouch.init can now be replaced by STOW_PROBE - and it is to be done before any movement takes place. Also, it should be done with all kinds of probes. They will be duly deployed in homeaxis() etc.
bltouch.h is no longer needed.
This is the right place
@AnHardt
Copy link
Contributor

AnHardt commented Jun 23, 2019

Currently
#define HOMING_Z_WITH_PROBE (Z_HOME_DIR < 0 && !USES_Z_MIN_PROBE_ENDSTOP)
limits homing with a probe to probes that are attached to the ZMIN pin.

Right. And it's correct that way.
The only good reason to have the probe not at the ZMIN pin is having a z-min-endstop connected right there. The reason for that is wanting to home with the endstop.

@ghost ghost mentioned this pull request Jun 23, 2019
@thinkyhead thinkyhead changed the title G28.cpp fix to work with ALL probe types, not only BLTOUCH, FIX for #14328 Fix G28 with non-BLTouch probes Jun 24, 2019
@thinkyhead thinkyhead merged commit 5986194 into MarlinFirmware:bugfix-2.0.x Jun 24, 2019
@ghost ghost deleted the G28 branch June 24, 2019 08:15
thinkyhead added a commit that referenced this pull request Jun 26, 2019
- Revert "Fix FIX_MOUNTED_PROBE compile error (#14393)"
- Revert "Fix G28 with non-BLTouch probes (#14381)"
- Revert "Fix BLTOUCH deploy/stow in HS mode (#14352)"
- Revert "Apply needed BLTouch patch (#14233)"

Co-Authored-By: AnHardt <github@kitelab.de>
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