Explorar el Código

fix #1305 by proposed workaround (thanks gaby64)

Steffen Vogel hace 10 años
padre
commit
df17a6a1b4
Se han modificado 1 ficheros con 8 adiciones y 0 borrados
  1. 8
    0
      Marlin/scripts/createTemperatureLookupMarlin.py

+ 8
- 0
Marlin/scripts/createTemperatureLookupMarlin.py Ver fichero

@@ -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…
Cancelar
Guardar