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

Added new 'P' (precise probing) option to G28 #27523

Open
wants to merge 1 commit into
base: bugfix-2.1.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Marlin/src/gcode/calibrate/G28.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,18 @@ void GcodeSuite::G28() {

#endif // DUAL_X_CARRIAGE

#if HAS_BED_PROBE
// Perform precise homing using the same probing procedure as bed leveling
if (parser.seen_test('P')) {
xy_pos_t xyPos = { current_position.x, current_position.y };
float probedZHeight = probe.probe_at_point(xyPos, PROBE_PT_RAISE, 0, false);
DEBUG_ECHOLNPGM("Probed ZHeight (correction amount): ", probedZHeight);

current_position.z -= probedZHeight;
sync_plan_position();
}
#endif

endstops.not_homing();

// Clear endstop state for polled stallGuard endstops
Expand Down