diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-08-20 12:42:50 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-08-20 12:42:50 -0400 |
commit | b80c488d36fa22313616d3eacdcf3fcc284f972f (patch) | |
tree | f503f66ab08fde3f7cae946de1ff0bf3f08deded | |
parent | f25cb33367739abb6a66ff96f0bc6cdb1de3bb22 (diff) | |
download | kutter-b80c488d36fa22313616d3eacdcf3fcc284f972f.tar.gz kutter-b80c488d36fa22313616d3eacdcf3fcc284f972f.tar.xz kutter-b80c488d36fa22313616d3eacdcf3fcc284f972f.zip |
heater: Another minor cleanup to Steinhart-Hart math
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r-- | klippy/heater.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/klippy/heater.py b/klippy/heater.py index 1873104a..1b644e72 100644 --- a/klippy/heater.py +++ b/klippy/heater.py @@ -44,10 +44,9 @@ class Thermistor: y = (self.c1 - inv_t) / (2. * self.c3) x = math.sqrt((self.c2 / (3. * self.c3))**3 + y**2) ln_r = math.pow(x - y, 1./3.) - math.pow(x + y, 1./3.) - r = math.exp(ln_r) else: ln_r = (inv_t - self.c1) / self.c2 - r = math.exp(ln_r) + r = math.exp(ln_r) return r / (self.pullup + r) # Thermistor calibrated from one temp measurement and its beta |