Fix User Temp Sensor (1000), reversed Pt100 / Pt1000 (#18590)
This commit is contained in:
parent
1815866877
commit
c2e0e61fe8
5 changed files with 10 additions and 2 deletions
|
@ -1800,13 +1800,13 @@ void Temperature::init() {
|
||||||
#if HAS_HOTEND
|
#if HAS_HOTEND
|
||||||
|
|
||||||
#define _TEMP_MIN_E(NR) do{ \
|
#define _TEMP_MIN_E(NR) do{ \
|
||||||
const int16_t tmin = _MAX(HEATER_ ##NR## _MINTEMP, (int16_t)pgm_read_word(&HEATER_ ##NR## _TEMPTABLE[HEATER_ ##NR## _SENSOR_MINTEMP_IND].celsius)); \
|
const int16_t tmin = _MAX(HEATER_ ##NR## _MINTEMP, TERN(HEATER_##NR##_USER_THERMISTOR, 0, (int16_t)pgm_read_word(&HEATER_ ##NR## _TEMPTABLE[HEATER_ ##NR## _SENSOR_MINTEMP_IND].celsius))); \
|
||||||
temp_range[NR].mintemp = tmin; \
|
temp_range[NR].mintemp = tmin; \
|
||||||
while (analog_to_celsius_hotend(temp_range[NR].raw_min, NR) < tmin) \
|
while (analog_to_celsius_hotend(temp_range[NR].raw_min, NR) < tmin) \
|
||||||
temp_range[NR].raw_min += TEMPDIR(NR) * (OVERSAMPLENR); \
|
temp_range[NR].raw_min += TEMPDIR(NR) * (OVERSAMPLENR); \
|
||||||
}while(0)
|
}while(0)
|
||||||
#define _TEMP_MAX_E(NR) do{ \
|
#define _TEMP_MAX_E(NR) do{ \
|
||||||
const int16_t tmax = _MIN(HEATER_ ##NR## _MAXTEMP, (int16_t)pgm_read_word(&HEATER_ ##NR## _TEMPTABLE[HEATER_ ##NR## _SENSOR_MAXTEMP_IND].celsius) - 1); \
|
const int16_t tmax = _MIN(HEATER_ ##NR## _MAXTEMP, TERN(HEATER_##NR##_USER_THERMISTOR, 2000, (int16_t)pgm_read_word(&HEATER_ ##NR## _TEMPTABLE[HEATER_ ##NR## _SENSOR_MAXTEMP_IND].celsius) - 1)); \
|
||||||
temp_range[NR].maxtemp = tmax; \
|
temp_range[NR].maxtemp = tmax; \
|
||||||
while (analog_to_celsius_hotend(temp_range[NR].raw_max, NR) > tmax) \
|
while (analog_to_celsius_hotend(temp_range[NR].raw_max, NR) > tmax) \
|
||||||
temp_range[NR].raw_max -= TEMPDIR(NR) * (OVERSAMPLENR); \
|
temp_range[NR].raw_max -= TEMPDIR(NR) * (OVERSAMPLENR); \
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#define REVERSE_TEMP_SENSOR_RANGE_1010 1
|
||||||
|
|
||||||
// Pt1000 with 1k0 pullup
|
// Pt1000 with 1k0 pullup
|
||||||
const temp_entry_t temptable_1010[] PROGMEM = {
|
const temp_entry_t temptable_1010[] PROGMEM = {
|
||||||
PtLine( 0, 1000, 1000),
|
PtLine( 0, 1000, 1000),
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#define REVERSE_TEMP_SENSOR_RANGE_1047 1
|
||||||
|
|
||||||
// Pt1000 with 4k7 pullup
|
// Pt1000 with 4k7 pullup
|
||||||
const temp_entry_t temptable_1047[] PROGMEM = {
|
const temp_entry_t temptable_1047[] PROGMEM = {
|
||||||
// only a few values are needed as the curve is very flat
|
// only a few values are needed as the curve is very flat
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#define REVERSE_TEMP_SENSOR_RANGE_110 1
|
||||||
|
|
||||||
// Pt100 with 1k0 pullup
|
// Pt100 with 1k0 pullup
|
||||||
const temp_entry_t temptable_110[] PROGMEM = {
|
const temp_entry_t temptable_110[] PROGMEM = {
|
||||||
// only a few values are needed as the curve is very flat
|
// only a few values are needed as the curve is very flat
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#define REVERSE_TEMP_SENSOR_RANGE_147 1
|
||||||
|
|
||||||
// Pt100 with 4k7 pullup
|
// Pt100 with 4k7 pullup
|
||||||
const temp_entry_t temptable_147[] PROGMEM = {
|
const temp_entry_t temptable_147[] PROGMEM = {
|
||||||
// only a few values are needed as the curve is very flat
|
// only a few values are needed as the curve is very flat
|
||||||
|
|
Reference in a new issue