Merge pull request #2748 from mkbel/detect_superpinda

Detect superPINDA PFW-1107
This commit is contained in:
Marek Běl 2020-06-16 14:07:12 +02:00 committed by GitHub
commit 45e182911d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 176 additions and 148 deletions

View File

@ -334,7 +334,6 @@ extern unsigned long stoptime;
extern int bowden_length[4]; extern int bowden_length[4];
extern bool is_usb_printing; extern bool is_usb_printing;
extern bool homing_flag; extern bool homing_flag;
extern bool temp_cal_active;
extern bool loading_flag; extern bool loading_flag;
extern unsigned int usb_printing_counter; extern unsigned int usb_printing_counter;

View File

@ -202,8 +202,6 @@ int bowden_length[4] = {385, 385, 385, 385};
bool is_usb_printing = false; bool is_usb_printing = false;
bool homing_flag = false; bool homing_flag = false;
bool temp_cal_active = false;
unsigned long kicktime = _millis()+100000; unsigned long kicktime = _millis()+100000;
unsigned int usb_printing_counter; unsigned int usb_printing_counter;
@ -1465,8 +1463,7 @@ void setup()
if (eeprom_read_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE) == 255) { if (eeprom_read_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE) == 255) {
eeprom_write_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0); eeprom_write_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0);
temp_cal_active = false; }
} else temp_cal_active = eeprom_read_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE);
if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA) == 255) { if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA) == 255) {
//eeprom_write_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 0); //eeprom_write_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 0);
@ -1474,7 +1471,6 @@ void setup()
int16_t z_shift = 0; int16_t z_shift = 0;
for (uint8_t i = 0; i < 5; i++) EEPROM_save_B(EEPROM_PROBE_TEMP_SHIFT + i * 2, &z_shift); for (uint8_t i = 0; i < 5; i++) EEPROM_save_B(EEPROM_PROBE_TEMP_SHIFT + i * 2, &z_shift);
eeprom_write_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0); eeprom_write_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0);
temp_cal_active = false;
} }
if (eeprom_read_byte((uint8_t*)EEPROM_UVLO) == 255) { if (eeprom_read_byte((uint8_t*)EEPROM_UVLO) == 255) {
eeprom_write_byte((uint8_t*)EEPROM_UVLO, 0); eeprom_write_byte((uint8_t*)EEPROM_UVLO, 0);
@ -1547,7 +1543,7 @@ void setup()
lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET));
lcd_update_enable(true); lcd_update_enable(true);
} }
else if (calibration_status() == CALIBRATION_STATUS_CALIBRATED && temp_cal_active == true && calibration_status_pinda() == false) { else if (calibration_status() == CALIBRATION_STATUS_CALIBRATED && eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE) && calibration_status_pinda() == false) {
//lcd_show_fullscreen_message_and_wait_P(_i("Temperature calibration has not been run yet"));////MSG_PINDA_NOT_CALIBRATED c=20 r=4 //lcd_show_fullscreen_message_and_wait_P(_i("Temperature calibration has not been run yet"));////MSG_PINDA_NOT_CALIBRATED c=20 r=4
lcd_update_enable(true); lcd_update_enable(true);
} }
@ -4570,6 +4566,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
The Original i3 Prusa MK2/s uses PINDAv1 and this calibration improves the temperature drift, but not as good as the PINDAv2. The Original i3 Prusa MK2/s uses PINDAv1 and this calibration improves the temperature drift, but not as good as the PINDAv2.
superPINDA sensor has internal temperature compensation and no thermistor output. There is no point of doing temperature calibration in such case.
If PINDA_THERMISTOR and DETECT_SUPERPINDA is defined during compilation, calibration is skipped with serial message "No PINDA thermistor".
This can be caused also if PINDA thermistor connection is broken or PINDA temperature is lower than PINDA_MINTEMP.
#### Example #### Example
``` ```
@ -4584,154 +4584,155 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
case 76: case 76:
{ {
#ifdef PINDA_THERMISTOR #ifdef PINDA_THERMISTOR
if (true) if (!has_temperature_compensation())
{ {
SERIAL_ECHOLNPGM("No PINDA thermistor");
break;
}
if (calibration_status() >= CALIBRATION_STATUS_XYZ_CALIBRATION) { if (calibration_status() >= CALIBRATION_STATUS_XYZ_CALIBRATION) {
//we need to know accurate position of first calibration point //we need to know accurate position of first calibration point
//if xyz calibration was not performed yet, interrupt temperature calibration and inform user that xyz cal. is needed //if xyz calibration was not performed yet, interrupt temperature calibration and inform user that xyz cal. is needed
lcd_show_fullscreen_message_and_wait_P(_i("Please run XYZ calibration first.")); lcd_show_fullscreen_message_and_wait_P(_i("Please run XYZ calibration first."));
break; break;
} }
if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]))
{ {
// We don't know where we are! HOME! // We don't know where we are! HOME!
// Push the commands to the front of the message queue in the reverse order! // Push the commands to the front of the message queue in the reverse order!
// There shall be always enough space reserved for these commands. // There shall be always enough space reserved for these commands.
repeatcommand_front(); // repeat G76 with all its parameters repeatcommand_front(); // repeat G76 with all its parameters
enquecommand_front_P((PSTR("G28 W0"))); enquecommand_front_P((PSTR("G28 W0")));
break; break;
} }
lcd_show_fullscreen_message_and_wait_P(_i("Stable ambient temperature 21-26C is needed a rigid stand is required."));////MSG_TEMP_CAL_WARNING c=20 r=4 lcd_show_fullscreen_message_and_wait_P(_i("Stable ambient temperature 21-26C is needed a rigid stand is required."));////MSG_TEMP_CAL_WARNING c=20 r=4
bool result = lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false, false); bool result = lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false, false);
if (result) if (result)
{ {
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
plan_buffer_line_curposXYZE(3000 / 60); plan_buffer_line_curposXYZE(3000 / 60);
current_position[Z_AXIS] = 50; current_position[Z_AXIS] = 50;
current_position[Y_AXIS] = 180; current_position[Y_AXIS] = 180;
plan_buffer_line_curposXYZE(3000 / 60); plan_buffer_line_curposXYZE(3000 / 60);
st_synchronize(); st_synchronize();
lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_STEEL_SHEET)); lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_STEEL_SHEET));
current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1);
current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); current_position[X_AXIS] = pgm_read_float(bed_ref_points_4);
plan_buffer_line_curposXYZE(3000 / 60); plan_buffer_line_curposXYZE(3000 / 60);
st_synchronize(); st_synchronize();
gcode_G28(false, false, true); gcode_G28(false, false, true);
} }
if ((current_temperature_pinda > 35) && (farm_mode == false)) { if ((current_temperature_pinda > 35) && (farm_mode == false)) {
//waiting for PIDNA probe to cool down in case that we are not in farm mode //waiting for PIDNA probe to cool down in case that we are not in farm mode
current_position[Z_AXIS] = 100; current_position[Z_AXIS] = 100;
plan_buffer_line_curposXYZE(3000 / 60); plan_buffer_line_curposXYZE(3000 / 60);
if (lcd_wait_for_pinda(35) == false) { //waiting for PINDA probe to cool, if this takes more then time expected, temp. cal. fails if (lcd_wait_for_pinda(35) == false) { //waiting for PINDA probe to cool, if this takes more then time expected, temp. cal. fails
lcd_temp_cal_show_result(false); lcd_temp_cal_show_result(false);
break; break;
} }
} }
lcd_update_enable(true); lcd_update_enable(true);
KEEPALIVE_STATE(NOT_BUSY); //no need to print busy messages as we print current temperatures periodicaly KEEPALIVE_STATE(NOT_BUSY); //no need to print busy messages as we print current temperatures periodicaly
SERIAL_ECHOLNPGM("PINDA probe calibration start"); SERIAL_ECHOLNPGM("PINDA probe calibration start");
float zero_z; float zero_z;
int z_shift = 0; //unit: steps int z_shift = 0; //unit: steps
float start_temp = 5 * (int)(current_temperature_pinda / 5); float start_temp = 5 * (int)(current_temperature_pinda / 5);
if (start_temp < 35) start_temp = 35; if (start_temp < 35) start_temp = 35;
if (start_temp < current_temperature_pinda) start_temp += 5; if (start_temp < current_temperature_pinda) start_temp += 5;
printf_P(_N("start temperature: %.1f\n"), start_temp); printf_P(_N("start temperature: %.1f\n"), start_temp);
// setTargetHotend(200, 0); // setTargetHotend(200, 0);
setTargetBed(70 + (start_temp - 30)); setTargetBed(70 + (start_temp - 30));
custom_message_type = CustomMsg::TempCal; custom_message_type = CustomMsg::TempCal;
custom_message_state = 1; custom_message_state = 1;
lcd_setstatuspgm(_T(MSG_TEMP_CALIBRATION)); lcd_setstatuspgm(_T(MSG_TEMP_CALIBRATION));
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
plan_buffer_line_curposXYZE(3000 / 60); plan_buffer_line_curposXYZE(3000 / 60);
current_position[X_AXIS] = PINDA_PREHEAT_X; current_position[X_AXIS] = PINDA_PREHEAT_X;
current_position[Y_AXIS] = PINDA_PREHEAT_Y; current_position[Y_AXIS] = PINDA_PREHEAT_Y;
plan_buffer_line_curposXYZE(3000 / 60); plan_buffer_line_curposXYZE(3000 / 60);
current_position[Z_AXIS] = PINDA_PREHEAT_Z; current_position[Z_AXIS] = PINDA_PREHEAT_Z;
plan_buffer_line_curposXYZE(3000 / 60); plan_buffer_line_curposXYZE(3000 / 60);
st_synchronize(); st_synchronize();
while (current_temperature_pinda < start_temp) while (current_temperature_pinda < start_temp)
{ {
delay_keep_alive(1000); delay_keep_alive(1000);
serialecho_temperatures(); serialecho_temperatures();
} }
eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 0); //invalidate temp. calibration in case that in will be aborted during the calibration process eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 0); //invalidate temp. calibration in case that in will be aborted during the calibration process
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
plan_buffer_line_curposXYZE(3000 / 60); plan_buffer_line_curposXYZE(3000 / 60);
current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); current_position[X_AXIS] = pgm_read_float(bed_ref_points_4);
current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1);
plan_buffer_line_curposXYZE(3000 / 60); plan_buffer_line_curposXYZE(3000 / 60);
st_synchronize(); st_synchronize();
bool find_z_result = find_bed_induction_sensor_point_z(-1.f); bool find_z_result = find_bed_induction_sensor_point_z(-1.f);
if (find_z_result == false) { if (find_z_result == false) {
lcd_temp_cal_show_result(find_z_result); lcd_temp_cal_show_result(find_z_result);
break; break;
} }
zero_z = current_position[Z_AXIS]; zero_z = current_position[Z_AXIS];
printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]);
int i = -1; for (; i < 5; i++) int i = -1; for (; i < 5; i++)
{ {
float temp = (40 + i * 5); float temp = (40 + i * 5);
printf_P(_N("\nStep: %d/6 (skipped)\nPINDA temperature: %d Z shift (mm):0\n"), i + 2, (40 + i*5)); printf_P(_N("\nStep: %d/6 (skipped)\nPINDA temperature: %d Z shift (mm):0\n"), i + 2, (40 + i*5));
if (i >= 0) EEPROM_save_B(EEPROM_PROBE_TEMP_SHIFT + i * 2, &z_shift); if (i >= 0) EEPROM_save_B(EEPROM_PROBE_TEMP_SHIFT + i * 2, &z_shift);
if (start_temp <= temp) break; if (start_temp <= temp) break;
} }
for (i++; i < 5; i++) for (i++; i < 5; i++)
{ {
float temp = (40 + i * 5); float temp = (40 + i * 5);
printf_P(_N("\nStep: %d/6\n"), i + 2); printf_P(_N("\nStep: %d/6\n"), i + 2);
custom_message_state = i + 2; custom_message_state = i + 2;
setTargetBed(50 + 10 * (temp - 30) / 5); setTargetBed(50 + 10 * (temp - 30) / 5);
// setTargetHotend(255, 0); // setTargetHotend(255, 0);
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
plan_buffer_line_curposXYZE(3000 / 60); plan_buffer_line_curposXYZE(3000 / 60);
current_position[X_AXIS] = PINDA_PREHEAT_X; current_position[X_AXIS] = PINDA_PREHEAT_X;
current_position[Y_AXIS] = PINDA_PREHEAT_Y; current_position[Y_AXIS] = PINDA_PREHEAT_Y;
plan_buffer_line_curposXYZE(3000 / 60); plan_buffer_line_curposXYZE(3000 / 60);
current_position[Z_AXIS] = PINDA_PREHEAT_Z; current_position[Z_AXIS] = PINDA_PREHEAT_Z;
plan_buffer_line_curposXYZE(3000 / 60); plan_buffer_line_curposXYZE(3000 / 60);
st_synchronize(); st_synchronize();
while (current_temperature_pinda < temp) while (current_temperature_pinda < temp)
{ {
delay_keep_alive(1000); delay_keep_alive(1000);
serialecho_temperatures(); serialecho_temperatures();
} }
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
plan_buffer_line_curposXYZE(3000 / 60); plan_buffer_line_curposXYZE(3000 / 60);
current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); current_position[X_AXIS] = pgm_read_float(bed_ref_points_4);
current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1);
plan_buffer_line_curposXYZE(3000 / 60); plan_buffer_line_curposXYZE(3000 / 60);
st_synchronize(); st_synchronize();
find_z_result = find_bed_induction_sensor_point_z(-1.f); find_z_result = find_bed_induction_sensor_point_z(-1.f);
if (find_z_result == false) { if (find_z_result == false) {
lcd_temp_cal_show_result(find_z_result); lcd_temp_cal_show_result(find_z_result);
break; break;
} }
z_shift = (int)((current_position[Z_AXIS] - zero_z)*cs.axis_steps_per_unit[Z_AXIS]); z_shift = (int)((current_position[Z_AXIS] - zero_z)*cs.axis_steps_per_unit[Z_AXIS]);
printf_P(_N("\nPINDA temperature: %.1f Z shift (mm): %.3f"), current_temperature_pinda, current_position[Z_AXIS] - zero_z); printf_P(_N("\nPINDA temperature: %.1f Z shift (mm): %.3f"), current_temperature_pinda, current_position[Z_AXIS] - zero_z);
EEPROM_save_B(EEPROM_PROBE_TEMP_SHIFT + i * 2, &z_shift); EEPROM_save_B(EEPROM_PROBE_TEMP_SHIFT + i * 2, &z_shift);
} }
lcd_temp_cal_show_result(true); lcd_temp_cal_show_result(true);
break; #else //PINDA_THERMISTOR
}
#endif //PINDA_THERMISTOR
setTargetBed(PINDA_MIN_T); setTargetBed(PINDA_MIN_T);
float zero_z; float zero_z;
@ -4827,13 +4828,12 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
disable_e2(); disable_e2();
setTargetBed(0); //set bed target temperature back to 0 setTargetBed(0); //set bed target temperature back to 0
lcd_show_fullscreen_message_and_wait_P(_T(MSG_TEMP_CALIBRATION_DONE)); lcd_show_fullscreen_message_and_wait_P(_T(MSG_TEMP_CALIBRATION_DONE));
temp_cal_active = true;
eeprom_update_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE, 1); eeprom_update_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE, 1);
lcd_update_enable(true); lcd_update_enable(true);
lcd_update(2); lcd_update(2);
#endif //PINDA_THERMISTOR
} }
break; break;
@ -5253,7 +5253,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
go_home_with_z_lift(); go_home_with_z_lift();
// SERIAL_ECHOLNPGM("Go home finished"); // SERIAL_ECHOLNPGM("Go home finished");
//unretract (after PINDA preheat retraction) //unretract (after PINDA preheat retraction)
if (degHotend(active_extruder) > EXTRUDE_MINTEMP && temp_cal_active == true && calibration_status_pinda() == true && target_temperature_bed >= 50) { if ((degHotend(active_extruder) > EXTRUDE_MINTEMP) && eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE) && calibration_status_pinda() && (target_temperature_bed >= 50)) {
current_position[E_AXIS] += default_retraction; current_position[E_AXIS] += default_retraction;
plan_buffer_line_curposXYZE(400); plan_buffer_line_curposXYZE(400);
} }
@ -10495,7 +10495,11 @@ float temp_comp_interpolation(float inp_temperature) {
if (i>0) EEPROM_read_B(EEPROM_PROBE_TEMP_SHIFT + (i-1) * 2, &shift[i]); //read shift in steps from EEPROM if (i>0) EEPROM_read_B(EEPROM_PROBE_TEMP_SHIFT + (i-1) * 2, &shift[i]); //read shift in steps from EEPROM
temp_C[i] = 50 + i * 10; //temperature in C temp_C[i] = 50 + i * 10; //temperature in C
#ifdef PINDA_THERMISTOR #ifdef PINDA_THERMISTOR
temp_C[i] = 35 + i * 5; //temperature in C constexpr int start_compensating_temp = 35;
temp_C[i] = start_compensating_temp + i * 5; //temperature in degrees C
#ifdef DETECT_SUPERPINDA
static_assert(start_compensating_temp >= PINDA_MINTEMP, "Temperature compensation start point is lower than PINDA_MINTEMP.");
#endif //DETECT_SUPERPINDA
#else #else
temp_C[i] = 50 + i * 10; //temperature in C temp_C[i] = 50 + i * 10; //temperature in C
#endif #endif
@ -10548,7 +10552,7 @@ float temp_comp_interpolation(float inp_temperature) {
#ifdef PINDA_THERMISTOR #ifdef PINDA_THERMISTOR
float temp_compensation_pinda_thermistor_offset(float temperature_pinda) float temp_compensation_pinda_thermistor_offset(float temperature_pinda)
{ {
if (!temp_cal_active) return 0; if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0;
if (!calibration_status_pinda()) return 0; if (!calibration_status_pinda()) return 0;
return temp_comp_interpolation(temperature_pinda) / cs.axis_steps_per_unit[Z_AXIS]; return temp_comp_interpolation(temperature_pinda) / cs.axis_steps_per_unit[Z_AXIS];
} }

View File

@ -2196,4 +2196,20 @@ float unscalePID_d(float d)
#endif //PIDTEMP #endif //PIDTEMP
#ifdef PINDA_THERMISTOR
//! @brief PINDA thermistor detected
//!
//! @retval true firmware should do temperature compensation and allow calibration
//! @retval false PINDA thermistor is not detected, disable temperature compensation and calibration
//!
bool has_temperature_compensation()
{
#ifdef DETECT_SUPERPINDA
return (current_temperature_pinda >= PINDA_MINTEMP) ? true : false;
#else
return true;
#endif
}
#endif //PINDA_THERMISTOR

View File

@ -63,6 +63,7 @@ extern float current_temperature_bed;
#ifdef PINDA_THERMISTOR #ifdef PINDA_THERMISTOR
extern uint16_t current_temperature_raw_pinda; extern uint16_t current_temperature_raw_pinda;
extern float current_temperature_pinda; extern float current_temperature_pinda;
bool has_temperature_compensation();
#endif #endif
#ifdef AMBIENT_THERMISTOR #ifdef AMBIENT_THERMISTOR

View File

@ -3920,14 +3920,12 @@ void lcd_temp_cal_show_result(bool result) {
eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 1); eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 1);
SERIAL_ECHOLNPGM("Temperature calibration done. Continue with pressing the knob."); SERIAL_ECHOLNPGM("Temperature calibration done. Continue with pressing the knob.");
lcd_show_fullscreen_message_and_wait_P(_T(MSG_TEMP_CALIBRATION_DONE)); lcd_show_fullscreen_message_and_wait_P(_T(MSG_TEMP_CALIBRATION_DONE));
temp_cal_active = true;
eeprom_update_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE, 1); eeprom_update_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE, 1);
} }
else { else {
eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 0); eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 0);
SERIAL_ECHOLNPGM("Temperature calibration failed. Continue with pressing the knob."); SERIAL_ECHOLNPGM("Temperature calibration failed. Continue with pressing the knob.");
lcd_show_fullscreen_message_and_wait_P(_i("Temperature calibration failed"));////MSG_TEMP_CAL_FAILED c=20 r=8 lcd_show_fullscreen_message_and_wait_P(_i("Temperature calibration failed"));////MSG_TEMP_CAL_FAILED c=20 r=8
temp_cal_active = false;
eeprom_update_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE, 0); eeprom_update_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE, 0);
} }
lcd_update_enable(true); lcd_update_enable(true);
@ -4635,6 +4633,7 @@ void lcd_pinda_calibration_menu()
} }
void lcd_temp_calibration_set() { void lcd_temp_calibration_set() {
bool temp_cal_active = eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE);
temp_cal_active = !temp_cal_active; temp_cal_active = !temp_cal_active;
eeprom_update_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE, temp_cal_active); eeprom_update_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE, temp_cal_active);
} }
@ -5764,8 +5763,10 @@ static void lcd_settings_menu()
#if defined (TMC2130) && defined (LINEARITY_CORRECTION) #if defined (TMC2130) && defined (LINEARITY_CORRECTION)
MENU_ITEM_SUBMENU_P(_i("Lin. correction"), lcd_settings_linearity_correction_menu); MENU_ITEM_SUBMENU_P(_i("Lin. correction"), lcd_settings_linearity_correction_menu);
#endif //LINEARITY_CORRECTION && TMC2130 #endif //LINEARITY_CORRECTION && TMC2130
if(has_temperature_compensation())
MENU_ITEM_TOGGLE_P(_T(MSG_TEMP_CALIBRATION), temp_cal_active ? _T(MSG_ON) : _T(MSG_OFF), lcd_temp_calibration_set); {
MENU_ITEM_TOGGLE_P(_T(MSG_TEMP_CALIBRATION), eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE) ? _T(MSG_ON) : _T(MSG_OFF), lcd_temp_calibration_set);
}
#ifdef HAS_SECOND_SERIAL_PORT #ifdef HAS_SECOND_SERIAL_PORT
MENU_ITEM_TOGGLE_P(_T(MSG_RPI_PORT), (selectedSerialPort == 0) ? _T(MSG_OFF) : _T(MSG_ON), lcd_second_serial_set); MENU_ITEM_TOGGLE_P(_T(MSG_RPI_PORT), (selectedSerialPort == 0) ? _T(MSG_OFF) : _T(MSG_ON), lcd_second_serial_set);
@ -5869,7 +5870,10 @@ static void lcd_calibration_menu()
//MENU_ITEM_FUNCTION_P(MSG_RESET_CALIBRATE_E, lcd_extr_cal_reset); //MENU_ITEM_FUNCTION_P(MSG_RESET_CALIBRATE_E, lcd_extr_cal_reset);
#endif #endif
#ifndef MK1BP #ifndef MK1BP
MENU_ITEM_SUBMENU_P(_i("Temp. calibration"), lcd_pinda_calibration_menu);////MSG_CALIBRATION_PINDA_MENU c=17 r=1 if(has_temperature_compensation())
{
MENU_ITEM_SUBMENU_P(_i("Temp. calibration"), lcd_pinda_calibration_menu);////MSG_CALIBRATION_PINDA_MENU c=17 r=1
}
#endif //MK1BP #endif //MK1BP
} }

