Browse Source

Temp-related cosmetic changes

Scott Lahteine 8 years ago
parent
commit
8a0a5cfccc
2 changed files with 21 additions and 42 deletions
  1. 4
    4
      Marlin/Marlin_main.cpp
  2. 17
    38
      Marlin/temperature.cpp

+ 4
- 4
Marlin/Marlin_main.cpp View File

6684
       }
6684
       }
6685
     #endif
6685
     #endif
6686
 
6686
 
6687
-    if (code_value_temp_abs() > thermalManager.degHotend(target_extruder)) lcd_status_printf_P(0, PSTR("E%i %s"), target_extruder + 1, MSG_HEATING);
6687
+    if (code_value_temp_abs() > thermalManager.degHotend(target_extruder))
6688
+      lcd_status_printf_P(0, PSTR("E%i %s"), target_extruder + 1, MSG_HEATING);
6688
   }
6689
   }
6689
 
6690
 
6690
   #if ENABLED(AUTOTEMP)
6691
   #if ENABLED(AUTOTEMP)
8290
       // Report current state
8291
       // Report current state
8291
       SERIAL_ECHO_START;
8292
       SERIAL_ECHO_START;
8292
       SERIAL_ECHOPAIR("Cold extrudes are ", (thermalManager.allow_cold_extrude ? "en" : "dis"));
8293
       SERIAL_ECHOPAIR("Cold extrudes are ", (thermalManager.allow_cold_extrude ? "en" : "dis"));
8293
-      SERIAL_ECHOPAIR("abled (min temp ", int(thermalManager.extrude_min_temp + 0.5));
8294
+      SERIAL_ECHOPAIR("abled (min temp ", thermalManager.extrude_min_temp);
8294
       SERIAL_ECHOLNPGM("C)");
8295
       SERIAL_ECHOLNPGM("C)");
8295
     }
8296
     }
8296
   }
8297
   }
11909
       #if HAS_TEMP_BED
11910
       #if HAS_TEMP_BED
11910
         max_temp = MAX3(max_temp, thermalManager.degTargetBed(), thermalManager.degBed());
11911
         max_temp = MAX3(max_temp, thermalManager.degTargetBed(), thermalManager.degBed());
11911
       #endif
11912
       #endif
11912
-      HOTEND_LOOP() {
11913
+      HOTEND_LOOP()
11913
         max_temp = MAX3(max_temp, thermalManager.degHotend(e), thermalManager.degTargetHotend(e));
11914
         max_temp = MAX3(max_temp, thermalManager.degHotend(e), thermalManager.degTargetHotend(e));
11914
-      }
11915
       bool new_led = (max_temp > 55.0) ? true : (max_temp < 54.0) ? false : red_led;
11915
       bool new_led = (max_temp > 55.0) ? true : (max_temp < 54.0) ? false : red_led;
