⚡️ Apply PTC on all probing (#23764)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
committed by
Scott Lahteine
parent
56cec9690a
commit
7ec2167a73
@ -36,11 +36,6 @@
|
||||
#include "../../../module/probe.h"
|
||||
#include "../../queue.h"
|
||||
|
||||
#if HAS_PTC
|
||||
#include "../../../feature/probe_temp_comp.h"
|
||||
#include "../../../module/temperature.h"
|
||||
#endif
|
||||
|
||||
#if HAS_STATUS_MESSAGE
|
||||
#include "../../../lcd/marlinui.h"
|
||||
#endif
|
||||
@ -658,10 +653,6 @@ G29_TYPE GcodeSuite::G29() {
|
||||
break; // Breaks out of both loops
|
||||
}
|
||||
|
||||
TERN_(PTC_BED, ptc.compensate_measurement(TSI_BED, thermalManager.degBed(), abl.measured_z));
|
||||
TERN_(PTC_PROBE, ptc.compensate_measurement(TSI_PROBE, thermalManager.degProbe(), abl.measured_z));
|
||||
TERN_(PTC_HOTEND, ptc.compensate_measurement(TSI_EXT, thermalManager.degHotend(0), abl.measured_z));
|
||||
|
||||
#if ENABLED(AUTO_BED_LEVELING_LINEAR)
|
||||
|
||||
abl.mean += abl.measured_z;
|
||||
|
@ -109,7 +109,9 @@ static void say_failed_to_calibrate() { SERIAL_ECHOPGM("!Failed to calibra
|
||||
|
||||
auto g76_probe = [](const TempSensorID sid, celsius_t &targ, const xy_pos_t &nozpos) {
|
||||
do_z_clearance(5.0); // Raise nozzle before probing
|
||||
ptc.set_enabled(false);
|
||||
const float measured_z = probe.probe_at_point(nozpos, PROBE_PT_STOW, 0, false); // verbose=0, probe_relative=false
|
||||
ptc.set_enabled(true);
|
||||
if (isnan(measured_z))
|
||||
SERIAL_ECHOLNPGM("!Received NAN. Aborting.");
|
||||
else {
|
||||
|
@ -35,11 +35,15 @@
|
||||
#include "../../module/planner.h"
|
||||
#endif
|
||||
|
||||
#if HAS_PTC
|
||||
#include "../../feature/probe_temp_comp.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* M48: Z probe repeatability measurement function.
|
||||
*
|
||||
* Usage:
|
||||
* M48 <P#> <X#> <Y#> <V#> <E> <L#> <S>
|
||||
* M48 <P#> <X#> <Y#> <V#> <E> <L#> <S> <C#>
|
||||
* P = Number of sampled points (4-50, default 10)
|
||||
* X = Sample X position
|
||||
* Y = Sample Y position
|
||||
@ -47,6 +51,7 @@
|
||||
* E = Engage Z probe for each reading
|
||||
* L = Number of legs of movement before probe
|
||||
* S = Schizoid (Or Star if you prefer)
|
||||
* C = Enable probe temperature compensation (0 or 1, default 1)
|
||||
*
|
||||
* This function requires the machine to be homed before invocation.
|
||||
*/
|
||||
@ -107,6 +112,8 @@ void GcodeSuite::M48() {
|
||||
set_bed_leveling_enabled(false);
|
||||
#endif
|
||||
|
||||
TERN_(HAS_PTC, ptc.set_enabled(!parser.seen('C') || parser.value_bool()));
|
||||
|
||||
// Work with reasonable feedrates
|
||||
remember_feedrate_scaling_off();
|
||||
|
||||
@ -269,6 +276,9 @@ void GcodeSuite::M48() {
|
||||
// Re-enable bed level correction if it had been on
|
||||
TERN_(HAS_LEVELING, set_bed_leveling_enabled(was_enabled));
|
||||
|
||||
// Re-enable probe temperature correction
|
||||
TERN_(HAS_PTC, ptc.set_enabled(true));
|
||||
|
||||
report_current_position();
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user