瀏覽代碼

Preheat before leveling

Scott Lahteine 3 年之前
父節點
當前提交
e349a44c60
共有 2 個文件被更改,包括 31 次插入1 次删除
  1. 9
    0
      Marlin/Configuration.h
  2. 22
    1
      Marlin/src/gcode/bedlevel/abl/G29.cpp

+ 9
- 0
Marlin/Configuration.h 查看文件

@@ -1290,6 +1290,15 @@
1290 1290
 //#define RESTORE_LEVELING_AFTER_G28
1291 1291
 
1292 1292
 /**
1293
+ * Auto-leveling needs preheating
1294
+ */
1295
+//#define PREHEAT_BEFORE_LEVELING
1296
+#if ENABLED(PREHEAT_BEFORE_LEVELING)
1297
+  #define LEVELING_NOZZLE_TEMP 120
1298
+  #define LEVELING_BED_TEMP     50
1299
+#endif
1300
+
1301
+/**
1293 1302
  * Enable detailed logging of G28, G29, M48, etc.
1294 1303
  * Turn on with the command 'M111 S32'.
1295 1304
  * NOTE: Requires a lot of PROGMEM!

+ 22
- 1
Marlin/src/gcode/bedlevel/abl/G29.cpp 查看文件

@@ -36,9 +36,12 @@
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
+
39 43
 #if ENABLED(PROBE_TEMP_COMPENSATION)
40 44
   #include "../../../feature/probe_temp_comp.h"
41
-  #include "../../../module/temperature.h"
42 45
 #endif
43 46
 
44 47
 #if HAS_DISPLAY
@@ -403,6 +406,24 @@ G29_TYPE GcodeSuite::G29() {
403 406
 
404 407
     if (!faux) remember_feedrate_scaling_off();
405 408
 
409
+    #if ENABLED(PREHEAT_BEFORE_LEVELING)
410
+      #ifndef LEVELING_NOZZLE_TEMP
411
+        #define LEVELING_NOZZLE_TEMP 0
412
+      #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
426
+
406 427
     // Disable auto bed leveling during G29.
407 428
     // Be formal so G29 can be done successively without G28.
408 429
     if (!no_action) set_bed_leveling_enabled(false);

Loading…
取消
儲存