Browse Source

Use Material Preset 1 for PID autotune (#18446)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Luc Hoang Long 5 years ago
parent
commit
764fc81761
No account linked to committer's email address
2 changed files with 6 additions and 21 deletions
  1. 3
    11
      Marlin/src/gcode/temp/M303.cpp
  2. 3
    10
      Marlin/src/lcd/menu/menu_advanced.cpp

+ 3
- 11
Marlin/src/gcode/temp/M303.cpp View File

60
     }
60
     }
61
   #endif
61
   #endif
62
 
62
 
63
-  #if ENABLED(PIDTEMPBED)
64
-    #define SI H_BED
65
-  #else
66
-    #define SI H_E0
67
-  #endif
68
-  #if ENABLED(PIDTEMP)
69
-    #define EI HOTENDS - 1
70
-  #else
71
-    #define EI H_BED
72
-  #endif
63
+  #define SI TERN(PIDTEMPBED, H_BED, H_E0)
64
+  #define EI TERN(PIDTEMP, HOTENDS - 1, H_BED)
73
   const heater_ind_t e = (heater_ind_t)parser.intval('E');
65
   const heater_ind_t e = (heater_ind_t)parser.intval('E');
74
   if (!WITHIN(e, SI, EI)) {
66
   if (!WITHIN(e, SI, EI)) {
75
     SERIAL_ECHOLNPGM(STR_PID_BAD_EXTRUDER_NUM);
67
     SERIAL_ECHOLNPGM(STR_PID_BAD_EXTRUDER_NUM);
79
 
71
 
80
   const int c = parser.intval('C', 5);
72
   const int c = parser.intval('C', 5);
81
   const bool u = parser.boolval('U');
73
   const bool u = parser.boolval('U');
82
-  const int16_t temp = parser.celsiusval('S', e < 0 ? 70 : 150);
74
+  const int16_t temp = parser.celsiusval('S', e < 0 ? PREHEAT_1_TEMP_BED : PREHEAT_1_TEMP_HOTEND);
83
 
75
 
84
   #if DISABLED(BUSY_WHILE_HEATING)
76
   #if DISABLED(BUSY_WHILE_HEATING)
85
     KEEPALIVE_STATE(NOT_BUSY);
77
     KEEPALIVE_STATE(NOT_BUSY);

+ 3
- 10
Marlin/src/lcd/menu/menu_advanced.cpp View File

169
 #if ENABLED(PID_AUTOTUNE_MENU)
169
 #if ENABLED(PID_AUTOTUNE_MENU)
170
 
170
 
171
   #if ENABLED(PIDTEMP)
171
   #if ENABLED(PIDTEMP)
172
-    #ifdef PREHEAT_1_TEMP_HOTEND
173
-      #define PID_TUNE_TEMP PREHEAT_1_TEMP_HOTEND
174
-    #else
175
-      #define PID_TUNE_TEMP 200
176
-    #endif
177
-    int16_t autotune_temp[HOTENDS] = ARRAY_BY_HOTENDS1(PID_TUNE_TEMP);
178
-    #undef PID_TUNE_TEMP
172
+    int16_t autotune_temp[HOTENDS] = ARRAY_BY_HOTENDS1(PREHEAT_1_TEMP_HOTEND);
179
   #endif
173
   #endif
180
-
181
   #if ENABLED(PIDTEMPBED)
174
   #if ENABLED(PIDTEMPBED)
182
-    int16_t autotune_temp_bed = 70;
175
+    int16_t autotune_temp_bed = PREHEAT_1_TEMP_BED;
183
   #endif
176
   #endif
184
 
177
 
185
   #include "../../gcode/queue.h"
178
   #include "../../gcode/queue.h"
324
         #ifndef BED_OVERSHOOT
317
         #ifndef BED_OVERSHOOT
325
           #define BED_OVERSHOOT 5
318
           #define BED_OVERSHOOT 5
326
         #endif
319
         #endif
327
-        EDIT_ITEM_FAST_N(int3, -1, MSG_PID_AUTOTUNE_E, &autotune_temp_bed, 70, BED_MAXTEMP - BED_OVERSHOOT, []{ _lcd_autotune(-1); });
320
+        EDIT_ITEM_FAST_N(int3, -1, MSG_PID_AUTOTUNE_E, &autotune_temp_bed, PREHEAT_1_TEMP_BED, BED_MAXTEMP - BED_OVERSHOOT, []{ _lcd_autotune(-1); });
328
       #endif
321
       #endif
329
     #endif
322
     #endif
330
 
323
 

Loading…
Cancel
Save