Merge pull request #2931 from 3d-gussner/MK3_3.9.3_SuperPINDA

Add SuperPINDA Support for MK2.5/S for MK3_3.9.3
This commit is contained in:
DRracer 2020-12-23 21:26:37 +01:00 committed by GitHub
commit ad68405321
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 71 additions and 12 deletions

View file

@ -4572,7 +4572,7 @@ 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.
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".
If PINDA_THERMISTOR and SUPERPINDA_SUPPORT 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
@ -10502,9 +10502,9 @@ float temp_comp_interpolation(float inp_temperature) {
#ifdef PINDA_THERMISTOR
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
#ifdef SUPERPINDA_SUPPORT
static_assert(start_compensating_temp >= PINDA_MINTEMP, "Temperature compensation start point is lower than PINDA_MINTEMP.");
#endif //SUPERPINDA_SUPPORT
#else
temp_C[i] = 50 + i * 10; //temperature in C
#endif

View file

@ -93,6 +93,10 @@ void eeprom_init()
eeprom_switch_to_next_sheet();
}
check_babystep();
#ifdef PINDA_TEMP_COMP
if (eeprom_read_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION) == 0xff) eeprom_update_byte((uint8_t *)EEPROM_PINDA_TEMP_COMPENSATION, 0);
#endif //PINDA_TEMP_COMP
}
//! @brief Get default sheet name for index

View file

@ -365,6 +365,9 @@ static_assert(sizeof(Sheets) == EEPROM_SHEETS_SIZEOF, "Sizeof(Sheets) is not EEP
| 0x0D2A 3370 | uint8 | EEPROM_EXPERIMENTAL_VISIBILITY | ffh 255 | ffh 255 | Experimental menu visibility unknown state | LCD menu | D3 Ax0d2a C1
| ^ | ^ | ^ | 00h 0 | ^ | Experimental menu visibility hidden | ^ | ^
| ^ | ^ | ^ | 01h 1 | ^ | Experimental menu visibility visible | ^ | ^
| 0x0D29 3369 | uint8 | EEPROM_PINDA_TEMP_COMPENSATION | ffh 255 | ffh 255 | PINDA temp compensation unknown state | LCD menu | D3 Ax0d29 C1
| ^ | ^ | ^ | 00h 0 | ^ | PINDA has no temp compensation PINDA v1/2 | ^ | ^
| ^ | ^ | ^ | 01h 1 | ^ | PINDA has temp compensation aka SuperPINDA | ^ | ^
| Address begin | Bit/Type | Name | Valid values | Default/FactoryReset | Description | Gcode/Function| Debug code
@ -569,9 +572,9 @@ static Sheets * const EEPROM_Sheets_base = (Sheets*)(EEPROM_SHEETS_BASE);
#define EEPROM_ALTFAN_OVERRIDE (EEPROM_UVLO_LA_K-1) //uint8
#define EEPROM_EXPERIMENTAL_VISIBILITY (EEPROM_ALTFAN_OVERRIDE-1) //uint8
#define EEPROM_PINDA_TEMP_COMPENSATION (EEPROM_EXPERIMENTAL_VISIBILITY-1) //uint8
//This is supposed to point to last item to allow EEPROM overrun check. Please update when adding new items.
#define EEPROM_LAST_ITEM EEPROM_EXPERIMENTAL_VISIBILITY
#define EEPROM_LAST_ITEM EEPROM_PINDA_TEMP_COMPENSATION
// !!!!!
// !!!!! this is end of EEPROM section ... all updates MUST BE inserted before this mark !!!!!
// !!!!!

View file

@ -2325,11 +2325,22 @@ float unscalePID_d(float d)
//!
//! @retval true firmware should do temperature compensation and allow calibration
//! @retval false PINDA thermistor is not detected, disable temperature compensation and calibration
//! @retval true/false when forced via LCD menu Settings->HW Setup->SuperPINDA
//!
bool has_temperature_compensation()
{
#ifdef DETECT_SUPERPINDA
return (current_temperature_pinda >= PINDA_MINTEMP) ? true : false;
#ifdef SUPERPINDA_SUPPORT
#ifdef PINDA_TEMP_COMP
uint8_t pinda_temp_compensation = eeprom_read_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION);
if (pinda_temp_compensation == EEPROM_EMPTY_VALUE) //Unkown PINDA temp compenstation, so check it.
{
#endif //PINDA_TEMP_COMP
return (current_temperature_pinda >= PINDA_MINTEMP) ? true : false;
#ifdef PINDA_TEMP_COMP
}
else if (pinda_temp_compensation == 0) return true; //Overwritten via LCD menu SuperPINDA [No]
else return false; //Overwritten via LCD menu SuperPINDA [YES]
#endif //PINDA_TEMP_COMP
#else
return true;
#endif

View file

@ -5753,6 +5753,15 @@ void lcd_hw_setup_menu(void) // can not be "static"
MENU_ITEM_SUBMENU_P(PSTR("Experimental"), lcd_experimental_menu);////MSG_MENU_EXPERIMENTAL c=18
}
#ifdef PINDA_TEMP_COMP
//! The SuperPINDA is detected when the PINDA temp is below its defined limit.
//! This works well on the EINSY board but not on the miniRAMBo board as
//! as a disconnected SuperPINDA will show higher temps compared to an EINSY board.
//!
//! This menu allows the user to en-/disable the SuperPINDA manualy
MENU_ITEM_TOGGLE_P(_N("SuperPINDA"), eeprom_read_byte((uint8_t *)EEPROM_PINDA_TEMP_COMPENSATION) ? _T(MSG_YES) : _T(MSG_NO), lcd_pinda_temp_compensation_toggle);
#endif //PINDA_TEMP_COMP
MENU_END();
}
@ -9235,3 +9244,17 @@ void lcd_experimental_menu()
MENU_END();
}
#ifdef PINDA_TEMP_COMP
void lcd_pinda_temp_compensation_toggle()
{
uint8_t pinda_temp_compensation = eeprom_read_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION);
if (pinda_temp_compensation == EEPROM_EMPTY_VALUE) // On MK2.5/S the EEPROM_EMPTY_VALUE will be set to 0 during eeprom_init.
pinda_temp_compensation = 1; // But for MK3/S it should be 1 so SuperPINDA is "active"
else
pinda_temp_compensation = !pinda_temp_compensation;
eeprom_update_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION, pinda_temp_compensation);
SERIAL_ECHOLNPGM("SuperPINDA:");
SERIAL_ECHOLN(pinda_temp_compensation);
}
#endif //PINDA_TEMP_COMP

