Add safety temperature for nozzle as probe

This commit is contained in:
InsanityAutomation
2020-12-05 18:33:39 -05:00
parent e8ed880e62
commit 1570559bba
2 changed files with 35 additions and 0 deletions
+7
View File
@@ -884,6 +884,13 @@
* nozzle system or a piezo-electric smart effector.
*/
//#define NOZZLE_AS_PROBE
#if ENABLED(NOZZLE_AS_PROBE)
#define PROBE_REQUIRES_MINTEMP // Require a minimum temperature when using the nozzle as a probe
#if ENABLED(PROBE_REQUIRES_MINTEMP)
#define PROBE_REQUIRES_MINTEMP_NOZZLE 150
#define PROBE_REQUIRES_MINTEMP_BED 50
#endif
#endif
/**
* Z Servo Probe, such as an endstop switch on a rotating arm.
+28
View File
@@ -348,6 +348,34 @@ bool Probe::set_deployed(const bool deploy) {
constexpr bool deploy_stow_condition = true;
#endif
#if BOTH(NOZZLE_AS_PROBE, PROBE_REQUIRES_MINTEMP)
bool setting_hotend, setting_bed = false;
#if defined(PROBE_REQUIRES_MINTEMP_NOZZLE) && PROBE_REQUIRES_MINTEMP_NOZZLE < 0 && HAS_TEMP_HOTEND
if (thermalManager.degTargetHotend(0) < PROBE_REQUIRES_MINTEMP_NOZZLE) {
uint16_t hotendTemperature = AUTOLEVEL_PREHEAT_NOZZLE_TEMP;
SERIAL_ECHOLNPAIR("Preheating hot-end to ", hotendTemperature);
thermalManager.setTargetHotend(hotendTemperature, 0);
setting_hotend = true;
}
#endif
#if defined(PROBE_REQUIRES_MINTEMP_BED) && PROBE_REQUIRES_MINTEMP_BED < 0 && HAS_HEATED_BED
if (thermalManager.degBed() < PROBE_REQUIRES_MINTEMP_BED) {
uint16_t bedTemperature = AUTOLEVEL_PREHEAT_BED_TEMP;
SERIAL_ECHOLNPAIR("Preheating bed to ", bedTemperature);
thermalManager.setTargetBed(bedTemperature);
setting_bed = true;
}
#endif
#if HAS_TEMP_HOTEND
if (setting_hotend) thermalManager.wait_for_hotend(0);
#endif
#if HAS_HEATED_BED
if (setting_bed) thermalManager.wait_for_bed_heating();
#endif
#endif
// For beds that fall when Z is powered off only raise for trusted Z
#if ENABLED(UNKNOWN_Z_NO_RAISE)
const bool unknown_condition = axis_is_trusted(Z_AXIS);