fix #1305 by proposed workaround (thanks gaby64)
This commit is contained in:
parent
f7e65935fb
commit
df17a6a1b4
@ -43,6 +43,14 @@ class Thermistor:
|
||||
x = (y2 - y1) / (l2 - l1)
|
||||
y = (y3 - y1) / (l3 - l1)
|
||||
c = (y - x) / ((l3 - l2) * (l1 + l2 + l3))
|
||||
b = x - c * (l1**2 + l2**2 + l1*l2)
|
||||
a = y1 - (b + l1**2 *c)*l1
|
||||
|
||||
if c < 0:
|
||||
print "//////////////////////////////////////////////////////////////////////////////////////"
|
||||
print "// WARNING: negative coefficient 'c'! Something may be wrong with the measurements! //"
|
||||
print "//////////////////////////////////////////////////////////////////////////////////////"
|
||||
c = -c
|
||||
self.c1 = a # Steinhart-Hart coefficients
|
||||
self.c2 = b
|
||||
self.c3 = c
|
||||
|
Loading…
Reference in New Issue
Block a user