Browse Source

(21) PT100 for MCUs with 3.3v logic (#16731)

Artur Petrzak 4 years ago
parent
commit
e4679c1b78
No account linked to committer's email address

+ 2
- 1
Marlin/Configuration.h View File

@@ -379,7 +379,8 @@
379 379
  *    13 : 100k Hisens 3950  1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
380 380
  *    15 : 100k thermistor calibration for JGAurora A5 hotend
381 381
  *    18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327
382
- *    20 : Pt100 with circuit in the Ultimainboard V2.x
382
+ *    20 : Pt100 with circuit in the Ultimainboard V2.x with 5v excitation (AVR)
383
+ *    21 : Pt100 with circuit in the Ultimainboard V2.x with 3.3v excitation (STM32 \ LPC176x....)
383 384
  *   201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x
384 385
  *    60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
385 386
  *    61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup

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

@@ -85,7 +85,9 @@
85 85
 #elif THERMISTOR_ID == 18
86 86
   #define THERMISTOR_NAME "ATC Semitec 204GT-2"
87 87
 #elif THERMISTOR_ID == 20
88
-  #define THERMISTOR_NAME "Pt100 UltiMB"
88
+  #define THERMISTOR_NAME "Pt100 UltiMB 5v"
89
+#elif THERMISTOR_ID == 21
90
+  #define THERMISTOR_NAME "Pt100 UltiMB 3.3v"
89 91
 #elif THERMISTOR_ID == 201
90 92
   #define THERMISTOR_NAME "Pt100 OverLord"
91 93
 #elif THERMISTOR_ID == 60

+ 77
- 0
Marlin/src/module/thermistor/thermistor_21.h View File

@@ -0,0 +1,77 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+#define REVERSE_TEMP_SENSOR_RANGE
25
+
26
+#undef OV_SCALE
27
+#define OV_SCALE(N) (float((N) * 5) / 3.3f)
28
+
29
+// Pt100 with INA826 amp with 3.3v excitation based on "Pt100 with INA826 amp on Ultimaker v2.0 electronics"
30
+const short temptable_21[][2] PROGMEM = {
31
+  { OV(  0),    0 },
32
+  { OV(227),    1 },
33
+  { OV(236),   10 },
34
+  { OV(245),   20 },
35
+  { OV(253),   30 },
36
+  { OV(262),   40 },
37
+  { OV(270),   50 },
38
+  { OV(279),   60 },
39
+  { OV(287),   70 },
40
+  { OV(295),   80 },
41
+  { OV(304),   90 },
42
+  { OV(312),  100 },
43
+  { OV(320),  110 },
44
+  { OV(329),  120 },
45
+  { OV(337),  130 },
46
+  { OV(345),  140 },
47
+  { OV(353),  150 },
48
+  { OV(361),  160 },
49
+  { OV(369),  170 },
50
+  { OV(377),  180 },
51
+  { OV(385),  190 },
52
+  { OV(393),  200 },
53
+  { OV(401),  210 },
54
+  { OV(409),  220 },
55
+  { OV(417),  230 },
56
+  { OV(424),  240 },
57
+  { OV(432),  250 },
58
+  { OV(440),  260 },
59
+  { OV(447),  270 },
60
+  { OV(455),  280 },
61
+  { OV(463),  290 },
62
+  { OV(470),  300 },
63
+  { OV(478),  310 },
64
+  { OV(485),  320 },
65
+  { OV(493),  330 },
66
+  { OV(500),  340 },
67
+  { OV(507),  350 },
68
+  { OV(515),  360 },
69
+  { OV(522),  370 },
70
+  { OV(529),  380 },
71
+  { OV(537),  390 },
72
+  { OV(544),  400 },
73
+  { OV(614),  500 }
74
+};
75
+
76
+#undef OV_SCALE
77
+#define OV_SCALE(N) (N)

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

@@ -37,7 +37,8 @@
37 37
   #error "MAX_RAW_THERMISTOR_VALUE is too large for int16_t. Reduce OVERSAMPLENR or HAL_ADC_RESOLUTION."
38 38
 #endif
39 39
 
40
-#define OV(N) int16_t((N) * (OVERSAMPLENR) * (THERMISTOR_TABLE_SCALE))
40
+#define OV_SCALE(N) (N)
41
+#define OV(N) int16_t(OV_SCALE(N) * (OVERSAMPLENR) * (THERMISTOR_TABLE_SCALE))
41 42
 
42 43
 #define ANY_THERMISTOR_IS(n) (THERMISTOR_HEATER_0 == n || THERMISTOR_HEATER_1 == n || THERMISTOR_HEATER_2 == n || THERMISTOR_HEATER_3 == n || THERMISTOR_HEATER_4 == n || THERMISTOR_HEATER_5 == n || THERMISTOR_HEATER_6 == n || THERMISTOR_HEATER_7 == n || THERMISTORBED == n || THERMISTORCHAMBER == n || THERMISTORPROBE == n)
43 44
 
@@ -105,6 +106,9 @@
105 106
 #if ANY_THERMISTOR_IS(20) // Pt100 with INA826 amp on Ultimaker v2.0 electronics
106 107
   #include "thermistor_20.h"
107 108
 #endif
109
+#if ANY_THERMISTOR_IS(21) // Pt100 with INA826 amp with 3.3v excitation based on "Pt100 with INA826 amp on Ultimaker v2.0 electronics"
110
+  #include "thermistor_21.h"
111
+#endif
108 112
 #if ANY_THERMISTOR_IS(51) // beta25 = 4092 K, R25 = 100 kOhm, Pull-up = 1 kOhm, "EPCOS"
109 113
   #include "thermistor_51.h"
110 114
 #endif

Loading…
Cancel
Save