aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2020-02-27 11:31:51 -0500
committerKevin O'Connor <kevin@koconnor.net>2020-02-27 11:31:51 -0500
commitc197fdb03d3d54724e862cbf3b472f5434b88dc5 (patch)
tree8fe2a871cd0e3545ba49c900ef4c2265bdb3adc5 /klippy/extras
parent16e59511c3cdda2407c5e840eeedce00f22677de (diff)
downloadkutter-c197fdb03d3d54724e862cbf3b472f5434b88dc5.tar.gz
kutter-c197fdb03d3d54724e862cbf3b472f5434b88dc5.tar.xz
kutter-c197fdb03d3d54724e862cbf3b472f5434b88dc5.zip
heater: Fix misspelling of Celsius
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras')
-rw-r--r--klippy/extras/temperature_fan.py4
-rw-r--r--klippy/extras/temperature_sensor.py6
-rw-r--r--klippy/extras/thermistor.py22
3 files changed, 16 insertions, 16 deletions
diff --git a/klippy/extras/temperature_fan.py b/klippy/extras/temperature_fan.py
index d009d251..6fc2893b 100644
--- a/klippy/extras/temperature_fan.py
+++ b/klippy/extras/temperature_fan.py
@@ -5,7 +5,7 @@
# This file may be distributed under the terms of the GNU GPLv3 license.
import fan
-KELVIN_TO_CELCIUS = -273.15
+KELVIN_TO_CELSIUS = -273.15
MAX_FAN_TIME = 5.0
AMBIENT_TEMP = 25.
PID_PARAM_BASE = 255.
@@ -16,7 +16,7 @@ class TemperatureFan:
self.printer = config.get_printer()
self.fan = fan.PrinterFan(config, default_shutdown_speed=1.)
self.gcode = self.printer.lookup_object('gcode')
- self.min_temp = config.getfloat('min_temp', minval=KELVIN_TO_CELCIUS)
+ self.min_temp = config.getfloat('min_temp', minval=KELVIN_TO_CELSIUS)
self.max_temp = config.getfloat('max_temp', above=self.min_temp)
self.sensor = self.printer.lookup_object('heater').setup_sensor(config)
self.sensor.setup_minmax(self.min_temp, self.max_temp)
diff --git a/klippy/extras/temperature_sensor.py b/klippy/extras/temperature_sensor.py
index f2663f35..62b7afef 100644
--- a/klippy/extras/temperature_sensor.py
+++ b/klippy/extras/temperature_sensor.py
@@ -4,14 +4,14 @@
#
# This file may be distributed under the terms of the GNU GPLv3 license.
-KELVIN_TO_CELCIUS = -273.15
+KELVIN_TO_CELSIUS = -273.15
class PrinterSensorGeneric:
def __init__(self, config):
self.printer = config.get_printer()
self.sensor = self.printer.lookup_object('heater').setup_sensor(config)
- self.min_temp = config.getfloat('min_temp', KELVIN_TO_CELCIUS,
- minval=KELVIN_TO_CELCIUS)
+ self.min_temp = config.getfloat('min_temp', KELVIN_TO_CELSIUS,
+ minval=KELVIN_TO_CELSIUS)
self.max_temp = config.getfloat('max_temp', 99999999.9,
above=self.min_temp)
self.sensor.setup_minmax(self.min_temp, self.max_temp)
diff --git a/klippy/extras/thermistor.py b/klippy/extras/thermistor.py
index e805a70b..f43c0a99 100644
--- a/klippy/extras/thermistor.py
+++ b/klippy/extras/thermistor.py
@@ -6,7 +6,7 @@
import math, logging
import adc_temperature
-KELVIN_TO_CELCIUS = -273.15
+KELVIN_TO_CELSIUS = -273.15
# Analog voltage to temperature converter for thermistors
class Thermistor:
@@ -17,9 +17,9 @@ class Thermistor:
def setup_coefficients(self, t1, r1, t2, r2, t3, r3, name=""):
# Calculate Steinhart-Hart coefficents from temp measurements.
# Arrange samples as 3 linear equations and solve for c1, c2, and c3.
- inv_t1 = 1. / (t1 - KELVIN_TO_CELCIUS)
- inv_t2 = 1. / (t2 - KELVIN_TO_CELCIUS)
- inv_t3 = 1. / (t3 - KELVIN_TO_CELCIUS)
+ inv_t1 = 1. / (t1 - KELVIN_TO_CELSIUS)
+ inv_t2 = 1. / (t2 - KELVIN_TO_CELSIUS)
+ inv_t3 = 1. / (t3 - KELVIN_TO_CELSIUS)
ln_r1 = math.log(r1)
ln_r2 = math.log(r2)
ln_r3 = math.log(r3)
@@ -40,7 +40,7 @@ class Thermistor:
self.c1 = inv_t1 - self.c2 * ln_r1 - self.c3 * ln3_r1
def setup_coefficients_beta(self, t1, r1, beta):
# Calculate equivalent Steinhart-Hart coefficents from beta
- inv_t1 = 1. / (t1 - KELVIN_TO_CELCIUS)
+ inv_t1 = 1. / (t1 - KELVIN_TO_CELSIUS)
ln_r1 = math.log(r1)
self.c3 = 0.
self.c2 = 1. / beta
@@ -51,12 +51,12 @@ class Thermistor:
r = self.pullup * adc / (1.0 - adc)
ln_r = math.log(r - self.inline_resistor)
inv_t = self.c1 + self.c2 * ln_r + self.c3 * ln_r**3
- return 1.0/inv_t + KELVIN_TO_CELCIUS
+ return 1.0/inv_t + KELVIN_TO_CELSIUS
def calc_adc(self, temp):
# Calculate adc reading from a temperature
- if temp <= KELVIN_TO_CELCIUS:
+ if temp <= KELVIN_TO_CELSIUS:
return 1.
- inv_t = 1. / (temp - KELVIN_TO_CELCIUS)
+ inv_t = 1. / (temp - KELVIN_TO_CELSIUS)
if self.c3:
# Solve for ln_r using Cardano's formula
y = (self.c1 - inv_t) / (2. * self.c3)
@@ -85,15 +85,15 @@ def PrinterThermistor(config, params):
class CustomThermistor:
def __init__(self, config):
self.name = " ".join(config.get_name().split()[1:])
- t1 = config.getfloat("temperature1", minval=KELVIN_TO_CELCIUS)
+ t1 = config.getfloat("temperature1", minval=KELVIN_TO_CELSIUS)
r1 = config.getfloat("resistance1", minval=0.)
beta = config.getfloat("beta", None, above=0.)
if beta is not None:
self.params = {'t1': t1, 'r1': r1, 'beta': beta}
return
- t2 = config.getfloat("temperature2", minval=KELVIN_TO_CELCIUS)
+ t2 = config.getfloat("temperature2", minval=KELVIN_TO_CELSIUS)
r2 = config.getfloat("resistance2", minval=0.)
- t3 = config.getfloat("temperature3", minval=KELVIN_TO_CELCIUS)
+ t3 = config.getfloat("temperature3", minval=KELVIN_TO_CELSIUS)
r3 = config.getfloat("resistance3", minval=0.)
(t1, r1), (t2, r2), (t3, r3) = sorted([(t1, r1), (t2, r2), (t3, r3)])
self.params = {'t1': t1, 'r1': r1, 't2': t2, 'r2': r2,