diff options
author | kliment <kliment.yanev@gmail.com> | 2011-05-12 23:18:12 -0700 |
---|---|---|
committer | kliment <kliment.yanev@gmail.com> | 2011-05-12 23:18:12 -0700 |
commit | 1963409abade561be742ecd9e8e584047727ba55 (patch) | |
tree | 1f4b64531e431bc647b336e93221b9d9d5d715de /Tonokip_Firmware | |
parent | 37d8a4bd55bd8a60c010ad459b18ff040e5576e4 (diff) | |
parent | 889d6a7c5b5e715fd49dfb559704ab1dfc009746 (diff) |
Merge pull request #17 from WebSpider/master
Add a maximum temperature limit after which the heater shuts down.
Diffstat (limited to 'Tonokip_Firmware')
-rw-r--r-- | Tonokip_Firmware/Tonokip_Firmware.pde | 10 | ||||
-rw-r--r-- | Tonokip_Firmware/configuration.h | 6 |
2 files changed, 16 insertions, 0 deletions
diff --git a/Tonokip_Firmware/Tonokip_Firmware.pde b/Tonokip_Firmware/Tonokip_Firmware.pde index 81a73ae..c2ad00e 100644 --- a/Tonokip_Firmware/Tonokip_Firmware.pde +++ b/Tonokip_Firmware/Tonokip_Firmware.pde @@ -140,6 +140,9 @@ float tt=0,bt=0; #ifdef MINTEMP int minttemp=temp2analog(MINTEMP); #endif +#ifdef MAXTEMP +int maxttemp=temp2analog(MAXTEMP); +#endif //Inactivity shutdown variables unsigned long previous_millis_cmd=0; @@ -1375,6 +1378,12 @@ inline void manage_heater() if(current_raw<=minttemp) target_raw=0; #endif + #ifdef MAXTEMP + if(current_raw>maxttemp) { + // We are too hot. Emergency brake to protect hotend + kill(5); + } + #endif #if (TEMP_0_PIN > -1) || defined (HEATER_USES_MAX66675) #ifdef PIDTEMP error = target_raw - current_raw; @@ -1578,6 +1587,7 @@ inline void kill(byte debug) case 2: Serial.print("Linear Move Abort, Last Line: "); break; case 3: Serial.print("Homing X Min Stop Fail, Last Line: "); break; case 4: Serial.print("Homing Y Min Stop Fail, Last Line: "); break; + case 5: Serial.print("Hot-end overheat protection, Last Line: "); break; } Serial.println(gcode_LastN); delay(5000); // 5 Second delay diff --git a/Tonokip_Firmware/configuration.h b/Tonokip_Firmware/configuration.h index 97e94bc..47466ae 100644 --- a/Tonokip_Firmware/configuration.h +++ b/Tonokip_Firmware/configuration.h @@ -61,6 +61,12 @@ float min_constant_speed_units = 2; // the minimum units of an accelerated move //The minimal temperature defines the temperature below which the heater will not be enabled //#define MINTEMP +//Experimental max temp +//When temperature exceeds max temp, your bot will halt. +//This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure! +//You should use MINTEMP for thermistor short/failure protection. +//#define MAXTEMP 275 + // Select one of these only to define how the nozzle temp is read. #define HEATER_USES_THERMISTOR //#define HEATER_USES_AD595 |