2016-03-25 02:19:46 -04:00
/**
2016-03-24 14:01:20 -04:00
* Marlin 3 D Printer Firmware
* Copyright ( C ) 2016 MarlinFirmware [ https : //github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl .
* Copyright ( C ) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software : you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program . If not , see < http : //www.gnu.org/licenses/>.
*
*/
2011-08-12 16:28:35 -04:00
# ifndef THERMISTORTABLES_H_
# define THERMISTORTABLES_H_
2011-12-22 08:55:45 -05:00
# include "Marlin.h"
2015-07-22 18:50:20 -04:00
# include "macros.h"
2011-11-15 16:50:43 -05:00
2011-11-04 13:02:56 -04:00
# define OVERSAMPLENR 16
2011-08-12 16:28:35 -04:00
2016-07-08 22:54:45 -04:00
# define ANY_THERMISTOR_IS(n) (THERMISTORHEATER_0 == n || THERMISTORHEATER_1 == n || THERMISTORHEATER_2 == n || THERMISTORHEATER_3 == n || THERMISTORBED == n)
2016-12-19 17:27:39 -05:00
// Pt1000 and Pt100 handling
//
// Rt=R0*(1+a*T+b*T*T) [for T>0]
// a=3.9083E-3, b=-5.775E-7
# define PtA 3.9083E-3
# define PtB -5.775E-7
# define PtRt(T,R0) ((R0)*(1.0+(PtA)*(T)+(PtB)*(T)*(T)))
# define PtAdVal(T,R0,Rup) (short)(1024 / (Rup / PtRt(T,R0)+1))
# define PtLine(T,R0,Rup) { PtAdVal(T,R0,Rup)*OVERSAMPLENR, T },
2016-07-08 22:54:45 -04:00
# if ANY_THERMISTOR_IS(1) // 100k bed thermistor
2016-12-19 17:27:39 -05:00
# include "thermistortable_1.h"
2011-08-12 16:28:35 -04:00
# endif
2016-07-08 22:54:45 -04:00
# if ANY_THERMISTOR_IS(2) // 200k bed thermistor
2016-12-19 17:27:39 -05:00
# include "thermistortable_2.h"
2011-08-12 16:28:35 -04:00
# endif
2016-07-08 22:54:45 -04:00
# if ANY_THERMISTOR_IS(3) // mendel-parts
2016-12-19 17:27:39 -05:00
# include "thermistortable_3.h"
2011-08-12 16:28:35 -04:00
# endif
2016-07-08 22:54:45 -04:00
# if ANY_THERMISTOR_IS(4) // 10k thermistor
2016-12-19 17:27:39 -05:00
# include "thermistortable_4.h"
2011-11-04 17:51:14 -04:00
# endif
2016-07-08 22:54:45 -04:00
# if ANY_THERMISTOR_IS(5) // 100k ParCan thermistor (104GT-2)
2016-12-19 17:27:39 -05:00
# include "thermistortable_5.h"
2011-11-04 17:51:14 -04:00
# endif
2016-07-08 22:54:45 -04:00
# if ANY_THERMISTOR_IS(6) // 100k Epcos thermistor
2016-12-19 17:27:39 -05:00
# include "thermistortable_6.h"
2011-11-04 17:51:14 -04:00
# endif
2016-07-08 22:54:45 -04:00
# if ANY_THERMISTOR_IS(7) // 100k Honeywell 135-104LAG-J01
2016-12-19 17:27:39 -05:00
# include "thermistortable_7.h"
2011-11-04 17:51:14 -04:00
# endif
2016-07-08 22:54:45 -04:00
# if ANY_THERMISTOR_IS(71) // 100k Honeywell 135-104LAF-J01
2016-12-19 17:27:39 -05:00
# include "thermistortable_71.h"
2013-07-30 08:01:41 -04:00
# endif
2016-12-19 17:27:39 -05:00
# if ANY_THERMISTOR_IS(8) // 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
# include "thermistortable_8.h"
2012-12-30 06:09:38 -05:00
# endif
2016-12-19 17:27:39 -05:00
# if ANY_THERMISTOR_IS(9) // 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
# include "thermistortable_9.h"
2012-12-30 06:09:38 -05:00
# endif
2016-12-19 17:27:39 -05:00
# if ANY_THERMISTOR_IS(10) // 100k RS thermistor 198-961 (4.7k pullup)
# include "thermistortable_10.h"
2012-12-30 06:09:38 -05:00
# endif
2016-12-19 17:27:39 -05:00
# if ANY_THERMISTOR_IS(11) // QU-BD silicone bed QWG-104F-3950 thermistor
# include "thermistortable_11.h"
2014-04-13 11:03:20 -04:00
# endif
2016-12-19 17:27:39 -05:00
# if ANY_THERMISTOR_IS(13) // Hisens thermistor B25/50 =3950 +/-1%
# include "thermistortable_13.h"
2014-09-26 15:49:07 -04:00
# endif
2016-07-08 22:54:45 -04:00
# if ANY_THERMISTOR_IS(20) // PT100 with INA826 amp on Ultimaker v2.0 electronics
2016-12-19 17:27:39 -05:00
# include "thermistortable_20.h"
2015-01-23 17:13:06 -05:00
# endif
2016-12-19 17:27:39 -05:00
# if ANY_THERMISTOR_IS(51) // 100k EPCOS (WITH 1kohm RESISTOR FOR PULLUP, R9 ON SANGUINOLOLU! NOT FOR 4.7kohm PULLUP! THIS IS NOT NORMAL!)
# include "thermistortable_51.h"
2012-05-19 07:52:12 -04:00
# endif
2016-12-19 17:27:39 -05:00
# 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!)
# include "thermistortable_52.h"
2012-05-20 06:35:28 -04:00
# endif
2016-12-19 17:27:39 -05:00
# 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!)
# include "thermistortable_53.h"
2012-05-20 15:18:45 -04:00
# endif
2016-07-08 22:54:45 -04:00
# if ANY_THERMISTOR_IS(60) // Maker's Tool Works Kapton Bed Thermistor
2016-12-19 17:27:39 -05:00
# include "thermistortable_60.h"
2013-03-18 23:53:37 -04:00
# endif
2016-12-19 17:27:39 -05:00
# if ANY_THERMISTOR_IS(66) // DyzeDesign 500°C Thermistor
# include "thermistortable_66.h"
2016-07-08 22:28:37 -04:00
# endif
2016-12-19 17:27:39 -05:00
# if ANY_THERMISTOR_IS(12) // 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
# include "thermistortable_12.h"
2014-04-24 04:49:42 -04:00
# endif
2016-07-08 22:54:45 -04:00
# if ANY_THERMISTOR_IS(70) // bqh2 stock thermistor
2016-12-19 17:27:39 -05:00
# include "thermistortable_70.h"
2016-02-27 14:17:07 -05:00
# endif
2017-03-18 11:17:44 -04:00
# if ANY_THERMISTOR_IS(75) // Many of the generic silicon heat pads use the MGB18-104F39050L32 Thermistor
# include "thermistortable_75.h"
# endif
2016-07-08 22:54:45 -04:00
# if ANY_THERMISTOR_IS(110) // Pt100 with 1k0 pullup
2016-12-19 17:27:39 -05:00
# include "thermistortable_110.h"
2014-02-14 06:15:31 -05:00
# endif
2016-07-08 22:54:45 -04:00
# if ANY_THERMISTOR_IS(147) // Pt100 with 4k7 pullup
2016-12-19 17:27:39 -05:00
# include "thermistortable_147.h"
2014-02-14 06:15:31 -05:00
# endif
2016-07-08 22:54:45 -04:00
# if ANY_THERMISTOR_IS(1010) // Pt1000 with 1k0 pullup
2016-12-19 17:27:39 -05:00
# include "thermistortable_1010.h"
2014-02-14 06:15:31 -05:00
# endif
2016-07-08 22:54:45 -04:00
# if ANY_THERMISTOR_IS(1047) // Pt1000 with 4k7 pullup
2016-12-19 17:27:39 -05:00
# include "thermistortable_1047.h"
2014-02-14 06:15:31 -05:00
# endif
2016-12-19 17:27:39 -05:00
# if ANY_THERMISTOR_IS(998) // User-defined table 1
# include "thermistortable_998.h"
2015-02-22 09:02:04 -05:00
# endif
2016-12-19 17:27:39 -05:00
# if ANY_THERMISTOR_IS(999) // User-defined table 2
# include "thermistortable_999.h"
2015-02-24 05:02:16 -05:00
# endif
2015-02-22 09:02:04 -05:00
2011-12-05 23:33:33 -05:00
# define _TT_NAME(_N) temptable_ ## _N
# define TT_NAME(_N) _TT_NAME(_N)
2011-11-04 17:51:14 -04:00
2011-12-05 23:33:33 -05:00
# ifdef THERMISTORHEATER_0
2015-10-03 02:08:58 -04:00
# define HEATER_0_TEMPTABLE TT_NAME(THERMISTORHEATER_0)
# define HEATER_0_TEMPTABLE_LEN COUNT(HEATER_0_TEMPTABLE)
2016-12-19 17:27:39 -05:00
# elif defined(HEATER_0_USES_THERMISTOR)
# error "No heater 0 thermistor table specified"
2011-12-05 23:33:33 -05:00
# else
2016-12-19 17:27:39 -05:00
# define HEATER_0_TEMPTABLE NULL
# define HEATER_0_TEMPTABLE_LEN 0
# endif
# ifdef THERMISTORHEATER_1
# define HEATER_1_TEMPTABLE TT_NAME(THERMISTORHEATER_1)
# define HEATER_1_TEMPTABLE_LEN COUNT(HEATER_1_TEMPTABLE)
# elif defined(HEATER_1_USES_THERMISTOR)
# error "No heater 1 thermistor table specified"
# else
# define HEATER_1_TEMPTABLE NULL
# define HEATER_1_TEMPTABLE_LEN 0
2012-12-09 17:00:06 -05:00
# endif
2016-12-19 17:27:39 -05:00
# ifdef THERMISTORHEATER_2
# define HEATER_2_TEMPTABLE TT_NAME(THERMISTORHEATER_2)
# define HEATER_2_TEMPTABLE_LEN COUNT(HEATER_2_TEMPTABLE)
# elif defined(HEATER_2_USES_THERMISTOR)
# error "No heater 2 thermistor table specified"
# else
# define HEATER_2_TEMPTABLE NULL
# define HEATER_2_TEMPTABLE_LEN 0
# endif
# ifdef THERMISTORHEATER_3
# define HEATER_3_TEMPTABLE TT_NAME(THERMISTORHEATER_3)
# define HEATER_3_TEMPTABLE_LEN COUNT(HEATER_3_TEMPTABLE)
# elif defined(HEATER_3_USES_THERMISTOR)
# error "No heater 3 thermistor table specified"
# else
# define HEATER_3_TEMPTABLE NULL
# define HEATER_3_TEMPTABLE_LEN 0
# endif
# ifdef THERMISTORBED
# define BEDTEMPTABLE TT_NAME(THERMISTORBED)
# define BEDTEMPTABLE_LEN COUNT(BEDTEMPTABLE)
# else
# ifdef BED_USES_THERMISTOR
# error "No bed thermistor table specified"
# endif
# endif
// Set the high and low raw values for the heaters
// For thermistors the highest temperature results in the lowest ADC value
// For thermocouples the highest temperature results in the highest ADC value
2012-12-09 17:00:06 -05:00
# ifndef HEATER_0_RAW_HI_TEMP
2016-12-19 17:27:39 -05:00
# ifdef HEATER_0_USES_THERMISTOR
2015-10-03 02:08:58 -04:00
# define HEATER_0_RAW_HI_TEMP 0
# define HEATER_0_RAW_LO_TEMP 16383
2016-12-19 17:27:39 -05:00
# else
2015-10-03 02:08:58 -04:00
# define HEATER_0_RAW_HI_TEMP 16383
# define HEATER_0_RAW_LO_TEMP 0
# endif
2011-11-05 14:21:36 -04:00
# endif
2012-12-09 17:00:06 -05:00
# ifndef HEATER_1_RAW_HI_TEMP
2016-12-19 17:27:39 -05:00
# ifdef HEATER_1_USES_THERMISTOR
2015-10-03 02:08:58 -04:00
# define HEATER_1_RAW_HI_TEMP 0
# define HEATER_1_RAW_LO_TEMP 16383
2016-12-19 17:27:39 -05:00
# else
2015-10-03 02:08:58 -04:00
# define HEATER_1_RAW_HI_TEMP 16383
# define HEATER_1_RAW_LO_TEMP 0
# endif
2011-11-04 17:51:14 -04:00
# endif
2012-12-09 17:00:06 -05:00
# ifndef HEATER_2_RAW_HI_TEMP
2016-12-19 17:27:39 -05:00
# ifdef HEATER_2_USES_THERMISTOR
2015-10-03 02:08:58 -04:00
# define HEATER_2_RAW_HI_TEMP 0
# define HEATER_2_RAW_LO_TEMP 16383
2016-12-19 17:27:39 -05:00
# else
2015-10-03 02:08:58 -04:00
# define HEATER_2_RAW_HI_TEMP 16383
# define HEATER_2_RAW_LO_TEMP 0
# endif
2011-12-05 23:33:33 -05:00
# endif
2015-01-23 17:13:06 -05:00
# ifndef HEATER_3_RAW_HI_TEMP
2016-12-19 17:27:39 -05:00
# ifdef HEATER_3_USES_THERMISTOR
2015-10-03 02:08:58 -04:00
# define HEATER_3_RAW_HI_TEMP 0
# define HEATER_3_RAW_LO_TEMP 16383
2016-12-19 17:27:39 -05:00
# else
2015-10-03 02:08:58 -04:00
# define HEATER_3_RAW_HI_TEMP 16383
# define HEATER_3_RAW_LO_TEMP 0
# endif
2015-01-23 17:13:06 -05:00
# endif
2012-12-09 17:00:06 -05:00
# ifndef HEATER_BED_RAW_HI_TEMP
2016-12-19 17:27:39 -05:00
# ifdef BED_USES_THERMISTOR
2015-10-03 02:08:58 -04:00
# define HEATER_BED_RAW_HI_TEMP 0
# define HEATER_BED_RAW_LO_TEMP 16383
2016-12-19 17:27:39 -05:00
# else
2015-10-03 02:08:58 -04:00
# define HEATER_BED_RAW_HI_TEMP 16383
# define HEATER_BED_RAW_LO_TEMP 0
# endif
2012-12-09 17:00:06 -05:00
# endif
2011-11-04 17:51:14 -04:00
2016-06-20 14:53:55 -04:00
# endif // THERMISTORTABLES_H_