Bladeren bron

Improve max temp / target

Scott Lahteine 3 jaren geleden
bovenliggende
commit
cfa6c7d45b

+ 1
- 0
Marlin/Configuration.h Bestand weergeven

@@ -484,6 +484,7 @@
484 484
  */
485 485
 #define HOTEND_OVERSHOOT 15   // (°C) Forbid temperatures over MAXTEMP - OVERSHOOT
486 486
 #define BED_OVERSHOOT    10   // (°C) Forbid temperatures over MAXTEMP - OVERSHOOT
487
+#define COOLER_OVERSHOOT  2   // (°C) Forbid temperatures closer than OVERSHOOT
487 488
 
488 489
 //===========================================================================
489 490
 //============================= PID Settings ================================

+ 1
- 1
Marlin/src/gcode/host/M360.cpp Bestand weergeven

@@ -177,7 +177,7 @@ void GcodeSuite::M360() {
177 177
       config_line_e(e, PSTR("MaxSpeed"), planner.settings.max_feedrate_mm_s[E_AXIS_N(e)]);
178 178
       config_line_e(e, PSTR("Acceleration"), planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(e)]);
179 179
       config_line_e(e, PSTR("Diameter"), TERN(NO_VOLUMETRICS, DEFAULT_NOMINAL_FILAMENT_DIA, planner.filament_size[e]));
180
-      config_line_e(e, PSTR("MaxTemp"), thermalManager.heater_maxtemp[e]);
180
+      config_line_e(e, PSTR("MaxTemp"), thermalManager.hotend_maxtemp[e]);
181 181
     }
182 182
   #endif
183 183
 }

+ 2
- 4
Marlin/src/gcode/parser.h Bestand weergeven

@@ -390,15 +390,13 @@ public:
390 390
       }
391 391
     }
392 392
 
393
-    #define TEMP_UNIT(N) parser.to_temp_units(N)
394
-
395 393
   #else // !TEMPERATURE_UNITS_SUPPORT
396 394
 
395
+    static inline float to_temp_units(int16_t c) { return (float)c; }
396
+
397 397
     static inline float value_celsius()      { return value_float(); }
398 398
     static inline float value_celsius_diff() { return value_float(); }
399 399
 
400
-    #define TEMP_UNIT(N) (N)
401
-
402 400
   #endif // !TEMPERATURE_UNITS_SUPPORT
403 401
 
404 402
   static inline feedRate_t value_feedrate() { return MMM_TO_MMS(value_linear_units()); }

+ 9
- 3
Marlin/src/inc/Conditionals_post.h Bestand weergeven

@@ -2025,11 +2025,17 @@
2025 2025
   #undef PIDTEMPBED
2026 2026
 #endif
2027 2027
 
2028
-#if HAS_HEATED_BED || HAS_TEMP_CHAMBER
2029
-  #define BED_OR_CHAMBER 1
2030
-#endif
2031 2028
 #if HAS_TEMP_COOLER && PIN_EXISTS(COOLER)
2032 2029
   #define HAS_COOLER 1
2030
+  #ifndef COOLER_OVERSHOOT
2031
+    #define COOLER_OVERSHOOT 2
2032
+  #endif
2033
+  #define COOLER_MIN_TARGET (COOLER_MINTEMP + (COOLER_OVERSHOOT))
2034
+  #define COOLER_MAX_TARGET (COOLER_MAXTEMP - (COOLER_OVERSHOOT))
2035
+#endif
2036
+
2037
+#if HAS_HEATED_BED || HAS_TEMP_CHAMBER
2038
+  #define BED_OR_CHAMBER 1
2033 2039
 #endif
2034 2040
 #if HAS_TEMP_HOTEND || BED_OR_CHAMBER || HAS_TEMP_PROBE || HAS_TEMP_COOLER
2035 2041
   #define HAS_TEMP_SENSOR 1

+ 1
- 7
Marlin/src/lcd/dwin/e3v2/dwin.cpp Bestand weergeven

@@ -112,12 +112,6 @@
112 112
 #define MAX_PRINT_SPEED   999
113 113
 #define MIN_PRINT_SPEED   10
114 114
 
115
-// Temp limits
116
-#if HAS_HOTEND
117
-  #define MAX_E_TEMP    (HEATER_0_MAXTEMP - (HOTEND_OVERSHOOT))
118
-  #define MIN_E_TEMP    HEATER_0_MINTEMP
119
-#endif
120
-
121 115
 #if HAS_HEATED_BED
