temperature_sensors: Define default thermistors in config

Move the definitions of the default thermistors from thermistors.py to
the temperature_sensors.cfg file.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2021-11-01 12:02:36 -04:00
parent 596cd21751
commit c0909d2f7f
2 changed files with 64 additions and 30 deletions

View File

@ -1,5 +1,10 @@
# This file loads the default temperature sensors.
########################################
# Module loading
########################################
# Load "PT1000", "PT100 INA826", "AD595", "AD597", "AD8494", "AD8495",
# "AD8496", and "AD8497" sensors
[adc_temperature]
@ -25,7 +30,62 @@
# Load "temperature_mcu" sensor
[temperature_mcu]
# Load "EPCOS 100K B57560G104F", "ATC Semitec 104GT-2", "NTC 100K beta 3950",
# "Honeywell 100K 135-104LAG-J01", "NTC 100K MGB18-104F39050L32",
# "SliceEngineering 450", and "TDK NTCG104LH104JT1" sensors
[thermistor]
########################################
# Default thermistors
########################################
# Definition from (20211101): https://download.lulzbot.com/retail_parts/Completed_Parts/100k_Semitech_GT2_Thermistor_KT-EL0059/GT-2-glass-thermistors.pdf
[thermistor ATC Semitec 104GT-2]
temperature1: 20
resistance1: 126800
temperature2: 150
resistance2: 1360
temperature3: 300
resistance3: 80.65
# Definition from (20211101): https://www.tdk-electronics.tdk.com/inf/50/db/ntc_09/Glass_enc_Sensors__B57560__G560__G1560.pdf
# (B57560G104 is same definition as B57560G1104)
[thermistor EPCOS 100K B57560G104F]
temperature1: 25
resistance1: 100000
temperature2: 150
resistance2: 1641.9
temperature3: 250
resistance3: 226.15
# Definition from (20211101): https://www.sliceengineering.com/products/thermistor-high-temperature and https://docs.google.com/spreadsheets/d/1904x5JK-Sup-cX5DqHiiZWaFVTK6_PQBFxgi_6yXEJw/edit#gid=0
[thermistor SliceEngineering 450]
temperature1: 25
resistance1: 500000
temperature2: 200
resistance2: 3734
temperature3: 400
resistance3: 240
# Definition from (20211101): https://product.tdk.com/system/files/dam/doc/product/sensor/ntc/chip-ntc-thermistor/rt_sheets/ntcg104lh104jt1.csv
[thermistor TDK NTCG104LH104JT1]
temperature1: 25
resistance1: 100000
temperature2: 50
resistance2: 31230
temperature3: 125
resistance3: 2066
# Definition from (20211101): https://sensing.honeywell.com/135-104lag-j01-thermistors
[thermistor Honeywell 100K 135-104LAG-J01]
temperature1: 25
resistance1: 100000
beta: 3974
# Definition inherent from name
[thermistor NTC 100K beta 3950]
temperature1: 25
resistance1: 100000
beta: 3950
# Definition from description of Marlin "thermistor 75"
[thermistor NTC 100K MGB18-104F39050L32]
temperature1: 25
resistance1: 100000
beta: 4100

View File

@ -101,32 +101,6 @@ class CustomThermistor:
def create(self, config):
return PrinterThermistor(config, self.params)
# Default sensors
Sensors = {
"EPCOS 100K B57560G104F": {
't1': 25., 'r1': 100000., 't2': 150., 'r2': 1641.9,
't3': 250., 'r3': 226.15 },
"ATC Semitec 104GT-2": {
't1': 20., 'r1': 126800., 't2': 150., 'r2': 1360.,
't3': 300., 'r3': 80.65 },
"SliceEngineering 450": {
't1': 25., 'r1': 500000., 't2': 200., 'r2': 3734.,
't3': 400., 'r3': 240. },
"TDK NTCG104LH104JT1": {
't1': 25., 'r1': 100000., 't2': 50., 'r2': 31230.,
't3': 125., 'r3': 2066. },
"NTC 100K beta 3950": { 't1': 25., 'r1': 100000., 'beta': 3950. },
"Honeywell 100K 135-104LAG-J01": { 't1': 25., 'r1': 100000., 'beta': 3974.},
"NTC 100K MGB18-104F39050L32": { 't1': 25., 'r1': 100000., 'beta': 4100. },
}
def load_config(config):
# Register default thermistor types
pheaters = config.get_printer().load_object(config, "heaters")
for sensor_type, params in Sensors.items():
func = (lambda config, params=params: PrinterThermistor(config, params))
pheaters.add_sensor_factory(sensor_type, func)
def load_config_prefix(config):
thermistor = CustomThermistor(config)
pheaters = config.get_printer().load_object(config, "heaters")