Allow PID_DEBUG to be turned on and off (#17284)
M303 D will now toggle activation of PID_DEBUG output. This allows the debug capability to be built into the firmware, but turned on and off as needed.
This commit is contained in:
@ -830,6 +830,9 @@ void Temperature::min_temp_error(const heater_ind_t heater) {
|
||||
}
|
||||
|
||||
#if HOTENDS
|
||||
#if ENABLED(PID_DEBUG)
|
||||
extern bool PID_Debug_Flag;
|
||||
#endif
|
||||
|
||||
float Temperature::get_pid_output_hotend(const uint8_t E_NAME) {
|
||||
const uint8_t ee = HOTEND_INDEX;
|
||||
@ -911,24 +914,15 @@ void Temperature::min_temp_error(const heater_ind_t heater) {
|
||||
#endif // PID_OPENLOOP
|
||||
|
||||
#if ENABLED(PID_DEBUG)
|
||||
if (ee == active_extruder) {
|
||||
if (ee == active_extruder && PID_Debug_Flag) {
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPAIR(
|
||||
STR_PID_DEBUG, ee,
|
||||
STR_PID_DEBUG_INPUT, temp_hotend[ee].celsius,
|
||||
STR_PID_DEBUG_OUTPUT, pid_output
|
||||
);
|
||||
SERIAL_ECHOPAIR(STR_PID_DEBUG, ee, STR_PID_DEBUG_INPUT, temp_hotend[ee].celsius, STR_PID_DEBUG_OUTPUT, pid_output);
|
||||
#if DISABLED(PID_OPENLOOP)
|
||||
{
|
||||
SERIAL_ECHOPAIR(
|
||||
STR_PID_DEBUG_PTERM, work_pid[ee].Kp,
|
||||
STR_PID_DEBUG_ITERM, work_pid[ee].Ki,
|
||||
STR_PID_DEBUG_DTERM, work_pid[ee].Kd
|
||||
SERIAL_ECHOPAIR( STR_PID_DEBUG_PTERM, work_pid[ee].Kp, STR_PID_DEBUG_ITERM, work_pid[ee].Ki, STR_PID_DEBUG_DTERM, work_pid[ee].Kd
|
||||
#if ENABLED(PID_EXTRUSION_SCALING)
|
||||
, STR_PID_DEBUG_CTERM, work_pid[ee].Kc
|
||||
#endif
|
||||
);
|
||||
}
|
||||
#endif
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
Reference in New Issue
Block a user