122 116
   #define MIN_BED_TEMP  BED_MINTEMP
123 117
 #endif
@@ -1357,7 +1351,7 @@ void HMI_Move_Z() {
1357 1351
         return;
1358 1352
       }
1359 1353
       // E_Temp limit
1360
-      LIMIT(HMI_ValueStruct.E_Temp, MIN_E_TEMP, MAX_E_TEMP);
1354
+      LIMIT(HMI_ValueStruct.E_Temp, HEATER_0_MINTEMP, thermalManager.hotend_max_target(0));
1361 1355
       // E_Temp value
1362 1356
       DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Select_Color, 3, 216, MBASE(temp_line), HMI_ValueStruct.E_Temp);
1363 1357
     }

+ 3
- 3
Marlin/src/lcd/extui/ui_api.cpp Bestand weergeven

@@ -924,7 +924,7 @@ namespace ExtUI {
924 924
     enableHeater(heater);
925 925
     switch (heater) {
926 926
       #if HAS_HEATED_CHAMBER
927
-        case CHAMBER: thermalManager.setTargetChamber(LROUND(constrain(value, 0, CHAMBER_MAXTEMP - 10))); break;
927
+        case CHAMBER: thermalManager.setTargetChamber(LROUND(constrain(value, 0, CHAMBER_MAX_TARGET))); break;
928 928
       #endif
929 929
       #if HAS_COOLER
930 930
         case COOLER: thermalManager.setTargetCooler(LROUND(constrain(value, 0, COOLER_MAXTEMP))); break;
@@ -935,7 +935,7 @@ namespace ExtUI {
935 935
       default: {
936 936
         #if HAS_HOTEND
937 937
           const int16_t e = heater - H0;
938
-          thermalManager.setTargetHotend(LROUND(constrain(value, 0, thermalManager.heater_maxtemp[e] - HOTEND_OVERSHOOT)), e);
938
+          thermalManager.setTargetHotend(LROUND(constrain(value, 0, thermalManager.hotend_max_target(e))), e);
939 939
         #endif
940 940
       } break;
941 941
     }
@@ -949,7 +949,7 @@ namespace ExtUI {
949 949
     #if HAS_HOTEND
950 950
       const int16_t e = extruder - E0;
951 951
       enableHeater(extruder);
952
-      thermalManager.setTargetHotend(LROUND(constrain(value, 0, thermalManager.heater_maxtemp[e] - HOTEND_OVERSHOOT)), e);
952
+      thermalManager.setTargetHotend(LROUND(constrain(value, 0, thermalManager.hotend_max_target(e))), e);
953 953
     #endif
954 954
   }
955 955
 

+ 1
- 1
Marlin/src/lcd/menu/menu_advanced.cpp Bestand weergeven

@@ -315,7 +315,7 @@ void menu_backlash();
315 315
     #if ENABLED(PID_AUTOTUNE_MENU)
316 316
       #define HOTEND_PID_EDIT_MENU_ITEMS(N) \
317 317
         _HOTEND_PID_EDIT_MENU_ITEMS(N); \
318
-        EDIT_ITEM_FAST_N(int3, N, MSG_PID_AUTOTUNE_E, &autotune_temp[N], 150, thermalManager.heater_maxtemp[N] - HOTEND_OVERSHOOT, []{ _lcd_autotune(heater_id_t(MenuItemBase::itemIndex)); });
318
+        EDIT_ITEM_FAST_N(int3, N, MSG_PID_AUTOTUNE_E, &autotune_temp[N], 150, thermalManager.hotend_max_target(N), []{ _lcd_autotune(heater_id_t(MenuItemBase::itemIndex)); });
319 319
     #else
320 320
       #define HOTEND_PID_EDIT_MENU_ITEMS(N) _HOTEND_PID_EDIT_MENU_ITEMS(N);
321 321
     #endif

+ 1
- 1
Marlin/src/lcd/menu/menu_filament.cpp Bestand weergeven

@@ -95,7 +95,7 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) {
95 95
       ACTION_ITEM_N_S(m, ui.get_preheat_label(m), MSG_PREHEAT_M, _change_filament_with_preset);
96 96
   #endif
97 97
   EDIT_ITEM_FAST_N(int3, extruder, MSG_PREHEAT_CUSTOM, &thermalManager.temp_hotend[extruder].target,
98
-    EXTRUDE_MINTEMP, thermalManager.heater_maxtemp[extruder] - HOTEND_OVERSHOOT,
98
+    EXTRUDE_MINTEMP, thermalManager.hotend_max_target(extruder),
99 99
     _change_filament_with_custom
100 100
   );
101 101
   END_MENU();

+ 8
- 8
Marlin/src/lcd/menu/menu_temperature.cpp Bestand weergeven

@@ -47,11 +47,11 @@
47 47
 // "Temperature" submenu items
48 48
 //
49 49
 
50
-void Temperature::lcd_preheat(const int16_t e, const int8_t indh, const int8_t indb) {
50
+void Temperature::lcd_preheat(const uint8_t e, const int8_t indh, const int8_t indb) {
51 51
   UNUSED(e); UNUSED(indh); UNUSED(indb);
52 52
   #if HAS_HOTEND
53 53
     if (indh >= 0 && ui.material_preset[indh].hotend_temp > 0)
54
-      setTargetHotend(_MIN(thermalManager.heater_maxtemp[e] - HOTEND_OVERSHOOT, ui.material_preset[indh].hotend_temp), e);
54
+      setTargetHotend(_MIN(thermalManager.hotend_max_target(e), ui.material_preset[indh].hotend_temp), e);
55 55
   #endif
56 56
   #if HAS_HEATED_BED
57 57
     if (indb >= 0 && ui.material_preset[indb].bed_temp > 0) setTargetBed(ui.material_preset[indb].bed_temp);
@@ -70,7 +70,7 @@ void Temperature::lcd_preheat(const int16_t e, const int8_t indh, const int8_t i
70 70
     void do_preheat_end_m() { _preheat_end(editable.int8, 0); }
71 71
   #endif
72 72
   #if HAS_HEATED_BED
73
-    inline void _preheat_bed(const uint8_t m) { thermalManager.lcd_preheat(-1, -1, m); }
73
+    inline void _preheat_bed(const uint8_t m) { thermalManager.lcd_preheat(0, -1, m); }
74 74
   #endif
75 75
   #if HAS_COOLER
76 76
     inline void _precool_laser(const uint8_t m, const uint8_t e) { thermalManager.lcd_preheat(e, m, -1); }
@@ -163,15 +163,15 @@ void menu_temperature() {
163 163
   // Nozzle [1-5]:
164 164
   //
165 165
   #if HOTENDS == 1
166
-    EDIT_ITEM_FAST(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, HEATER_0_MAXTEMP - (HOTEND_OVERSHOOT), []{ thermalManager.start_watching_hotend(0); });
166
+    EDIT_ITEM_FAST(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, thermalManager.hotend_max_target(0), []{ thermalManager.start_watching_hotend(0); });
167 167
   #elif HAS_MULTI_HOTEND
168 168
     HOTEND_LOOP()
169
-      EDIT_ITEM_FAST_N(int3, e, MSG_NOZZLE_N, &thermalManager.temp_hotend[e].target, 0, thermalManager.heater_maxtemp[e] - (HOTEND_OVERSHOOT), []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); });
169
+      EDIT_ITEM_FAST_N(int3, e, MSG_NOZZLE_N, &thermalManager.temp_hotend[e].target, 0, thermalManager.hotend_max_target(e), []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); });
170 170
   #endif
171 171
 
172 172
   #if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
173 173
     LOOP_S_L_N(e, 1, EXTRUDERS)
174
-      EDIT_ITEM_FAST_N(uint16_3, e, MSG_NOZZLE_STANDBY, &thermalManager.singlenozzle_temp[e], 0, thermalManager.heater_maxtemp[0] - (HOTEND_OVERSHOOT));
174
+      EDIT_ITEM_FAST_N(uint16_3, e, MSG_NOZZLE_STANDBY, &thermalManager.singlenozzle_temp[e], 0, thermalManager.hotend_max_target(0));
175 175
   #endif
176 176
 
177 177
   //
@@ -185,7 +185,7 @@ void menu_temperature() {
185 185
   // Chamber:
186 186
   //
187 187
   #if HAS_HEATED_CHAMBER
188
-    EDIT_ITEM_FAST(int3, MSG_CHAMBER, &thermalManager.temp_chamber.target, 0, CHAMBER_MAXTEMP - 10, thermalManager.start_watching_chamber);
188
+    EDIT_ITEM_FAST(int3, MSG_CHAMBER, &thermalManager.temp_chamber.target, 0, CHAMBER_MAX_TARGET, thermalManager.start_watching_chamber);
189 189
   #endif
190 190
 
191 191
   //
@@ -194,7 +194,7 @@ void menu_temperature() {
194 194
   #if HAS_COOLER
195 195
     editable.state = cooler.is_enabled();
196 196
     EDIT_ITEM(bool, MSG_COOLER(TOGGLE), &cooler.state, []{ if (editable.state) cooler.disable(); else cooler.enable(); });
197
-    EDIT_ITEM_FAST(int3, MSG_COOLER, &thermalManager.temp_cooler.target, COOLER_MINTEMP + 2, COOLER_MAXTEMP - 2, thermalManager.start_watching_cooler);
197
+    EDIT_ITEM_FAST(int3, MSG_COOLER, &thermalManager.temp_cooler.target, COOLER_MIN_TARGET, COOLER_MAX_TARGET, thermalManager.start_watching_cooler);
198 198
   #endif
199 199
 
200 200
   //

+ 3
- 3
Marlin/src/lcd/menu/menu_tune.cpp Bestand weergeven

@@ -126,15 +126,15 @@ void menu_tune() {
126 126
   // Nozzle [1-4]:
127 127
   //
128 128
   #if HOTENDS == 1
129
-    EDIT_ITEM_FAST(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, HEATER_0_MAXTEMP - HOTEND_OVERSHOOT, []{ thermalManager.start_watching_hotend(0); });
129
+    EDIT_ITEM_FAST(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, thermalManager.hotend_max_target(0), []{ thermalManager.start_watching_hotend(0); });
130 130
   #elif HAS_MULTI_HOTEND
131 131
     HOTEND_LOOP()
132
-      EDIT_ITEM_FAST_N(int3, e, MSG_NOZZLE_N, &thermalManager.temp_hotend[e].target, 0, thermalManager.heater_maxtemp[e] - HOTEND_OVERSHOOT, []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); });
132
+      EDIT_ITEM_FAST_N(int3, e, MSG_NOZZLE_N, &thermalManager.temp_hotend[e].target, 0, thermalManager.hotend_max_target(e), []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); });
133 133
   #endif
134 134
 
135 135
   #if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
136 136
     LOOP_S_L_N(e, 1, EXTRUDERS)
137
-      EDIT_ITEM_FAST_N(uint16_3, e, MSG_NOZZLE_STANDBY, &thermalManager.singlenozzle_temp[e], 0, thermalManager.heater_maxtemp[0] - HOTEND_OVERSHOOT);
137
+      EDIT_ITEM_FAST_N(uint16_3, e, MSG_NOZZLE_STANDBY, &thermalManager.singlenozzle_temp[e], 0, thermalManager.hotend_max_target(0));
138 138
   #endif
139 139
 
140 140
   //

+ 1
- 1
Marlin/src/lcd/menu/menu_ubl.cpp Bestand weergeven

@@ -126,7 +126,7 @@ void _lcd_ubl_custom_mesh() {
126 126
   START_MENU();
127 127
   BACK_ITEM(MSG_UBL_BUILD_MESH_MENU);
128 128
   #if HAS_HOTEND
129
-    EDIT_ITEM(int3, MSG_UBL_HOTEND_TEMP_CUSTOM, &custom_hotend_temp, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - HOTEND_OVERSHOOT);
129
+    EDIT_ITEM(int3, MSG_UBL_HOTEND_TEMP_CUSTOM, &custom_hotend_temp, EXTRUDE_MINTEMP, thermalManager.hotend_max_target(0));
130 130
   #endif
131 131
   #if HAS_HEATED_BED
132 132
     EDIT_ITEM(int3, MSG_UBL_BED_TEMP_CUSTOM, &custom_bed_temp, BED_MINTEMP, BED_MAX_TARGET);

+ 5
- 5
Marlin/src/lcd/tft/touch.cpp Bestand weergeven

@@ -186,25 +186,25 @@ void Touch::touch(touch_control_t *control) {
186 186
       ui.clear_lcd();
187 187
       if (heater >= 0) { // HotEnd
188 188
         #if HOTENDS == 1
189
-          MenuItem_int3::action((const char *)GET_TEXT_F(MSG_NOZZLE), &thermalManager.temp_hotend[0].target, 0, thermalManager.heater_maxtemp[0] - 15, []{ thermalManager.start_watching_hotend(0); });
189
+          MenuItem_int3::action((const char *)GET_TEXT_F(MSG_NOZZLE), &thermalManager.temp_hotend[0].target, 0, thermalManager.hotend_max_target(0), []{ thermalManager.start_watching_hotend(0); });
190 190
         #else
191 191
           MenuItemBase::itemIndex = heater;
192
-          MenuItem_int3::action((const char *)GET_TEXT_F(MSG_NOZZLE_N), &thermalManager.temp_hotend[heater].target, 0, thermalManager.heater_maxtemp[heater] - 15, []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); });
192
+          MenuItem_int3::action((const char *)GET_TEXT_F(MSG_NOZZLE_N), &thermalManager.temp_hotend[heater].target, 0, thermalManager.hotend_max_target(heater), []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); });
193 193
         #endif
