Browse Source

🔧 Thermistor (66) sanity-check (#24803)

Keith Bennett 1 year ago
parent
commit
11f8244573
No account linked to committer's email address

+ 1
- 1
Marlin/Configuration.h View File

@@ -496,7 +496,7 @@
496 496
  *    30 : 100kΩ  Kis3d Silicone heating mat 200W/300W with 6mm precision cast plate (EN AW 5083) NTC100K - beta 3950
497 497
  *    60 : 100kΩ  Maker's Tool Works Kapton Bed Thermistor - beta 3950
498 498
  *    61 : 100kΩ  Formbot/Vivedino 350°C Thermistor - beta 3950
499
- *    66 : 4.7MΩ  Dyze Design High Temperature Thermistor
499
+ *    66 : 4.7MΩ  Dyze Design / Trianglelab T-D500 500°C High Temperature Thermistor
500 500
  *    67 : 500kΩ  SliceEngineering 450°C Thermistor
501 501
  *    68 : PT100 amplifier board from Dyze Design
502 502
  *    70 : 100kΩ  bq Hephestos 2

+ 3
- 2
Marlin/src/core/macros.h View File

@@ -738,6 +738,7 @@
738 738
 #define MAPLIST(OP,V...) EVAL(_MAPLIST(OP,V))
739 739
 
740 740
 // Temperature Sensor Config
741
-#define _HAS_E_TEMP(N) || (TEMP_SENSOR_##N != 0)
741
+#define TEMP_SENSOR(N) TEMP_SENSOR_##N
742
+#define _HAS_E_TEMP(N) || TEMP_SENSOR(N)
742 743
 #define HAS_E_TEMP_SENSOR (0 REPEAT(EXTRUDERS, _HAS_E_TEMP))
743
-#define TEMP_SENSOR_IS_MAX_TC(T) (TEMP_SENSOR_##T == -5 || TEMP_SENSOR_##T == -3 || TEMP_SENSOR_##T == -2)
744
+#define TEMP_SENSOR_IS_MAX_TC(T) (TEMP_SENSOR(T) == -5 || TEMP_SENSOR(T) == -3 || TEMP_SENSOR(T) == -2)

+ 3
- 2
Marlin/src/inc/Conditionals_adv.h View File

@@ -161,9 +161,10 @@
161 161
 #define HID_E6         6
162 162
 #define HID_E7         7
163 163
 
164
-#define _SENSOR_IS(I,N) || (TEMP_SENSOR_##N == I)
164
+#define _SENSOR_IS(I,N) || (TEMP_SENSOR(N) == I)
165 165
 #define _E_SENSOR_IS(I,N) _SENSOR_IS(N,I)
166
-#define ANY_THERMISTOR_IS(N) (0 REPEAT2(HOTENDS, _E_SENSOR_IS, N) \
166
+#define ANY_E_SENSOR_IS(N) (0 REPEAT2(HOTENDS, _E_SENSOR_IS, N))
167
+#define ANY_THERMISTOR_IS(N) ( ANY_E_SENSOR_IS(N) \
167 168
   _SENSOR_IS(N,BED) _SENSOR_IS(N,PROBE) _SENSOR_IS(N,CHAMBER) \
168 169
   _SENSOR_IS(N,COOLER) _SENSOR_IS(N,BOARD) _SENSOR_IS(N,REDUNDANT) )
169 170
 

+ 1
- 1
Marlin/src/inc/Conditionals_post.h View File

@@ -2656,7 +2656,7 @@
2656 2656
 //
2657 2657
 // ADC Temp Sensors (Thermistor or Thermocouple with amplifier ADC interface)
2658 2658
 //
2659
-#define HAS_ADC_TEST(P) (PIN_EXISTS(TEMP_##P) && TEMP_SENSOR_##P != 0 && !TEMP_SENSOR_IS_MAX_TC(P) && !TEMP_SENSOR_##P##_IS_DUMMY)
2659
+#define HAS_ADC_TEST(P) (TEMP_SENSOR(P) && PIN_EXISTS(TEMP_##P) && !TEMP_SENSOR_IS_MAX_TC(P) && !TEMP_SENSOR_##P##_IS_DUMMY)
2660 2660
 #if HOTENDS > 0 && HAS_ADC_TEST(0)
2661 2661
   #define HAS_TEMP_ADC_0 1
2662 2662
 #endif

+ 31
- 0
Marlin/src/inc/SanityCheck.h View File

@@ -2273,6 +2273,37 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
2273 2273
 #endif
2274 2274
 
