|
@@ -34,18 +34,31 @@
|
34
|
34
|
/**
|
35
|
35
|
* M303: PID relay autotune
|
36
|
36
|
*
|
37
|
|
- * S<temperature> sets the target temperature. (default 150C / 70C)
|
38
|
|
- * E<extruder> (-1 for the bed) (default 0)
|
39
|
|
- * C<cycles> Minimum 3. Default 5.
|
40
|
|
- * U<bool> with a non-zero value will apply the result to current settings
|
41
|
|
- * D Toggles PID_DEBUG flag. No other action happens even if more parameters are specified.
|
|
37
|
+ * S<temperature> Set the target temperature. (Default: 150C / 70C)
|
|
38
|
+ * E<extruder> Extruder number to tune, or -1 for the bed. (Default: E0)
|
|
39
|
+ * C<cycles> Number of times to repeat the procedure. (Minimum: 3, Default: 5)
|
|
40
|
+ * U<bool> Flag to apply the result to the current PID values
|
|
41
|
+ *
|
|
42
|
+ * With PID_DEBUG:
|
|
43
|
+ * D Toggle PID debugging and EXIT without further action.
|
42
|
44
|
*/
|
43
|
45
|
|
44
|
46
|
#if ENABLED(PID_DEBUG)
|
45
|
|
- bool PID_Debug_Flag = 0;
|
|
47
|
+ bool pid_debug_flag = 0;
|
46
|
48
|
#endif
|
47
|
49
|
|
48
|
50
|
void GcodeSuite::M303() {
|
|
51
|
+
|
|
52
|
+ #if ENABLED(PID_DEBUG)
|
|
53
|
+ if (parser.seen('D')) {
|
|
54
|
+ pid_debug_flag = !pid_debug_flag;
|
|
55
|
+ SERIAL_ECHO_START();
|
|
56
|
+ SERIAL_ECHOPGM("PID Debug ");
|
|
57
|
+ serialprintln_onoff(pid_debug_flag);
|
|
58
|
+ return;
|
|
59
|
+ }
|
|
60
|
+ #endif
|
|
61
|
+
|
49
|
62
|
#if ENABLED(PIDTEMPBED)
|
50
|
63
|
#define SI H_BED
|
51
|
64
|
#else
|
|
@@ -69,16 +82,6 @@ void GcodeSuite::M303() {
|
69
|
82
|
const bool u = parser.boolval('U');
|
70
|
83
|
const int16_t temp = parser.celsiusval('S', e < 0 ? 70 : 150);
|
71
|
84
|
|
72
|
|
- #if ENABLED(PID_DEBUG)
|
73
|
|
- bool d = parser.boolval('D');
|
74
|
|
- if (d) {
|
75
|
|
- PID_Debug_Flag = !PID_Debug_Flag;
|
76
|
|
- SERIAL_ECHOPGM("PID Debug set to: ");
|
77
|
|
- SERIAL_ECHOLN( PID_Debug_Flag );
|
78
|
|
- return;
|
79
|
|
- }
|
80
|
|
- #endif
|
81
|
|
-
|
82
|
85
|
#if DISABLED(BUSY_WHILE_HEATING)
|
83
|
86
|
KEEPALIVE_STATE(NOT_BUSY);
|
84
|
87
|
#endif
|