-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
High temperature thermistor support #4098
High temperature thermistor support #4098
Conversation
…nto High-Temperature-Thermistor-Support
@@ -161,6 +161,9 @@ int Temperature::maxttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_RAW_HI_TEMP , | |||
int Temperature::minttemp[HOTENDS] = { 0 }; | |||
int Temperature::maxttemp[HOTENDS] = ARRAY_BY_HOTENDS1(16383); | |||
|
|||
int Temperature::consecutive_low_temperature_error[HOTENDS] = ARRAY_BY_HOTENDS(0, 0, 0, 0); | |||
unsigned long Temperature::preheatStartTime[HOTENDS] = ARRAY_BY_HOTENDS(0, 0, 0, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For arrays initialized to zero, you can just use { 0 }
rather than these macros.
I'd prefer seeing people use a PT100 or thermocouple instead of these "high temperature" thermistors |
@Grogyan It is true that the best case would be to use the proper amplification circuit with a platinum or thermocouple sensor, but I prefer a drop-in remplacement with minimum hardware add-on and changes. All sensors have their advantages and disadvantages. Since it is possible to do a little trick on the firmware to go around the weakness of the high temperature thermistor ( low resolution below 40°C ) , it makes this solution more than interesting;
I think these sensors have been underrated due to their limitation at low temperature and I think it is very well suited for 3D printer application. |
@woodencase01 laziness usually wins out every time. Why go out and buy a hammer to tap something in place, when a screwdriver works just as well. I do agree though that Marlin should support a variety of thermistors in the meantime |
@Grogyan Thanks for your reply! I didn't know the MAX6675 and MAX31855 at all, very interesting. Regarding both the PT100 and AD595, they end up having a different resolution because they use a different portion in the 5V ADC range at the output. The amplified PT100 has 1.1V at 0°C up to 2.65V at 400°C. I'm currently writing a blog about temperature sensors for 3D printers, I'll keep you updated :D |
- Added thermistor 66 in configuration.h - Use ending time and macro instead of start Time for preheat function - Use { 0 } instead of ARRAY_BY_HOTENDS macro to initialize static members when applicable - Wrapped some variables and functions in #ifdef block where relevant
Seems like I did a bad merge with thermistortables.h, will fix this asap |
Thermistortables should be properly merged and the branch up to date
if (celsius == 0.0f) | ||
reset_preheat_time(hotend); | ||
else if (target_temperature[hotend] == 0.0f) | ||
start_preheat_time(hotend); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 4 lines need indentation.
Moved define for high temp thermistors to configuration_adv.h and copied the segment for every configuration_adv in example_configurations. Add UNUSED(hotend) in default case of is_preheating to remove warning
…nto High-Temperature-Thermistor-Support
Any news on this? Does something else needs improvement? |
Hi @JeanSebastienCarrier-Dyze Everything looks good to me, although I have a couple of cleanups that I would make before merging. If you could squash and rebase these commits it will help a lot. Otherwise I'm stuck making a completely new PR and your moniker won't be on any of the commits. My version of this PR is now posted at #4244. |
PFW-1515 Fix an issue with Thermal Anomaly message
This is a follow up of : #2915 and #2941 (since changes that were made in MarlinDev are brought back in Marlin)
These modifications allow the use of high temperature thermistors in order to handle hot ends temperature up to 500 degrees Celsius.
Because thermistors able to read higher temperature tend to have a hard time reading lower values, two "defines" were added to allow a "preheating time" as well as handle some measure of noise reading (sudden drops for a few frames).
These defines have been added to the default configuration. Using another configuration or commenting these additions produce the same execution than before these changes.
A high temperature compatible thermistor has been added (no 66) to the thermistor table
The tests were taken from #2066
The hardware was : Board: Arduino MEGA2560 with RAMPS 1.4
Dyze Design sensor 500°C
HEATER_0_MINTEMP 21
MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED = 5;
MILLISECONDS_PREHEAT_TIME = 20000;
TEST 7 - Hotend's thermistor disconnected before startup
No error is shown. Temperature shown is 20°C, 1°C below the mintemp error.
Since the conditions «is preheating» and «target temperature > 0» is not met, the min_temp error is not shown as it would normally be.
TEST 9 - Hotend's thermistor disconnected after heating begins AND before (preheating time) seconds elapsed
Heater remains ON for the duration of "preheating time". Turns OFF once the duration is elapsed.
TEST 11 - Hotend's thermistor disconnected after heating begins AND after (preheating time) seconds elapsed
Min_temp error, heater is disabled.
TEST 13 - Hotend's thermistor disconnected after target temperature reached.
Min_temp error, heater is disabled.