Переглянути джерело

Merge pull request #4250 from AnHardt/wait-for-cooling-slope

Adjust wait_for_cooling slope
Scott Lahteine 8 роки тому
джерело
коміт
4a100c6832
1 змінених файлів з 22 додано та 8 видалено
  1. 22
    8
      Marlin/Marlin_main.cpp

+ 22
- 8
Marlin/Marlin_main.cpp Переглянути файл

@@ -4488,6 +4488,13 @@ inline void gcode_M105() {
4488 4488
 
4489 4489
 #endif
4490 4490
 
4491
+  #ifndef MIN_COOLING_SLOPE_DEG
4492
+    #define MIN_COOLING_SLOPE_DEG 1.50
4493
+  #endif
4494
+  #ifndef MIN_COOLING_SLOPE_TIME
4495
+    #define MIN_COOLING_SLOPE_TIME 60
4496
+  #endif
4497
+
4491 4498
 /**
4492 4499
  * M109: Sxxx Wait for extruder(s) to reach temperature. Waits only when heating.
4493 4500
  *       Rxxx Wait for extruder(s) to reach temperature. Waits when heating and cooling.
@@ -4600,11 +4607,11 @@ inline void gcode_M109() {
4600 4607
 
4601 4608
     // Prevent a wait-forever situation if R is misused i.e. M109 R0
4602 4609
     if (wants_to_cool) {
4603
-      if (temp < (EXTRUDE_MINTEMP) / 2) break; // always break at (default) 85°
4604
-      // break after 20 seconds if cooling stalls
4610
+      // break after MIN_COOLING_SLOPE_TIME seconds
4611
+      // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG
4605 4612
       if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) {
4606
-        if (old_temp - temp < 1.0) break;
4607
-        next_cool_check_ms = now + 20000;
4613
+        if (old_temp - temp < MIN_COOLING_SLOPE_DEG) break;
4614
+        next_cool_check_ms = now + 1000UL * MIN_COOLING_SLOPE_TIME;
4608 4615
         old_temp = temp;
4609 4616
       }
4610 4617
     }
@@ -4617,6 +4624,13 @@ inline void gcode_M109() {
4617 4624
 
4618 4625
 #if HAS_TEMP_BED
4619 4626
 
4627
+  #ifndef MIN_COOLING_SLOPE_DEG_BED
4628
+    #define MIN_COOLING_SLOPE_DEG_BED 1.50
4629
+  #endif
4630
+  #ifndef MIN_COOLING_SLOPE_TIME_BED
4631
+    #define MIN_COOLING_SLOPE_TIME_BED 60
4632
+  #endif
4633
+
4620 4634
   /**
4621 4635
    * M190: Sxxx Wait for bed current temp to reach target temp. Waits only when heating
4622 4636
    *       Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
@@ -4709,11 +4723,11 @@ inline void gcode_M109() {
4709 4723
 
4710 4724
       // Prevent a wait-forever situation if R is misused i.e. M190 R0
4711 4725
       if (wants_to_cool) {
4712
-        if (temp < 30.0) break; // always break at 30°
4713
-        // break after 20 seconds if cooling stalls
4726
+        // break after MIN_COOLING_SLOPE_TIME_BED seconds
4727
+        // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG_BED
4714 4728
         if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) {
4715
-          if (old_temp - temp < 1.0) break;
4716
-          next_cool_check_ms = now + 20000;
4729
+          if (old_temp - temp < MIN_COOLING_SLOPE_DEG_BED) break;
4730
+          next_cool_check_ms = now + 1000UL * MIN_COOLING_SLOPE_TIME_BED;
4717 4731
           old_temp = temp;
4718 4732
         }
4719 4733
       }

Завантаження…
Відмінити
Зберегти