Prusa3d Marlin fork
thermistortables.h
1 #ifndef THERMISTORTABLES_H_
2 #define THERMISTORTABLES_H_
3 
4 #include "Configuration_adv.h"
5 #include <avr/pgmspace.h>
6 
7 #define OVERSAMPLENR 16
8 
9 #if (THERMISTORHEATER_0 == 1) || (THERMISTORBED == 1) //100k bed thermistor
10 
11 const short temptable_1[][2] PROGMEM = {
12 { 23*OVERSAMPLENR , 300 },
13 { 25*OVERSAMPLENR , 295 },
14 { 27*OVERSAMPLENR , 290 },
15 { 28*OVERSAMPLENR , 285 },
16 { 31*OVERSAMPLENR , 280 },
17 { 33*OVERSAMPLENR , 275 },
18 { 35*OVERSAMPLENR , 270 },
19 { 38*OVERSAMPLENR , 265 },
20 { 41*OVERSAMPLENR , 260 },
21 { 44*OVERSAMPLENR , 255 },
22 { 48*OVERSAMPLENR , 250 },
23 { 52*OVERSAMPLENR , 245 },
24 { 56*OVERSAMPLENR , 240 },
25 { 61*OVERSAMPLENR , 235 },
26 { 66*OVERSAMPLENR , 230 },
27 { 71*OVERSAMPLENR , 225 },
28 { 78*OVERSAMPLENR , 220 },
29 { 84*OVERSAMPLENR , 215 },
30 { 92*OVERSAMPLENR , 210 },
31 { 100*OVERSAMPLENR , 205 },
32 { 109*OVERSAMPLENR , 200 },
33 { 120*OVERSAMPLENR , 195 },
34 { 131*OVERSAMPLENR , 190 },
35 { 143*OVERSAMPLENR , 185 },
36 { 156*OVERSAMPLENR , 180 },
37 { 171*OVERSAMPLENR , 175 },
38 { 187*OVERSAMPLENR , 170 },
39 { 205*OVERSAMPLENR , 165 },
40 { 224*OVERSAMPLENR , 160 },
41 { 245*OVERSAMPLENR , 155 },
42 { 268*OVERSAMPLENR , 150 },
43 { 293*OVERSAMPLENR , 145 },
44 { 320*OVERSAMPLENR , 140 },
45 { 348*OVERSAMPLENR , 135 },
46 { 379*OVERSAMPLENR , 130 },
47 { 411*OVERSAMPLENR , 125 },
48 { 445*OVERSAMPLENR , 120 },
49 { 480*OVERSAMPLENR , 115 },
50 { 516*OVERSAMPLENR , 110 },
51 { 553*OVERSAMPLENR , 105 },
52 { 591*OVERSAMPLENR , 100 },
53 { 628*OVERSAMPLENR , 95 },
54 { 665*OVERSAMPLENR , 90 },
55 { 702*OVERSAMPLENR , 85 },
56 { 737*OVERSAMPLENR , 80 },
57 { 770*OVERSAMPLENR , 75 },
58 { 801*OVERSAMPLENR , 70 },
59 { 830*OVERSAMPLENR , 65 },
60 { 857*OVERSAMPLENR , 60 },
61 { 881*OVERSAMPLENR , 55 },
62 { 903*OVERSAMPLENR , 50 },
63 { 922*OVERSAMPLENR , 45 },
64 { 939*OVERSAMPLENR , 40 },
65 { 954*OVERSAMPLENR , 35 },
66 { 966*OVERSAMPLENR , 30 },
67 { 977*OVERSAMPLENR , 25 },
68 { 985*OVERSAMPLENR , 20 },
69 { 993*OVERSAMPLENR , 15 },
70 { 999*OVERSAMPLENR , 10 },
71 { 1004*OVERSAMPLENR , 5 },
72 { 1008*OVERSAMPLENR , 0 } //safety
73 };
74 #endif
75 #if (THERMISTORHEATER_0 == 2) || (THERMISTORBED == 2) //200k bed thermistor
76 const short temptable_2[][2] PROGMEM = {
77 //200k ATC Semitec 204GT-2
78 //Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf
79 // Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance
80  {1*OVERSAMPLENR, 848},
81  {30*OVERSAMPLENR, 300}, //top rating 300C
82  {34*OVERSAMPLENR, 290},
83  {39*OVERSAMPLENR, 280},
84  {46*OVERSAMPLENR, 270},
85  {53*OVERSAMPLENR, 260},
86  {63*OVERSAMPLENR, 250},
87  {74*OVERSAMPLENR, 240},
88  {87*OVERSAMPLENR, 230},
89  {104*OVERSAMPLENR, 220},
90  {124*OVERSAMPLENR, 210},
91  {148*OVERSAMPLENR, 200},
92  {176*OVERSAMPLENR, 190},
93  {211*OVERSAMPLENR, 180},
94  {252*OVERSAMPLENR, 170},
95  {301*OVERSAMPLENR, 160},
96  {357*OVERSAMPLENR, 150},
97  {420*OVERSAMPLENR, 140},
98  {489*OVERSAMPLENR, 130},
99  {562*OVERSAMPLENR, 120},
100  {636*OVERSAMPLENR, 110},
101  {708*OVERSAMPLENR, 100},
102  {775*OVERSAMPLENR, 90},
103  {835*OVERSAMPLENR, 80},
104  {884*OVERSAMPLENR, 70},
105  {924*OVERSAMPLENR, 60},
106  {955*OVERSAMPLENR, 50},
107  {977*OVERSAMPLENR, 40},
108  {993*OVERSAMPLENR, 30},
109  {1004*OVERSAMPLENR, 20},
110  {1012*OVERSAMPLENR, 10},
111  {1016*OVERSAMPLENR, 0},
112 };
113 
114 #endif
115 #if (THERMISTORHEATER_0 == 3) || (THERMISTORBED == 3) //mendel-parts
116 const short temptable_3[][2] PROGMEM = {
117  {1*OVERSAMPLENR,864},
118  {21*OVERSAMPLENR,300},
119  {25*OVERSAMPLENR,290},
120  {29*OVERSAMPLENR,280},
121  {33*OVERSAMPLENR,270},
122  {39*OVERSAMPLENR,260},
123  {46*OVERSAMPLENR,250},
124  {54*OVERSAMPLENR,240},
125  {64*OVERSAMPLENR,230},
126  {75*OVERSAMPLENR,220},
127  {90*OVERSAMPLENR,210},
128  {107*OVERSAMPLENR,200},
129  {128*OVERSAMPLENR,190},
130  {154*OVERSAMPLENR,180},
131  {184*OVERSAMPLENR,170},
132  {221*OVERSAMPLENR,160},
133  {265*OVERSAMPLENR,150},
134  {316*OVERSAMPLENR,140},
135  {375*OVERSAMPLENR,130},
136  {441*OVERSAMPLENR,120},
137  {513*OVERSAMPLENR,110},
138  {588*OVERSAMPLENR,100},
139  {734*OVERSAMPLENR,80},
140  {856*OVERSAMPLENR,60},
141  {938*OVERSAMPLENR,40},
142  {986*OVERSAMPLENR,20},
143  {1008*OVERSAMPLENR,0},
144  {1018*OVERSAMPLENR,-20}
145  };
146 
147 #endif
148 #if (THERMISTORHEATER_0 == 4) || (THERMISTORBED == 4) //10k thermistor
149 const short temptable_4[][2] PROGMEM = {
150  {1*OVERSAMPLENR, 430},
151  {54*OVERSAMPLENR, 137},
152  {107*OVERSAMPLENR, 107},
153  {160*OVERSAMPLENR, 91},
154  {213*OVERSAMPLENR, 80},
155  {266*OVERSAMPLENR, 71},
156  {319*OVERSAMPLENR, 64},
157  {372*OVERSAMPLENR, 57},
158  {425*OVERSAMPLENR, 51},
159  {478*OVERSAMPLENR, 46},
160  {531*OVERSAMPLENR, 41},
161  {584*OVERSAMPLENR, 35},
162  {637*OVERSAMPLENR, 30},
163  {690*OVERSAMPLENR, 25},
164  {743*OVERSAMPLENR, 20},
165  {796*OVERSAMPLENR, 14},
166  {849*OVERSAMPLENR, 7},
167  {902*OVERSAMPLENR, 0},
168  {955*OVERSAMPLENR, -11},
169  {1008*OVERSAMPLENR, -35}
170 };
171 #endif
172 
173 #if (THERMISTORHEATER_0 == 5) || (THERMISTORBED == 5) //100k ParCan thermistor (104GT-2)
174 const short temptable_5[][2] PROGMEM = {
175 // ATC Semitec 104GT-2 (Used in ParCan)
176 // Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf
177 // Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance
178  {1*OVERSAMPLENR, 713},
179  {17*OVERSAMPLENR, 300}, //top rating 300C
180  {20*OVERSAMPLENR, 290},
181  {23*OVERSAMPLENR, 280},
182  {27*OVERSAMPLENR, 270},
183  {31*OVERSAMPLENR, 260},
184  {37*OVERSAMPLENR, 250},
185  {43*OVERSAMPLENR, 240},
186  {51*OVERSAMPLENR, 230},
187  {61*OVERSAMPLENR, 220},
188  {73*OVERSAMPLENR, 210},
189  {87*OVERSAMPLENR, 200},
190  {106*OVERSAMPLENR, 190},
191  {128*OVERSAMPLENR, 180},
192  {155*OVERSAMPLENR, 170},
193  {189*OVERSAMPLENR, 160},
194  {230*OVERSAMPLENR, 150},
195  {278*OVERSAMPLENR, 140},
196  {336*OVERSAMPLENR, 130},
197  {402*OVERSAMPLENR, 120},
198  {476*OVERSAMPLENR, 110},
199  {554*OVERSAMPLENR, 100},
200  {635*OVERSAMPLENR, 90},
201  {713*OVERSAMPLENR, 80},
202  {784*OVERSAMPLENR, 70},
203  {846*OVERSAMPLENR, 60},
204  {897*OVERSAMPLENR, 50},
205  {937*OVERSAMPLENR, 40},
206  {966*OVERSAMPLENR, 30},
207  {986*OVERSAMPLENR, 20},
208  {1000*OVERSAMPLENR, 10},
209  {1010*OVERSAMPLENR, 0}
210 };
211 #endif
212 
213 #if (THERMISTORHEATER_0 == 6) || (THERMISTORBED == 6) // 100k Epcos thermistor
214 const short temptable_6[][2] PROGMEM = {
215  {1*OVERSAMPLENR, 350},
216  {28*OVERSAMPLENR, 250}, //top rating 250C
217  {31*OVERSAMPLENR, 245},
218  {35*OVERSAMPLENR, 240},
219  {39*OVERSAMPLENR, 235},
220  {42*OVERSAMPLENR, 230},
221  {44*OVERSAMPLENR, 225},
222  {49*OVERSAMPLENR, 220},
223  {53*OVERSAMPLENR, 215},
224  {62*OVERSAMPLENR, 210},
225  {71*OVERSAMPLENR, 205}, //fitted graphically
226  {78*OVERSAMPLENR, 200}, //fitted graphically
227  {94*OVERSAMPLENR, 190},
228  {102*OVERSAMPLENR, 185},
229  {116*OVERSAMPLENR, 170},
230  {143*OVERSAMPLENR, 160},
231  {183*OVERSAMPLENR, 150},
232  {223*OVERSAMPLENR, 140},
233  {270*OVERSAMPLENR, 130},
234  {318*OVERSAMPLENR, 120},
235  {383*OVERSAMPLENR, 110},
236  {413*OVERSAMPLENR, 105},
237  {439*OVERSAMPLENR, 100},
238  {484*OVERSAMPLENR, 95},
239  {513*OVERSAMPLENR, 90},
240  {607*OVERSAMPLENR, 80},
241  {664*OVERSAMPLENR, 70},
242  {781*OVERSAMPLENR, 60},
243  {810*OVERSAMPLENR, 55},
244  {849*OVERSAMPLENR, 50},
245  {914*OVERSAMPLENR, 45},
246  {914*OVERSAMPLENR, 40},
247  {935*OVERSAMPLENR, 35},
248  {954*OVERSAMPLENR, 30},
249  {970*OVERSAMPLENR, 25},
250  {978*OVERSAMPLENR, 22},
251  {1008*OVERSAMPLENR, 3},
252  {1023*OVERSAMPLENR, 0} //to allow internal 0 degrees C
253 };
254 #endif
255 
256 #if (THERMISTORHEATER_0 == 7) || (THERMISTORBED == 7) // 100k Honeywell 135-104LAG-J01
257 const short temptable_7[][2] PROGMEM = {
258  {1*OVERSAMPLENR, 941},
259  {19*OVERSAMPLENR, 362},
260  {37*OVERSAMPLENR, 299}, //top rating 300C
261  {55*OVERSAMPLENR, 266},
262  {73*OVERSAMPLENR, 245},
263  {91*OVERSAMPLENR, 229},
264  {109*OVERSAMPLENR, 216},
265  {127*OVERSAMPLENR, 206},
266  {145*OVERSAMPLENR, 197},
267  {163*OVERSAMPLENR, 190},
268  {181*OVERSAMPLENR, 183},
269  {199*OVERSAMPLENR, 177},
270  {217*OVERSAMPLENR, 171},
271  {235*OVERSAMPLENR, 166},
272  {253*OVERSAMPLENR, 162},
273  {271*OVERSAMPLENR, 157},
274  {289*OVERSAMPLENR, 153},
275  {307*OVERSAMPLENR, 149},
276  {325*OVERSAMPLENR, 146},
277  {343*OVERSAMPLENR, 142},
278  {361*OVERSAMPLENR, 139},
279  {379*OVERSAMPLENR, 135},
280  {397*OVERSAMPLENR, 132},
281  {415*OVERSAMPLENR, 129},
282  {433*OVERSAMPLENR, 126},
283  {451*OVERSAMPLENR, 123},
284  {469*OVERSAMPLENR, 121},
285  {487*OVERSAMPLENR, 118},
286  {505*OVERSAMPLENR, 115},
287  {523*OVERSAMPLENR, 112},
288  {541*OVERSAMPLENR, 110},
289  {559*OVERSAMPLENR, 107},
290  {577*OVERSAMPLENR, 105},
291  {595*OVERSAMPLENR, 102},
292  {613*OVERSAMPLENR, 99},
293  {631*OVERSAMPLENR, 97},
294  {649*OVERSAMPLENR, 94},
295  {667*OVERSAMPLENR, 92},
296  {685*OVERSAMPLENR, 89},
297  {703*OVERSAMPLENR, 86},
298  {721*OVERSAMPLENR, 84},
299  {739*OVERSAMPLENR, 81},
300  {757*OVERSAMPLENR, 78},
301  {775*OVERSAMPLENR, 75},
302  {793*OVERSAMPLENR, 72},
303  {811*OVERSAMPLENR, 69},
304  {829*OVERSAMPLENR, 66},
305  {847*OVERSAMPLENR, 62},
306  {865*OVERSAMPLENR, 59},
307  {883*OVERSAMPLENR, 55},
308  {901*OVERSAMPLENR, 51},
309  {919*OVERSAMPLENR, 46},
310  {937*OVERSAMPLENR, 41},
311  {955*OVERSAMPLENR, 35},
312  {973*OVERSAMPLENR, 27},
313  {991*OVERSAMPLENR, 17},
314  {1009*OVERSAMPLENR, 1},
315  {1023*OVERSAMPLENR, 0} //to allow internal 0 degrees C
316 };
317 #endif
318 
319 #if (THERMISTORHEATER_0 == 71) || (THERMISTORBED == 71) // 100k Honeywell 135-104LAF-J01
320 // R0 = 100000 Ohm
321 // T0 = 25 °C
322 // Beta = 3974
323 // R1 = 0 Ohm
324 // R2 = 4700 Ohm
325 const short temptable_71[][2] PROGMEM = {
326  {35*OVERSAMPLENR, 300},
327  {51*OVERSAMPLENR, 270},
328  {54*OVERSAMPLENR, 265},
329  {58*OVERSAMPLENR, 260},
330  {59*OVERSAMPLENR, 258},
331  {61*OVERSAMPLENR, 256},
332  {63*OVERSAMPLENR, 254},
333  {64*OVERSAMPLENR, 252},
334  {66*OVERSAMPLENR, 250},
335  {67*OVERSAMPLENR, 249},
336  {68*OVERSAMPLENR, 248},
337  {69*OVERSAMPLENR, 247},
338  {70*OVERSAMPLENR, 246},
339  {71*OVERSAMPLENR, 245},
340  {72*OVERSAMPLENR, 244},
341  {73*OVERSAMPLENR, 243},
342  {74*OVERSAMPLENR, 242},
343  {75*OVERSAMPLENR, 241},
344  {76*OVERSAMPLENR, 240},
345  {77*OVERSAMPLENR, 239},
346  {78*OVERSAMPLENR, 238},
347  {79*OVERSAMPLENR, 237},
348  {80*OVERSAMPLENR, 236},
349  {81*OVERSAMPLENR, 235},
350  {82*OVERSAMPLENR, 234},
351  {84*OVERSAMPLENR, 233},
352  {85*OVERSAMPLENR, 232},
353  {86*OVERSAMPLENR, 231},
354  {87*OVERSAMPLENR, 230},
355  {89*OVERSAMPLENR, 229},
356  {90*OVERSAMPLENR, 228},
357  {91*OVERSAMPLENR, 227},
358  {92*OVERSAMPLENR, 226},
359  {94*OVERSAMPLENR, 225},
360  {95*OVERSAMPLENR, 224},
361  {97*OVERSAMPLENR, 223},
362  {98*OVERSAMPLENR, 222},
363  {99*OVERSAMPLENR, 221},
364  {101*OVERSAMPLENR, 220},
365  {102*OVERSAMPLENR, 219},
366  {104*OVERSAMPLENR, 218},
367  {106*OVERSAMPLENR, 217},
368  {107*OVERSAMPLENR, 216},
369  {109*OVERSAMPLENR, 215},
370  {110*OVERSAMPLENR, 214},
371  {112*OVERSAMPLENR, 213},
372  {114*OVERSAMPLENR, 212},
373  {115*OVERSAMPLENR, 211},
374  {117*OVERSAMPLENR, 210},
375  {119*OVERSAMPLENR, 209},
376  {121*OVERSAMPLENR, 208},
377  {123*OVERSAMPLENR, 207},
378  {125*OVERSAMPLENR, 206},
379  {126*OVERSAMPLENR, 205},
380  {128*OVERSAMPLENR, 204},
381  {130*OVERSAMPLENR, 203},
382  {132*OVERSAMPLENR, 202},
383  {134*OVERSAMPLENR, 201},
384  {136*OVERSAMPLENR, 200},
385  {139*OVERSAMPLENR, 199},
386  {141*OVERSAMPLENR, 198},
387  {143*OVERSAMPLENR, 197},
388  {145*OVERSAMPLENR, 196},
389  {147*OVERSAMPLENR, 195},
390  {150*OVERSAMPLENR, 194},
391  {152*OVERSAMPLENR, 193},
392  {154*OVERSAMPLENR, 192},
393  {157*OVERSAMPLENR, 191},
394  {159*OVERSAMPLENR, 190},
395  {162*OVERSAMPLENR, 189},
396  {164*OVERSAMPLENR, 188},
397  {167*OVERSAMPLENR, 187},
398  {170*OVERSAMPLENR, 186},
399  {172*OVERSAMPLENR, 185},
400  {175*OVERSAMPLENR, 184},
401  {178*OVERSAMPLENR, 183},
402  {181*OVERSAMPLENR, 182},
403  {184*OVERSAMPLENR, 181},
404  {187*OVERSAMPLENR, 180},
405  {190*OVERSAMPLENR, 179},
406  {193*OVERSAMPLENR, 178},
407  {196*OVERSAMPLENR, 177},
408  {199*OVERSAMPLENR, 176},
409  {202*OVERSAMPLENR, 175},
410  {205*OVERSAMPLENR, 174},
411  {208*OVERSAMPLENR, 173},
412  {212*OVERSAMPLENR, 172},
413  {215*OVERSAMPLENR, 171},
414  {219*OVERSAMPLENR, 170},
415  {237*OVERSAMPLENR, 165},
416  {256*OVERSAMPLENR, 160},
417  {300*OVERSAMPLENR, 150},
418  {351*OVERSAMPLENR, 140},
419  {470*OVERSAMPLENR, 120},
420  {504*OVERSAMPLENR, 115},
421  {538*OVERSAMPLENR, 110},
422  {552*OVERSAMPLENR, 108},
423  {566*OVERSAMPLENR, 106},
424  {580*OVERSAMPLENR, 104},
425  {594*OVERSAMPLENR, 102},
426  {608*OVERSAMPLENR, 100},
427  {622*OVERSAMPLENR, 98},
428  {636*OVERSAMPLENR, 96},
429  {650*OVERSAMPLENR, 94},
430  {664*OVERSAMPLENR, 92},
431  {678*OVERSAMPLENR, 90},
432  {712*OVERSAMPLENR, 85},
433  {745*OVERSAMPLENR, 80},
434  {758*OVERSAMPLENR, 78},
435  {770*OVERSAMPLENR, 76},
436  {783*OVERSAMPLENR, 74},
437  {795*OVERSAMPLENR, 72},
438  {806*OVERSAMPLENR, 70},
439  {818*OVERSAMPLENR, 68},
440  {829*OVERSAMPLENR, 66},
441  {840*OVERSAMPLENR, 64},
442  {850*OVERSAMPLENR, 62},
443  {860*OVERSAMPLENR, 60},
444  {870*OVERSAMPLENR, 58},
445  {879*OVERSAMPLENR, 56},
446  {888*OVERSAMPLENR, 54},
447  {897*OVERSAMPLENR, 52},
448  {905*OVERSAMPLENR, 50},
449  {924*OVERSAMPLENR, 45},
450  {940*OVERSAMPLENR, 40},
451  {955*OVERSAMPLENR, 35},
452  {967*OVERSAMPLENR, 30},
453  {970*OVERSAMPLENR, 29},
454  {972*OVERSAMPLENR, 28},
455  {974*OVERSAMPLENR, 27},
456  {976*OVERSAMPLENR, 26},
457  {978*OVERSAMPLENR, 25},
458  {980*OVERSAMPLENR, 24},
459  {982*OVERSAMPLENR, 23},
460  {984*OVERSAMPLENR, 22},
461  {985*OVERSAMPLENR, 21},
462  {987*OVERSAMPLENR, 20},
463  {995*OVERSAMPLENR, 15},
464  {1001*OVERSAMPLENR, 10},
465  {1006*OVERSAMPLENR, 5},
466  {1010*OVERSAMPLENR, 0},
467 };
468 #endif
469 
470 #if (THERMISTORHEATER_0 == 8) || (THERMISTORBED == 8)
471 // 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
472 const short temptable_8[][2] PROGMEM = {
473  {1*OVERSAMPLENR, 704},
474  {54*OVERSAMPLENR, 216},
475  {107*OVERSAMPLENR, 175},
476  {160*OVERSAMPLENR, 152},
477  {213*OVERSAMPLENR, 137},
478  {266*OVERSAMPLENR, 125},
479  {319*OVERSAMPLENR, 115},
480  {372*OVERSAMPLENR, 106},
481  {425*OVERSAMPLENR, 99},
482  {478*OVERSAMPLENR, 91},
483  {531*OVERSAMPLENR, 85},
484  {584*OVERSAMPLENR, 78},
485  {637*OVERSAMPLENR, 71},
486  {690*OVERSAMPLENR, 65},
487  {743*OVERSAMPLENR, 58},
488  {796*OVERSAMPLENR, 50},
489  {849*OVERSAMPLENR, 42},
490  {902*OVERSAMPLENR, 31},
491  {955*OVERSAMPLENR, 17},
492  {1008*OVERSAMPLENR, 0}
493 };
494 #endif
495 #if (THERMISTORHEATER_0 == 9) || (THERMISTORBED == 9)
496 // 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
497 const short temptable_9[][2] PROGMEM = {
498  {1*OVERSAMPLENR, 936},
499  {36*OVERSAMPLENR, 300},
500  {71*OVERSAMPLENR, 246},
501  {106*OVERSAMPLENR, 218},
502  {141*OVERSAMPLENR, 199},
503  {176*OVERSAMPLENR, 185},
504  {211*OVERSAMPLENR, 173},
505  {246*OVERSAMPLENR, 163},
506  {281*OVERSAMPLENR, 155},
507  {316*OVERSAMPLENR, 147},
508  {351*OVERSAMPLENR, 140},
509  {386*OVERSAMPLENR, 134},
510  {421*OVERSAMPLENR, 128},
511  {456*OVERSAMPLENR, 122},
512  {491*OVERSAMPLENR, 117},
513  {526*OVERSAMPLENR, 112},
514  {561*OVERSAMPLENR, 107},
515  {596*OVERSAMPLENR, 102},
516  {631*OVERSAMPLENR, 97},
517  {666*OVERSAMPLENR, 92},
518  {701*OVERSAMPLENR, 87},
519  {736*OVERSAMPLENR, 81},
520  {771*OVERSAMPLENR, 76},
521  {806*OVERSAMPLENR, 70},
522  {841*OVERSAMPLENR, 63},
523  {876*OVERSAMPLENR, 56},
524  {911*OVERSAMPLENR, 48},
525  {946*OVERSAMPLENR, 38},
526  {981*OVERSAMPLENR, 23},
527  {1005*OVERSAMPLENR, 5},
528  {1016*OVERSAMPLENR, 0}
529 };
530 #endif
531 #if (THERMISTORHEATER_0 == 10) || (THERMISTORBED == 10)
532 // 100k RS thermistor 198-961 (4.7k pullup)
533 const short temptable_10[][2] PROGMEM = {
534  {1*OVERSAMPLENR, 929},
535  {36*OVERSAMPLENR, 299},
536  {71*OVERSAMPLENR, 246},
537  {106*OVERSAMPLENR, 217},
538  {141*OVERSAMPLENR, 198},
539  {176*OVERSAMPLENR, 184},
540  {211*OVERSAMPLENR, 173},
541  {246*OVERSAMPLENR, 163},
542  {281*OVERSAMPLENR, 154},
543  {316*OVERSAMPLENR, 147},
544  {351*OVERSAMPLENR, 140},
545  {386*OVERSAMPLENR, 134},
546  {421*OVERSAMPLENR, 128},
547  {456*OVERSAMPLENR, 122},
548  {491*OVERSAMPLENR, 117},
549  {526*OVERSAMPLENR, 112},
550  {561*OVERSAMPLENR, 107},
551  {596*OVERSAMPLENR, 102},
552  {631*OVERSAMPLENR, 97},
553  {666*OVERSAMPLENR, 91},
554  {701*OVERSAMPLENR, 86},
555  {736*OVERSAMPLENR, 81},
556  {771*OVERSAMPLENR, 76},
557  {806*OVERSAMPLENR, 70},
558  {841*OVERSAMPLENR, 63},
559  {876*OVERSAMPLENR, 56},
560  {911*OVERSAMPLENR, 48},
561  {946*OVERSAMPLENR, 38},
562  {981*OVERSAMPLENR, 23},
563  {1005*OVERSAMPLENR, 5},
564  {1016*OVERSAMPLENR, 0}
565 };
566 #endif
567 
568 #if (THERMISTORHEATER_0 == 11) || (THERMISTORBED == 11)
569 // QU-BD silicone bed QWG-104F-3950 thermistor
570 
571 const short temptable_11[][2] PROGMEM = {
572  {1*OVERSAMPLENR, 938},
573  {31*OVERSAMPLENR, 314},
574  {41*OVERSAMPLENR, 290},
575  {51*OVERSAMPLENR, 272},
576  {61*OVERSAMPLENR, 258},
577  {71*OVERSAMPLENR, 247},
578  {81*OVERSAMPLENR, 237},
579  {91*OVERSAMPLENR, 229},
580  {101*OVERSAMPLENR, 221},
581  {111*OVERSAMPLENR, 215},
582  {121*OVERSAMPLENR, 209},
583  {131*OVERSAMPLENR, 204},
584  {141*OVERSAMPLENR, 199},
585  {151*OVERSAMPLENR, 195},
586  {161*OVERSAMPLENR, 190},
587  {171*OVERSAMPLENR, 187},
588  {181*OVERSAMPLENR, 183},
589  {191*OVERSAMPLENR, 179},
590  {201*OVERSAMPLENR, 176},
591  {221*OVERSAMPLENR, 170},
592  {241*OVERSAMPLENR, 165},
593  {261*OVERSAMPLENR, 160},
594  {281*OVERSAMPLENR, 155},
595  {301*OVERSAMPLENR, 150},
596  {331*OVERSAMPLENR, 144},
597  {361*OVERSAMPLENR, 139},
598  {391*OVERSAMPLENR, 133},
599  {421*OVERSAMPLENR, 128},
600  {451*OVERSAMPLENR, 123},
601  {491*OVERSAMPLENR, 117},
602  {531*OVERSAMPLENR, 111},
603  {571*OVERSAMPLENR, 105},
604  {611*OVERSAMPLENR, 100},
605  {641*OVERSAMPLENR, 95},
606  {681*OVERSAMPLENR, 90},
607  {711*OVERSAMPLENR, 85},
608  {751*OVERSAMPLENR, 79},
609  {791*OVERSAMPLENR, 72},
610  {811*OVERSAMPLENR, 69},
611  {831*OVERSAMPLENR, 65},
612  {871*OVERSAMPLENR, 57},
613  {881*OVERSAMPLENR, 55},
614  {901*OVERSAMPLENR, 51},
615  {921*OVERSAMPLENR, 45},
616  {941*OVERSAMPLENR, 39},
617  {971*OVERSAMPLENR, 28},
618  {981*OVERSAMPLENR, 23},
619  {991*OVERSAMPLENR, 17},
620  {1001*OVERSAMPLENR, 9},
621  {1021*OVERSAMPLENR, -27}
622 };
623 #endif
624 
625 #if (THERMISTORHEATER_0 == 13) || (THERMISTORBED == 13)
626 // Hisens thermistor B25/50 =3950 +/-1%
627 
628 const short temptable_13[][2] PROGMEM = {
629  { 22.5*OVERSAMPLENR, 300 },
630 { 24.125*OVERSAMPLENR, 295 },
631 { 25.875*OVERSAMPLENR, 290 },
632 { 27.8125*OVERSAMPLENR, 285 },
633 { 29.9375*OVERSAMPLENR, 280 },
634 { 32.25*OVERSAMPLENR, 275 },
635 { 34.8125*OVERSAMPLENR, 270 },
636 { 37.625*OVERSAMPLENR, 265 },
637 { 40.6875*OVERSAMPLENR, 260 },
638 { 44.0625*OVERSAMPLENR, 255 },
639 { 47.75*OVERSAMPLENR, 250 },
640 { 51.8125*OVERSAMPLENR, 245 },
641 { 56.3125*OVERSAMPLENR, 240 },
642 { 61.25*OVERSAMPLENR, 235 },
643 { 66.75*OVERSAMPLENR, 230 },
644 { 72.8125*OVERSAMPLENR, 225 },
645 { 79.5*OVERSAMPLENR, 220 },
646 { 87*OVERSAMPLENR, 215 },
647 { 95.3125*OVERSAMPLENR, 210 },
648 { 104.1875*OVERSAMPLENR, 205 },
649 { 112.75*OVERSAMPLENR, 200 },
650 { 123.125*OVERSAMPLENR, 195 },
651 { 135.75*OVERSAMPLENR, 190 },
652 { 148.3125*OVERSAMPLENR, 185 },
653 { 163.8125*OVERSAMPLENR, 180 },
654 { 179*OVERSAMPLENR, 175 },
655 { 211.125*OVERSAMPLENR, 170 },
656 { 216.125*OVERSAMPLENR, 165 },
657 { 236.5625*OVERSAMPLENR, 160 },
658 { 258.5*OVERSAMPLENR, 155 },
659 { 279.875*OVERSAMPLENR, 150 },
660 { 305.375*OVERSAMPLENR, 145 },
661 { 333.25*OVERSAMPLENR, 140 },
662 { 362.5625*OVERSAMPLENR, 135 },
663 { 393.6875*OVERSAMPLENR, 130 },
664 { 425*OVERSAMPLENR, 125 },
665 { 460.625*OVERSAMPLENR, 120 },
666 { 495.1875*OVERSAMPLENR, 115 },
667 { 530.875*OVERSAMPLENR, 110 },
668 { 567.25*OVERSAMPLENR, 105 },
669 { 601.625*OVERSAMPLENR, 100 },
670 { 637.875*OVERSAMPLENR, 95 },
671 { 674.5625*OVERSAMPLENR, 90 },
672 { 710*OVERSAMPLENR, 85 },
673 { 744.125*OVERSAMPLENR, 80 },
674 { 775.9375*OVERSAMPLENR, 75 },
675 { 806.875*OVERSAMPLENR, 70 },
676 { 835.1875*OVERSAMPLENR, 65 },
677 { 861.125*OVERSAMPLENR, 60 },
678 { 884.375*OVERSAMPLENR, 55 },
679 { 904.5625*OVERSAMPLENR, 50 },
680 { 923.8125*OVERSAMPLENR, 45 },
681 { 940.375*OVERSAMPLENR, 40 },
682 { 954.625*OVERSAMPLENR, 35 },
683 { 966.875*OVERSAMPLENR, 30 },
684 { 977.0625*OVERSAMPLENR, 25 },
685 { 986*OVERSAMPLENR, 20 },
686 { 993.375*OVERSAMPLENR, 15 },
687 { 999.5*OVERSAMPLENR, 10 },
688 { 1004.5*OVERSAMPLENR, 5 },
689 { 1008.5*OVERSAMPLENR, 0 }
690 
691  };
692 #endif
693 
694 #if (THERMISTORHEATER_0 == 20) || (THERMISTORBED == 20) // PT100 with INA826 amp on Ultimaker v2.0 electronics
695 /* The PT100 in the Ultimaker v2.0 electronics has a high sample value for a high temperature.
696 This does not match the normal thermistor behaviour so we need to set the following defines */
697 #if (THERMISTORHEATER_0 == 20)
698 # define HEATER_0_RAW_HI_TEMP 16383
699 # define HEATER_0_RAW_LO_TEMP 0
700 #endif
701 #if (THERMISTORBED == 20)
702 # define HEATER_BED_RAW_HI_TEMP 16383
703 # define HEATER_BED_RAW_LO_TEMP 0
704 #endif
705 const short temptable_20[][2] PROGMEM = {
706 { 0*OVERSAMPLENR , 0 },
707 { 227*OVERSAMPLENR , 1 },
708 { 236*OVERSAMPLENR , 10 },
709 { 245*OVERSAMPLENR , 20 },
710 { 253*OVERSAMPLENR , 30 },
711 { 262*OVERSAMPLENR , 40 },
712 { 270*OVERSAMPLENR , 50 },
713 { 279*OVERSAMPLENR , 60 },
714 { 287*OVERSAMPLENR , 70 },
715 { 295*OVERSAMPLENR , 80 },
716 { 304*OVERSAMPLENR , 90 },
717 { 312*OVERSAMPLENR , 100 },
718 { 320*OVERSAMPLENR , 110 },
719 { 329*OVERSAMPLENR , 120 },
720 { 337*OVERSAMPLENR , 130 },
721 { 345*OVERSAMPLENR , 140 },
722 { 353*OVERSAMPLENR , 150 },
723 { 361*OVERSAMPLENR , 160 },
724 { 369*OVERSAMPLENR , 170 },
725 { 377*OVERSAMPLENR , 180 },
726 { 385*OVERSAMPLENR , 190 },
727 { 393*OVERSAMPLENR , 200 },
728 { 401*OVERSAMPLENR , 210 },
729 { 409*OVERSAMPLENR , 220 },
730 { 417*OVERSAMPLENR , 230 },
731 { 424*OVERSAMPLENR , 240 },
732 { 432*OVERSAMPLENR , 250 },
733 { 440*OVERSAMPLENR , 260 },
734 { 447*OVERSAMPLENR , 270 },
735 { 455*OVERSAMPLENR , 280 },
736 { 463*OVERSAMPLENR , 290 },
737 { 470*OVERSAMPLENR , 300 },
738 { 478*OVERSAMPLENR , 310 },
739 { 485*OVERSAMPLENR , 320 },
740 { 493*OVERSAMPLENR , 330 },
741 { 500*OVERSAMPLENR , 340 },
742 { 507*OVERSAMPLENR , 350 },
743 { 515*OVERSAMPLENR , 360 },
744 { 522*OVERSAMPLENR , 370 },
745 { 529*OVERSAMPLENR , 380 },
746 { 537*OVERSAMPLENR , 390 },
747 { 544*OVERSAMPLENR , 400 },
748 { 614*OVERSAMPLENR , 500 },
749 { 681*OVERSAMPLENR , 600 },
750 { 744*OVERSAMPLENR , 700 },
751 { 805*OVERSAMPLENR , 800 },
752 { 862*OVERSAMPLENR , 900 },
753 { 917*OVERSAMPLENR , 1000 },
754 { 968*OVERSAMPLENR , 1100 }
755 };
756 #endif
757 
758 #if (THERMISTORHEATER_0 == 51) || (THERMISTORBED == 51)
759 // 100k EPCOS (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!)
760 // Verified by linagee.
761 // Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance
762 // Advantage: Twice the resolution and better linearity from 150C to 200C
763 const short temptable_51[][2] PROGMEM = {
764  {1*OVERSAMPLENR, 350},
765  {190*OVERSAMPLENR, 250}, //top rating 250C
766  {203*OVERSAMPLENR, 245},
767  {217*OVERSAMPLENR, 240},
768  {232*OVERSAMPLENR, 235},
769  {248*OVERSAMPLENR, 230},
770  {265*OVERSAMPLENR, 225},
771  {283*OVERSAMPLENR, 220},
772  {302*OVERSAMPLENR, 215},
773  {322*OVERSAMPLENR, 210},
774  {344*OVERSAMPLENR, 205},
775  {366*OVERSAMPLENR, 200},
776  {390*OVERSAMPLENR, 195},
777  {415*OVERSAMPLENR, 190},
778  {440*OVERSAMPLENR, 185},
779  {467*OVERSAMPLENR, 180},
780  {494*OVERSAMPLENR, 175},
781  {522*OVERSAMPLENR, 170},
782  {551*OVERSAMPLENR, 165},
783  {580*OVERSAMPLENR, 160},
784  {609*OVERSAMPLENR, 155},
785  {638*OVERSAMPLENR, 150},
786  {666*OVERSAMPLENR, 145},
787  {695*OVERSAMPLENR, 140},
788  {722*OVERSAMPLENR, 135},
789  {749*OVERSAMPLENR, 130},
790  {775*OVERSAMPLENR, 125},
791  {800*OVERSAMPLENR, 120},
792  {823*OVERSAMPLENR, 115},
793  {845*OVERSAMPLENR, 110},
794  {865*OVERSAMPLENR, 105},
795  {884*OVERSAMPLENR, 100},
796  {901*OVERSAMPLENR, 95},
797  {917*OVERSAMPLENR, 90},
798  {932*OVERSAMPLENR, 85},
799  {944*OVERSAMPLENR, 80},
800  {956*OVERSAMPLENR, 75},
801  {966*OVERSAMPLENR, 70},
802  {975*OVERSAMPLENR, 65},
803  {982*OVERSAMPLENR, 60},
804  {989*OVERSAMPLENR, 55},
805  {995*OVERSAMPLENR, 50},
806  {1000*OVERSAMPLENR, 45},
807  {1004*OVERSAMPLENR, 40},
808  {1007*OVERSAMPLENR, 35},
809  {1010*OVERSAMPLENR, 30},
810  {1013*OVERSAMPLENR, 25},
811  {1015*OVERSAMPLENR, 20},
812  {1017*OVERSAMPLENR, 15},
813  {1018*OVERSAMPLENR, 10},
814  {1019*OVERSAMPLENR, 5},
815  {1020*OVERSAMPLENR, 0},
816  {1021*OVERSAMPLENR, -5}
817 };
818 #endif
819 
820 #if (THERMISTORHEATER_0 == 52) || (THERMISTORBED == 52)
821 // 200k ATC Semitec 204GT-2 (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!)
822 // Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf
823 // Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance
824 // Advantage: More resolution and better linearity from 150C to 200C
825 const short temptable_52[][2] PROGMEM = {
826  {1*OVERSAMPLENR, 500},
827  {125*OVERSAMPLENR, 300}, //top rating 300C
828  {142*OVERSAMPLENR, 290},
829  {162*OVERSAMPLENR, 280},
830  {185*OVERSAMPLENR, 270},
831  {211*OVERSAMPLENR, 260},
832  {240*OVERSAMPLENR, 250},
833  {274*OVERSAMPLENR, 240},
834  {312*OVERSAMPLENR, 230},
835  {355*OVERSAMPLENR, 220},
836  {401*OVERSAMPLENR, 210},
837  {452*OVERSAMPLENR, 200},
838  {506*OVERSAMPLENR, 190},
839  {563*OVERSAMPLENR, 180},
840  {620*OVERSAMPLENR, 170},
841  {677*OVERSAMPLENR, 160},
842  {732*OVERSAMPLENR, 150},
843  {783*OVERSAMPLENR, 140},
844  {830*OVERSAMPLENR, 130},
845  {871*OVERSAMPLENR, 120},
846  {906*OVERSAMPLENR, 110},
847  {935*OVERSAMPLENR, 100},
848  {958*OVERSAMPLENR, 90},
849  {976*OVERSAMPLENR, 80},
850  {990*OVERSAMPLENR, 70},
851  {1000*OVERSAMPLENR, 60},
852  {1008*OVERSAMPLENR, 50},
853  {1013*OVERSAMPLENR, 40},
854  {1017*OVERSAMPLENR, 30},
855  {1019*OVERSAMPLENR, 20},
856  {1021*OVERSAMPLENR, 10},
857  {1022*OVERSAMPLENR, 0}
858 };
859 #endif
860 
861 #if (THERMISTORHEATER_0 == 55) || (THERMISTORBED == 55)
862 // 100k ATC Semitec 104GT-2 (Used on ParCan) (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!)
863 // Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf
864 // Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance
865 // Advantage: More resolution and better linearity from 150C to 200C
866 const short temptable_55[][2] PROGMEM = {
867  {1*OVERSAMPLENR, 500},
868  {76*OVERSAMPLENR, 300},
869  {87*OVERSAMPLENR, 290},
870  {100*OVERSAMPLENR, 280},
871  {114*OVERSAMPLENR, 270},
872  {131*OVERSAMPLENR, 260},
873  {152*OVERSAMPLENR, 250},
874  {175*OVERSAMPLENR, 240},
875  {202*OVERSAMPLENR, 230},
876  {234*OVERSAMPLENR, 220},
877  {271*OVERSAMPLENR, 210},
878  {312*OVERSAMPLENR, 200},
879  {359*OVERSAMPLENR, 190},
880  {411*OVERSAMPLENR, 180},
881  {467*OVERSAMPLENR, 170},
882  {527*OVERSAMPLENR, 160},
883  {590*OVERSAMPLENR, 150},
884  {652*OVERSAMPLENR, 140},
885  {713*OVERSAMPLENR, 130},
886  {770*OVERSAMPLENR, 120},
887  {822*OVERSAMPLENR, 110},
888  {867*OVERSAMPLENR, 100},
889  {905*OVERSAMPLENR, 90},
890  {936*OVERSAMPLENR, 80},
891  {961*OVERSAMPLENR, 70},
892  {979*OVERSAMPLENR, 60},
893  {993*OVERSAMPLENR, 50},
894  {1003*OVERSAMPLENR, 40},
895  {1010*OVERSAMPLENR, 30},
896  {1015*OVERSAMPLENR, 20},
897  {1018*OVERSAMPLENR, 10},
898  {1020*OVERSAMPLENR, 0}
899 };
900 #endif
901 
902 #if (THERMISTORHEATER_0 == 60) || (THERMISTORBED == 60) // Maker's Tool Works Kapton Bed Thermister
903 // ./createTemperatureLookup.py --r0=100000 --t0=25 --r1=0 --r2=4700 --beta=3950
904 // r0: 100000
905 // t0: 25
906 // r1: 0 (parallel with rTherm)
907 // r2: 4700 (series with rTherm)
908 // beta: 3950
909 // min adc: 1 at 0.0048828125 V
910 // max adc: 1023 at 4.9951171875 V
911 const short temptable_60[][2] PROGMEM = {
912  {51*OVERSAMPLENR, 272},
913  {61*OVERSAMPLENR, 258},
914  {71*OVERSAMPLENR, 247},
915  {81*OVERSAMPLENR, 237},
916  {91*OVERSAMPLENR, 229},
917  {101*OVERSAMPLENR, 221},
918  {131*OVERSAMPLENR, 204},
919  {161*OVERSAMPLENR, 190},
920  {191*OVERSAMPLENR, 179},
921  {231*OVERSAMPLENR, 167},
922  {271*OVERSAMPLENR, 157},
923  {311*OVERSAMPLENR, 148},
924  {351*OVERSAMPLENR, 140},
925  {381*OVERSAMPLENR, 135},
926  {411*OVERSAMPLENR, 130},
927  {441*OVERSAMPLENR, 125},
928  {451*OVERSAMPLENR, 123},
929  {461*OVERSAMPLENR, 122},
930  {471*OVERSAMPLENR, 120},
931  {481*OVERSAMPLENR, 119},
932  {491*OVERSAMPLENR, 117},
933  {501*OVERSAMPLENR, 116},
934  {511*OVERSAMPLENR, 114},
935  {521*OVERSAMPLENR, 113},
936  {531*OVERSAMPLENR, 111},
937  {541*OVERSAMPLENR, 110},
938  {551*OVERSAMPLENR, 108},
939  {561*OVERSAMPLENR, 107},
940  {571*OVERSAMPLENR, 105},
941  {581*OVERSAMPLENR, 104},
942  {591*OVERSAMPLENR, 102},
943  {601*OVERSAMPLENR, 101},
944  {611*OVERSAMPLENR, 100},
945  {621*OVERSAMPLENR, 98},
946  {631*OVERSAMPLENR, 97},
947  {641*OVERSAMPLENR, 95},
948  {651*OVERSAMPLENR, 94},
949  {661*OVERSAMPLENR, 92},
950  {671*OVERSAMPLENR, 91},
951  {681*OVERSAMPLENR, 90},
952  {691*OVERSAMPLENR, 88},
953  {701*OVERSAMPLENR, 87},
954  {711*OVERSAMPLENR, 85},
955  {721*OVERSAMPLENR, 84},
956  {731*OVERSAMPLENR, 82},
957  {741*OVERSAMPLENR, 81},
958  {751*OVERSAMPLENR, 79},
959  {761*OVERSAMPLENR, 77},
960  {771*OVERSAMPLENR, 76},
961  {781*OVERSAMPLENR, 74},
962  {791*OVERSAMPLENR, 72},
963  {801*OVERSAMPLENR, 71},
964  {811*OVERSAMPLENR, 69},
965  {821*OVERSAMPLENR, 67},
966  {831*OVERSAMPLENR, 65},
967  {841*OVERSAMPLENR, 63},
968  {851*OVERSAMPLENR, 62},
969  {861*OVERSAMPLENR, 60},
970  {871*OVERSAMPLENR, 57},
971  {881*OVERSAMPLENR, 55},
972  {891*OVERSAMPLENR, 53},
973  {901*OVERSAMPLENR, 51},
974  {911*OVERSAMPLENR, 48},
975  {921*OVERSAMPLENR, 45},
976  {931*OVERSAMPLENR, 42},
977  {941*OVERSAMPLENR, 39},
978  {951*OVERSAMPLENR, 36},
979  {961*OVERSAMPLENR, 32},
980  {981*OVERSAMPLENR, 23},
981  {991*OVERSAMPLENR, 17},
982  {1001*OVERSAMPLENR, 9},
983  {1008*OVERSAMPLENR, 0},
984 };
985 #endif
986 #if (THERMISTORBED == 12)
987 //100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
988 const short temptable_12[][2] PROGMEM = {
989  {35*OVERSAMPLENR, 180}, //top rating 180C
990  {211*OVERSAMPLENR, 140},
991  {233*OVERSAMPLENR, 135},
992  {261*OVERSAMPLENR, 130},
993  {290*OVERSAMPLENR, 125},
994  {328*OVERSAMPLENR, 120},
995  {362*OVERSAMPLENR, 115},
996  {406*OVERSAMPLENR, 110},
997  {446*OVERSAMPLENR, 105},
998  {496*OVERSAMPLENR, 100},
999  {539*OVERSAMPLENR, 95},
1000  {585*OVERSAMPLENR, 90},
1001  {629*OVERSAMPLENR, 85},
1002  {675*OVERSAMPLENR, 80},
1003  {718*OVERSAMPLENR, 75},
1004  {758*OVERSAMPLENR, 70},
1005  {793*OVERSAMPLENR, 65},
1006  {822*OVERSAMPLENR, 60},
1007  {841*OVERSAMPLENR, 55},
1008  {875*OVERSAMPLENR, 50},
1009  {899*OVERSAMPLENR, 45},
1010  {926*OVERSAMPLENR, 40},
1011  {946*OVERSAMPLENR, 35},
1012  {962*OVERSAMPLENR, 30},
1013  {977*OVERSAMPLENR, 25},
1014  {987*OVERSAMPLENR, 20},
1015  {995*OVERSAMPLENR, 15},
1016  {1001*OVERSAMPLENR, 10},
1017  {1010*OVERSAMPLENR, 0},
1018  {1023*OVERSAMPLENR, -40},
1019 };
1020 #endif
1021 
1022 // Pt1000 and Pt100 handling
1023 //
1024 // Rt=R0*(1+a*T+b*T*T) [for T>0]
1025 // a=3.9083E-3, b=-5.775E-7
1026 
1027 #define PtA 3.9083E-3
1028 #define PtB -5.775E-7
1029 #define PtC -4.183E-12
1030 #define PtRt(T,R0) ((R0)*(1.0+(PtA)*(T)+(PtB)*(T)*(T)))
1031 #define PtRtNew(T,R0) ((R0)*(1.0+(PtA)*(T)+(PtB)*(T)*(T) + (T-100)*PtC*(T)*(T)*(T)))
1032 #define PtAdVal(T,R0,Rup) (short)(1024/(Rup/PtRt(T,R0)+1))
1033 #define PtLine(T,R0,Rup) { PtAdVal(T,R0,Rup)*OVERSAMPLENR, T },
1034 
1035 #if (THERMISTORHEATER_0 == 110) || (THERMISTORBED == 110) // Pt100 with 1k0 pullup
1036 const short temptable_110[][2] PROGMEM = {
1037 // only few values are needed as the curve is very flat
1038  PtLine(0,100,1000)
1039  PtLine(50,100,1000)
1040  PtLine(100,100,1000)
1041  PtLine(150,100,1000)
1042  PtLine(200,100,1000)
1043  PtLine(250,100,1000)
1044  PtLine(300,100,1000)
1045 };
1046 #endif
1047 #if (THERMISTORHEATER_0 == 147) || (THERMISTORBED == 147) // Pt100 with 4k7 pullup
1048 const short temptable_147[][2] PROGMEM = {
1049 // only few values are needed as the curve is very flat
1050  PtLine(0,100,4700)
1051  PtLine(50,100,4700)
1052  PtLine(100,100,4700)
1053  PtLine(150,100,4700)
1054  PtLine(200,100,4700)
1055  PtLine(250,100,4700)
1056  PtLine(300,100,4700)
1057 };
1058 #endif
1059 // E3D Pt100 with 4k7 MiniRambo pullup, no Amp on the MiniRambo v1.3a
1060 #if (THERMISTORHEATER_0 == 148) || (THERMISTORBED == 148)
1061 const short temptable_148[][2] PROGMEM = {
1062 // These values have been calculated and tested over many days. See https://docs.google.com/spreadsheets/d/1MJXa6feEe0mGVCT2TrBwLxVOMoLDkJlvfQ4JXhAdV_E
1063 // Values that are missing from the 5C gap are missing due to resolution limits.
1064 {19.00000 * OVERSAMPLENR, 0},
1065 {19.25000 * OVERSAMPLENR, 5},
1066 {19.50000 * OVERSAMPLENR, 10},
1067 {19.87500 * OVERSAMPLENR, 15},
1068 {20.25000 * OVERSAMPLENR, 20},
1069 {21.00000 * OVERSAMPLENR, 25},
1070 {21.75000 * OVERSAMPLENR, 35},
1071 {22.00000 * OVERSAMPLENR, 40},
1072 {23.00000 * OVERSAMPLENR, 50}, // 55C is more commonly used.
1073 {23.75000 * OVERSAMPLENR, 60},
1074 {24.00000 * OVERSAMPLENR, 65},
1075 {24.06250 * OVERSAMPLENR, 70},
1076 {25.00000 * OVERSAMPLENR, 75},
1077 {25.50000 * OVERSAMPLENR, 85},
1078 {26.00000 * OVERSAMPLENR, 90},
1079 {26.93750 * OVERSAMPLENR,100},
1080 {27.00000 * OVERSAMPLENR,105},
1081 {27.37500 * OVERSAMPLENR,110},
1082 {28.00000 * OVERSAMPLENR,115},
1083 {29.00000 * OVERSAMPLENR,125},
1084 {29.25000 * OVERSAMPLENR,135},
1085 {30.00000 * OVERSAMPLENR,140},
1086 {35.50000 * OVERSAMPLENR,150},
1087 {31.00000 * OVERSAMPLENR,155},
1088 {32.00000 * OVERSAMPLENR,165},
1089 {32.18750 * OVERSAMPLENR,175},
1090 {33.00000 * OVERSAMPLENR,180},
1091 {33.62500 * OVERSAMPLENR,190},
1092 {34.00000 * OVERSAMPLENR,195},
1093 {35.00000 * OVERSAMPLENR,205},
1094 {35.50000 * OVERSAMPLENR,215},
1095 {36.00000 * OVERSAMPLENR,220},
1096 {36.75000 * OVERSAMPLENR,230},
1097 {37.00000 * OVERSAMPLENR,235},
1098 {37.75000 * OVERSAMPLENR,245},
1099 {38.00000 * OVERSAMPLENR,250},
1100 {38.12500 * OVERSAMPLENR,255},
1101 {39.00000 * OVERSAMPLENR,260},
1102 {40.00000 * OVERSAMPLENR,275},
1103 {40.25000 * OVERSAMPLENR,285},
1104 {41.00000 * OVERSAMPLENR,290},
1105 {41.25000 * OVERSAMPLENR,300},
1106 {42.00000 * OVERSAMPLENR,305},
1107 {43.00000 * OVERSAMPLENR,315},
1108 {43.25000 * OVERSAMPLENR,325},
1109 {44.00000 * OVERSAMPLENR,330},
1110 {44.18750 * OVERSAMPLENR,340},
1111 {45.00000 * OVERSAMPLENR,345},
1112 {45.25000 * OVERSAMPLENR,355},
1113 {46.00000 * OVERSAMPLENR,360},
1114 {46.62500 * OVERSAMPLENR,370},
1115 {47.00000 * OVERSAMPLENR,375},
1116 {47.25000 * OVERSAMPLENR,385},
1117 {48.00000 * OVERSAMPLENR,390},
1118 {48.75000 * OVERSAMPLENR,400},
1119 {49.00000 * OVERSAMPLENR,405},
1120 };
1121 #endif
1122 #if (THERMISTORHEATER_0 == 247) || (THERMISTORBED == 247) // Pt100 with 4k7 MiniRambo pullup & PT100 Amplifier
1123 const short temptable_247[][2] PROGMEM = {
1124 // Calculated from Bob-the-Kuhn's PT100 calculator listed in https://github.com/MarlinFirmware/Marlin/issues/5543
1125 // and the table provided by E3D at http://wiki.e3d-online.com/wiki/E3D_PT100_Amplifier_Documentation#Output_Characteristics.
1126 { 0 * OVERSAMPLENR, 0},
1127 {241 * OVERSAMPLENR, 1},
1128 {249 * OVERSAMPLENR, 10},
1129 {259 * OVERSAMPLENR, 20},
1130 {267 * OVERSAMPLENR, 30},
1131 {275 * OVERSAMPLENR, 40},
1132 {283 * OVERSAMPLENR, 50},
1133 {291 * OVERSAMPLENR, 60},
1134 {299 * OVERSAMPLENR, 70},
1135 {307 * OVERSAMPLENR, 80},
1136 {315 * OVERSAMPLENR, 90},
1137 {323 * OVERSAMPLENR, 100},
1138 {331 * OVERSAMPLENR, 110},
1139 {340 * OVERSAMPLENR, 120},
1140 {348 * OVERSAMPLENR, 130},
1141 {354 * OVERSAMPLENR, 140},
1142 {362 * OVERSAMPLENR, 150},
1143 {370 * OVERSAMPLENR, 160},
1144 {378 * OVERSAMPLENR, 170},
1145 {386 * OVERSAMPLENR, 180},
1146 {394 * OVERSAMPLENR, 190},
1147 {402 * OVERSAMPLENR, 200},
1148 {410 * OVERSAMPLENR, 210},
1149 {418 * OVERSAMPLENR, 220},
1150 {426 * OVERSAMPLENR, 230},
1151 {432 * OVERSAMPLENR, 240},
1152 {440 * OVERSAMPLENR, 250},
1153 {448 * OVERSAMPLENR, 260},
1154 {454 * OVERSAMPLENR, 270},
1155 {462 * OVERSAMPLENR, 280},
1156 {469 * OVERSAMPLENR, 290},
1157 {475 * OVERSAMPLENR, 300},
1158 {483 * OVERSAMPLENR, 310},
1159 {491 * OVERSAMPLENR, 320},
1160 {499 * OVERSAMPLENR, 330},
1161 {505 * OVERSAMPLENR, 340},
1162 {513 * OVERSAMPLENR, 350},
1163 {519 * OVERSAMPLENR, 360},
1164 {527 * OVERSAMPLENR, 370},
1165 {533 * OVERSAMPLENR, 380},
1166 {541 * OVERSAMPLENR, 390},
1167 {549 * OVERSAMPLENR, 400},
1168 {616 * OVERSAMPLENR, 500},
1169 {682 * OVERSAMPLENR, 600},
1170 {741 * OVERSAMPLENR, 700},
1171 {801 * OVERSAMPLENR, 800},
1172 {856 * OVERSAMPLENR, 900},
1173 {910 * OVERSAMPLENR, 1000},
1174 {960 * OVERSAMPLENR, 1100},
1175 };
1176 #endif
1177 #if (THERMISTORHEATER_0 == 1010) || (THERMISTORBED == 1010) // Pt1000 with 1k0 pullup
1178 const short temptable_1010[][2] PROGMEM = {
1179  PtLine(0,1000,1000)
1180  PtLine(25,1000,1000)
1181  PtLine(50,1000,1000)
1182  PtLine(75,1000,1000)
1183  PtLine(100,1000,1000)
1184  PtLine(125,1000,1000)
1185  PtLine(150,1000,1000)
1186  PtLine(175,1000,1000)
1187  PtLine(200,1000,1000)
1188  PtLine(225,1000,1000)
1189  PtLine(250,1000,1000)
1190  PtLine(275,1000,1000)
1191  PtLine(300,1000,1000)
1192 };
1193 #endif
1194 #if (THERMISTORHEATER_0 == 1047) || (THERMISTORBED == 1047) // Pt1000 with 4k7 pullup
1195 const short temptable_1047[][2] PROGMEM = {
1196 // only few values are needed as the curve is very flat
1197  PtLine(0,1000,4700)
1198  PtLine(50,1000,4700)
1199  PtLine(100,1000,4700)
1200  PtLine(150,1000,4700)
1201  PtLine(200,1000,4700)
1202  PtLine(250,1000,4700)
1203  PtLine(300,1000,4700)
1204 };
1205 #endif
1206 
1207 #if (THERMISTORAMBIENT == 2000) //100k thermistor NTCG104LH104JT1
1208 # define AMBIENT_RAW_HI_TEMP 0
1209 # define AMBIENT_RAW_LO_TEMP 16383
1210 const short temptable_2000[][2] PROGMEM = {
1211 // Source: https://product.tdk.com/info/en/catalog/datasheets/503021/tpd_ntc-thermistor_ntcg_en.pdf
1212 // Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance
1213 /*{305*OVERSAMPLENR, 125},
1214 {338*OVERSAMPLENR, 120},
1215 {374*OVERSAMPLENR, 115},
1216 {412*OVERSAMPLENR, 110},
1217 {452*OVERSAMPLENR, 105},
1218 {494*OVERSAMPLENR, 100},
1219 {536*OVERSAMPLENR, 95},
1220 {580*OVERSAMPLENR, 90},
1221 {623*OVERSAMPLENR, 85},
1222 {665*OVERSAMPLENR, 80},
1223 {706*OVERSAMPLENR, 75},
1224 {744*OVERSAMPLENR, 70},
1225 {780*OVERSAMPLENR, 65},
1226 {813*OVERSAMPLENR, 60},
1227 {843*OVERSAMPLENR, 55},
1228 {869*OVERSAMPLENR, 50},
1229 {892*OVERSAMPLENR, 45},
1230 {912*OVERSAMPLENR, 40},
1231 {929*OVERSAMPLENR, 35},
1232 {943*OVERSAMPLENR, 30},
1233 {955*OVERSAMPLENR, 25},
1234 {965*OVERSAMPLENR, 20},
1235 {973*OVERSAMPLENR, 15},
1236 {979*OVERSAMPLENR, 10},
1237 {984*OVERSAMPLENR, 5},
1238 {988*OVERSAMPLENR, 0},
1239 {991*OVERSAMPLENR, -5},
1240 {993*OVERSAMPLENR, -10},
1241 {995*OVERSAMPLENR, -15},
1242 {996*OVERSAMPLENR, -20},
1243 {997*OVERSAMPLENR, -25},
1244 {998*OVERSAMPLENR, -30},
1245 {999*OVERSAMPLENR, -35},
1246 {999*OVERSAMPLENR, -40},*/
1247 {313*OVERSAMPLENR,125},
1248 {347*OVERSAMPLENR,120},
1249 {383*OVERSAMPLENR,115},
1250 {422*OVERSAMPLENR,110},
1251 {463*OVERSAMPLENR,105},
1252 {506*OVERSAMPLENR,100},
1253 {549*OVERSAMPLENR,95},
1254 {594*OVERSAMPLENR,90},
1255 {638*OVERSAMPLENR,85},
1256 {681*OVERSAMPLENR,80},
1257 {722*OVERSAMPLENR,75},
1258 {762*OVERSAMPLENR,70},
1259 {799*OVERSAMPLENR,65},
1260 {833*OVERSAMPLENR,60},
1261 {863*OVERSAMPLENR,55},
1262 {890*OVERSAMPLENR,50},
1263 {914*OVERSAMPLENR,45},
1264 {934*OVERSAMPLENR,40},
1265 {951*OVERSAMPLENR,35},
1266 {966*OVERSAMPLENR,30},
1267 {978*OVERSAMPLENR,25},
1268 {988*OVERSAMPLENR,20},
1269 {996*OVERSAMPLENR,15},
1270 {1002*OVERSAMPLENR,10},
1271 {1007*OVERSAMPLENR,5},
1272 {1012*OVERSAMPLENR,0},
1273 {1015*OVERSAMPLENR,-5},
1274 {1017*OVERSAMPLENR,-10},
1275 {1019*OVERSAMPLENR,-15},
1276 {1020*OVERSAMPLENR,-20},
1277 {1021*OVERSAMPLENR,-25},
1278 {1022*OVERSAMPLENR,-30},
1279 {1023*OVERSAMPLENR,-35},
1280 {1023*OVERSAMPLENR,-40},
1281 };
1282 #endif
1283 
1284 #define _TT_NAME(_N) temptable_ ## _N
1285 #define TT_NAME(_N) _TT_NAME(_N)
1286 
1287 #ifdef THERMISTORHEATER_0
1288 # define HEATER_0_TEMPTABLE TT_NAME(THERMISTORHEATER_0)
1289 # define HEATER_0_TEMPTABLE_LEN (sizeof(HEATER_0_TEMPTABLE)/sizeof(*HEATER_0_TEMPTABLE))
1290 #else
1291 # ifdef HEATER_0_USES_THERMISTOR
1292 # error No heater 0 thermistor table specified
1293 # else // HEATER_0_USES_THERMISTOR
1294 # define HEATER_0_TEMPTABLE NULL
1295 # define HEATER_0_TEMPTABLE_LEN 0
1296 # endif // HEATER_0_USES_THERMISTOR
1297 #endif
1298 
1299 //Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
1300 #ifndef HEATER_0_RAW_HI_TEMP
1301 # ifdef HEATER_0_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value
1302 # define HEATER_0_RAW_HI_TEMP 0
1303 # define HEATER_0_RAW_LO_TEMP 16383
1304 # else //In case of an thermocouple the highest temperature results in the highest ADC value
1305 # define HEATER_0_RAW_HI_TEMP 16383
1306 # define HEATER_0_RAW_LO_TEMP 0
1307 # endif
1308 #endif
1309 
1310 #ifdef THERMISTORBED
1311 # define BEDTEMPTABLE TT_NAME(THERMISTORBED)
1312 # define BEDTEMPTABLE_LEN (sizeof(BEDTEMPTABLE)/sizeof(*BEDTEMPTABLE))
1313 #else
1314 # ifdef BED_USES_THERMISTOR
1315 # error No bed thermistor table specified
1316 # endif // BED_USES_THERMISTOR
1317 #endif
1318 
1319 #ifdef THERMISTORAMBIENT
1320 # define AMBIENTTEMPTABLE TT_NAME(THERMISTORAMBIENT)
1321 # define AMBIENTTEMPTABLE_LEN (sizeof(AMBIENTTEMPTABLE)/sizeof(*AMBIENTTEMPTABLE))
1322 #endif
1323 
1324 //Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
1325 #ifndef HEATER_BED_RAW_HI_TEMP
1326 # ifdef BED_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value
1327 # define HEATER_BED_RAW_HI_TEMP 0
1328 # define HEATER_BED_RAW_LO_TEMP 16383
1329 # else //In case of an thermocouple the highest temperature results in the highest ADC value
1330 # define HEATER_BED_RAW_HI_TEMP 16383
1331 # define HEATER_BED_RAW_LO_TEMP 0
1332 # endif
1333 #endif
1334 
1335 #endif //THERMISTORTABLES_H_