️ Apply PTC on all probing (#23764)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
tombrazier
2022-02-22 01:15:52 +00:00
committed by GitHub
parent a9682f2e97
commit 8f8427ec8f
8 changed files with 48 additions and 14 deletions

View File

@@ -29,6 +29,10 @@
#include "../../module/probe.h"
#include "../../feature/bedlevel/bedlevel.h"
#if HAS_PTC
#include "../../feature/probe_temp_comp.h"
#endif
/**
* G30: Do a single Z probe at the current XY
*
@@ -37,6 +41,7 @@
* X Probe X position (default current X)
* Y Probe Y position (default current Y)
* E Engage the probe for each probe (default 1)
* C Enable probe temperature compensation (0 or 1, default 1)
*/
void GcodeSuite::G30() {
@@ -51,7 +56,10 @@ void GcodeSuite::G30() {
remember_feedrate_scaling_off();
const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE;
TERN_(HAS_PTC, ptc.set_enabled(!parser.seen('C') || parser.value_bool()));
const float measured_z = probe.probe_at_point(pos, raise_after, 1);
TERN_(HAS_PTC, ptc.set_enabled(true));
if (!isnan(measured_z))
SERIAL_ECHOLNPGM("Bed X: ", pos.x, " Y: ", pos.y, " Z: ", measured_z);