View File

@ -294,6 +294,8 @@
#if BED_MINTEMP_DELAY>USHRT_MAX #if BED_MINTEMP_DELAY>USHRT_MAX
#error "Check maximal allowed value @ ShortTimer (see BED_MINTEMP_DELAY definition)" #error "Check maximal allowed value @ ShortTimer (see BED_MINTEMP_DELAY definition)"
#endif #endif
#define DETECT_SUPERPINDA
#define PINDA_MINTEMP BED_MINTEMP
// Maxtemps // Maxtemps
#if defined(E3D_PT100_EXTRUDER_WITH_AMP) || defined(E3D_PT100_EXTRUDER_NO_AMP) #if defined(E3D_PT100_EXTRUDER_WITH_AMP) || defined(E3D_PT100_EXTRUDER_NO_AMP)

View File

@ -296,6 +296,8 @@
#if BED_MINTEMP_DELAY>USHRT_MAX #if BED_MINTEMP_DELAY>USHRT_MAX
#error "Check maximal allowed value @ ShortTimer (see BED_MINTEMP_DELAY definition)" #error "Check maximal allowed value @ ShortTimer (see BED_MINTEMP_DELAY definition)"
#endif #endif
#define DETECT_SUPERPINDA
#define PINDA_MINTEMP BED_MINTEMP
// Maxtemps // Maxtemps
#if defined(E3D_PT100_EXTRUDER_WITH_AMP) || defined(E3D_PT100_EXTRUDER_NO_AMP) #if defined(E3D_PT100_EXTRUDER_WITH_AMP) || defined(E3D_PT100_EXTRUDER_NO_AMP)