My Marlin configs for Fabrikator Mini and CTC i3 Pro B
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

thermistortables.h 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  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 || 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(110) // Pt100 with 1k0 pullup
  101. #include "thermistortable_110.h"
  102. #endif
  103. #if ANY_THERMISTOR_IS(147) // Pt100 with 4k7 pullup
  104. #include "thermistortable_147.h"
  105. #endif
  106. #if ANY_THERMISTOR_IS(1010) // Pt1000 with 1k0 pullup
  107. #include "thermistortable_1010.h"
  108. #endif
  109. #if ANY_THERMISTOR_IS(1047) // Pt1000 with 4k7 pullup
  110. #include "thermistortable_1047.h"
  111. #endif
  112. #if ANY_THERMISTOR_IS(998) // User-defined table 1
  113. #include "thermistortable_998.h"
  114. #endif
  115. #if ANY_THERMISTOR_IS(999) // User-defined table 2
  116. #include "thermistortable_999.h"
  117. #endif
  118. #define _TT_NAME(_N) temptable_ ## _N
  119. #define TT_NAME(_N) _TT_NAME(_N)
  120. #ifdef THERMISTORHEATER_0
  121. #define HEATER_0_TEMPTABLE TT_NAME(THERMISTORHEATER_0)
  122. #define HEATER_0_TEMPTABLE_LEN COUNT(HEATER_0_TEMPTABLE)
  123. #elif defined(HEATER_0_USES_THERMISTOR)
  124. #error "No heater 0 thermistor table specified"
  125. #else
  126. #define HEATER_0_TEMPTABLE NULL
  127. #define HEATER_0_TEMPTABLE_LEN 0
  128. #endif
  129. #ifdef THERMISTORHEATER_1
  130. #define HEATER_1_TEMPTABLE TT_NAME(THERMISTORHEATER_1)
  131. #define HEATER_1_TEMPTABLE_LEN COUNT(HEATER_1_TEMPTABLE)
  132. #elif defined(HEATER_1_USES_THERMISTOR)
  133. #error "No heater 1 thermistor table specified"
  134. #else
  135. #define HEATER_1_TEMPTABLE NULL
  136. #define HEATER_1_TEMPTABLE_LEN 0
  137. #endif
  138. #ifdef THERMISTORHEATER_2
  139. #define HEATER_2_TEMPTABLE TT_NAME(THERMISTORHEATER_2)
  140. #define HEATER_2_TEMPTABLE_LEN COUNT(HEATER_2_TEMPTABLE)
  141. #elif defined(HEATER_2_USES_THERMISTOR)
  142. #error "No heater 2 thermistor table specified"
  143. #else
  144. #define HEATER_2_TEMPTABLE NULL
  145. #define HEATER_2_TEMPTABLE_LEN 0
  146. #endif
  147. #ifdef THERMISTORHEATER_3
  148. #define HEATER_3_TEMPTABLE TT_NAME(THERMISTORHEATER_3)
  149. #define HEATER_3_TEMPTABLE_LEN COUNT(HEATER_3_TEMPTABLE)
  150. #elif defined(HEATER_3_USES_THERMISTOR)
  151. #error "No heater 3 thermistor table specified"
  152. #else
  153. #define HEATER_3_TEMPTABLE NULL
  154. #define HEATER_3_TEMPTABLE_LEN 0
  155. #endif
  156. #ifdef THERMISTORBED
  157. #define BEDTEMPTABLE TT_NAME(THERMISTORBED)
  158. #define BEDTEMPTABLE_LEN COUNT(BEDTEMPTABLE)
  159. #else
  160. #ifdef BED_USES_THERMISTOR
  161. #error "No bed thermistor table specified"
  162. #endif
  163. #endif
  164. // Set the high and low raw values for the heaters
  165. // For thermistors the highest temperature results in the lowest ADC value
  166. // For thermocouples the highest temperature results in the highest ADC value
  167. #ifndef HEATER_0_RAW_HI_TEMP
  168. #ifdef HEATER_0_USES_THERMISTOR
  169. #define HEATER_0_RAW_HI_TEMP 0
  170. #define HEATER_0_RAW_LO_TEMP 16383
  171. #else
  172. #define HEATER_0_RAW_HI_TEMP 16383
  173. #define HEATER_0_RAW_LO_TEMP 0
  174. #endif
  175. #endif
  176. #ifndef HEATER_1_RAW_HI_TEMP
  177. #ifdef HEATER_1_USES_THERMISTOR
  178. #define HEATER_1_RAW_HI_TEMP 0
  179. #define HEATER_1_RAW_LO_TEMP 16383
  180. #else
  181. #define HEATER_1_RAW_HI_TEMP 16383
  182. #define HEATER_1_RAW_LO_TEMP 0
  183. #endif
  184. #endif
  185. #ifndef HEATER_2_RAW_HI_TEMP
  186. #ifdef HEATER_2_USES_THERMISTOR
  187. #define HEATER_2_RAW_HI_TEMP 0
  188. #define HEATER_2_RAW_LO_TEMP 16383
  189. #else
  190. #define HEATER_2_RAW_HI_TEMP 16383
  191. #define HEATER_2_RAW_LO_TEMP 0
  192. #endif
  193. #endif
  194. #ifndef HEATER_3_RAW_HI_TEMP
  195. #ifdef HEATER_3_USES_THERMISTOR
  196. #define HEATER_3_RAW_HI_TEMP 0
  197. #define HEATER_3_RAW_LO_TEMP 16383
  198. #else
  199. #define HEATER_3_RAW_HI_TEMP 16383
  200. #define HEATER_3_RAW_LO_TEMP 0
  201. #endif
  202. #endif
  203. #ifndef HEATER_BED_RAW_HI_TEMP
  204. #ifdef BED_USES_THERMISTOR
  205. #define HEATER_BED_RAW_HI_TEMP 0
  206. #define HEATER_BED_RAW_LO_TEMP 16383
  207. #else
  208. #define HEATER_BED_RAW_HI_TEMP 16383
  209. #define HEATER_BED_RAW_LO_TEMP 0
  210. #endif
  211. #endif
  212. #endif // THERMISTORTABLES_H_