From df17a6a1b44176fe571d21e79bb7b682f1b71c8b Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Tue, 6 Jan 2015 10:29:26 +0100 Subject: [PATCH] fix #1305 by proposed workaround (thanks gaby64) --- Marlin/scripts/createTemperatureLookupMarlin.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Marlin/scripts/createTemperatureLookupMarlin.py b/Marlin/scripts/createTemperatureLookupMarlin.py index 0e05981a1..4f54c2833 100755 --- a/Marlin/scripts/createTemperatureLookupMarlin.py +++ b/Marlin/scripts/createTemperatureLookupMarlin.py @@ -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