thermistortables.h 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148
  1. #ifndef THERMISTORTABLES_H_
  2. #define THERMISTORTABLES_H_
  3. #include "Marlin.h"
  4. #define OVERSAMPLENR 16
  5. #if (THERMISTORHEATER_0 == 1) || (THERMISTORHEATER_1 == 1) || (THERMISTORHEATER_2 == 1) || (THERMISTORBED == 1) //100k bed thermistor
  6. const short temptable_1[][2] PROGMEM = {
  7. { 23*OVERSAMPLENR , 300 },
  8. { 25*OVERSAMPLENR , 295 },
  9. { 27*OVERSAMPLENR , 290 },
  10. { 28*OVERSAMPLENR , 285 },
  11. { 31*OVERSAMPLENR , 280 },
  12. { 33*OVERSAMPLENR , 275 },
  13. { 35*OVERSAMPLENR , 270 },
  14. { 38*OVERSAMPLENR , 265 },
  15. { 41*OVERSAMPLENR , 260 },
  16. { 44*OVERSAMPLENR , 255 },
  17. { 48*OVERSAMPLENR , 250 },
  18. { 52*OVERSAMPLENR , 245 },
  19. { 56*OVERSAMPLENR , 240 },
  20. { 61*OVERSAMPLENR , 235 },
  21. { 66*OVERSAMPLENR , 230 },
  22. { 71*OVERSAMPLENR , 225 },
  23. { 78*OVERSAMPLENR , 220 },
  24. { 84*OVERSAMPLENR , 215 },
  25. { 92*OVERSAMPLENR , 210 },
  26. { 100*OVERSAMPLENR , 205 },
  27. { 109*OVERSAMPLENR , 200 },
  28. { 120*OVERSAMPLENR , 195 },
  29. { 131*OVERSAMPLENR , 190 },
  30. { 143*OVERSAMPLENR , 185 },
  31. { 156*OVERSAMPLENR , 180 },
  32. { 171*OVERSAMPLENR , 175 },
  33. { 187*OVERSAMPLENR , 170 },
  34. { 205*OVERSAMPLENR , 165 },
  35. { 224*OVERSAMPLENR , 160 },
  36. { 245*OVERSAMPLENR , 155 },
  37. { 268*OVERSAMPLENR , 150 },
  38. { 293*OVERSAMPLENR , 145 },
  39. { 320*OVERSAMPLENR , 140 },
  40. { 348*OVERSAMPLENR , 135 },
  41. { 379*OVERSAMPLENR , 130 },
  42. { 411*OVERSAMPLENR , 125 },
  43. { 445*OVERSAMPLENR , 120 },
  44. { 480*OVERSAMPLENR , 115 },
  45. { 516*OVERSAMPLENR , 110 },
  46. { 553*OVERSAMPLENR , 105 },
  47. { 591*OVERSAMPLENR , 100 },
  48. { 628*OVERSAMPLENR , 95 },
  49. { 665*OVERSAMPLENR , 90 },
  50. { 702*OVERSAMPLENR , 85 },
  51. { 737*OVERSAMPLENR , 80 },
  52. { 770*OVERSAMPLENR , 75 },
  53. { 801*OVERSAMPLENR , 70 },
  54. { 830*OVERSAMPLENR , 65 },
  55. { 857*OVERSAMPLENR , 60 },
  56. { 881*OVERSAMPLENR , 55 },
  57. { 903*OVERSAMPLENR , 50 },
  58. { 922*OVERSAMPLENR , 45 },
  59. { 939*OVERSAMPLENR , 40 },
  60. { 954*OVERSAMPLENR , 35 },
  61. { 966*OVERSAMPLENR , 30 },
  62. { 977*OVERSAMPLENR , 25 },
  63. { 985*OVERSAMPLENR , 20 },
  64. { 993*OVERSAMPLENR , 15 },
  65. { 999*OVERSAMPLENR , 10 },
  66. { 1004*OVERSAMPLENR , 5 },
  67. { 1008*OVERSAMPLENR , 0 } //safety
  68. };
  69. #endif
  70. #if (THERMISTORHEATER_0 == 2) || (THERMISTORHEATER_1 == 2) || (THERMISTORHEATER_2 == 2) || (THERMISTORBED == 2) //200k bed thermistor
  71. const short temptable_2[][2] PROGMEM = {
  72. //200k ATC Semitec 204GT-2
  73. //Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf
  74. // Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance
  75. {1*OVERSAMPLENR, 848},
  76. {30*OVERSAMPLENR, 300}, //top rating 300C
  77. {34*OVERSAMPLENR, 290},
  78. {39*OVERSAMPLENR, 280},
  79. {46*OVERSAMPLENR, 270},
  80. {53*OVERSAMPLENR, 260},
  81. {63*OVERSAMPLENR, 250},
  82. {74*OVERSAMPLENR, 240},
  83. {87*OVERSAMPLENR, 230},
  84. {104*OVERSAMPLENR, 220},
  85. {124*OVERSAMPLENR, 210},
  86. {148*OVERSAMPLENR, 200},
  87. {176*OVERSAMPLENR, 190},
  88. {211*OVERSAMPLENR, 180},
  89. {252*OVERSAMPLENR, 170},
  90. {301*OVERSAMPLENR, 160},
  91. {357*OVERSAMPLENR, 150},
  92. {420*OVERSAMPLENR, 140},
  93. {489*OVERSAMPLENR, 130},
  94. {562*OVERSAMPLENR, 120},
  95. {636*OVERSAMPLENR, 110},
  96. {708*OVERSAMPLENR, 100},
  97. {775*OVERSAMPLENR, 90},
  98. {835*OVERSAMPLENR, 80},
  99. {884*OVERSAMPLENR, 70},
  100. {924*OVERSAMPLENR, 60},
  101. {955*OVERSAMPLENR, 50},
  102. {977*OVERSAMPLENR, 40},
  103. {993*OVERSAMPLENR, 30},
  104. {1004*OVERSAMPLENR, 20},
  105. {1012*OVERSAMPLENR, 10},
  106. {1016*OVERSAMPLENR, 0},
  107. };
  108. #endif
  109. #if (THERMISTORHEATER_0 == 3) || (THERMISTORHEATER_1 == 3) || (THERMISTORHEATER_2 == 3) || (THERMISTORBED == 3) //mendel-parts
  110. const short temptable_3[][2] PROGMEM = {
  111. {1*OVERSAMPLENR,864},
  112. {21*OVERSAMPLENR,300},
  113. {25*OVERSAMPLENR,290},
  114. {29*OVERSAMPLENR,280},
  115. {33*OVERSAMPLENR,270},
  116. {39*OVERSAMPLENR,260},
  117. {46*OVERSAMPLENR,250},
  118. {54*OVERSAMPLENR,240},
  119. {64*OVERSAMPLENR,230},
  120. {75*OVERSAMPLENR,220},
  121. {90*OVERSAMPLENR,210},
  122. {107*OVERSAMPLENR,200},
  123. {128*OVERSAMPLENR,190},
  124. {154*OVERSAMPLENR,180},
  125. {184*OVERSAMPLENR,170},
  126. {221*OVERSAMPLENR,160},
  127. {265*OVERSAMPLENR,150},
  128. {316*OVERSAMPLENR,140},
  129. {375*OVERSAMPLENR,130},
  130. {441*OVERSAMPLENR,120},
  131. {513*OVERSAMPLENR,110},
  132. {588*OVERSAMPLENR,100},
  133. {734*OVERSAMPLENR,80},
  134. {856*OVERSAMPLENR,60},
  135. {938*OVERSAMPLENR,40},
  136. {986*OVERSAMPLENR,20},
  137. {1008*OVERSAMPLENR,0},
  138. {1018*OVERSAMPLENR,-20}
  139. };
  140. #endif
  141. #if (THERMISTORHEATER_0 == 4) || (THERMISTORHEATER_1 == 4) || (THERMISTORHEATER_2 == 4) || (THERMISTORBED == 4) //10k thermistor
  142. const short temptable_4[][2] PROGMEM = {
  143. {1*OVERSAMPLENR, 430},
  144. {54*OVERSAMPLENR, 137},
  145. {107*OVERSAMPLENR, 107},
  146. {160*OVERSAMPLENR, 91},
  147. {213*OVERSAMPLENR, 80},
  148. {266*OVERSAMPLENR, 71},
  149. {319*OVERSAMPLENR, 64},
  150. {372*OVERSAMPLENR, 57},
  151. {425*OVERSAMPLENR, 51},
  152. {478*OVERSAMPLENR, 46},
  153. {531*OVERSAMPLENR, 41},
  154. {584*OVERSAMPLENR, 35},
  155. {637*OVERSAMPLENR, 30},
  156. {690*OVERSAMPLENR, 25},
  157. {743*OVERSAMPLENR, 20},
  158. {796*OVERSAMPLENR, 14},
  159. {849*OVERSAMPLENR, 7},
  160. {902*OVERSAMPLENR, 0},
  161. {955*OVERSAMPLENR, -11},
  162. {1008*OVERSAMPLENR, -35}
  163. };
  164. #endif
  165. #if (THERMISTORHEATER_0 == 5) || (THERMISTORHEATER_1 == 5) || (THERMISTORHEATER_2 == 5) || (THERMISTORBED == 5) //100k ParCan thermistor (104GT-2)
  166. const short temptable_5[][2] PROGMEM = {
  167. // ATC Semitec 104GT-2 (Used in ParCan)
  168. // Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf
  169. // Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance
  170. {1*OVERSAMPLENR, 713},
  171. {17*OVERSAMPLENR, 300}, //top rating 300C
  172. {20*OVERSAMPLENR, 290},
  173. {23*OVERSAMPLENR, 280},
  174. {27*OVERSAMPLENR, 270},
  175. {31*OVERSAMPLENR, 260},
  176. {37*OVERSAMPLENR, 250},
  177. {43*OVERSAMPLENR, 240},
  178. {51*OVERSAMPLENR, 230},
  179. {61*OVERSAMPLENR, 220},
  180. {73*OVERSAMPLENR, 210},
  181. {87*OVERSAMPLENR, 200},
  182. {106*OVERSAMPLENR, 190},
  183. {128*OVERSAMPLENR, 180},
  184. {155*OVERSAMPLENR, 170},
  185. {189*OVERSAMPLENR, 160},
  186. {230*OVERSAMPLENR, 150},
  187. {278*OVERSAMPLENR, 140},
  188. {336*OVERSAMPLENR, 130},
  189. {402*OVERSAMPLENR, 120},
  190. {476*OVERSAMPLENR, 110},
  191. {554*OVERSAMPLENR, 100},
  192. {635*OVERSAMPLENR, 90},
  193. {713*OVERSAMPLENR, 80},
  194. {784*OVERSAMPLENR, 70},
  195. {846*OVERSAMPLENR, 60},
  196. {897*OVERSAMPLENR, 50},
  197. {937*OVERSAMPLENR, 40},
  198. {966*OVERSAMPLENR, 30},
  199. {986*OVERSAMPLENR, 20},
  200. {1000*OVERSAMPLENR, 10},
  201. {1010*OVERSAMPLENR, 0}
  202. };
  203. #endif
  204. #if (THERMISTORHEATER_0 == 6) || (THERMISTORHEATER_1 == 6) || (THERMISTORHEATER_2 == 6) || (THERMISTORBED == 6) // 100k Epcos thermistor
  205. const short temptable_6[][2] PROGMEM = {
  206. {1*OVERSAMPLENR, 350},
  207. {28*OVERSAMPLENR, 250}, //top rating 250C
  208. {31*OVERSAMPLENR, 245},
  209. {35*OVERSAMPLENR, 240},
  210. {39*OVERSAMPLENR, 235},
  211. {42*OVERSAMPLENR, 230},
  212. {44*OVERSAMPLENR, 225},
  213. {49*OVERSAMPLENR, 220},
  214. {53*OVERSAMPLENR, 215},
  215. {62*OVERSAMPLENR, 210},
  216. {71*OVERSAMPLENR, 205}, //fitted graphically
  217. {78*OVERSAMPLENR, 200}, //fitted graphically
  218. {94*OVERSAMPLENR, 190},
  219. {102*OVERSAMPLENR, 185},
  220. {116*OVERSAMPLENR, 170},
  221. {143*OVERSAMPLENR, 160},
  222. {183*OVERSAMPLENR, 150},
  223. {223*OVERSAMPLENR, 140},
  224. {270*OVERSAMPLENR, 130},
  225. {318*OVERSAMPLENR, 120},
  226. {383*OVERSAMPLENR, 110},
  227. {413*OVERSAMPLENR, 105},
  228. {439*OVERSAMPLENR, 100},
  229. {484*OVERSAMPLENR, 95},
  230. {513*OVERSAMPLENR, 90},
  231. {607*OVERSAMPLENR, 80},
  232. {664*OVERSAMPLENR, 70},
  233. {781*OVERSAMPLENR, 60},
  234. {810*OVERSAMPLENR, 55},
  235. {849*OVERSAMPLENR, 50},
  236. {914*OVERSAMPLENR, 45},
  237. {914*OVERSAMPLENR, 40},
  238. {935*OVERSAMPLENR, 35},
  239. {954*OVERSAMPLENR, 30},
  240. {970*OVERSAMPLENR, 25},
  241. {978*OVERSAMPLENR, 22},
  242. {1008*OVERSAMPLENR, 3},
  243. {1023*OVERSAMPLENR, 0} //to allow internal 0 degrees C
  244. };
  245. #endif
  246. #if (THERMISTORHEATER_0 == 7) || (THERMISTORHEATER_1 == 7) || (THERMISTORHEATER_2 == 7) || (THERMISTORBED == 7) // 100k Honeywell 135-104LAG-J01
  247. const short temptable_7[][2] PROGMEM = {
  248. {1*OVERSAMPLENR, 941},
  249. {19*OVERSAMPLENR, 362},
  250. {37*OVERSAMPLENR, 299}, //top rating 300C
  251. {55*OVERSAMPLENR, 266},
  252. {73*OVERSAMPLENR, 245},
  253. {91*OVERSAMPLENR, 229},
  254. {109*OVERSAMPLENR, 216},
  255. {127*OVERSAMPLENR, 206},
  256. {145*OVERSAMPLENR, 197},
  257. {163*OVERSAMPLENR, 190},
  258. {181*OVERSAMPLENR, 183},
  259. {199*OVERSAMPLENR, 177},
  260. {217*OVERSAMPLENR, 171},
  261. {235*OVERSAMPLENR, 166},
  262. {253*OVERSAMPLENR, 162},
  263. {271*OVERSAMPLENR, 157},
  264. {289*OVERSAMPLENR, 153},
  265. {307*OVERSAMPLENR, 149},
  266. {325*OVERSAMPLENR, 146},
  267. {343*OVERSAMPLENR, 142},
  268. {361*OVERSAMPLENR, 139},
  269. {379*OVERSAMPLENR, 135},
  270. {397*OVERSAMPLENR, 132},
  271. {415*OVERSAMPLENR, 129},
  272. {433*OVERSAMPLENR, 126},
  273. {451*OVERSAMPLENR, 123},
  274. {469*OVERSAMPLENR, 121},
  275. {487*OVERSAMPLENR, 118},
  276. {505*OVERSAMPLENR, 115},
  277. {523*OVERSAMPLENR, 112},
  278. {541*OVERSAMPLENR, 110},
  279. {559*OVERSAMPLENR, 107},
  280. {577*OVERSAMPLENR, 105},
  281. {595*OVERSAMPLENR, 102},
  282. {613*OVERSAMPLENR, 99},
  283. {631*OVERSAMPLENR, 97},
  284. {649*OVERSAMPLENR, 94},
  285. {667*OVERSAMPLENR, 92},
  286. {685*OVERSAMPLENR, 89},
  287. {703*OVERSAMPLENR, 86},
  288. {721*OVERSAMPLENR, 84},
  289. {739*OVERSAMPLENR, 81},
  290. {757*OVERSAMPLENR, 78},
  291. {775*OVERSAMPLENR, 75},
  292. {793*OVERSAMPLENR, 72},
  293. {811*OVERSAMPLENR, 69},
  294. {829*OVERSAMPLENR, 66},
  295. {847*OVERSAMPLENR, 62},
  296. {865*OVERSAMPLENR, 59},
  297. {883*OVERSAMPLENR, 55},
  298. {901*OVERSAMPLENR, 51},
  299. {919*OVERSAMPLENR, 46},
  300. {937*OVERSAMPLENR, 41},
  301. {955*OVERSAMPLENR, 35},
  302. {973*OVERSAMPLENR, 27},
  303. {991*OVERSAMPLENR, 17},
  304. {1009*OVERSAMPLENR, 1},
  305. {1023*OVERSAMPLENR, 0} //to allow internal 0 degrees C
  306. };
  307. #endif
  308. #if (THERMISTORHEATER_0 == 71) || (THERMISTORHEATER_1 == 71) || (THERMISTORHEATER_2 == 71) || (THERMISTORBED == 71) // 100k Honeywell 135-104LAF-J01
  309. // R0 = 100000 Ohm
  310. // T0 = 25 °C
  311. // Beta = 3974
  312. // R1 = 0 Ohm
  313. // R2 = 4700 Ohm
  314. const short temptable_71[][2] PROGMEM = {
  315. {35*OVERSAMPLENR, 300},
  316. {51*OVERSAMPLENR, 270},
  317. {54*OVERSAMPLENR, 265},
  318. {58*OVERSAMPLENR, 260},
  319. {59*OVERSAMPLENR, 258},
  320. {61*OVERSAMPLENR, 256},
  321. {63*OVERSAMPLENR, 254},
  322. {64*OVERSAMPLENR, 252},
  323. {66*OVERSAMPLENR, 250},
  324. {67*OVERSAMPLENR, 249},
  325. {68*OVERSAMPLENR, 248},
  326. {69*OVERSAMPLENR, 247},
  327. {70*OVERSAMPLENR, 246},
  328. {71*OVERSAMPLENR, 245},
  329. {72*OVERSAMPLENR, 244},
  330. {73*OVERSAMPLENR, 243},
  331. {74*OVERSAMPLENR, 242},
  332. {75*OVERSAMPLENR, 241},
  333. {76*OVERSAMPLENR, 240},
  334. {77*OVERSAMPLENR, 239},
  335. {78*OVERSAMPLENR, 238},
  336. {79*OVERSAMPLENR, 237},
  337. {80*OVERSAMPLENR, 236},
  338. {81*OVERSAMPLENR, 235},
  339. {82*OVERSAMPLENR, 234},
  340. {84*OVERSAMPLENR, 233},
  341. {85*OVERSAMPLENR, 232},
  342. {86*OVERSAMPLENR, 231},
  343. {87*OVERSAMPLENR, 230},
  344. {89*OVERSAMPLENR, 229},
  345. {90*OVERSAMPLENR, 228},
  346. {91*OVERSAMPLENR, 227},
  347. {92*OVERSAMPLENR, 226},
  348. {94*OVERSAMPLENR, 225},
  349. {95*OVERSAMPLENR, 224},
  350. {97*OVERSAMPLENR, 223},
  351. {98*OVERSAMPLENR, 222},
  352. {99*OVERSAMPLENR, 221},
  353. {101*OVERSAMPLENR, 220},
  354. {102*OVERSAMPLENR, 219},
  355. {104*OVERSAMPLENR, 218},
  356. {106*OVERSAMPLENR, 217},
  357. {107*OVERSAMPLENR, 216},
  358. {109*OVERSAMPLENR, 215},
  359. {110*OVERSAMPLENR, 214},
  360. {112*OVERSAMPLENR, 213},
  361. {114*OVERSAMPLENR, 212},
  362. {115*OVERSAMPLENR, 211},
  363. {117*OVERSAMPLENR, 210},
  364. {119*OVERSAMPLENR, 209},
  365. {121*OVERSAMPLENR, 208},
  366. {123*OVERSAMPLENR, 207},
  367. {125*OVERSAMPLENR, 206},
  368. {126*OVERSAMPLENR, 205},
  369. {128*OVERSAMPLENR, 204},
  370. {130*OVERSAMPLENR, 203},
  371. {132*OVERSAMPLENR, 202},
  372. {134*OVERSAMPLENR, 201},
  373. {136*OVERSAMPLENR, 200},
  374. {139*OVERSAMPLENR, 199},
  375. {141*OVERSAMPLENR, 198},
  376. {143*OVERSAMPLENR, 197},
  377. {145*OVERSAMPLENR, 196},
  378. {147*OVERSAMPLENR, 195},
  379. {150*OVERSAMPLENR, 194},
  380. {152*OVERSAMPLENR, 193},
  381. {154*OVERSAMPLENR, 192},
  382. {157*OVERSAMPLENR, 191},
  383. {159*OVERSAMPLENR, 190},
  384. {162*OVERSAMPLENR, 189},
  385. {164*OVERSAMPLENR, 188},
  386. {167*OVERSAMPLENR, 187},
  387. {170*OVERSAMPLENR, 186},
  388. {172*OVERSAMPLENR, 185},
  389. {175*OVERSAMPLENR, 184},
  390. {178*OVERSAMPLENR, 183},
  391. {181*OVERSAMPLENR, 182},
  392. {184*OVERSAMPLENR, 181},
  393. {187*OVERSAMPLENR, 180},
  394. {190*OVERSAMPLENR, 179},
  395. {193*OVERSAMPLENR, 178},
  396. {196*OVERSAMPLENR, 177},
  397. {199*OVERSAMPLENR, 176},
  398. {202*OVERSAMPLENR, 175},
  399. {205*OVERSAMPLENR, 174},
  400. {208*OVERSAMPLENR, 173},
  401. {212*OVERSAMPLENR, 172},
  402. {215*OVERSAMPLENR, 171},
  403. {219*OVERSAMPLENR, 170},
  404. {237*OVERSAMPLENR, 165},
  405. {256*OVERSAMPLENR, 160},
  406. {300*OVERSAMPLENR, 150},
  407. {351*OVERSAMPLENR, 140},
  408. {470*OVERSAMPLENR, 120},
  409. {504*OVERSAMPLENR, 115},
  410. {538*OVERSAMPLENR, 110},
  411. {552*OVERSAMPLENR, 108},
  412. {566*OVERSAMPLENR, 106},
  413. {580*OVERSAMPLENR, 104},
  414. {594*OVERSAMPLENR, 102},
  415. {608*OVERSAMPLENR, 100},
  416. {622*OVERSAMPLENR, 98},
  417. {636*OVERSAMPLENR, 96},
  418. {650*OVERSAMPLENR, 94},
  419. {664*OVERSAMPLENR, 92},
  420. {678*OVERSAMPLENR, 90},
  421. {712*OVERSAMPLENR, 85},
  422. {745*OVERSAMPLENR, 80},
  423. {758*OVERSAMPLENR, 78},
  424. {770*OVERSAMPLENR, 76},
  425. {783*OVERSAMPLENR, 74},
  426. {795*OVERSAMPLENR, 72},
  427. {806*OVERSAMPLENR, 70},
  428. {818*OVERSAMPLENR, 68},
  429. {829*OVERSAMPLENR, 66},
  430. {840*OVERSAMPLENR, 64},
  431. {850*OVERSAMPLENR, 62},
  432. {860*OVERSAMPLENR, 60},
  433. {870*OVERSAMPLENR, 58},
  434. {879*OVERSAMPLENR, 56},
  435. {888*OVERSAMPLENR, 54},
  436. {897*OVERSAMPLENR, 52},
  437. {905*OVERSAMPLENR, 50},
  438. {924*OVERSAMPLENR, 45},
  439. {940*OVERSAMPLENR, 40},
  440. {955*OVERSAMPLENR, 35},
  441. {967*OVERSAMPLENR, 30},
  442. {970*OVERSAMPLENR, 29},
  443. {972*OVERSAMPLENR, 28},
  444. {974*OVERSAMPLENR, 27},
  445. {976*OVERSAMPLENR, 26},
  446. {978*OVERSAMPLENR, 25},
  447. {980*OVERSAMPLENR, 24},
  448. {982*OVERSAMPLENR, 23},
  449. {984*OVERSAMPLENR, 22},
  450. {985*OVERSAMPLENR, 21},
  451. {987*OVERSAMPLENR, 20},
  452. {995*OVERSAMPLENR, 15},
  453. {1001*OVERSAMPLENR, 10},
  454. {1006*OVERSAMPLENR, 5},
  455. {1010*OVERSAMPLENR, 0},
  456. };
  457. #endif
  458. #if (THERMISTORHEATER_0 == 8) || (THERMISTORHEATER_1 == 8) || (THERMISTORHEATER_2 == 8) || (THERMISTORBED == 8)
  459. // 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
  460. const short temptable_8[][2] PROGMEM = {
  461. {1*OVERSAMPLENR, 704},
  462. {54*OVERSAMPLENR, 216},
  463. {107*OVERSAMPLENR, 175},
  464. {160*OVERSAMPLENR, 152},
  465. {213*OVERSAMPLENR, 137},
  466. {266*OVERSAMPLENR, 125},
  467. {319*OVERSAMPLENR, 115},
  468. {372*OVERSAMPLENR, 106},
  469. {425*OVERSAMPLENR, 99},
  470. {478*OVERSAMPLENR, 91},
  471. {531*OVERSAMPLENR, 85},
  472. {584*OVERSAMPLENR, 78},
  473. {637*OVERSAMPLENR, 71},
  474. {690*OVERSAMPLENR, 65},
  475. {743*OVERSAMPLENR, 58},
  476. {796*OVERSAMPLENR, 50},
  477. {849*OVERSAMPLENR, 42},
  478. {902*OVERSAMPLENR, 31},
  479. {955*OVERSAMPLENR, 17},
  480. {1008*OVERSAMPLENR, 0}
  481. };
  482. #endif
  483. #if (THERMISTORHEATER_0 == 9) || (THERMISTORHEATER_1 == 9) || (THERMISTORHEATER_2 == 9) || (THERMISTORBED == 9)
  484. // 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
  485. const short temptable_9[][2] PROGMEM = {
  486. {1*OVERSAMPLENR, 936},
  487. {36*OVERSAMPLENR, 300},
  488. {71*OVERSAMPLENR, 246},
  489. {106*OVERSAMPLENR, 218},
  490. {141*OVERSAMPLENR, 199},
  491. {176*OVERSAMPLENR, 185},
  492. {211*OVERSAMPLENR, 173},
  493. {246*OVERSAMPLENR, 163},
  494. {281*OVERSAMPLENR, 155},
  495. {316*OVERSAMPLENR, 147},
  496. {351*OVERSAMPLENR, 140},
  497. {386*OVERSAMPLENR, 134},
  498. {421*OVERSAMPLENR, 128},
  499. {456*OVERSAMPLENR, 122},
  500. {491*OVERSAMPLENR, 117},
  501. {526*OVERSAMPLENR, 112},
  502. {561*OVERSAMPLENR, 107},
  503. {596*OVERSAMPLENR, 102},
  504. {631*OVERSAMPLENR, 97},
  505. {666*OVERSAMPLENR, 92},
  506. {701*OVERSAMPLENR, 87},
  507. {736*OVERSAMPLENR, 81},
  508. {771*OVERSAMPLENR, 76},
  509. {806*OVERSAMPLENR, 70},
  510. {841*OVERSAMPLENR, 63},
  511. {876*OVERSAMPLENR, 56},
  512. {911*OVERSAMPLENR, 48},
  513. {946*OVERSAMPLENR, 38},
  514. {981*OVERSAMPLENR, 23},
  515. {1005*OVERSAMPLENR, 5},
  516. {1016*OVERSAMPLENR, 0}
  517. };
  518. #endif
  519. #if (THERMISTORHEATER_0 == 10) || (THERMISTORHEATER_1 == 10) || (THERMISTORHEATER_2 == 10) || (THERMISTORBED == 10)
  520. // 100k RS thermistor 198-961 (4.7k pullup)
  521. const short temptable_10[][2] PROGMEM = {
  522. {1*OVERSAMPLENR, 929},
  523. {36*OVERSAMPLENR, 299},
  524. {71*OVERSAMPLENR, 246},
  525. {106*OVERSAMPLENR, 217},
  526. {141*OVERSAMPLENR, 198},
  527. {176*OVERSAMPLENR, 184},
  528. {211*OVERSAMPLENR, 173},
  529. {246*OVERSAMPLENR, 163},
  530. {281*OVERSAMPLENR, 154},
  531. {316*OVERSAMPLENR, 147},
  532. {351*OVERSAMPLENR, 140},
  533. {386*OVERSAMPLENR, 134},
  534. {421*OVERSAMPLENR, 128},
  535. {456*OVERSAMPLENR, 122},
  536. {491*OVERSAMPLENR, 117},
  537. {526*OVERSAMPLENR, 112},
  538. {561*OVERSAMPLENR, 107},
  539. {596*OVERSAMPLENR, 102},
  540. {631*OVERSAMPLENR, 97},
  541. {666*OVERSAMPLENR, 91},
  542. {701*OVERSAMPLENR, 86},
  543. {736*OVERSAMPLENR, 81},
  544. {771*OVERSAMPLENR, 76},
  545. {806*OVERSAMPLENR, 70},
  546. {841*OVERSAMPLENR, 63},
  547. {876*OVERSAMPLENR, 56},
  548. {911*OVERSAMPLENR, 48},
  549. {946*OVERSAMPLENR, 38},
  550. {981*OVERSAMPLENR, 23},
  551. {1005*OVERSAMPLENR, 5},
  552. {1016*OVERSAMPLENR, 0}
  553. };
  554. #endif
  555. #if (THERMISTORHEATER_0 == 11) || (THERMISTORHEATER_1 == 11) || (THERMISTORHEATER_2 == 11) || (THERMISTORBED == 11)
  556. // QU-BD silicone bed QWG-104F-3950 thermistor
  557. const short temptable_11[][2] PROGMEM = {
  558. {1*OVERSAMPLENR, 938},
  559. {31*OVERSAMPLENR, 314},
  560. {41*OVERSAMPLENR, 290},
  561. {51*OVERSAMPLENR, 272},
  562. {61*OVERSAMPLENR, 258},
  563. {71*OVERSAMPLENR, 247},
  564. {81*OVERSAMPLENR, 237},
  565. {91*OVERSAMPLENR, 229},
  566. {101*OVERSAMPLENR, 221},
  567. {111*OVERSAMPLENR, 215},
  568. {121*OVERSAMPLENR, 209},
  569. {131*OVERSAMPLENR, 204},
  570. {141*OVERSAMPLENR, 199},
  571. {151*OVERSAMPLENR, 195},
  572. {161*OVERSAMPLENR, 190},
  573. {171*OVERSAMPLENR, 187},
  574. {181*OVERSAMPLENR, 183},
  575. {191*OVERSAMPLENR, 179},
  576. {201*OVERSAMPLENR, 176},
  577. {221*OVERSAMPLENR, 170},
  578. {241*OVERSAMPLENR, 165},
  579. {261*OVERSAMPLENR, 160},
  580. {281*OVERSAMPLENR, 155},
  581. {301*OVERSAMPLENR, 150},
  582. {331*OVERSAMPLENR, 144},
  583. {361*OVERSAMPLENR, 139},
  584. {391*OVERSAMPLENR, 133},
  585. {421*OVERSAMPLENR, 128},
  586. {451*OVERSAMPLENR, 123},
  587. {491*OVERSAMPLENR, 117},
  588. {531*OVERSAMPLENR, 111},
  589. {571*OVERSAMPLENR, 105},
  590. {611*OVERSAMPLENR, 100},
  591. {641*OVERSAMPLENR, 95},
  592. {681*OVERSAMPLENR, 90},
  593. {711*OVERSAMPLENR, 85},
  594. {751*OVERSAMPLENR, 79},
  595. {791*OVERSAMPLENR, 72},
  596. {811*OVERSAMPLENR, 69},
  597. {831*OVERSAMPLENR, 65},
  598. {871*OVERSAMPLENR, 57},
  599. {881*OVERSAMPLENR, 55},
  600. {901*OVERSAMPLENR, 51},
  601. {921*OVERSAMPLENR, 45},
  602. {941*OVERSAMPLENR, 39},
  603. {971*OVERSAMPLENR, 28},
  604. {981*OVERSAMPLENR, 23},
  605. {991*OVERSAMPLENR, 17},
  606. {1001*OVERSAMPLENR, 9},
  607. {1021*OVERSAMPLENR, -27}
  608. };
  609. #endif
  610. #if (THERMISTORHEATER_0 == 13) || (THERMISTORHEATER_1 == 13) || (THERMISTORHEATER_2 == 13) || (THERMISTORBED == 13)
  611. // Hisens thermistor B25/50 =3950 +/-1%
  612. const short temptable_13[][2] PROGMEM = {
  613. { 20.04*OVERSAMPLENR, 300 },
  614. { 23.19*OVERSAMPLENR, 290 },
  615. { 26.71*OVERSAMPLENR, 280 },
  616. { 31.23*OVERSAMPLENR, 270 },
  617. { 36.52*OVERSAMPLENR, 260 },
  618. { 42.75*OVERSAMPLENR, 250 },
  619. { 50.68*OVERSAMPLENR, 240 },
  620. { 60.22*OVERSAMPLENR, 230 },
  621. { 72.03*OVERSAMPLENR, 220 },
  622. { 86.84*OVERSAMPLENR, 210 },
  623. { 102.79*OVERSAMPLENR, 200 },
  624. { 124.46*OVERSAMPLENR, 190 },
  625. { 151.02*OVERSAMPLENR, 180 },
  626. { 182.86*OVERSAMPLENR, 170 },
  627. { 220.72*OVERSAMPLENR, 160 },
  628. { 316.96*OVERSAMPLENR, 140 },
  629. { 447.17*OVERSAMPLENR, 120 },
  630. { 590.61*OVERSAMPLENR, 100 },
  631. { 737.31*OVERSAMPLENR, 80 },
  632. { 857.77*OVERSAMPLENR, 60 },
  633. { 939.52*OVERSAMPLENR, 40 },
  634. { 986.03*OVERSAMPLENR, 20 },
  635. { 1008.7*OVERSAMPLENR, 0}
  636. };
  637. #endif
  638. #if (THERMISTORHEATER_0 == 20) || (THERMISTORHEATER_1 == 20) || (THERMISTORHEATER_2 == 20) || (THERMISTORBED == 20) // PT100 with INA826 amp on Ultimaker v2.0 electronics
  639. /* The PT100 in the Ultimaker v2.0 electronics has a high sample value for a high temperature.
  640. This does not match the normal thermistor behaviour so we need to set the following defines */
  641. #if (THERMISTORHEATER_0 == 20)
  642. # define HEATER_0_RAW_HI_TEMP 16383
  643. # define HEATER_0_RAW_LO_TEMP 0
  644. #endif
  645. #if (THERMISTORHEATER_1 == 20)
  646. # define HEATER_1_RAW_HI_TEMP 16383
  647. # define HEATER_1_RAW_LO_TEMP 0
  648. #endif
  649. #if (THERMISTORHEATER_2 == 20)
  650. # define HEATER_2_RAW_HI_TEMP 16383
  651. # define HEATER_2_RAW_LO_TEMP 0
  652. #endif
  653. #if (THERMISTORBED == 20)
  654. # define HEATER_BED_RAW_HI_TEMP 16383
  655. # define HEATER_BED_RAW_LO_TEMP 0
  656. #endif
  657. const short temptable_20[][2] PROGMEM = {
  658. { 0*OVERSAMPLENR , 0 },
  659. { 227*OVERSAMPLENR , 1 },
  660. { 236*OVERSAMPLENR , 10 },
  661. { 245*OVERSAMPLENR , 20 },
  662. { 253*OVERSAMPLENR , 30 },
  663. { 262*OVERSAMPLENR , 40 },
  664. { 270*OVERSAMPLENR , 50 },
  665. { 279*OVERSAMPLENR , 60 },
  666. { 287*OVERSAMPLENR , 70 },
  667. { 295*OVERSAMPLENR , 80 },
  668. { 304*OVERSAMPLENR , 90 },
  669. { 312*OVERSAMPLENR , 100 },
  670. { 320*OVERSAMPLENR , 110 },
  671. { 329*OVERSAMPLENR , 120 },
  672. { 337*OVERSAMPLENR , 130 },
  673. { 345*OVERSAMPLENR , 140 },
  674. { 353*OVERSAMPLENR , 150 },
  675. { 361*OVERSAMPLENR , 160 },
  676. { 369*OVERSAMPLENR , 170 },
  677. { 377*OVERSAMPLENR , 180 },
  678. { 385*OVERSAMPLENR , 190 },
  679. { 393*OVERSAMPLENR , 200 },
  680. { 401*OVERSAMPLENR , 210 },
  681. { 409*OVERSAMPLENR , 220 },
  682. { 417*OVERSAMPLENR , 230 },
  683. { 424*OVERSAMPLENR , 240 },
  684. { 432*OVERSAMPLENR , 250 },
  685. { 440*OVERSAMPLENR , 260 },
  686. { 447*OVERSAMPLENR , 270 },
  687. { 455*OVERSAMPLENR , 280 },
  688. { 463*OVERSAMPLENR , 290 },
  689. { 470*OVERSAMPLENR , 300 },
  690. { 478*OVERSAMPLENR , 310 },
  691. { 485*OVERSAMPLENR , 320 },
  692. { 493*OVERSAMPLENR , 330 },
  693. { 500*OVERSAMPLENR , 340 },
  694. { 507*OVERSAMPLENR , 350 },
  695. { 515*OVERSAMPLENR , 360 },
  696. { 522*OVERSAMPLENR , 370 },
  697. { 529*OVERSAMPLENR , 380 },
  698. { 537*OVERSAMPLENR , 390 },
  699. { 544*OVERSAMPLENR , 400 },
  700. { 614*OVERSAMPLENR , 500 },
  701. { 681*OVERSAMPLENR , 600 },
  702. { 744*OVERSAMPLENR , 700 },
  703. { 805*OVERSAMPLENR , 800 },
  704. { 862*OVERSAMPLENR , 900 },
  705. { 917*OVERSAMPLENR , 1000 },
  706. { 968*OVERSAMPLENR , 1100 }
  707. };
  708. #endif
  709. #if (THERMISTORHEATER_0 == 51) || (THERMISTORHEATER_1 == 51) || (THERMISTORHEATER_2 == 51) || (THERMISTORBED == 51)
  710. // 100k EPCOS (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!)
  711. // Verified by linagee.
  712. // Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance
  713. // Advantage: Twice the resolution and better linearity from 150C to 200C
  714. const short temptable_51[][2] PROGMEM = {
  715. {1*OVERSAMPLENR, 350},
  716. {190*OVERSAMPLENR, 250}, //top rating 250C
  717. {203*OVERSAMPLENR, 245},
  718. {217*OVERSAMPLENR, 240},
  719. {232*OVERSAMPLENR, 235},
  720. {248*OVERSAMPLENR, 230},
  721. {265*OVERSAMPLENR, 225},
  722. {283*OVERSAMPLENR, 220},
  723. {302*OVERSAMPLENR, 215},
  724. {322*OVERSAMPLENR, 210},
  725. {344*OVERSAMPLENR, 205},
  726. {366*OVERSAMPLENR, 200},
  727. {390*OVERSAMPLENR, 195},
  728. {415*OVERSAMPLENR, 190},
  729. {440*OVERSAMPLENR, 185},
  730. {467*OVERSAMPLENR, 180},
  731. {494*OVERSAMPLENR, 175},
  732. {522*OVERSAMPLENR, 170},
  733. {551*OVERSAMPLENR, 165},
  734. {580*OVERSAMPLENR, 160},
  735. {609*OVERSAMPLENR, 155},
  736. {638*OVERSAMPLENR, 150},
  737. {666*OVERSAMPLENR, 145},
  738. {695*OVERSAMPLENR, 140},
  739. {722*OVERSAMPLENR, 135},
  740. {749*OVERSAMPLENR, 130},
  741. {775*OVERSAMPLENR, 125},
  742. {800*OVERSAMPLENR, 120},
  743. {823*OVERSAMPLENR, 115},
  744. {845*OVERSAMPLENR, 110},
  745. {865*OVERSAMPLENR, 105},
  746. {884*OVERSAMPLENR, 100},
  747. {901*OVERSAMPLENR, 95},
  748. {917*OVERSAMPLENR, 90},
  749. {932*OVERSAMPLENR, 85},
  750. {944*OVERSAMPLENR, 80},
  751. {956*OVERSAMPLENR, 75},
  752. {966*OVERSAMPLENR, 70},
  753. {975*OVERSAMPLENR, 65},
  754. {982*OVERSAMPLENR, 60},
  755. {989*OVERSAMPLENR, 55},
  756. {995*OVERSAMPLENR, 50},
  757. {1000*OVERSAMPLENR, 45},
  758. {1004*OVERSAMPLENR, 40},
  759. {1007*OVERSAMPLENR, 35},
  760. {1010*OVERSAMPLENR, 30},
  761. {1013*OVERSAMPLENR, 25},
  762. {1015*OVERSAMPLENR, 20},
  763. {1017*OVERSAMPLENR, 15},
  764. {1018*OVERSAMPLENR, 10},
  765. {1019*OVERSAMPLENR, 5},
  766. {1020*OVERSAMPLENR, 0},
  767. {1021*OVERSAMPLENR, -5}
  768. };
  769. #endif
  770. #if (THERMISTORHEATER_0 == 52) || (THERMISTORHEATER_1 == 52) || (THERMISTORHEATER_2 == 52) || (THERMISTORBED == 52)
  771. // 200k ATC Semitec 204GT-2 (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!)
  772. // Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf
  773. // Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance
  774. // Advantage: More resolution and better linearity from 150C to 200C
  775. const short temptable_52[][2] PROGMEM = {
  776. {1*OVERSAMPLENR, 500},
  777. {125*OVERSAMPLENR, 300}, //top rating 300C
  778. {142*OVERSAMPLENR, 290},
  779. {162*OVERSAMPLENR, 280},
  780. {185*OVERSAMPLENR, 270},
  781. {211*OVERSAMPLENR, 260},
  782. {240*OVERSAMPLENR, 250},
  783. {274*OVERSAMPLENR, 240},
  784. {312*OVERSAMPLENR, 230},
  785. {355*OVERSAMPLENR, 220},
  786. {401*OVERSAMPLENR, 210},
  787. {452*OVERSAMPLENR, 200},
  788. {506*OVERSAMPLENR, 190},
  789. {563*OVERSAMPLENR, 180},
  790. {620*OVERSAMPLENR, 170},
  791. {677*OVERSAMPLENR, 160},
  792. {732*OVERSAMPLENR, 150},
  793. {783*OVERSAMPLENR, 140},
  794. {830*OVERSAMPLENR, 130},
  795. {871*OVERSAMPLENR, 120},
  796. {906*OVERSAMPLENR, 110},
  797. {935*OVERSAMPLENR, 100},
  798. {958*OVERSAMPLENR, 90},
  799. {976*OVERSAMPLENR, 80},
  800. {990*OVERSAMPLENR, 70},
  801. {1000*OVERSAMPLENR, 60},
  802. {1008*OVERSAMPLENR, 50},
  803. {1013*OVERSAMPLENR, 40},
  804. {1017*OVERSAMPLENR, 30},
  805. {1019*OVERSAMPLENR, 20},
  806. {1021*OVERSAMPLENR, 10},
  807. {1022*OVERSAMPLENR, 0}
  808. };
  809. #endif
  810. #if (THERMISTORHEATER_0 == 55) || (THERMISTORHEATER_1 == 55) || (THERMISTORHEATER_2 == 55) || (THERMISTORBED == 55)
  811. // 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!)
  812. // Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf
  813. // Calculated using 1kohm pullup, voltage divider math, and manufacturer provided temp/resistance
  814. // Advantage: More resolution and better linearity from 150C to 200C
  815. const short temptable_55[][2] PROGMEM = {
  816. {1*OVERSAMPLENR, 500},
  817. {76*OVERSAMPLENR, 300},
  818. {87*OVERSAMPLENR, 290},
  819. {100*OVERSAMPLENR, 280},
  820. {114*OVERSAMPLENR, 270},
  821. {131*OVERSAMPLENR, 260},
  822. {152*OVERSAMPLENR, 250},
  823. {175*OVERSAMPLENR, 240},
  824. {202*OVERSAMPLENR, 230},
  825. {234*OVERSAMPLENR, 220},
  826. {271*OVERSAMPLENR, 210},
  827. {312*OVERSAMPLENR, 200},
  828. {359*OVERSAMPLENR, 190},
  829. {411*OVERSAMPLENR, 180},
  830. {467*OVERSAMPLENR, 170},
  831. {527*OVERSAMPLENR, 160},
  832. {590*OVERSAMPLENR, 150},
  833. {652*OVERSAMPLENR, 140},
  834. {713*OVERSAMPLENR, 130},
  835. {770*OVERSAMPLENR, 120},
  836. {822*OVERSAMPLENR, 110},
  837. {867*OVERSAMPLENR, 100},
  838. {905*OVERSAMPLENR, 90},
  839. {936*OVERSAMPLENR, 80},
  840. {961*OVERSAMPLENR, 70},
  841. {979*OVERSAMPLENR, 60},
  842. {993*OVERSAMPLENR, 50},
  843. {1003*OVERSAMPLENR, 40},
  844. {1010*OVERSAMPLENR, 30},
  845. {1015*OVERSAMPLENR, 20},
  846. {1018*OVERSAMPLENR, 10},
  847. {1020*OVERSAMPLENR, 0}
  848. };
  849. #endif
  850. #if (THERMISTORHEATER_0 == 60) || (THERMISTORHEATER_1 == 60) || (THERMISTORHEATER_2 == 60) || (THERMISTORBED == 60) // Maker's Tool Works Kapton Bed Thermister
  851. // ./createTemperatureLookup.py --r0=100000 --t0=25 --r1=0 --r2=4700 --beta=3950
  852. // r0: 100000
  853. // t0: 25
  854. // r1: 0 (parallel with rTherm)
  855. // r2: 4700 (series with rTherm)
  856. // beta: 3950
  857. // min adc: 1 at 0.0048828125 V
  858. // max adc: 1023 at 4.9951171875 V
  859. const short temptable_60[][2] PROGMEM = {
  860. {51*OVERSAMPLENR, 272},
  861. {61*OVERSAMPLENR, 258},
  862. {71*OVERSAMPLENR, 247},
  863. {81*OVERSAMPLENR, 237},
  864. {91*OVERSAMPLENR, 229},
  865. {101*OVERSAMPLENR, 221},
  866. {131*OVERSAMPLENR, 204},
  867. {161*OVERSAMPLENR, 190},
  868. {191*OVERSAMPLENR, 179},
  869. {231*OVERSAMPLENR, 167},
  870. {271*OVERSAMPLENR, 157},
  871. {311*OVERSAMPLENR, 148},
  872. {351*OVERSAMPLENR, 140},
  873. {381*OVERSAMPLENR, 135},
  874. {411*OVERSAMPLENR, 130},
  875. {441*OVERSAMPLENR, 125},
  876. {451*OVERSAMPLENR, 123},
  877. {461*OVERSAMPLENR, 122},
  878. {471*OVERSAMPLENR, 120},
  879. {481*OVERSAMPLENR, 119},
  880. {491*OVERSAMPLENR, 117},
  881. {501*OVERSAMPLENR, 116},
  882. {511*OVERSAMPLENR, 114},
  883. {521*OVERSAMPLENR, 113},
  884. {531*OVERSAMPLENR, 111},
  885. {541*OVERSAMPLENR, 110},
  886. {551*OVERSAMPLENR, 108},
  887. {561*OVERSAMPLENR, 107},
  888. {571*OVERSAMPLENR, 105},
  889. {581*OVERSAMPLENR, 104},
  890. {591*OVERSAMPLENR, 102},
  891. {601*OVERSAMPLENR, 101},
  892. {611*OVERSAMPLENR, 100},
  893. {621*OVERSAMPLENR, 98},
  894. {631*OVERSAMPLENR, 97},
  895. {641*OVERSAMPLENR, 95},
  896. {651*OVERSAMPLENR, 94},
  897. {661*OVERSAMPLENR, 92},
  898. {671*OVERSAMPLENR, 91},
  899. {681*OVERSAMPLENR, 90},
  900. {691*OVERSAMPLENR, 88},
  901. {701*OVERSAMPLENR, 87},
  902. {711*OVERSAMPLENR, 85},
  903. {721*OVERSAMPLENR, 84},
  904. {731*OVERSAMPLENR, 82},
  905. {741*OVERSAMPLENR, 81},
  906. {751*OVERSAMPLENR, 79},
  907. {761*OVERSAMPLENR, 77},
  908. {771*OVERSAMPLENR, 76},
  909. {781*OVERSAMPLENR, 74},
  910. {791*OVERSAMPLENR, 72},
  911. {801*OVERSAMPLENR, 71},
  912. {811*OVERSAMPLENR, 69},
  913. {821*OVERSAMPLENR, 67},
  914. {831*OVERSAMPLENR, 65},
  915. {841*OVERSAMPLENR, 63},
  916. {851*OVERSAMPLENR, 62},
  917. {861*OVERSAMPLENR, 60},
  918. {871*OVERSAMPLENR, 57},
  919. {881*OVERSAMPLENR, 55},
  920. {891*OVERSAMPLENR, 53},
  921. {901*OVERSAMPLENR, 51},
  922. {911*OVERSAMPLENR, 48},
  923. {921*OVERSAMPLENR, 45},
  924. {931*OVERSAMPLENR, 42},
  925. {941*OVERSAMPLENR, 39},
  926. {951*OVERSAMPLENR, 36},
  927. {961*OVERSAMPLENR, 32},
  928. {981*OVERSAMPLENR, 23},
  929. {991*OVERSAMPLENR, 17},
  930. {1001*OVERSAMPLENR, 9},
  931. {1008*OVERSAMPLENR, 0},
  932. };
  933. #endif
  934. #if (THERMISTORBED == 12)
  935. //100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
  936. const short temptable_12[][2] PROGMEM = {
  937. {35*OVERSAMPLENR, 180}, //top rating 180C
  938. {211*OVERSAMPLENR, 140},
  939. {233*OVERSAMPLENR, 135},
  940. {261*OVERSAMPLENR, 130},
  941. {290*OVERSAMPLENR, 125},
  942. {328*OVERSAMPLENR, 120},
  943. {362*OVERSAMPLENR, 115},
  944. {406*OVERSAMPLENR, 110},
  945. {446*OVERSAMPLENR, 105},
  946. {496*OVERSAMPLENR, 100},
  947. {539*OVERSAMPLENR, 95},
  948. {585*OVERSAMPLENR, 90},
  949. {629*OVERSAMPLENR, 85},
  950. {675*OVERSAMPLENR, 80},
  951. {718*OVERSAMPLENR, 75},
  952. {758*OVERSAMPLENR, 70},
  953. {793*OVERSAMPLENR, 65},
  954. {822*OVERSAMPLENR, 60},
  955. {841*OVERSAMPLENR, 55},
  956. {875*OVERSAMPLENR, 50},
  957. {899*OVERSAMPLENR, 45},
  958. {926*OVERSAMPLENR, 40},
  959. {946*OVERSAMPLENR, 35},
  960. {962*OVERSAMPLENR, 30},
  961. {977*OVERSAMPLENR, 25},
  962. {987*OVERSAMPLENR, 20},
  963. {995*OVERSAMPLENR, 15},
  964. {1001*OVERSAMPLENR, 10},
  965. {1010*OVERSAMPLENR, 0},
  966. {1023*OVERSAMPLENR, -40},
  967. };
  968. #endif
  969. // Pt1000 and Pt100 handling
  970. //
  971. // Rt=R0*(1+a*T+b*T*T) [for T>0]
  972. // a=3.9083E-3, b=-5.775E-7
  973. #define PtA 3.9083E-3
  974. #define PtB -5.775E-7
  975. #define PtRt(T,R0) ((R0)*(1.0+(PtA)*(T)+(PtB)*(T)*(T)))
  976. #define PtAdVal(T,R0,Rup) (short)(1024/(Rup/PtRt(T,R0)+1))
  977. #define PtLine(T,R0,Rup) { PtAdVal(T,R0,Rup)*OVERSAMPLENR, T },
  978. #if (THERMISTORHEATER_0 == 110) || (THERMISTORHEATER_1 == 110) || (THERMISTORHEATER_2 == 110) || (THERMISTORBED == 110) // Pt100 with 1k0 pullup
  979. const short temptable_110[][2] PROGMEM = {
  980. // only few values are needed as the curve is very flat
  981. PtLine(0,100,1000)
  982. PtLine(50,100,1000)
  983. PtLine(100,100,1000)
  984. PtLine(150,100,1000)
  985. PtLine(200,100,1000)
  986. PtLine(250,100,1000)
  987. PtLine(300,100,1000)
  988. };
  989. #endif
  990. #if (THERMISTORHEATER_0 == 147) || (THERMISTORHEATER_1 == 147) || (THERMISTORHEATER_2 == 147) || (THERMISTORBED == 147) // Pt100 with 4k7 pullup
  991. const short temptable_147[][2] PROGMEM = {
  992. // only few values are needed as the curve is very flat
  993. PtLine(0,100,4700)
  994. PtLine(50,100,4700)
  995. PtLine(100,100,4700)
  996. PtLine(150,100,4700)
  997. PtLine(200,100,4700)
  998. PtLine(250,100,4700)
  999. PtLine(300,100,4700)
  1000. };
  1001. #endif
  1002. #if (THERMISTORHEATER_0 == 1010) || (THERMISTORHEATER_1 == 1010) || (THERMISTORHEATER_2 == 1010) || (THERMISTORBED == 1010) // Pt1000 with 1k0 pullup
  1003. const short temptable_1010[][2] PROGMEM = {
  1004. PtLine(0,1000,1000)
  1005. PtLine(25,1000,1000)
  1006. PtLine(50,1000,1000)
  1007. PtLine(75,1000,1000)
  1008. PtLine(100,1000,1000)
  1009. PtLine(125,1000,1000)
  1010. PtLine(150,1000,1000)
  1011. PtLine(175,1000,1000)
  1012. PtLine(200,1000,1000)
  1013. PtLine(225,1000,1000)
  1014. PtLine(250,1000,1000)
  1015. PtLine(275,1000,1000)
  1016. PtLine(300,1000,1000)
  1017. };
  1018. #endif
  1019. #if (THERMISTORHEATER_0 == 1047) || (THERMISTORHEATER_1 == 1047) || (THERMISTORHEATER_2 == 1047) || (THERMISTORBED == 1047) // Pt1000 with 4k7 pullup
  1020. const short temptable_1047[][2] PROGMEM = {
  1021. // only few values are needed as the curve is very flat
  1022. PtLine(0,1000,4700)
  1023. PtLine(50,1000,4700)
  1024. PtLine(100,1000,4700)
  1025. PtLine(150,1000,4700)
  1026. PtLine(200,1000,4700)
  1027. PtLine(250,1000,4700)
  1028. PtLine(300,1000,4700)
  1029. };
  1030. #endif
  1031. #define _TT_NAME(_N) temptable_ ## _N
  1032. #define TT_NAME(_N) _TT_NAME(_N)
  1033. #ifdef THERMISTORHEATER_0
  1034. # define HEATER_0_TEMPTABLE TT_NAME(THERMISTORHEATER_0)
  1035. # define HEATER_0_TEMPTABLE_LEN (sizeof(HEATER_0_TEMPTABLE)/sizeof(*HEATER_0_TEMPTABLE))
  1036. #else
  1037. # ifdef HEATER_0_USES_THERMISTOR
  1038. # error No heater 0 thermistor table specified
  1039. # else // HEATER_0_USES_THERMISTOR
  1040. # define HEATER_0_TEMPTABLE NULL
  1041. # define HEATER_0_TEMPTABLE_LEN 0
  1042. # endif // HEATER_0_USES_THERMISTOR
  1043. #endif
  1044. //Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
  1045. #ifndef HEATER_0_RAW_HI_TEMP
  1046. # ifdef HEATER_0_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value
  1047. # define HEATER_0_RAW_HI_TEMP 0
  1048. # define HEATER_0_RAW_LO_TEMP 16383
  1049. # else //In case of an thermocouple the highest temperature results in the highest ADC value
  1050. # define HEATER_0_RAW_HI_TEMP 16383
  1051. # define HEATER_0_RAW_LO_TEMP 0
  1052. # endif
  1053. #endif
  1054. #ifdef THERMISTORHEATER_1
  1055. # define HEATER_1_TEMPTABLE TT_NAME(THERMISTORHEATER_1)
  1056. # define HEATER_1_TEMPTABLE_LEN (sizeof(HEATER_1_TEMPTABLE)/sizeof(*HEATER_1_TEMPTABLE))
  1057. #else
  1058. # ifdef HEATER_1_USES_THERMISTOR
  1059. # error No heater 1 thermistor table specified
  1060. # else // HEATER_1_USES_THERMISTOR
  1061. # define HEATER_1_TEMPTABLE NULL
  1062. # define HEATER_1_TEMPTABLE_LEN 0
  1063. # endif // HEATER_1_USES_THERMISTOR
  1064. #endif
  1065. //Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
  1066. #ifndef HEATER_1_RAW_HI_TEMP
  1067. # ifdef HEATER_1_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value
  1068. # define HEATER_1_RAW_HI_TEMP 0
  1069. # define HEATER_1_RAW_LO_TEMP 16383
  1070. # else //In case of an thermocouple the highest temperature results in the highest ADC value
  1071. # define HEATER_1_RAW_HI_TEMP 16383
  1072. # define HEATER_1_RAW_LO_TEMP 0
  1073. # endif
  1074. #endif
  1075. #ifdef THERMISTORHEATER_2
  1076. # define HEATER_2_TEMPTABLE TT_NAME(THERMISTORHEATER_2)
  1077. # define HEATER_2_TEMPTABLE_LEN (sizeof(HEATER_2_TEMPTABLE)/sizeof(*HEATER_2_TEMPTABLE))
  1078. #else
  1079. # ifdef HEATER_2_USES_THERMISTOR
  1080. # error No heater 2 thermistor table specified
  1081. # else // HEATER_2_USES_THERMISTOR
  1082. # define HEATER_2_TEMPTABLE NULL
  1083. # define HEATER_2_TEMPTABLE_LEN 0
  1084. # endif // HEATER_2_USES_THERMISTOR
  1085. #endif
  1086. //Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
  1087. #ifndef HEATER_2_RAW_HI_TEMP
  1088. # ifdef HEATER_2_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value
  1089. # define HEATER_2_RAW_HI_TEMP 0
  1090. # define HEATER_2_RAW_LO_TEMP 16383
  1091. # else //In case of an thermocouple the highest temperature results in the highest ADC value
  1092. # define HEATER_2_RAW_HI_TEMP 16383
  1093. # define HEATER_2_RAW_LO_TEMP 0
  1094. # endif
  1095. #endif
  1096. #ifdef THERMISTORBED
  1097. # define BEDTEMPTABLE TT_NAME(THERMISTORBED)
  1098. # define BEDTEMPTABLE_LEN (sizeof(BEDTEMPTABLE)/sizeof(*BEDTEMPTABLE))
  1099. #else
  1100. # ifdef BED_USES_THERMISTOR
  1101. # error No bed thermistor table specified
  1102. # endif // BED_USES_THERMISTOR
  1103. #endif
  1104. //Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
  1105. #ifndef HEATER_BED_RAW_HI_TEMP
  1106. # ifdef BED_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value
  1107. # define HEATER_BED_RAW_HI_TEMP 0
  1108. # define HEATER_BED_RAW_LO_TEMP 16383
  1109. # else //In case of an thermocouple the highest temperature results in the highest ADC value
  1110. # define HEATER_BED_RAW_HI_TEMP 16383
  1111. # define HEATER_BED_RAW_LO_TEMP 0
  1112. # endif
  1113. #endif
  1114. #endif //THERMISTORTABLES_H_