From 7613383e7b5d3c71ad18e4ee9823d353403d01c2 Mon Sep 17 00:00:00 2001
From: Axel <ansepulveda@uc.cl>
Date: Sat, 2 May 2020 19:45:54 -0400
Subject: [PATCH] Add Rostock 301 thermistors (22, 23) (#17806)

---
 Marlin/Configuration.h                       |   2 +
 Marlin/src/module/thermistor/thermistor_22.h |  72 +++++++++++
 Marlin/src/module/thermistor/thermistor_23.h | 128 +++++++++++++++++++
 Marlin/src/module/thermistor/thermistors.h   |   6 +
 4 files changed, 208 insertions(+)
 create mode 100644 Marlin/src/module/thermistor/thermistor_22.h
 create mode 100644 Marlin/src/module/thermistor/thermistor_23.h

diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index 9564cad8a4..de61230a6f 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -387,6 +387,8 @@
  *    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....)
+ *    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
  *    60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
  *    61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup
diff --git a/Marlin/src/module/thermistor/thermistor_22.h b/Marlin/src/module/thermistor/thermistor_22.h
new file mode 100644
index 0000000000..b3ef68a47e
--- /dev/null
+++ b/Marlin/src/module/thermistor/thermistor_22.h
@@ -0,0 +1,72 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+// 100k hotend thermistor with 4.7k pull up to 3.3v and 220R to analog input as in GTM32 Pro vB
+const short temptable_22[][2] PROGMEM = {
+  { OV(   1), 352 },
+  { OV(   6), 341 },
+  { OV(  11), 330 },
+  { OV(  16), 319 },
+  { OV(  20), 307 },
+  { OV(  26), 296 },
+  { OV(  31), 285 },
+  { OV(  40), 274 },
+  { OV(  51), 263 },
+  { OV(  61), 251 },
+  { OV(  72), 245 },
+  { OV(  77), 240 },
+  { OV(  82), 237 },
+  { OV(  87), 232 },
+  { OV(  91), 229 },
+  { OV(  94), 227 },
+  { OV(  97), 225 },
+  { OV( 100), 223 },
+  { OV( 104), 221 },
+  { OV( 108), 219 },
+  { OV( 115), 214 },
+  { OV( 126), 209 },
+  { OV( 137), 204 },
+  { OV( 147), 200 },
+  { OV( 158), 193 },
+  { OV( 167), 192 },
+  { OV( 177), 189 },
+  { OV( 197), 163 },
+  { OV( 230), 174 },
+  { OV( 267), 165 },
+  { OV( 310), 158 },
+  { OV( 336), 151 },
+  { OV( 379), 143 },
+  { OV( 413), 138 },
+  { OV( 480), 127 },
+  { OV( 580), 110 },
+  { OV( 646), 100 },
+  { OV( 731),  88 },
+  { OV( 768),  84 },
+  { OV( 861),  69 },
+  { OV( 935),  50 },
+  { OV( 975),  38 },
+  { OV(1001),  27 },
+  { OV(1011),  22 },
+  { OV(1015),  13 },
+  { OV(1020),   6 },
+  { OV(1023),   0 }
+};
diff --git a/Marlin/src/module/thermistor/thermistor_23.h b/Marlin/src/module/thermistor/thermistor_23.h
new file mode 100644
index 0000000000..46c025d21a
--- /dev/null
+++ b/Marlin/src/module/thermistor/thermistor_23.h
@@ -0,0 +1,128 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+// 100k hotbed thermistor with 4.7k pull up to 3.3v and 220R to analog input as in GTM32 Pro vB
+const short temptable_23[][2] PROGMEM = {
+  { OV(   1), 938 },
+  { OV(  11), 423 },
+  { OV(  21), 351 },
+  { OV(  31), 314 },
+  { OV(  41), 290 },
+  { OV(  51), 272 },
+  { OV(  61), 258 },
+  { OV(  71), 247 },
+  { OV(  81), 237 },
+  { OV(  91), 229 },
+  { OV( 101), 221 },
+  { OV( 111), 215 },
+  { OV( 121), 209 },
+  { OV( 131), 204 },
+  { OV( 141), 199 },
+  { OV( 151), 195 },
+  { OV( 161), 190 },
+  { OV( 171), 187 },
+  { OV( 181), 183 },
+  { OV( 191), 179 },
+  { OV( 201), 176 },
+  { OV( 211), 173 },
+  { OV( 221), 170 },
+  { OV( 231), 167 },
+  { OV( 241), 165 },
+  { OV( 251), 162 },
+  { OV( 261), 160 },
+  { OV( 271), 157 },
+  { OV( 281), 155 },
+  { OV( 291), 153 },
+  { OV( 301), 150 },
+  { OV( 311), 148 },
+  { OV( 321), 146 },
+  { OV( 331), 144 },
+  { OV( 341), 142 },
+  { OV( 351), 140 },
+  { OV( 361), 139 },
+  { OV( 371), 137 },
+  { OV( 381), 135 },
+  { OV( 391), 133 },
+  { OV( 401), 131 },
+  { OV( 411), 130 },
+  { OV( 421), 128 },
+  { OV( 431), 126 },
+  { OV( 441), 125 },
+  { OV( 451), 123 },
+  { OV( 461), 122 },
+  { OV( 471), 120 },
+  { OV( 481), 119 },
+  { OV( 491), 117 },
+  { OV( 501), 116 },
+  { OV( 511), 114 },
+  { OV( 521), 113 },
+  { OV( 531), 111 },
+  { OV( 541), 110 },
+  { OV( 551), 108 },
+  { OV( 561), 107 },
+  { OV( 571), 105 },
+  { OV( 581), 104 },
+  { OV( 591), 102 },
+  { OV( 601), 101 },
+  { OV( 611), 100 },
+  { OV( 621),  98 },
+  { OV( 631),  97 },
+  { OV( 641),  95 },
+  { OV( 651),  94 },
+  { OV( 661),  92 },
+  { OV( 671),  91 },
+  { OV( 681),  90 },
+  { OV( 691),  88 },
+  { OV( 701),  87 },
+  { OV( 711),  85 },
+  { OV( 721),  84 },
+  { OV( 731),  82 },
+  { OV( 741),  81 },
+  { OV( 751),  79 },
+  { OV( 761),  77 },
+  { OV( 771),  76 },
+  { OV( 781),  74 },
+  { OV( 791),  72 },
+  { OV( 801),  71 },
+  { OV( 811),  69 },
+  { OV( 821),  67 },
+  { OV( 831),  65 },
+  { OV( 841),  63 },
+  { OV( 851),  62 },
+  { OV( 861),  60 },
+  { OV( 871),  57 },
+  { OV( 881),  55 },
+  { OV( 891),  53 },
+  { OV( 901),  51 },
+  { OV( 911),  48 },
+  { OV( 921),  45 },
+  { OV( 931),  42 },
+  { OV( 941),  39 },
+  { OV( 951),  36 },
+  { OV( 961),  32 },
+  { OV( 971),  28 },
+  { OV( 981),  25 },
+  { OV( 991),  23 },
+  { OV(1001),  21 },
+  { OV(1011),  19 },
+  { OV(1021),   5 }
+};
diff --git a/Marlin/src/module/thermistor/thermistors.h b/Marlin/src/module/thermistor/thermistors.h
index 032386c2bd..b66e30b5cc 100644
--- a/Marlin/src/module/thermistor/thermistors.h
+++ b/Marlin/src/module/thermistor/thermistors.h
@@ -109,6 +109,12 @@
 #if ANY_THERMISTOR_IS(21) // Pt100 with INA826 amp with 3.3v excitation based on "Pt100 with INA826 amp on Ultimaker v2.0 electronics"
   #include "thermistor_21.h"
 #endif
+#if ANY_THERMISTOR_IS(22) // Thermistor in a Rostock 301 hot end, calibrated with a multimeter
+  #include "thermistor_22.h"  
+#endif
+#if ANY_THERMISTOR_IS(23) // By AluOne #12622. Formerly 22 above. May need calibration/checking.
+  #include "thermistor_23.h"
+#endif
 #if ANY_THERMISTOR_IS(51) // beta25 = 4092 K, R25 = 100 kOhm, Pull-up = 1 kOhm, "EPCOS"
   #include "thermistor_51.h"
 #endif
-- 
GitLab