diff options
author | David Crocker <dcrocker@eschertech.com> | 2020-12-24 17:19:27 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2020-12-24 17:19:27 +0300 |
commit | c99c5be037e504775b2531c99be5c78d33f0205d (patch) | |
tree | 32e1df0ffe4c42cc96439e9deed5ddec0ccf71ee /src/Heating | |
parent | 57b094be2156f1128c3992e3c61b9fbff5c3923b (diff) |
Fixed bus off handling and other bugs in SAME70 CAN driver3.2RC2
Also allow temperatures below -5C to be read by low-resistance
thermistors
Diffstat (limited to 'src/Heating')
-rw-r--r-- | src/Heating/Sensors/Thermistor.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Heating/Sensors/Thermistor.cpp b/src/Heating/Sensors/Thermistor.cpp index 4fa8e1e0..873e4325 100644 --- a/src/Heating/Sensors/Thermistor.cpp +++ b/src/Heating/Sensors/Thermistor.cpp @@ -324,7 +324,9 @@ void Thermistor::Poll() noexcept const float recipT = shA + shB * logResistance + shC * logResistance * logResistance * logResistance; const float temp = (recipT > 0.0) ? (1.0/recipT) + ABS_ZERO : BadErrorTemperature; - if (temp < MinimumConnectedTemperature) + // It's hard to distinguish between an open circuit and a cold high-resistance thermistor. + // So we treat a temperature below -5C as an open circuit, unless we are using a low-resistance thermistor. The E3D thermistor has a resistance of about 470k @ -5C. + if (temp < MinimumConnectedTemperature && resistance > seriesR * 100) { // Assume thermistor is disconnected SetResult(ABS_ZERO, TemperatureError::openCircuit); |