aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2020-08-22 16:59:56 -0400
committerKevin O'Connor <kevin@koconnor.net>2020-08-22 17:16:45 -0400
commitd3e41b55b796b392935da670973452febd7d2cd9 (patch)
tree6230833e78e6a5b11bf3958c2015a8cd0ac96dea /klippy
parent2c76f7527d030d2f975325be456883d823e907eb (diff)
downloadkutter-d3e41b55b796b392935da670973452febd7d2cd9.tar.gz
kutter-d3e41b55b796b392935da670973452febd7d2cd9.tar.xz
kutter-d3e41b55b796b392935da670973452febd7d2cd9.zip
adc_temperature: Calculate PT1000 temperature/resistance pairs from formula
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy')
-rw-r--r--klippy/extras/adc_temperature.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/klippy/extras/adc_temperature.py b/klippy/extras/adc_temperature.py
index 87a1cac6..6e02118a 100644
--- a/klippy/extras/adc_temperature.py
+++ b/klippy/extras/adc_temperature.py
@@ -274,10 +274,12 @@ PT100 = [
(1000, 4.48), (1100, 4.73)
]
-PT1000 = [
- (0., 1000.), (100., 1385.1), (200., 1758.6), (300., 2120.5),
- (400., 2470.9), (500., 2809.8),
-]
+def calc_pt1000():
+ # Calc PT1000 temperature/resistance pairs using formula
+ A, B = (3.9083e-3, -5.775e-7)
+ return [(float(t), 1000. * (1. + A*t + B*t*t)) for t in range(0, 500, 10)]
+
+PT1000 = calc_pt1000()
def load_config(config):
# Register default sensors