11916
       if (new_led != red_led) {
11916
       if (new_led != red_led) {
11917
         red_led = new_led;
11917
         red_led = new_led;

+ 17
- 38
Marlin/temperature.cpp View File

695
   updateTemperaturesFromRawValues(); // also resets the watchdog
695
   updateTemperaturesFromRawValues(); // also resets the watchdog
696
 
696
 
697
   #if ENABLED(HEATER_0_USES_MAX6675)
697
   #if ENABLED(HEATER_0_USES_MAX6675)
698
-    if (current_temperature[0] > min(HEATER_0_MAXTEMP, MAX6675_TMAX - 1)) max_temp_error(0);
698
+    if (current_temperature[0] > min(HEATER_0_MAXTEMP, MAX6675_TMAX - 1.0)) max_temp_error(0);
699
-    if (current_temperature[0] < max(HEATER_0_MINTEMP, MAX6675_TMIN + 0.01)) min_temp_error(0);
699
+    if (current_temperature[0] < max(HEATER_0_MINTEMP, MAX6675_TMIN + .01)) min_temp_error(0);
700
   #endif
700
   #endif
701
 
701
 
702
   #if WATCH_HOTENDS || WATCH_THE_BED || DISABLED(PIDTEMPBED) || HAS_AUTO_FAN
702
   #if WATCH_HOTENDS || WATCH_THE_BED || DISABLED(PIDTEMPBED) || HAS_AUTO_FAN
703
     millis_t ms = millis();
703
     millis_t ms = millis();
704
   #endif
704
   #endif
705
 
705
 
706
-  // Loop through all hotends
707
   HOTEND_LOOP() {
706
   HOTEND_LOOP() {
708
 
707
 
709
     #if ENABLED(THERMAL_PROTECTION_HOTENDS)
708
     #if ENABLED(THERMAL_PROTECTION_HOTENDS)
709
+      // Check for thermal runaway
710
       thermal_runaway_protection(&thermal_runaway_state_machine[e], &thermal_runaway_timer[e], current_temperature[e], target_temperature[e], e, THERMAL_PROTECTION_PERIOD, THERMAL_PROTECTION_HYSTERESIS);
710
       thermal_runaway_protection(&thermal_runaway_state_machine[e], &thermal_runaway_timer[e], current_temperature[e], target_temperature[e], e, THERMAL_PROTECTION_PERIOD, THERMAL_PROTECTION_HYSTERESIS);
711
     #endif
711
     #endif
712
 
712
 
713
-    float pid_output = get_pid_output(e);
713
+    soft_pwm_amount[e] = (current_temperature[e] > minttemp[e] || is_preheating(e)) && current_temperature[e] < maxttemp[e] ? (int)get_pid_output(e) >> 1 : 0;
714
 
714
 
715
-    // Check if temperature is within the correct range
716
-    soft_pwm_amount[e] = (current_temperature[e] > minttemp[e] || is_preheating(e)) && current_temperature[e] < maxttemp[e] ? (int)pid_output >> 1 : 0;
717
-
718
-    // Check if the temperature is failing to increase
719
     #if WATCH_HOTENDS
715
     #if WATCH_HOTENDS
720
-
716
+      // Make sure temperature is increasing
721
-      // Is it time to check this extruder's heater?
717
+      if (watch_heater_next_ms[e] && ELAPSED(ms, watch_heater_next_ms[e])) { // Time to check this extruder?
722
-      if (watch_heater_next_ms[e] && ELAPSED(ms, watch_heater_next_ms[e])) {
718
+        if (degHotend(e) < watch_target_temp[e])                             // Failed to increase enough?
723
-        // Has it failed to increase enough?
724
-        if (degHotend(e) < watch_target_temp[e]) {
725
-          // Stop!
726
           _temp_error(e, PSTR(MSG_T_HEATING_FAILED), PSTR(MSG_HEATING_FAILED_LCD));
719
           _temp_error(e, PSTR(MSG_T_HEATING_FAILED), PSTR(MSG_HEATING_FAILED_LCD));
727
-        }
720
+        else                                                                 // Start again if the target is still far off
728
-        else {
729
-          // Start again if the target is still far off
730
           start_watching_heater(e);
721
           start_watching_heater(e);
731
-        }
732
       }
722
       }
723
+    #endif
733
 
724
 
734
-    #endif // THERMAL_PROTECTION_HOTENDS
735
-
736
-    // Check if the temperature is failing to increase
737
     #if WATCH_THE_BED
725
     #if WATCH_THE_BED
738
-
726
+      // Make sure temperature is increasing
739
-      // Is it time to check the bed?
727
+      if (watch_bed_next_ms && ELAPSED(ms, watch_bed_next_ms)) {        // Time to check the bed?
740
-      if (watch_bed_next_ms && ELAPSED(ms, watch_bed_next_ms)) {
728
+        if (degBed() < watch_target_bed_temp)                           // Failed to increase enough?
741
-        // Has it failed to increase enough?
742
-        if (degBed() < watch_target_bed_temp) {
743
-          // Stop!
744
           _temp_error(-1, PSTR(MSG_T_HEATING_FAILED), PSTR(MSG_HEATING_FAILED_LCD));
729
           _temp_error(-1, PSTR(MSG_T_HEATING_FAILED), PSTR(MSG_HEATING_FAILED_LCD));
745
-        }
730
+        else                                                            // Start again if the target is still far off
746
-        else {
747
-          // Start again if the target is still far off
748
           start_watching_bed();
731
           start_watching_bed();
749
-        }
750
       }
732
       }
751
-
733
+    #endif
752
-    #endif // THERMAL_PROTECTION_HOTENDS
753
 
734
 
754
     #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
735
     #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
755
-      if (fabs(current_temperature[0] - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) {
736
+      // Make sure measured temperatures are close together
737
+      if (fabs(current_temperature[0] - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF)
756
         _temp_error(0, PSTR(MSG_REDUNDANCY), PSTR(MSG_ERR_REDUNDANT_TEMP));
738
         _temp_error(0, PSTR(MSG_REDUNDANCY), PSTR(MSG_ERR_REDUNDANT_TEMP));
757
-      }
758
     #endif
739
     #endif
759
 
740
 
760
   } // HOTEND_LOOP
741
   } // HOTEND_LOOP
792
     #endif
773
     #endif
793
 
774
 
794
     #if ENABLED(PIDTEMPBED)
775
     #if ENABLED(PIDTEMPBED)
795
-      float pid_output = get_pid_output_bed();
776
+      soft_pwm_amount_bed = WITHIN(current_temperature_bed, BED_MINTEMP, BED_MAXTEMP) ? (int)get_pid_output_bed() >> 1 : 0;
796
-
797
-      soft_pwm_amount_bed = WITHIN(current_temperature_bed, BED_MINTEMP, BED_MAXTEMP) ? (int)pid_output >> 1 : 0;
798
 
777
 
799
     #elif ENABLED(BED_LIMIT_SWITCHING)
778
     #elif ENABLED(BED_LIMIT_SWITCHING)
800
       // Check if temperature is within the correct band
779
       // Check if temperature is within the correct band

Loading…
Cancel
Save