|
@@ -39,7 +39,7 @@
|
39
|
39
|
#include "../../module/probe.h"
|
40
|
40
|
#endif
|
41
|
41
|
|
42
|
|
-#if ENABLED(PIDTEMP)
|
|
42
|
+#if ANY(PIDTEMP, PIDTEMPBED, PIDTEMPCHAMBER)
|
43
|
43
|
#include "../../module/temperature.h"
|
44
|
44
|
#endif
|
45
|
45
|
|
|
@@ -190,7 +190,12 @@ void menu_backlash();
|
190
|
190
|
#if ENABLED(PIDTEMPCHAMBER)
|
191
|
191
|
case H_CHAMBER: tune_temp = autotune_temp_chamber; break;
|
192
|
192
|
#endif
|
193
|
|
- default: tune_temp = autotune_temp[hid]; break;
|
|
193
|
+ default:
|
|
194
|
+ #if ENABLED(PIDTEMP)
|
|
195
|
+ tune_temp = autotune_temp[hid]; break;
|
|
196
|
+ #else
|
|
197
|
+ return;
|
|
198
|
+ #endif
|
194
|
199
|
}
|
195
|
200
|
sprintf_P(cmd, PSTR("M303 U1 E%i S%i"), hid, tune_temp);
|
196
|
201
|
queue.inject(cmd);
|
|
@@ -206,14 +211,36 @@ void menu_backlash();
|
206
|
211
|
// Helpers for editing PID Ki & Kd values
|
207
|
212
|
// grab the PID value out of the temp variable; scale it; then update the PID driver
|
208
|
213
|
void copy_and_scalePID_i(int16_t e) {
|
209
|
|
- UNUSED(e);
|
210
|
|
- PID_PARAM(Ki, e) = scalePID_i(raw_Ki);
|
211
|
|
- thermalManager.updatePID();
|
|
214
|
+ switch (e) {
|
|
215
|
+ #if ENABLED(PIDTEMPBED)
|
|
216
|
+ case H_BED: thermalManager.temp_bed.pid.Ki = scalePID_i(raw_Ki); break;
|
|
217
|
+ #endif
|
|
218
|
+ #if ENABLED(PIDTEMPCHAMBER)
|
|
219
|
+ case H_CHAMBER: thermalManager.temp_chamber.pid.Ki = scalePID_i(raw_Ki); break;
|
|
220
|
+ #endif
|
|
221
|
+ default:
|
|
222
|
+ #if ENABLED(PIDTEMP)
|
|
223
|
+ PID_PARAM(Ki, e) = scalePID_i(raw_Ki);
|
|
224
|
+ thermalManager.updatePID();
|
|
225
|
+ #endif
|
|
226
|
+ break;
|
|
227
|
+ }
|
212
|
228
|
}
|
213
|
229
|
void copy_and_scalePID_d(int16_t e) {
|
214
|
|
- UNUSED(e);
|
215
|
|
- PID_PARAM(Kd, e) = scalePID_d(raw_Kd);
|
216
|
|
- thermalManager.updatePID();
|
|
230
|
+ switch (e) {
|
|
231
|
+ #if ENABLED(PIDTEMPBED)
|
|
232
|
+ case H_BED: thermalManager.temp_bed.pid.Kd = scalePID_d(raw_Kd); break;
|
|
233
|
+ #endif
|
|
234
|
+ #if ENABLED(PIDTEMPCHAMBER)
|
|
235
|
+ case H_CHAMBER: thermalManager.temp_chamber.pid.Kd = scalePID_d(raw_Kd); break;
|
|
236
|
+ #endif
|
|
237
|
+ default:
|
|
238
|
+ #if ENABLED(PIDTEMP)
|
|
239
|
+ PID_PARAM(Kd, e) = scalePID_d(raw_Kd);
|
|
240
|
+ thermalManager.updatePID();
|
|
241
|
+ #endif
|
|
242
|
+ break;
|
|
243
|
+ }
|
217
|
244
|
}
|
218
|
245
|
|
219
|
246
|
#define _DEFINE_PIDTEMP_BASE_FUNCS(N) \
|