Browse Source

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>
InsanityAutomation 3 years ago
parent
commit
7a168205eb
No account linked to committer's email address

+ 12
- 1
Marlin/Configuration.h View File

@@ -1067,6 +1067,13 @@
1067 1067
 //#define PROBING_STEPPERS_OFF      // Turn steppers off (unless needed to hold position) when probing
1068 1068
 //#define DELAY_BEFORE_PROBING 200  // (ms) To prevent vibrations from triggering piezo sensors
1069 1069
 
1070
+// Require minimum nozzle and/or bed temperature for probing.
1071
+//#define PREHEAT_BEFORE_PROBING
1072
+#if ENABLED(PREHEAT_BEFORE_PROBING)
1073
+  #define PROBING_NOZZLE_TEMP 120   // (°C) Only applies to E0 at this time
1074
+  #define PROBING_BED_TEMP     50
1075
+#endif
1076
+
1070 1077
 // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
1071 1078
 // :{ 0:'Low', 1:'High' }
1072 1079
 #define X_ENABLE_ON 0
@@ -1296,7 +1303,7 @@
1296 1303
  */
1297 1304
 //#define PREHEAT_BEFORE_LEVELING
1298 1305
 #if ENABLED(PREHEAT_BEFORE_LEVELING)
1299
-  #define LEVELING_NOZZLE_TEMP 120
1306
+  #define LEVELING_NOZZLE_TEMP 120   // (°C) Only applies to E0 at this time
1300 1307
   #define LEVELING_BED_TEMP     50
1301 1308
 #endif
1302 1309
 
@@ -1666,6 +1673,10 @@
1666 1673
   // For a purge/clean station mounted on the X axis
1667 1674
   //#define NOZZLE_CLEAN_NO_Y
1668 1675
 
1676
+  // Require a minimum hotend temperature for cleaning
1677
+  #define NOZZLE_CLEAN_MIN_TEMP 170
1678
+  //#define NOZZLE_CLEAN_HEATUP       // Heat up the nozzle instead of skipping wipe
1679
+
1669 1680
   // Explicit wipe G-code script applies to a G12 with no arguments.
1670 1681
   //#define WIPE_SEQUENCE_COMMANDS "G1 X-17 Y25 Z10 F4000\nG1 Z1\nM114\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 Z15\nM400\nG0 X-10.0 Y-9.0"
1671 1682
 

+ 6
- 21
Marlin/src/gcode/bedlevel/abl/G29.cpp View File

@@ -36,12 +36,9 @@
36 36
 #include "../../../module/probe.h"
37 37
 #include "../../queue.h"
38 38
 
39
-#if EITHER(PROBE_TEMP_COMPENSATION, PREHEAT_BEFORE_LEVELING)
40
-  #include "../../../module/temperature.h"
41
-#endif
42
-
43 39
 #if ENABLED(PROBE_TEMP_COMPENSATION)
44 40
   #include "../../../feature/probe_temp_comp.h"
41
+  #include "../../../module/temperature.h"
45 42
 #endif
46 43
 
47 44
 #if HAS_DISPLAY
