My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

thermistortables.h 8.0KB

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