Browse Source

fix #1305 by proposed workaround (thanks gaby64)

Steffen Vogel 9 years ago
parent
commit
df17a6a1b4
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      Marlin/scripts/createTemperatureLookupMarlin.py

+ 8
- 0
Marlin/scripts/createTemperatureLookupMarlin.py View File

@@ -43,6 +43,14 @@ class Thermistor:
43 43
         x = (y2 - y1) / (l2 - l1)
44 44
         y = (y3 - y1) / (l3 - l1)
45 45
         c = (y - x) / ((l3 - l2) * (l1 + l2 + l3))
46
+        b = x - c * (l1**2 + l2**2 + l1*l2)
47
+        a = y1 - (b + l1**2 *c)*l1
48
+        
49
+        if c < 0:
50
+            print "//////////////////////////////////////////////////////////////////////////////////////"
51
+            print "// WARNING: negative coefficient 'c'! Something may be wrong with the measurements! //"
52
+            print "//////////////////////////////////////////////////////////////////////////////////////"
53
+            c = -c
46 54
         self.c1 = a                         # Steinhart-Hart coefficients
47 55
         self.c2 = b
48 56
         self.c3 = c

Loading…
Cancel
Save