@@ -404,25 +401,13 @@ G29_TYPE GcodeSuite::G29() {
404 401
       ExtUI::onMeshLevelingStart();
405 402
     #endif
406 403
 
407
-    if (!faux) remember_feedrate_scaling_off();
404
+    if (!faux) {
405
+      remember_feedrate_scaling_off();
408 406
 
409
-    #if ENABLED(PREHEAT_BEFORE_LEVELING)
410
-      #ifndef LEVELING_NOZZLE_TEMP
411
-        #define LEVELING_NOZZLE_TEMP 0
407
+      #if ENABLED(PREHEAT_BEFORE_LEVELING)
408
+        if (!dryrun) probe.preheat_for_probing(LEVELING_NOZZLE_TEMP, LEVELING_BED_TEMP);
412 409
       #endif
413
-      #ifndef LEVELING_BED_TEMP
414
-        #define LEVELING_BED_TEMP 0
415
-      #endif
416
-      if (!dryrun && !faux) {
417
-        constexpr uint16_t hotendPreheat = LEVELING_NOZZLE_TEMP, bedPreheat = LEVELING_BED_TEMP;
418
-        if (DEBUGGING(LEVELING))
419
-          DEBUG_ECHOLNPAIR("Preheating hotend (", hotendPreheat, ") and bed (", bedPreheat, ")");
420
-        if (hotendPreheat) thermalManager.setTargetHotend(hotendPreheat, 0);
421
-        if (bedPreheat)    thermalManager.setTargetBed(bedPreheat);
422
-        if (hotendPreheat) thermalManager.wait_for_hotend(0);
423
-        if (bedPreheat)    thermalManager.wait_for_bed_heating();
424
-      }
425
-    #endif
410
+    }
426 411
 
427 412
     // Disable auto bed leveling during G29.
428 413
     // Be formal so G29 can be done successively without G28.

+ 16
- 0
Marlin/src/inc/Conditionals_LCD.h View File

@@ -819,6 +819,22 @@
819 819
       #define TOTAL_PROBING MULTIPLE_PROBING
820 820
     #endif
821 821
   #endif
822
+  #if ENABLED(PREHEAT_BEFORE_PROBING)
823
+    #ifndef PROBING_NOZZLE_TEMP
824
+      #define PROBING_NOZZLE_TEMP 0
825
+    #endif
826
+    #ifndef PROBING_BED_TEMP
827
+      #define PROBING_BED_TEMP 0
828
+    #endif
829
+  #endif
830
+  #if ENABLED(PREHEAT_BEFORE_LEVELING)
831
+    #ifndef LEVELING_NOZZLE_TEMP
832
+      #define LEVELING_NOZZLE_TEMP 0
833
+    #endif
834
+    #ifndef LEVELING_BED_TEMP
835
+      #define LEVELING_BED_TEMP 0
836
+    #endif
837
+  #endif
822 838
 #else
823 839
   // Clear probe pin settings when no probe is selected
824 840
   #undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN

+ 4
- 0
Marlin/src/inc/SanityCheck.h View File

@@ -1514,6 +1514,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1514 1514
   #endif
1515 1515
 #endif
1516 1516
 
1517
+#if BOTH(PREHEAT_BEFORE_PROBING, PREHEAT_BEFORE_LEVELING)
1518
+  #error "Disable PREHEAT_BEFORE_LEVELING when using PREHEAT_BEFORE_PROBING."
1519
+#endif
1520
+
1517 1521
 /**
1518 1522
  * Homing
1519 1523
  */

+ 17
- 0
Marlin/src/libs/nozzle.cpp View File

@@ -31,6 +31,10 @@ Nozzle nozzle;
31 31
 #include "../MarlinCore.h"
32 32
 #include "../module/motion.h"
33 33
 
34
+#if NOZZLE_CLEAN_MIN_TEMP > 20
35
+  #include "../module/temperature.h"
36
+#endif
37
+
34 38
 #if ENABLED(NOZZLE_CLEAN_FEATURE)
35 39
 
36 40
   /**
@@ -153,6 +157,19 @@ Nozzle nozzle;
153 157
 
154 158
     const uint8_t arrPos = ANY(SINGLENOZZLE, MIXING_EXTRUDER) ? 0 : active_extruder;
155 159
 
160
+    #if NOZZLE_CLEAN_MIN_TEMP > 20
161
+      if (thermalManager.degTargetHotend(arrPos) < NOZZLE_CLEAN_MIN_TEMP) {
162
+        #if ENABLED(NOZZLE_CLEAN_HEATUP)
163
+          SERIAL_ECHOLNPGM("Nozzle too Cold - Heating");
164
+          thermalManager.setTargetHotend(NOZZLE_CLEAN_MIN_TEMP, arrPos);
165
+          thermalManager.wait_for_hotend(arrPos);
166
+        #else
167
+          SERIAL_ECHOLNPGM("Nozzle too cold - Skipping wipe");
168
+          return;
169
+        #endif
170
+      }
171
+    #endif
172
+
156 173
     #if HAS_SOFTWARE_ENDSTOPS
157 174
 
158 175
       #define LIMIT_AXIS(A) do{ \

+ 33
- 0
Marlin/src/module/probe.cpp View File

@@ -325,6 +325,36 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
325 325
   #endif
326 326
 }
327 327
 
328
+#if EITHER(PREHEAT_BEFORE_PROBING, PREHEAT_BEFORE_LEVELING)
329
+
330
+  /**
331
+   * Do preheating as required before leveling or probing
332
+   */
333
+  void Probe::preheat_for_probing(const uint16_t hotend_temp, const uint16_t bed_temp) {
334
+    #if PROBING_NOZZLE_TEMP || LEVELING_NOZZLE_TEMP
335
+      #define WAIT_FOR_NOZZLE_HEAT
336
+    #endif
337
+    #if PROBING_BED_TEMP || LEVELING_BED_TEMP
338
+      #define WAIT_FOR_BED_HEAT
339
+    #endif
340
+    const uint16_t hotendPreheat = TERN0(WAIT_FOR_NOZZLE_HEAT, thermalManager.degHotend(0) < hotend_temp) ? hotend_temp : 0,
341
+                      bedPreheat = TERN0(WAIT_FOR_BED_HEAT,    thermalManager.degBed()     < bed_temp)    ? bed_temp    : 0;
342
+    DEBUG_ECHOPGM("Preheating ");
343
+    if (hotendPreheat) {
344
+      DEBUG_ECHOPAIR("hotend (", hotendPreheat, ") ");
345
+      if (bedPreheat) DEBUG_ECHOPGM("and ");
346
+    }
347
+    if (bedPreheat) DEBUG_ECHOPAIR("bed (", bedPreheat, ") ");
348
+    DEBUG_EOL();
349
+
350
+    TERN_(WAIT_FOR_NOZZLE_HEAT, if (hotendPreheat) thermalManager.setTargetHotend(hotendPreheat, 0));
351
+    TERN_(WAIT_FOR_BED_HEAT,    if (bedPreheat)    thermalManager.setTargetBed(bedPreheat));
352
+    TERN_(WAIT_FOR_NOZZLE_HEAT, if (hotendPreheat) thermalManager.wait_for_hotend(0));
353
+    TERN_(WAIT_FOR_BED_HEAT,    if (bedPreheat)    thermalManager.wait_for_bed_heating());
354
+  }
355
+
356
+#endif
357
+
328 358
 /**
329 359
  * Attempt to deploy or stow the probe
330 360
  *
@@ -392,6 +422,9 @@ bool Probe::set_deployed(const bool deploy) {
392 422
 
393 423
   #endif
394 424
 
425
+  // If preheating is required before any probing...
426
+  TERN_(PREHEAT_BEFORE_PROBING, if (deploy) preheat_for_probing(PROBING_NOZZLE_TEMP, PROBING_BED_TEMP));
427
+
395 428
   do_blocking_move_to(old_xy);
396 429
   endstops.enable_z_probe(deploy);
397 430
   return false;

+ 4
- 0
Marlin/src/module/probe.h View File

@@ -51,6 +51,10 @@ public:
51 51
 
52 52
     static xyz_pos_t offset;
53 53
 
54
+    #if EITHER(PREHEAT_BEFORE_PROBING, PREHEAT_BEFORE_LEVELING)
55
+      static void preheat_for_probing(const uint16_t hotend_temp, const uint16_t bed_temp);
56
+    #endif
57
+
54 58
     static bool set_deployed(const bool deploy);
55 59
 
56 60
     #if IS_KINEMATIC

+ 2
- 1
buildroot/tests/LPC1768-tests View File

@@ -39,7 +39,7 @@ opt_set TEMP_SENSOR_1 -1
39 39
 opt_set TEMP_SENSOR_BED 5
40 40
 opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PID_TUNING \
41 41
            FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY PID_EXTRUSION_SCALING SOUND_MENU_ITEM \
42
-           NOZZLE_AS_PROBE AUTO_BED_LEVELING_BILINEAR G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \
42
+           NOZZLE_AS_PROBE AUTO_BED_LEVELING_BILINEAR PREHEAT_BEFORE_LEVELING G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \
43 43
            BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \
44 44
            PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \
45 45
            Z_SAFE_HOMING ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE \
@@ -47,6 +47,7 @@ opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT ADAPTIVE_FAN_
47 47
            LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA EMERGENCY_PARSER
48 48
 opt_set GRID_MAX_POINTS_X 16
49 49
 opt_set NOZZLE_TO_PROBE_OFFSET "{ 0, 0, 0 }"
50
+opt_set NOZZLE_CLEAN_MIN_TEMP 170
50 51
 exec_test $1 $2 "Re-ARM with NOZZLE_AS_PROBE and many features." "$3"
51 52
 
52 53
 # clean up

+ 1
- 1
buildroot/tests/rambo-tests View File

@@ -25,7 +25,7 @@ opt_set FANMUX0_PIN 53
25 25
 opt_disable USE_WATCHDOG
26 26
 opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_PROGRESS_BAR_TEST \
27 27
            FIX_MOUNTED_PROBE Z_SAFE_HOMING CODEPENDENT_XY_HOMING PIDTEMPBED PROBE_TEMP_COMPENSATION \
28
-           PROBING_HEATERS_OFF PROBING_FANS_OFF PROBING_STEPPERS_OFF WAIT_FOR_BED_HEATER \
28
+           PREHEAT_BEFORE_PROBING PROBING_HEATERS_OFF PROBING_FANS_OFF PROBING_STEPPERS_OFF WAIT_FOR_BED_HEATER \
29 29
            EEPROM_SETTINGS SDSUPPORT SD_REPRINT_LAST_SELECTED_FILE BINARY_FILE_TRANSFER \
30 30
            BLINKM PCA9533 PCA9632 RGB_LED RGB_LED_R_PIN RGB_LED_G_PIN RGB_LED_B_PIN LED_CONTROL_MENU \
31 31
            NEOPIXEL_LED CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CASE_LIGHT_MENU \

Loading…
Cancel
Save