From 710abdf03e934e5aa85484a1eced7f953115a0f4 Mon Sep 17 00:00:00 2001 From: Till Date: Thu, 3 Sep 2020 13:24:36 +0200 Subject: [PATCH 1/6] Update thermistor_21.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed 5V to 3.3V table conversion. The conversion is leading to an erronous temperature reading, as for instance 1°C reading at room temperature. The 5V table provided in _ADC-counts_ is valid as long as the ADC reference voltage and the INA826 supply voltage are identical. The ADC is providing counts in relation to his reference voltage and the INA826 does the very same in the analog domain. Validated with 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. --- Marlin/src/module/thermistor/thermistor_21.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Marlin/src/module/thermistor/thermistor_21.h b/Marlin/src/module/thermistor/thermistor_21.h index cd867df291..65bc17b3a5 100644 --- a/Marlin/src/module/thermistor/thermistor_21.h +++ b/Marlin/src/module/thermistor/thermistor_21.h @@ -23,10 +23,10 @@ #define REVERSE_TEMP_SENSOR_RANGE_21 1 -#undef OV_SCALE -#define OV_SCALE(N) (float((N) * 5) / 3.3f) - -// Pt100 with INA826 amp with 3.3v excitation based on "Pt100 with INA826 amp on Ultimaker v2.0 electronics" +// Pt100 with INA826 amp with 3.3V excitation based on "Pt100 with INA826 amp on Ultimaker v2.0 electronics" +// As the uC ADC reference voltage is 3.3V as well as the INA826 supply/reference, the same table as for 5V excitation is valid. +// The ADC is referring his counts to the reference voltage as the IN826 opamp does scale the output voltage to the supply voltage in the analog domain. +// Note, that the quantization error of this table in conjunction with rounding of the temperature reading can result in a few degrees error most noticeable between datapoints, e.g. 25°C, 35°C, etc. const temp_entry_t temptable_21[] PROGMEM = { { OV( 0), 0 }, { OV(227), 1 }, @@ -73,5 +73,3 @@ const temp_entry_t temptable_21[] PROGMEM = { { OV(614), 500 } }; -#undef OV_SCALE -#define OV_SCALE(N) (N) From 0033187a6e53961c654b39eb844955c72d815ad0 Mon Sep 17 00:00:00 2001 From: Till Date: Thu, 3 Sep 2020 13:49:37 +0200 Subject: [PATCH 2/6] Update Configuration.h added temp_sensor_0 21 for integration test --- Marlin/Configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 8cd2faf7f8..2af9d820ed 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -416,7 +416,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. */ -#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_0 21 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 From 8e722accecefc80cb3144fabbc0672fb93734d7b Mon Sep 17 00:00:00 2001 From: Till Date: Thu, 3 Sep 2020 15:44:30 +0200 Subject: [PATCH 3/6] Update Configuration.h changed back for PR --- Marlin/Configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 2af9d820ed..8cd2faf7f8 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -416,7 +416,7 @@ * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. */ -#define TEMP_SENSOR_0 21 +#define TEMP_SENSOR_0 1 #define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 From 5b7c353a22795601bbccfdce5daea12a0b057d74 Mon Sep 17 00:00:00 2001 From: Till Date: Sat, 12 Sep 2020 02:22:22 +0200 Subject: [PATCH 4/6] Update Configuration.h updated description for temperature probe 20 and 21 --- Marlin/Configuration.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 8cd2faf7f8..201f5927ac 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -386,8 +386,8 @@ * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" * 15 : 100k thermistor calibration for JGAurora A5 hotend * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 - * 20 : Pt100 with circuit in the Ultimainboard V2.x with 5v excitation (AVR) - * 21 : Pt100 with circuit in the Ultimainboard V2.x with 3.3v excitation (STM32 \ LPC176x....) +* 20 : Pt100 with circuit in the Ultimainboard V2.x with mainboard ADC reference voltage = INA826 amplifier-board supply voltage (notes: 1) Must use an ADC input without a pull up resistor. 2) Some INA826 amplifiers do not operate properly at 3.3V. In this case consider using thermal tables 147 [PT100, 4.7K pullup, no amplifier], 110 [PT100, 1K pullup, no amplifier], or 21 [PT100, no pullup, 5V powered amplifier]) +* 21 : Pt100 with circuit in the Ultimainboard V2.x with 3.3v ADC reference voltage (STM32, LPC176x....) and 5V INA826 amplifier board supply. (note: ADC pins are not 5V tolerant. Not recomended as there is a small chance of damaging the CPU by going beyond 500°C.) * 22 : 100k (hotend) with 4.7k pullup to 3.3V and 220R to analog input (as in GTM32 Pro vB) * 23 : 100k (bed) with 4.7k pullup to 3.3v and 220R to analog input (as in GTM32 Pro vB) * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x From e59d9f073bd2299134c234669faa48c386c45995 Mon Sep 17 00:00:00 2001 From: Till Date: Sat, 12 Sep 2020 02:27:49 +0200 Subject: [PATCH 5/6] Update thermistor_21.h reverted back to original code and added additional comment on intended usecase for this probe (5V INA826 supply, 3v3 ADC ref on mainboard) --- Marlin/src/module/thermistor/thermistor_21.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Marlin/src/module/thermistor/thermistor_21.h b/Marlin/src/module/thermistor/thermistor_21.h index 65bc17b3a5..943cb484c5 100644 --- a/Marlin/src/module/thermistor/thermistor_21.h +++ b/Marlin/src/module/thermistor/thermistor_21.h @@ -23,10 +23,11 @@ #define REVERSE_TEMP_SENSOR_RANGE_21 1 -// Pt100 with INA826 amp with 3.3V excitation based on "Pt100 with INA826 amp on Ultimaker v2.0 electronics" -// As the uC ADC reference voltage is 3.3V as well as the INA826 supply/reference, the same table as for 5V excitation is valid. -// The ADC is referring his counts to the reference voltage as the IN826 opamp does scale the output voltage to the supply voltage in the analog domain. -// Note, that the quantization error of this table in conjunction with rounding of the temperature reading can result in a few degrees error most noticeable between datapoints, e.g. 25°C, 35°C, etc. +#undef OV_SCALE +#define OV_SCALE(N) (float((N) * 5) / 3.3f) + +// Pt100 with INA826 amplifier board with 5v supply based on "Pt100 with INA826 amp on Ultimaker v2.0 electronics" with 3v3 ADC reference on the mainboard +// If the ADC reference and INA826 board supply voltage are identical, use senosr no. 20 instead. const temp_entry_t temptable_21[] PROGMEM = { { OV( 0), 0 }, { OV(227), 1 }, @@ -73,3 +74,5 @@ const temp_entry_t temptable_21[] PROGMEM = { { OV(614), 500 } }; +#undef OV_SCALE +#define OV_SCALE(N) (N) From b6c626ae67996a84480fbcd6dcc9026effd5dd8c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 5 Oct 2020 17:34:50 -0500 Subject: [PATCH 6/6] Update Configuration.h --- Marlin/Configuration.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 201f5927ac..b8e2dbcc3e 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -386,8 +386,8 @@ * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" * 15 : 100k thermistor calibration for JGAurora A5 hotend * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 -* 20 : Pt100 with circuit in the Ultimainboard V2.x with mainboard ADC reference voltage = INA826 amplifier-board supply voltage (notes: 1) Must use an ADC input without a pull up resistor. 2) Some INA826 amplifiers do not operate properly at 3.3V. In this case consider using thermal tables 147 [PT100, 4.7K pullup, no amplifier], 110 [PT100, 1K pullup, no amplifier], or 21 [PT100, no pullup, 5V powered amplifier]) -* 21 : Pt100 with circuit in the Ultimainboard V2.x with 3.3v ADC reference voltage (STM32, LPC176x....) and 5V INA826 amplifier board supply. (note: ADC pins are not 5V tolerant. Not recomended as there is a small chance of damaging the CPU by going beyond 500°C.) + * 20 : Pt100 with circuit in the Ultimainboard V2.x with mainboard ADC reference voltage = INA826 amplifier-board supply voltage. NOTES: 1. Must use an ADC input without a pullup resistor. 2. Some INA826 amplifiers are unreliable at 3.3V so consider using sensor 147, 110, or 21. + * 21 : Pt100 with circuit in the Ultimainboard V2.x with 3.3v ADC reference voltage (STM32, LPC176x....) and 5V INA826 amplifier board supply. NOTE: ADC pins are not 5V tolerant. Not recommended because it's possible to damage the CPU by going over 500°C. * 22 : 100k (hotend) with 4.7k pullup to 3.3V and 220R to analog input (as in GTM32 Pro vB) * 23 : 100k (bed) with 4.7k pullup to 3.3v and 220R to analog input (as in GTM32 Pro vB) * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x