浏览代码

fix #1305 by proposed workaround (thanks gaby64)

Steffen Vogel 9 年前
父节点
当前提交
df17a6a1b4
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8
    0
      Marlin/scripts/createTemperatureLookupMarlin.py

+ 8
- 0
Marlin/scripts/createTemperatureLookupMarlin.py 查看文件

@@ -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

正在加载...
取消
保存