Minimum temp options for Probing and G12 Nozzle Clean (#20383)
Co-authored-by: Jason Smith <jason.inet@gmail.com> Co-authored-by: Scott Lahteine <github@thinkyhead.com>
This commit is contained in:
committed by
Scott Lahteine
parent
87fbb89330
commit
588fec6474
@ -36,12 +36,9 @@
|
||||
#include "../../../module/probe.h"
|
||||
#include "../../queue.h"
|
||||
|
||||
#if EITHER(PROBE_TEMP_COMPENSATION, PREHEAT_BEFORE_LEVELING)
|
||||
#include "../../../module/temperature.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(PROBE_TEMP_COMPENSATION)
|
||||
#include "../../../feature/probe_temp_comp.h"
|
||||
#include "../../../module/temperature.h"
|
||||
#endif
|
||||
|
||||
#if HAS_DISPLAY
|
||||
@ -404,25 +401,13 @@ G29_TYPE GcodeSuite::G29() {
|
||||
ExtUI::onMeshLevelingStart();
|
||||
#endif
|
||||
|
||||
if (!faux) remember_feedrate_scaling_off();
|
||||
if (!faux) {
|
||||
remember_feedrate_scaling_off();
|
||||
|
||||
#if ENABLED(PREHEAT_BEFORE_LEVELING)
|
||||
#ifndef LEVELING_NOZZLE_TEMP
|
||||
#define LEVELING_NOZZLE_TEMP 0
|
||||
#if ENABLED(PREHEAT_BEFORE_LEVELING)
|
||||
if (!dryrun) probe.preheat_for_probing(LEVELING_NOZZLE_TEMP, LEVELING_BED_TEMP);
|
||||
#endif
|
||||
#ifndef LEVELING_BED_TEMP
|
||||
#define LEVELING_BED_TEMP 0
|
||||
#endif
|
||||
if (!dryrun && !faux) {
|
||||
constexpr uint16_t hotendPreheat = LEVELING_NOZZLE_TEMP, bedPreheat = LEVELING_BED_TEMP;
|
||||
if (DEBUGGING(LEVELING))
|
||||
DEBUG_ECHOLNPAIR("Preheating hotend (", hotendPreheat, ") and bed (", bedPreheat, ")");
|
||||
if (hotendPreheat) thermalManager.setTargetHotend(hotendPreheat, 0);
|
||||
if (bedPreheat) thermalManager.setTargetBed(bedPreheat);
|
||||
if (hotendPreheat) thermalManager.wait_for_hotend(0);
|
||||
if (bedPreheat) thermalManager.wait_for_bed_heating();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Disable auto bed leveling during G29.
|
||||
// Be formal so G29 can be done successively without G28.
|
||||
|
@ -819,6 +819,22 @@
|
||||
#define TOTAL_PROBING MULTIPLE_PROBING
|
||||
#endif
|
||||
#endif
|
||||
#if ENABLED(PREHEAT_BEFORE_PROBING)
|
||||
#ifndef PROBING_NOZZLE_TEMP
|
||||
#define PROBING_NOZZLE_TEMP 0
|
||||
#endif
|
||||
#ifndef PROBING_BED_TEMP
|
||||
#define PROBING_BED_TEMP 0
|
||||
#endif
|
||||
#endif
|
||||
#if ENABLED(PREHEAT_BEFORE_LEVELING)
|
||||
#ifndef LEVELING_NOZZLE_TEMP
|
||||
#define LEVELING_NOZZLE_TEMP 0
|
||||
#endif
|
||||
#ifndef LEVELING_BED_TEMP
|
||||
#define LEVELING_BED_TEMP 0
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
// Clear probe pin settings when no probe is selected
|
||||
#undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
|
||||
|
@ -1514,6 +1514,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if BOTH(PREHEAT_BEFORE_PROBING, PREHEAT_BEFORE_LEVELING)
|
||||
#error "Disable PREHEAT_BEFORE_LEVELING when using PREHEAT_BEFORE_PROBING."
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Homing
|
||||
*/
|
||||
|
@ -31,6 +31,10 @@ Nozzle nozzle;
|
||||
#include "../MarlinCore.h"
|
||||
#include "../module/motion.h"
|
||||
|
||||
#if NOZZLE_CLEAN_MIN_TEMP > 20
|
||||
#include "../module/temperature.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(NOZZLE_CLEAN_FEATURE)
|
||||
|
||||
/**
|
||||
@ -153,6 +157,19 @@ Nozzle nozzle;
|
||||
|
||||
const uint8_t arrPos = ANY(SINGLENOZZLE, MIXING_EXTRUDER) ? 0 : active_extruder;
|
||||
|
||||
#if NOZZLE_CLEAN_MIN_TEMP > 20
|
||||
if (thermalManager.degTargetHotend(arrPos) < NOZZLE_CLEAN_MIN_TEMP) {
|
||||
#if ENABLED(NOZZLE_CLEAN_HEATUP)
|
||||
SERIAL_ECHOLNPGM("Nozzle too Cold - Heating");
|
||||
thermalManager.setTargetHotend(NOZZLE_CLEAN_MIN_TEMP, arrPos);
|
||||
thermalManager.wait_for_hotend(arrPos);
|
||||
#else
|
||||
SERIAL_ECHOLNPGM("Nozzle too cold - Skipping wipe");
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if HAS_SOFTWARE_ENDSTOPS
|
||||
|
||||
#define LIMIT_AXIS(A) do{ \
|
||||
|
@ -325,6 +325,36 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
|
||||
#endif
|
||||
}
|
||||
|
||||
#if EITHER(PREHEAT_BEFORE_PROBING, PREHEAT_BEFORE_LEVELING)
|
||||
|
||||
/**
|
||||
* Do preheating as required before leveling or probing
|
||||
*/
|
||||
void Probe::preheat_for_probing(const uint16_t hotend_temp, const uint16_t bed_temp) {
|
||||
#if PROBING_NOZZLE_TEMP || LEVELING_NOZZLE_TEMP
|
||||
#define WAIT_FOR_NOZZLE_HEAT
|
||||
#endif
|
||||
#if PROBING_BED_TEMP || LEVELING_BED_TEMP
|
||||
#define WAIT_FOR_BED_HEAT
|
||||
#endif
|
||||
const uint16_t hotendPreheat = TERN0(WAIT_FOR_NOZZLE_HEAT, thermalManager.degHotend(0) < hotend_temp) ? hotend_temp : 0,
|
||||
bedPreheat = TERN0(WAIT_FOR_BED_HEAT, thermalManager.degBed() < bed_temp) ? bed_temp : 0;
|
||||
DEBUG_ECHOPGM("Preheating ");
|
||||
if (hotendPreheat) {
|
||||
DEBUG_ECHOPAIR("hotend (", hotendPreheat, ") ");
|
||||
if (bedPreheat) DEBUG_ECHOPGM("and ");
|
||||
}
|
||||
if (bedPreheat) DEBUG_ECHOPAIR("bed (", bedPreheat, ") ");
|
||||
DEBUG_EOL();
|
||||
|
||||
TERN_(WAIT_FOR_NOZZLE_HEAT, if (hotendPreheat) thermalManager.setTargetHotend(hotendPreheat, 0));
|
||||
TERN_(WAIT_FOR_BED_HEAT, if (bedPreheat) thermalManager.setTargetBed(bedPreheat));
|
||||
TERN_(WAIT_FOR_NOZZLE_HEAT, if (hotendPreheat) thermalManager.wait_for_hotend(0));
|
||||
TERN_(WAIT_FOR_BED_HEAT, if (bedPreheat) thermalManager.wait_for_bed_heating());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Attempt to deploy or stow the probe
|
||||
*
|
||||
@ -392,6 +422,9 @@ bool Probe::set_deployed(const bool deploy) {
|
||||
|
||||
#endif
|
||||
|
||||
// If preheating is required before any probing...
|
||||
TERN_(PREHEAT_BEFORE_PROBING, if (deploy) preheat_for_probing(PROBING_NOZZLE_TEMP, PROBING_BED_TEMP));
|
||||
|
||||
do_blocking_move_to(old_xy);
|
||||
endstops.enable_z_probe(deploy);
|
||||
return false;
|
||||
|
@ -51,6 +51,10 @@ public:
|
||||
|
||||
static xyz_pos_t offset;
|
||||
|
||||
#if EITHER(PREHEAT_BEFORE_PROBING, PREHEAT_BEFORE_LEVELING)
|
||||
static void preheat_for_probing(const uint16_t hotend_temp, const uint16_t bed_temp);
|
||||
#endif
|
||||
|
||||
static bool set_deployed(const bool deploy);
|
||||
|
||||
#if IS_KINEMATIC
|
||||
|
Reference in New Issue
Block a user