mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-02-16 22:37:35 +00:00
Added new 'P' (precise probing) option to G28
* This new flag causes G28 to execute the same probing algorithm that is used when bed leveling in order to increase accuracy. Provides a good alternative to 'bump' probing for probes that are still intermittently innacurate (I recommend disabling HOMING_BUMP_MM for the Z axis when using this option exclusively). * Only avaialbe when 'HAS_BED_PROBE' is enabled and is configurable via all the same options as the bed level probe.
This commit is contained in:
parent
13af4e1ef1
commit
c252098459
1 changed files with 12 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue