|
@@ -217,6 +217,12 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS],
|
217
|
217
|
|
218
|
218
|
#if HAS_PID_HEATING
|
219
|
219
|
|
|
220
|
+ /**
|
|
221
|
+ * PID Autotuning (M303)
|
|
222
|
+ *
|
|
223
|
+ * Alternately heat and cool the nozzle, observing its behavior to
|
|
224
|
+ * determine the best PID values to achieve a stable temperature.
|
|
225
|
+ */
|
220
|
226
|
void Temperature::PID_autotune(const float temp, const int8_t hotend, const int8_t ncycles, const bool set_result/*=false*/) {
|
221
|
227
|
float input = 0.0;
|
222
|
228
|
int cycles = 0;
|
|
@@ -466,7 +472,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS],
|
466
|
472
|
bedKp = workKp; \
|
467
|
473
|
bedKi = scalePID_i(workKi); \
|
468
|
474
|
bedKd = scalePID_d(workKd); \
|
469
|
|
- updatePID(); }while(0)
|
|
475
|
+ }while(0)
|
470
|
476
|
|
471
|
477
|
#define _SET_EXTRUDER_PID() do { \
|
472
|
478
|
PID_PARAM(Kp, hotend) = workKp; \
|
|
@@ -502,14 +508,6 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS],
|
502
|
508
|
|
503
|
509
|
Temperature::Temperature() { }
|
504
|
510
|
|
505
|
|
-void Temperature::updatePID() {
|
506
|
|
- #if ENABLED(PIDTEMP)
|
507
|
|
- #if ENABLED(PID_EXTRUSION_SCALING)
|
508
|
|
- last_e_position = 0;
|
509
|
|
- #endif
|
510
|
|
- #endif
|
511
|
|
-}
|
512
|
|
-
|
513
|
511
|
int Temperature::getHeaterPower(int heater) {
|
514
|
512
|
return heater < 0 ? soft_pwm_amount_bed : soft_pwm_amount[heater];
|
515
|
513
|
}
|