Skip to content

Commit

Permalink
Do not compile, if PINDA temperature compensation start point is lowe…
Browse files Browse the repository at this point in the history
…r than PINDA_MINTEMP. Document.
  • Loading branch information
mkbel committed Jun 16, 2020
1 parent d5feed1 commit 9838be8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Firmware/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4561,13 +4561,15 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
/*!
### G76 - PINDA probe temperature calibration <a href="https://reprap.org/wiki/G-code#G76:_PINDA_probe_temperature_calibration">G76: PINDA probe temperature calibration</a>
This G-code is used to calibrate the temperature drift of the PINDA (inductive Sensor).
superPINDA sensor
The PINDAv2 sensor has a built-in thermistor which has the advantage that the calibration can be done once for all materials.
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
```
Expand Down Expand Up @@ -10493,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
temp_C[i] = 50 + i * 10; //temperature in C
#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
temp_C[i] = 50 + i * 10; //temperature in C
#endif
Expand Down
5 changes: 5 additions & 0 deletions Firmware/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2197,6 +2197,11 @@ float unscalePID_d(float d)
#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
Expand Down

0 comments on commit 9838be8

Please sign in to comment.