Set pid_tuning_finished globally to true
Use pid_tuning_finished as a flag to prevent automatic PID management. As a result, set the default start-up state to true and adjust the dependent code accordingly.
This commit is contained in:
parent
92418e9d1b
commit
442b2e16de
|
|
@ -85,7 +85,7 @@ float current_temperature_bed = 0.0;
|
||||||
#ifdef PIDTEMP
|
#ifdef PIDTEMP
|
||||||
float _Kp, _Ki, _Kd;
|
float _Kp, _Ki, _Kd;
|
||||||
int pid_cycle, pid_number_of_cycles;
|
int pid_cycle, pid_number_of_cycles;
|
||||||
bool pid_tuning_finished = false;
|
bool pid_tuning_finished = true;
|
||||||
#endif //PIDTEMP
|
#endif //PIDTEMP
|
||||||
|
|
||||||
unsigned char soft_pwm_bed;
|
unsigned char soft_pwm_bed;
|
||||||
|
|
|
||||||
|
|
@ -1018,6 +1018,7 @@ void lcd_commands()
|
||||||
lcd_commands_step = 3;
|
lcd_commands_step = 3;
|
||||||
}
|
}
|
||||||
if (lcd_commands_step == 3 && !blocks_queued()) { //PID calibration
|
if (lcd_commands_step == 3 && !blocks_queued()) { //PID calibration
|
||||||
|
pid_tuning_finished = false; // ensure we don't move to the next step early
|
||||||
sprintf_P(cmd1, PSTR("M303 E0 S%3u"), pid_temp);
|
sprintf_P(cmd1, PSTR("M303 E0 S%3u"), pid_temp);
|
||||||
// setting the correct target temperature (for visualization) is done in PID_autotune
|
// setting the correct target temperature (for visualization) is done in PID_autotune
|
||||||
enquecommand(cmd1);
|
enquecommand(cmd1);
|
||||||
|
|
@ -1025,7 +1026,6 @@ void lcd_commands()
|
||||||
lcd_commands_step = 2;
|
lcd_commands_step = 2;
|
||||||
}
|
}
|
||||||
if (lcd_commands_step == 2 && pid_tuning_finished) { //saving to eeprom
|
if (lcd_commands_step == 2 && pid_tuning_finished) { //saving to eeprom
|
||||||
pid_tuning_finished = false;
|
|
||||||
custom_message_state = 0;
|
custom_message_state = 0;
|
||||||
lcd_setstatuspgm(_i("PID cal. finished"));////MSG_PID_FINISHED c=20
|
lcd_setstatuspgm(_i("PID cal. finished"));////MSG_PID_FINISHED c=20
|
||||||
setAllTargetHotends(0); // reset all hotends temperature including the number displayed on the main screen
|
setAllTargetHotends(0); // reset all hotends temperature including the number displayed on the main screen
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue