Generalize function out of nozzle as probe

This commit is contained in:
InsanityAutomation
2020-12-06 10:23:09 -05:00
parent bbdd481dab
commit 8394f0c3f4
2 changed files with 33 additions and 35 deletions
+7 -9
View File
@@ -884,15 +884,6 @@
* nozzle system or a piezo-electric smart effector.
*/
//#define NOZZLE_AS_PROBE
#if ENABLED(NOZZLE_AS_PROBE)
// Require a minimum temperature when using the nozzle as a probe. Useful on machines such as the Lulzbot series
// which uses a conductive nozzle or the Creality CR6 and other strain gauge sensors to prevent misreads from filament debris.
#define PROBE_REQUIRES_MINTEMP
#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.
@@ -1066,6 +1057,13 @@
//#define PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing
//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors
// Require a minimum temperature when ubefore allowing probing. Useful on machines such as the Lulzbot series
// which uses a conductive nozzle or the Creality CR6 and other strain gauge sensors to prevent misreads from filament debris.
#define PROBE_REQUIRES_MINTEMP_NOZZLE 150
#define PROBE_REQUIRES_MINTEMP_BED 50
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{ 0:'Low', 1:'High' }
#define X_ENABLE_ON 0
+26 -26
View File
@@ -348,34 +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
#if defined(PROBE_REQUIRES_MINTEMP_NOZZLE) && PROBE_REQUIRES_MINTEMP_NOZZLE < 0 && HAS_TEMP_HOTEND
if (thermalManager.degTargetHotend(0) < PROBE_REQUIRES_MINTEMP_NOZZLE) {
bool setting_hotend = false;
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
bool setting_hotend, setting_bed = false;
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
// 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);