My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

thermistortables.h 8.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #ifndef THERMISTORTABLES_H_
  23. #define THERMISTORTABLES_H_
  24. #include "Marlin.h"
  25. #include "macros.h"
  26. #define OVERSAMPLENR 16
  27. #define OV(N) int16_t((N)*(OVERSAMPLENR))
  28. #define ANY_THERMISTOR_IS(n) (THERMISTORHEATER_0 == n || THERMISTORHEATER_1 == n || THERMISTORHEATER_2 == n || THERMISTORHEATER_3 == n || THERMISTORHEATER_4 == n || THERMISTORBED == n)
  29. // Pt1000 and Pt100 handling
  30. //
  31. // Rt=R0*(1+a*T+b*T*T) [for T>0]
  32. // a=3.9083E-3, b=-5.775E-7
  33. #define PtA 3.9083E-3
  34. #define PtB -5.775E-7
  35. #define PtRt(T,R0) ((R0)*(1.0+(PtA)*(T)+(PtB)*(T)*(T)))
  36. #define PtAdVal(T,R0,Rup) (short)(1024/(Rup/PtRt(T,R0)+1))
  37. #define PtLine(T,R0,Rup) { OV(PtAdVal(T,R0,Rup)), T },
  38. #if ANY_THERMISTOR_IS(1) // 100k bed thermistor
  39. #include "thermistortable_1.h"
  40. #endif
  41. #if ANY_THERMISTOR_IS(2) // 200k bed thermistor
  42. #include "thermistortable_2.h"
  43. #endif
  44. #if ANY_THERMISTOR_IS(3) // mendel-parts
  45. #include "thermistortable_3.h"
  46. #endif
  47. #if ANY_THERMISTOR_IS(4) // 10k thermistor
  48. #include "thermistortable_4.h"
  49. #endif
  50. #if ANY_THERMISTOR_IS(5) // 100k ParCan thermistor (104GT-2)
  51. #include "thermistortable_5.h"
  52. #endif
  53. #if ANY_THERMISTOR_IS(6) // 100k Epcos thermistor
  54. #include "thermistortable_6.h"
  55. #endif
  56. #if ANY_THERMISTOR_IS(7) // 100k Honeywell 135-104LAG-J01
  57. #include "thermistortable_7.h"
  58. #endif
  59. #if ANY_THERMISTOR_IS(71) // 100k Honeywell 135-104LAF-J01
  60. #include "thermistortable_71.h"
  61. #endif
  62. #if ANY_THERMISTOR_IS(8) // 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
  63. #include "thermistortable_8.h"
  64. #endif
  65. #if ANY_THERMISTOR_IS(9) // 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
  66. #include "thermistortable_9.h"
  67. #endif
  68. #if ANY_THERMISTOR_IS(10) // 100k RS thermistor 198-961 (4.7k pullup)
  69. #include "thermistortable_10.h"
  70. #endif
  71. #if ANY_THERMISTOR_IS(11) // QU-BD silicone bed QWG-104F-3950 thermistor
  72. #include "thermistortable_11.h"
  73. #endif
  74. #if ANY_THERMISTOR_IS(13) // Hisens thermistor B25/50 =3950 +/-1%
  75. #include "thermistortable_13.h"
  76. #endif
  77. #if ANY_THERMISTOR_IS(20) // PT100 with INA826 amp on Ultimaker v2.0 electronics
  78. #include "thermistortable_20.h"
  79. #endif
  80. #if ANY_THERMISTOR_IS(51) // 100k EPCOS (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!)
  81. #include "thermistortable_51.h"
  82. #endif
  83. #if ANY_THERMISTOR_IS(52) // 200k ATC Semitec 204GT-2 (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!)
  84. #include "thermistortable_52.h"
  85. #endif
  86. #if ANY_THERMISTOR_IS(55) // 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!)
  87. #include "thermistortable_55.h"
  88. #endif
  89. #if ANY_THERMISTOR_IS(60) // Maker's Tool Works Kapton Bed Thermistor
  90. #include "thermistortable_60.h"
  91. #endif
  92. #if ANY_THERMISTOR_IS(66) // DyzeDesign 500°C Thermistor
  93. #include "thermistortable_66.h"
  94. #endif
  95. #if ANY_THERMISTOR_IS(12) // 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
  96. #include "thermistortable_12.h"
  97. #endif
  98. #if ANY_THERMISTOR_IS(70) // bqh2 stock thermistor
  99. #include "thermistortable_70.h"
  100. #endif
  101. #if ANY_THERMISTOR_IS(75) // Many of the generic silicon heat pads use the MGB18-104F39050L32 Thermistor
  102. #include "thermistortable_75.h"
  103. #endif
  104. #if ANY_THERMISTOR_IS(110) // Pt100 with 1k0 pullup
  105. #include "thermistortable_110.h"
  106. #endif
  107. #if ANY_THERMISTOR_IS(147) // Pt100 with 4k7 pullup
  108. #include "thermistortable_147.h"
  109. #endif
  110. #if ANY_THERMISTOR_IS(1010) // Pt1000 with 1k0 pullup
  111. #include "thermistortable_1010.h"
  112. #endif
  113. #if ANY_THERMISTOR_IS(1047) // Pt1000 with 4k7 pullup
  114. #include "thermistortable_1047.h"
  115. #endif
  116. #if ANY_THERMISTOR_IS(998) // User-defined table 1
  117. #include "thermistortable_998.h"
  118. #endif
  119. #if ANY_THERMISTOR_IS(999) // User-defined table 2
  120. #include "thermistortable_999.h"
  121. #endif
  122. #define _TT_NAME(_N) temptable_ ## _N
  123. #define TT_NAME(_N) _TT_NAME(_N)
  124. #ifdef THERMISTORHEATER_0
  125. #define HEATER_0_TEMPTABLE TT_NAME(THERMISTORHEATER_0)
  126. #define HEATER_0_TEMPTABLE_LEN COUNT(HEATER_0_TEMPTABLE)
  127. #elif defined(HEATER_0_USES_THERMISTOR)
  128. #error "No heater 0 thermistor table specified"
  129. #else
  130. #define HEATER_0_TEMPTABLE NULL
  131. #define HEATER_0_TEMPTABLE_LEN 0
  132. #endif
  133. #ifdef THERMISTORHEATER_1
  134. #define HEATER_1_TEMPTABLE TT_NAME(THERMISTORHEATER_1)
  135. #define HEATER_1_TEMPTABLE_LEN COUNT(HEATER_1_TEMPTABLE)
  136. #elif defined(HEATER_1_USES_THERMISTOR)
  137. #error "No heater 1 thermistor table specified"
  138. #else
  139. #define HEATER_1_TEMPTABLE NULL
  140. #define HEATER_1_TEMPTABLE_LEN 0
  141. #endif
  142. #ifdef THERMISTORHEATER_2
  143. #define HEATER_2_TEMPTABLE TT_NAME(THERMISTORHEATER_2)
  144. #define HEATER_2_TEMPTABLE_LEN COUNT(HEATER_2_TEMPTABLE)
  145. #elif defined(HEATER_2_USES_THERMISTOR)
  146. #error "No heater 2 thermistor table specified"
  147. #else
  148. #define HEATER_2_TEMPTABLE NULL
  149. #define HEATER_2_TEMPTABLE_LEN 0
  150. #endif
  151. #ifdef THERMISTORHEATER_3
  152. #define HEATER_3_TEMPTABLE TT_NAME(THERMISTORHEATER_3)
  153. #define HEATER_3_TEMPTABLE_LEN COUNT(HEATER_3_TEMPTABLE)
  154. #elif defined(HEATER_3_USES_THERMISTOR)
  155. #error "No heater 3 thermistor table specified"
  156. #else
  157. #define HEATER_3_TEMPTABLE NULL
  158. #define HEATER_3_TEMPTABLE_LEN 0
  159. #endif
  160. #ifdef THERMISTORHEATER_4
  161. #define HEATER_4_TEMPTABLE TT_NAME(THERMISTORHEATER_4)
  162. #define HEATER_4_TEMPTABLE_LEN COUNT(HEATER_4_TEMPTABLE)
  163. #elif defined(HEATER_4_USES_THERMISTOR)
  164. #error "No heater 4 thermistor table specified"
  165. #else
  166. #define HEATER_4_TEMPTABLE NULL
  167. #define HEATER_4_TEMPTABLE_LEN 0
  168. #endif
  169. #ifdef THERMISTORBED
  170. #define BEDTEMPTABLE TT_NAME(THERMISTORBED)
  171. #define BEDTEMPTABLE_LEN COUNT(BEDTEMPTABLE)
  172. #else
  173. #ifdef BED_USES_THERMISTOR
  174. #error "No bed thermistor table specified"
  175. #endif
  176. #endif
  177. // Set the high and low raw values for the heaters
  178. // For thermistors the highest temperature results in the lowest ADC value
  179. // For thermocouples the highest temperature results in the highest ADC value
  180. #ifndef HEATER_0_RAW_HI_TEMP
  181. #ifdef HEATER_0_USES_THERMISTOR
  182. #define HEATER_0_RAW_HI_TEMP 0
  183. #define HEATER_0_RAW_LO_TEMP 16383
  184. #else
  185. #define HEATER_0_RAW_HI_TEMP 16383
  186. #define HEATER_0_RAW_LO_TEMP 0
  187. #endif
  188. #endif
  189. #ifndef HEATER_1_RAW_HI_TEMP
  190. #ifdef HEATER_1_USES_THERMISTOR
  191. #define HEATER_1_RAW_HI_TEMP 0
  192. #define HEATER_1_RAW_LO_TEMP 16383
  193. #else
  194. #define HEATER_1_RAW_HI_TEMP 16383
  195. #define HEATER_1_RAW_LO_TEMP 0
  196. #endif
  197. #endif
  198. #ifndef HEATER_2_RAW_HI_TEMP
  199. #ifdef HEATER_2_USES_THERMISTOR
  200. #define HEATER_2_RAW_HI_TEMP 0
  201. #define HEATER_2_RAW_LO_TEMP 16383
  202. #else
  203. #define HEATER_2_RAW_HI_TEMP 16383
  204. #define HEATER_2_RAW_LO_TEMP 0
  205. #endif
  206. #endif
  207. #ifndef HEATER_3_RAW_HI_TEMP
  208. #ifdef HEATER_3_USES_THERMISTOR
  209. #define HEATER_3_RAW_HI_TEMP 0
  210. #define HEATER_3_RAW_LO_TEMP 16383
  211. #else
  212. #define HEATER_3_RAW_HI_TEMP 16383
  213. #define HEATER_3_RAW_LO_TEMP 0
  214. #endif
  215. #endif
  216. #ifndef HEATER_4_RAW_HI_TEMP
  217. #ifdef HEATER_4_USES_THERMISTOR
  218. #define HEATER_4_RAW_HI_TEMP 0
  219. #define HEATER_4_RAW_LO_TEMP 16383
  220. #else
  221. #define HEATER_4_RAW_HI_TEMP 16383
  222. #define HEATER_4_RAW_LO_TEMP 0
  223. #endif
  224. #endif
  225. #ifndef HEATER_BED_RAW_HI_TEMP
  226. #ifdef BED_USES_THERMISTOR
  227. #define HEATER_BED_RAW_HI_TEMP 0
  228. #define HEATER_BED_RAW_LO_TEMP 16383
  229. #else
  230. #define HEATER_BED_RAW_HI_TEMP 16383
  231. #define HEATER_BED_RAW_LO_TEMP 0
  232. #endif
  233. #endif
  234. #endif // THERMISTORTABLES_H_