194 194
       }
195 195
       #if HAS_HEATED_BED
196 196
         else if (heater == H_BED) {
197
-          MenuItem_int3::action((const char *)GET_TEXT_F(MSG_BED), &thermalManager.temp_bed.target, 0, BED_MAXTEMP - 10, thermalManager.start_watching_bed);
197
+          MenuItem_int3::action((const char *)GET_TEXT_F(MSG_BED), &thermalManager.temp_bed.target, 0, BED_MAX_TARGET, thermalManager.start_watching_bed);
198 198
         }
199 199
       #endif
200 200
       #if HAS_HEATED_CHAMBER
201 201
         else if (heater == H_CHAMBER) {
202
-          MenuItem_int3::action((const char *)GET_TEXT_F(MSG_CHAMBER), &thermalManager.temp_chamber.target, 0, CHAMBER_MAXTEMP - 10, thermalManager.start_watching_chamber);
202
+          MenuItem_int3::action((const char *)GET_TEXT_F(MSG_CHAMBER), &thermalManager.temp_chamber.target, 0, CHAMBER_MAX_TARGET, thermalManager.start_watching_chamber);
203 203
         }
204 204
       #endif
205 205
       #if HAS_COOLER
206 206
         else if (heater == H_COOLER) {
207
-          MenuItem_int3::action((const char *)GET_TEXT_F(MSG_COOLER), &thermalManager.temp_cooler.target, 0, COOLER_MAXTEMP - 8, thermalManager.start_watching_cooler);
207
+          MenuItem_int3::action((const char *)GET_TEXT_F(MSG_COOLER), &thermalManager.temp_cooler.target, 0, COOLER_MAX_TARGET, thermalManager.start_watching_cooler);
208 208
         }
