Cleanups for PTC

This commit is contained in:
Scott Lahteine 2020-02-27 06:18:27 -06:00
parent be62ab2d02
commit e5d39063a2
2 changed files with 15 additions and 15 deletions

View File

@ -57,16 +57,16 @@ class ProbeTempComp {
static const temp_calib_t cali_info[TSI_COUNT]; static const temp_calib_t cali_info[TSI_COUNT];
// Where to park nozzle to wait for probe cooldown // Where to park nozzle to wait for probe cooldown
static constexpr xyz_pos_t park_point = xyz_pos_t({ PTC_PARK_POS_X, PTC_PARK_POS_Y, PTC_PARK_POS_Z }); static constexpr float park_point_x = PTC_PARK_POS_X,
park_point_y = PTC_PARK_POS_Y,
park_point_z = PTC_PARK_POS_Z,
// XY coordinates of nozzle for probing the bed
measure_point_x = PTC_PROBE_POS_X, // Coordinates to probe
measure_point_y = PTC_PROBE_POS_Y;
//measure_point_x = 12.0f, // Coordinates to probe on MK52 magnetic heatbed
//measure_point_y = 7.3f;
static constexpr int max_bed_temp = PTC_MAX_BED_TEMP, // Max temperature to avoid heating errors static constexpr int max_bed_temp = PTC_MAX_BED_TEMP, // Max temperature to avoid heating errors
// XY coordinates of nozzle for probing the bed
measure_point_x = PTC_PROBE_POS_X, // X-coordinate to probe
measure_point_y = PTC_PROBE_POS_Y, // Y-coordinate to probe
//measure_point_x = 12.0f, // X-coordinate to probe on MK52 magnetic heatbed
//measure_point_y = 7.3f, // Y-coordinate to probe on MK52 magnetic heatbed
probe_calib_bed_temp = max_bed_temp, // Bed temperature while calibrating probe probe_calib_bed_temp = max_bed_temp, // Bed temperature while calibrating probe
bed_calib_probe_temp = 30; // Probe temperature while calibrating bed bed_calib_probe_temp = 30; // Probe temperature while calibrating bed

View File

@ -105,8 +105,8 @@ void GcodeSuite::G76() {
if (do_bed_cal || do_probe_cal) { if (do_bed_cal || do_probe_cal) {
// Ensure park position is reachable // Ensure park position is reachable
if (!position_is_reachable(ProbeTempComp::park_point.x, ProbeTempComp::park_point.y) if (!position_is_reachable(temp_comp.park_point_x, temp_comp.park_point_y)
|| !(WITHIN(ProbeTempComp::park_point.z, Z_MIN_POS - 0.001f, Z_MAX_POS + 0.001f)) || !(WITHIN(temp_comp.park_point_z, Z_MIN_POS - 0.001f, Z_MAX_POS + 0.001f))
) { ) {
SERIAL_ECHOLNPGM("!Park position unreachable - aborting."); SERIAL_ECHOLNPGM("!Park position unreachable - aborting.");
return; return;
@ -161,7 +161,7 @@ void GcodeSuite::G76() {
SERIAL_ECHOLNPAIR("Target Bed: ", target_bed, "; Probe: ", target_probe); SERIAL_ECHOLNPAIR("Target Bed: ", target_bed, "; Probe: ", target_probe);
// Park nozzle // Park nozzle
do_blocking_move_to(ProbeTempComp::park_point.x, ProbeTempComp::park_point.y, ProbeTempComp::park_point.z); do_blocking_move_to(temp_comp.park_point_x, temp_comp.park_point_y, temp_comp.park_point_z);
// Wait for heatbed to reach target temp and probe to cool below target temp // Wait for heatbed to reach target temp and probe to cool below target temp
SERIAL_ECHOLNPGM("Waiting for bed and probe to reach target temp."); SERIAL_ECHOLNPGM("Waiting for bed and probe to reach target temp.");
@ -186,9 +186,9 @@ void GcodeSuite::G76() {
if (timeout) break; if (timeout) break;
// Move probe to probing point and wait for probe to reach target temp // Move the nozzle to the probing point and wait for the probe to reach target temp
destination.set(temp_comp.measure_point_x, temp_comp.measure_point_y, 0.5); destination.set(temp_comp.measure_point_x, temp_comp.measure_point_y, 0.5);
do_blocking_move_to(destination.x, destination.y, destination.z); do_blocking_move_to(destination);
SERIAL_ECHOLNPGM("Waiting for probe heating."); SERIAL_ECHOLNPGM("Waiting for probe heating.");
while (thermalManager.degProbe() < target_probe) { while (thermalManager.degProbe() < target_probe) {
idle( idle(
@ -207,7 +207,7 @@ void GcodeSuite::G76() {
destination.z = 5.0; destination.z = 5.0;
do_blocking_move_to_z(destination.z); do_blocking_move_to_z(destination.z);
// Do a single probe // Do a single probe at the current position
remember_feedrate_scaling_off(); remember_feedrate_scaling_off();
const float measured_z = probe.probe_at_point( const float measured_z = probe.probe_at_point(
destination.x + probe.offset_xy.x, destination.x + probe.offset_xy.x,
@ -252,7 +252,7 @@ void GcodeSuite::G76() {
if (do_probe_cal) { if (do_probe_cal) {
// Park nozzle // Park nozzle
do_blocking_move_to(ProbeTempComp::park_point.x, ProbeTempComp::park_point.y, ProbeTempComp::park_point.z); do_blocking_move_to(temp_comp.park_point_x, temp_comp.park_point_y, temp_comp.park_point_z);
// Initialize temperatures // Initialize temperatures
uint16_t target_bed = temp_comp.probe_calib_bed_temp, uint16_t target_bed = temp_comp.probe_calib_bed_temp,