Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I removed the 5V to 3.3V table #define OV_SCALE conversion. In essence, thermistor_21.h has now the same code content as thermistor_20.h.
The conversion is leading to an erronous temperature reading, as e.g. a 1°C reading at room temperature (see issues MarlinFirmware#16561 and MarlinFirmware#19234)
The table provides temperature reference points in terms of ADC-counts. As long as the ADC reference voltage (LPC, STM normally 3.3V) and the INA826 supply voltage (here as well 3.3V) are identical, there is no theoretical difference in ADC counts (besides noise, etc.).
The ADC is providing counts in relation to his reference voltage and the INA826 opamp does the very same in the analog domain referring to its supply voltage.
I validated with an additional PT100 measurement for 100°C and room temperature.
Note, that the quantization error of the table in combination with rounding of the temperature reading might lead to a few degrees (seen up to 3°C) of error around the center between datapoints, e.g. 25°C, 35°C, etc.
Benefits
Temp Probe Nr. 21 is usable for INA826 PT100 in 3V3 environments. Currently Nr. 21 is greatly underestimating the hotend temperature.
Configurations
in any Configuration.h with INA826-PT100 and 3V3 board setup:
#define TEMP_SENSOR_0 21
Related Issues
MarlinFirmware#19234
MarlinFirmware#16561