209 209
       #endif
210 210
 

+ 2
- 2
Marlin/src/module/settings.cpp Bestand weergeven

@@ -3386,10 +3386,10 @@ void MarlinSettings::reset() {
3386 3386
         SERIAL_ECHOLNPAIR_P(
3387 3387
           PSTR("  M145 S"), i
3388 3388
           #if HAS_HOTEND
3389
-            , PSTR(" H"), TEMP_UNIT(ui.material_preset[i].hotend_temp)
3389
+            , PSTR(" H"), parser.to_temp_units(ui.material_preset[i].hotend_temp)
3390 3390
           #endif
3391 3391
           #if HAS_HEATED_BED
3392
-            , SP_B_STR, TEMP_UNIT(ui.material_preset[i].bed_temp)
3392
+            , SP_B_STR, parser.to_temp_units(ui.material_preset[i].bed_temp)
3393 3393
           #endif
3394 3394
           #if HAS_FAN
3395 3395
             , PSTR(" F"), ui.material_preset[i].fan_speed

+ 4
- 3
Marlin/src/module/temperature.cpp Bestand weergeven

@@ -253,7 +253,7 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY,
253 253
 
254 254
 #if HAS_HOTEND
255 255
   hotend_info_t Temperature::temp_hotend[HOTEND_TEMPS]; // = { 0 }
256
-  const uint16_t Temperature::heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP, HEATER_5_MAXTEMP, HEATER_6_MAXTEMP, HEATER_7_MAXTEMP);
256
+  const uint16_t Temperature::hotend_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP, HEATER_5_MAXTEMP, HEATER_6_MAXTEMP, HEATER_7_MAXTEMP);
257 257
 #endif
