From 0124fbf9ee2a703bbd50b68e2fe0aab4c4c0ff1c Mon Sep 17 00:00:00 2001 From: DRracer Date: Tue, 7 May 2019 16:15:42 +0200 Subject: [PATCH 1/2] Fix: display target extruder temperature on the main screen when doing PID calibration --- Firmware/temperature.cpp | 2 ++ Firmware/ultralcd.cpp | 2 ++ 2 files changed, 4 insertions(+) mode change 100644 => 100755 Firmware/temperature.cpp diff --git a/Firmware/temperature.cpp b/Firmware/temperature.cpp old mode 100644 new mode 100755 index 45256bf4..bf99b526 --- a/Firmware/temperature.cpp +++ b/Firmware/temperature.cpp @@ -264,11 +264,13 @@ static void temp_runaway_stop(bool isPreheat, bool isBed); soft_pwm_bed = (MAX_BED_POWER)/2; timer02_set_pwm0(soft_pwm_bed << 1); bias = d = (MAX_BED_POWER)/2; + target_temperature_bed = (int)temp; // to display the requested target bed temperature properly on the main screen } else { soft_pwm[extruder] = (PID_MAX)/2; bias = d = (PID_MAX)/2; + target_temperature[extruder] = (int)temp; // to display the requested target extruder temperature properly on the main screen } diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index d099d922..4754bc27 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -1765,6 +1765,7 @@ void lcd_commands() if (lcd_commands_step == 3 && !blocks_queued()) { //PID calibration strcpy(cmd1, "M303 E0 S"); strcat(cmd1, ftostr3(pid_temp)); + // setting the correct target temperature (for visualization) is done in PID_autotune enquecommand(cmd1); lcd_setstatuspgm(_i("PID cal. "));////MSG_PID_RUNNING c=20 r=1 lcd_commands_step = 2; @@ -1773,6 +1774,7 @@ void lcd_commands() pid_tuning_finished = false; custom_message_state = 0; lcd_setstatuspgm(_i("PID cal. finished"));////MSG_PID_FINISHED c=20 r=1 + setTargetHotend(0, 0); // reset the target hotend temperature including the number displayed on the main screen if (_Kp != 0 || _Ki != 0 || _Kd != 0) { strcpy(cmd1, "M301 P"); strcat(cmd1, ftostr32(_Kp)); From 5707d4b85cc9476e13eae3c652a3f7219f88983f Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Fri, 10 May 2019 15:27:25 +0200 Subject: [PATCH 2/2] Set all target hot ends to 0 deg. Celsius instead of just hotend nr. 0 to be more safe with custom modifications. --- Firmware/ultralcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 3bdf5459..24c82023 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -1774,7 +1774,7 @@ void lcd_commands() pid_tuning_finished = false; custom_message_state = 0; lcd_setstatuspgm(_i("PID cal. finished"));////MSG_PID_FINISHED c=20 r=1 - setTargetHotend(0, 0); // reset the target hotend temperature including the number displayed on the main screen + setAllTargetHotends(0); // reset all hotends temperature including the number displayed on the main screen if (_Kp != 0 || _Ki != 0 || _Kd != 0) { strcpy(cmd1, "M301 P"); strcat(cmd1, ftostr32(_Kp));