Browse Source

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

Adjust wait_for_cooling slope
Scott Lahteine 8 years ago
parent
commit
4a100c6832
1 changed files with 22 additions and 8 deletions
  1. 22
    8
      Marlin/Marlin_main.cpp

+ 22
- 8
Marlin/Marlin_main.cpp View File

4488
 
4488
 
4489
 #endif
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
  * M109: Sxxx Wait for extruder(s) to reach temperature. Waits only when heating.
4499
  * M109: Sxxx Wait for extruder(s) to reach temperature. Waits only when heating.
4493
  *       Rxxx Wait for extruder(s) to reach temperature. Waits when heating and cooling.
4500
  *       Rxxx Wait for extruder(s) to reach temperature. Waits when heating and cooling.
4600
 
4607
 
4601
     // Prevent a wait-forever situation if R is misused i.e. M109 R0
4608
     // Prevent a wait-forever situation if R is misused i.e. M109 R0
4602
     if (wants_to_cool) {
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
       if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) {
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
         old_temp = temp;
4615
         old_temp = temp;
4609
       }
4616
       }
4610
     }
4617
     }
4617
 
4624
 
4618
 #if HAS_TEMP_BED
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
    * M190: Sxxx Wait for bed current temp to reach target temp. Waits only when heating
4635
    * M190: Sxxx Wait for bed current temp to reach target temp. Waits only when heating
4622
    *       Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
4636
    *       Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
4709
 
4723
 
4710
       // Prevent a wait-forever situation if R is misused i.e. M190 R0
4724
       // Prevent a wait-forever situation if R is misused i.e. M190 R0
4711
       if (wants_to_cool) {
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
         if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) {
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
           old_temp = temp;
4731
           old_temp = temp;
4718
         }
4732
         }
4719
       }
4733
       }

Loading…
Cancel
Save