View file

@ -262,4 +262,8 @@ void lcd_wizard(WizState state);
extern void lcd_experimental_toggle();
extern void lcd_experimental_menu();
#ifdef PINDA_TEMP_COMP
extern void lcd_pinda_temp_compensation_toggle();
#endif //PINDA_TEMP_COMP
#endif //ULTRALCD_H

View file

@ -175,6 +175,9 @@
#if BED_MINTEMP_DELAY>USHRT_MAX
#error "Check maximal allowed value @ ShortTimer (see BED_MINTEMP_DELAY definition)"
#endif
#define SUPERPINDA_SUPPORT
#define PINDA_MINTEMP 30 //The miniRAMBo thermistor readings below 30°C aren't very accurate
#define PINDA_TEMP_COMP //Used to enable SuperPINDA toggle menu/function
// Maxtemps
#if defined(E3D_PT100_EXTRUDER_WITH_AMP) || defined(E3D_PT100_EXTRUDER_NO_AMP)

View file

@ -176,6 +176,9 @@
#if BED_MINTEMP_DELAY>USHRT_MAX
#error "Check maximal allowed value @ ShortTimer (see BED_MINTEMP_DELAY definition)"
#endif
#define SUPERPINDA_SUPPORT
#define PINDA_MINTEMP 30 //The miniRAMBo thermistor readings below 30°C aren't very accurate
#define PINDA_TEMP_COMP //Used to enable SuperPINDA toggle menu/function
// Maxtemps
#if defined(E3D_PT100_EXTRUDER_WITH_AMP) || defined(E3D_PT100_EXTRUDER_NO_AMP)

View file

@ -175,6 +175,9 @@
#if BED_MINTEMP_DELAY>USHRT_MAX
#error "Check maximal allowed value @ ShortTimer (see BED_MINTEMP_DELAY definition)"
#endif
#define SUPERPINDA_SUPPORT
#define PINDA_MINTEMP 30 //The miniRAMBo thermistor readings below 30°C aren't very accurate
#define PINDA_TEMP_COMP //Used to enable SuperPINDA toggle menu/function
// Maxtemps
#if defined(E3D_PT100_EXTRUDER_WITH_AMP) || defined(E3D_PT100_EXTRUDER_NO_AMP)

View file

@ -176,6 +176,9 @@
#if BED_MINTEMP_DELAY>USHRT_MAX
#error "Check maximal allowed value @ ShortTimer (see BED_MINTEMP_DELAY definition)"
#endif
#define SUPERPINDA_SUPPORT
#define PINDA_MINTEMP 30 //The miniRAMBo thermistor readings below 30°C aren't very accurate
#define PINDA_TEMP_COMP //Used to enable SuperPINDA toggle menu/function
// Maxtemps
#if defined(E3D_PT100_EXTRUDER_WITH_AMP) || defined(E3D_PT100_EXTRUDER_NO_AMP)

View file

@ -294,8 +294,9 @@
#if BED_MINTEMP_DELAY>USHRT_MAX
#error "Check maximal allowed value @ ShortTimer (see BED_MINTEMP_DELAY definition)"
#endif
#define DETECT_SUPERPINDA
#define PINDA_MINTEMP BED_MINTEMP
#define SUPERPINDA_SUPPORT
#define PINDA_MINTEMP 10
//#define PINDA_TEMP_COMP //Used to enable SuperPINDA toggle menu/function
#define AMBIENT_MINTEMP -30
// Maxtemps

View file

@ -296,8 +296,9 @@
#if BED_MINTEMP_DELAY>USHRT_MAX
#error "Check maximal allowed value @ ShortTimer (see BED_MINTEMP_DELAY definition)"
#endif
#define DETECT_SUPERPINDA
#define PINDA_MINTEMP BED_MINTEMP
#define SUPERPINDA_SUPPORT
#define PINDA_MINTEMP 10
//#define PINDA_TEMP_COMP //Used to enable SuperPINDA toggle menu/function
#define AMBIENT_MINTEMP -30
// Maxtemps