2275 2275
 /**
2276
+ * Required thermistor 66 (Dyze Design / Trianglelab T-D500) settings
2277
+ * https://docs.dyzedesign.com/hotends.html#_500-%C2%B0c-thermistor
2278
+ */
2279
+#if ANY_E_SENSOR_IS(66)
2280
+  #define _BAD_MINTEMP(N) (TEMP_SENSOR(N) == 66 && HEATER_##N##_MINTEMP <= 20)
2281
+  #if _BAD_MINTEMP(0)
2282
+    #error "Thermistor 66 requires HEATER_0_MINTEMP > 20."
2283
+  #elif _BAD_MINTEMP(1)
2284
+    #error "Thermistor 66 requires HEATER_1_MINTEMP > 20."
2285
+  #elif _BAD_MINTEMP(2)
2286
+    #error "Thermistor 66 requires HEATER_2_MINTEMP > 20."
2287
+  #elif _BAD_MINTEMP(3)
2288
+    #error "Thermistor 66 requires HEATER_3_MINTEMP > 20."
2289
+  #elif _BAD_MINTEMP(4)
2290
+    #error "Thermistor 66 requires HEATER_4_MINTEMP > 20."
2291
+  #elif _BAD_MINTEMP(5)
2292
+    #error "Thermistor 66 requires HEATER_5_MINTEMP > 20."
2293
+  #elif _BAD_MINTEMP(6)
2294
+    #error "Thermistor 66 requires HEATER_6_MINTEMP > 20."
2295
+  #elif _BAD_MINTEMP(7)
2296
+    #error "Thermistor 66 requires HEATER_7_MINTEMP > 20."
2297
+  #endif
2298
+  #if MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED < 5
2299
+    #error "Thermistor 66 requires MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED ≥ 5."
2300
+  #elif MILLISECONDS_PREHEAT_TIME < 30000
2301
+    #error "Thermistor 66 requires MILLISECONDS_PREHEAT_TIME ≥ 30000."
2302
+  #endif
2303
+  #undef _BAD_MINTEMP
2304
+#endif
2305
+
2306
+/**
2276 2307
  * Required MAX31865 settings
2277 2308
  */
2278 2309
 #if TEMP_SENSOR_0_IS_MAX31865 || (TEMP_SENSOR_REDUNDANT_IS_MAX31865 && REDUNDANT_TEMP_MATCH(SOURCE, E0))

+ 1
- 1
Marlin/src/lcd/thermistornames.h View File

@@ -141,7 +141,7 @@
141 141
 #elif THERMISTOR_ID == 61
142 142
   #define THERMISTOR_NAME "Formbot 350°C"
143 143
 #elif THERMISTOR_ID == 66
144
-  #define THERMISTOR_NAME "Dyze 4.7M"
144
+  #define THERMISTOR_NAME "Dyze / TL 4.7M"
145 145
 #elif THERMISTOR_ID == 67
146 146
   #define THERMISTOR_NAME "SliceEng 450°C"
147 147
 

+ 1
- 1
Marlin/src/module/temperature.cpp View File

@@ -2649,7 +2649,7 @@ void Temperature::init() {
2649 2649
         temp_range[NR].raw_max -= TEMPDIR(NR) * (OVERSAMPLENR); \
2650 2650
     }while(0)
2651 2651
 
2652
-    #define _MINMAX_TEST(N,M) (HOTENDS > N && TEMP_SENSOR_##N > 0 && TEMP_SENSOR_##N != 998 && TEMP_SENSOR_##N != 999 && defined(HEATER_##N##_##M##TEMP))
2652
+    #define _MINMAX_TEST(N,M) (HOTENDS > N && TEMP_SENSOR(N) > 0 && TEMP_SENSOR(N) != 998 && TEMP_SENSOR(N) != 999 && defined(HEATER_##N##_##M##TEMP))
2653 2653
 
2654 2654
     #if _MINMAX_TEST(0, MIN)
2655 2655
       _TEMP_MIN_E(0);

+ 1
- 1
Marlin/src/module/thermistor/thermistor_66.h View File

@@ -21,7 +21,7 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
-// R25 = 2.5 MOhm, beta25 = 4500 K, 4.7 kOhm pull-up, DyzeDesign 500 °C Thermistor
24
+// R25 = 2.5 MOhm, beta25 = 4500 K, 4.7 kOhm pull-up, DyzeDesign / Trianglelab T-D500 500 °C Thermistor
25 25
 constexpr temp_entry_t temptable_66[] PROGMEM = {
26 26
   { OV(  17.5), 850 },
27 27
   { OV(  17.9), 500 },

+ 1
- 1
Marlin/src/module/thermistor/thermistors.h View File

@@ -338,7 +338,7 @@ static_assert(255 > TEMPTABLE_0_LEN || 255 > TEMPTABLE_1_LEN || 255 > TEMPTABLE_
338 338
 // For thermocouples the highest temperature results in the highest ADC value
339 339
 
340 340
 #define _TT_REV(N)    REVERSE_TEMP_SENSOR_RANGE_##N
341
-#define TT_REV(N)     TERN0(TEMP_SENSOR_##N##_IS_THERMISTOR, DEFER4(_TT_REV)(TEMP_SENSOR_##N))
341
+#define TT_REV(N)     TERN0(TEMP_SENSOR_##N##_IS_THERMISTOR, DEFER4(_TT_REV)(TEMP_SENSOR(N)))
342 342
 #define _TT_REVRAW(N) !TEMP_SENSOR_##N##_IS_THERMISTOR
343 343
 #define TT_REVRAW(N)  (TT_REV(N) || _TT_REVRAW(N))
344 344
 

Loading…
Cancel
Save