258 258
 
259 259
 #if ENABLED(AUTO_POWER_E_FANS)
@@ -267,6 +267,7 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY,
267 267
 #if ENABLED(AUTO_POWER_COOLER_FAN)
268 268
   uint8_t Temperature::coolerfan_speed; // = 0
269 269
 #endif
270
+
270 271
 #if HAS_FAN
271 272
 
272 273
   uint8_t Temperature::fan_speed[FAN_COUNT]; // = { 0 }
@@ -552,7 +553,7 @@ volatile bool Temperature::raw_temps_ready = false;
552 553
 
553 554
     TERN_(HAS_AUTO_FAN, next_auto_fan_check_ms = next_temp_ms + 2500UL);
554 555
 
555
-    if (target > GHV(CHAMBER_MAX_TARGET, BED_MAX_TARGET, temp_range[heater_id].maxtemp - HOTEND_OVERSHOOT)) {
556
+    if (target > GHV(CHAMBER_MAX_TARGET, BED_MAX_TARGET, temp_range[heater_id].maxtemp - (HOTEND_OVERSHOOT))) {
556 557
       SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH);
557 558
       TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH));
558 559
       return;
@@ -1512,7 +1513,7 @@ void Temperature::manage_heater() {
1512 1513
 
1513 1514
     if (cooler.is_enabled()) {
1514 1515
       flag_cooler_state = true; // used to allow M106 fan control when cooler is disabled
1515
-      if (temp_cooler.target == 0) temp_cooler.target = COOLER_MINTEMP;
1516
+      if (temp_cooler.target == 0) temp_cooler.target = COOLER_MIN_TARGET;
1516 1517
       if (ELAPSED(ms, next_cooler_check_ms)) {
1517 1518
         next_cooler_check_ms = ms + COOLER_CHECK_INTERVAL;
1518 1519
         if (temp_cooler.celsius > temp_cooler.target) {

+ 5
- 10
Marlin/src/module/temperature.h Bestand weergeven

@@ -323,7 +323,8 @@ class Temperature {
323 323
     #if HAS_HOTEND
324 324
       #define HOTEND_TEMPS (HOTENDS + ENABLED(TEMP_SENSOR_1_AS_REDUNDANT))
325 325
       static hotend_info_t temp_hotend[HOTEND_TEMPS];
326
-      static const uint16_t heater_maxtemp[HOTENDS];
326
+      static const uint16_t hotend_maxtemp[HOTENDS];
327
+      FORCE_INLINE static uint16_t hotend_max_target(const uint8_t e) { return hotend_maxtemp[e] - (HOTEND_OVERSHOOT); }
327 328
     #endif
328 329
     TERN_(HAS_HEATED_BED, static bed_info_t temp_bed);
329 330
     TERN_(HAS_TEMP_PROBE, static probe_info_t temp_probe);
@@ -639,7 +640,7 @@ class Temperature {
639 640
             start_preheat_time(ee);
640 641
         #endif
641 642
         TERN_(AUTO_POWER_CONTROL, if (celsius) powerManager.power_on());
642
-        temp_hotend[ee].target = _MIN(celsius, temp_range[ee].maxtemp - HOTEND_OVERSHOOT);
643
+        temp_hotend[ee].target = _MIN(celsius, hotend_max_target(ee));
643 644
         start_watching_hotend(ee);
644 645
       }
645 646
 
@@ -785,13 +786,7 @@ class Temperature {
785 786
 
786 787
     #if HAS_COOLER
787 788
       static void setTargetCooler(const int16_t celsius) {
788
-        temp_cooler.target =
789
-          #ifdef COOLER_MAXTEMP
790
-            _MIN(celsius, COOLER_MAXTEMP - 10)
791
-          #else
792
-            celsius
793
-          #endif
794
-        ;
789
+        temp_cooler.target = constrain(celsius, COOLER_MIN_TARGET, COOLER_MAX_TARGET);
795 790
         start_watching_cooler();
796 791
       }
797 792
     #endif
@@ -878,7 +873,7 @@ class Temperature {
878 873
     TERN_(HAS_DISPLAY, static void set_heating_message(const uint8_t e));
879 874
 
880 875
     #if HAS_LCD_MENU && HAS_TEMPERATURE
881
-      static void lcd_preheat(const int16_t e, const int8_t indh, const int8_t indb);
876
+      static void lcd_preheat(const uint8_t e, const int8_t indh, const int8_t indb);
882 877
     #endif
883 878
 
884 879
   private:

Laden…
Annuleren
Opslaan