[2.0.x] Add Z_AFTER_PROBING option (#10058)
Some "fix-mounted" probes need manual stowing. And after probing some may prefer to raise or lower the nozzle. This restores an old option but tailors it to allow raise or lower as preferred.
This commit is contained in:
@ -733,7 +733,7 @@ void GcodeSuite::G29() {
|
||||
|
||||
#endif // AUTO_BED_LEVELING_3POINT
|
||||
|
||||
// Stow the probe, raising if not fix-mounted.
|
||||
// Stow the probe. No raise for FIX_MOUNTED_PROBE.
|
||||
if (STOW_PROBE()) {
|
||||
set_bed_leveling_enabled(abl_should_enable);
|
||||
measured_z = NAN;
|
||||
@ -967,12 +967,16 @@ void GcodeSuite::G29() {
|
||||
if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< G29");
|
||||
#endif
|
||||
|
||||
report_current_position();
|
||||
|
||||
KEEPALIVE_STATE(IN_HANDLER);
|
||||
|
||||
if (planner.leveling_active)
|
||||
SYNC_PLAN_POSITION_KINEMATIC();
|
||||
|
||||
#if HAS_BED_PROBE
|
||||
move_z_after_probing();
|
||||
#endif
|
||||
|
||||
report_current_position();
|
||||
}
|
||||
|
||||
#endif // OLDSCHOOL_ABL
|
||||
|
@ -39,6 +39,10 @@
|
||||
#include "../../feature/tmc_util.h"
|
||||
#endif
|
||||
|
||||
#if HOMING_Z_WITH_PROBE
|
||||
#include "../../module/probe.h"
|
||||
#endif
|
||||
|
||||
#include "../../lcd/ultralcd.h"
|
||||
|
||||
#if ENABLED(QUICK_HOME)
|
||||
@ -304,6 +308,9 @@ void GcodeSuite::G28(const bool always_home_all) {
|
||||
HOMEAXIS(Z);
|
||||
#endif
|
||||
} // home_all || homeZ
|
||||
#if HOMING_Z_WITH_PROBE
|
||||
move_z_after_probing();
|
||||
#endif
|
||||
#endif // Z_HOME_DIR < 0
|
||||
|
||||
SYNC_PLAN_POSITION_KINEMATIC();
|
||||
|
@ -51,7 +51,8 @@ void GcodeSuite::G30() {
|
||||
|
||||
setup_for_endstop_or_probe_move();
|
||||
|
||||
const float measured_z = probe_pt(xpos, ypos, parser.boolval('E'), 1);
|
||||
const bool do_stow = parser.boolval('E');
|
||||
const float measured_z = probe_pt(xpos, ypos, do_stow, 1);
|
||||
|
||||
if (!isnan(measured_z)) {
|
||||
SERIAL_PROTOCOLPAIR("Bed X: ", FIXFLOAT(xpos));
|
||||
@ -61,6 +62,8 @@ void GcodeSuite::G30() {
|
||||
|
||||
clean_up_after_endstop_or_probe_move();
|
||||
|
||||
if (do_stow) move_z_after_probing();
|
||||
|
||||
report_current_position();
|
||||
}
|
||||
|
||||
|
@ -25,16 +25,24 @@
|
||||
#if HAS_BED_PROBE
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../module/motion.h"
|
||||
#include "../../module/probe.h"
|
||||
|
||||
/**
|
||||
* M401: Deploy and activate the Z probe
|
||||
*/
|
||||
void GcodeSuite::M401() { DEPLOY_PROBE(); }
|
||||
void GcodeSuite::M401() {
|
||||
DEPLOY_PROBE();
|
||||
report_current_position();
|
||||
}
|
||||
|
||||
/**
|
||||
* M402: Deactivate and stow the Z probe
|
||||
*/
|
||||
void GcodeSuite::M402() { STOW_PROBE(); }
|
||||
void GcodeSuite::M402() {
|
||||
STOW_PROBE();
|
||||
move_z_after_probing();
|
||||
report_current_position();
|
||||
}
|
||||
|
||||
#endif // HAS_BED_PROBE
|
||||
|
Reference in New Issue
Block a user