Merge remote-tracking branch 'origin/Marlin_v1' into Marlin_v1

This commit is contained in:
Erik van der Zalm
2011-11-13 20:46:44 +01:00
16 changed files with 1443 additions and 1156 deletions

View File

@@ -35,7 +35,6 @@
#include "pins.h"
#include "Marlin.h"
#include "ultralcd.h"
#include "streaming.h"
#include "temperature.h"
#include "watchdog.h"
@@ -160,11 +159,13 @@ void manage_heater()
// pTerm+=Kc*current_block->speed_e; //additional heating if extrusion speed is high
// #endif
pid_output = constrain(pTerm + iTerm - dTerm, 0, PID_MAX);
}
#endif //PID_OPENLOOP
#ifdef PID_DEBUG
SERIAL_ECHOLN(" PIDDEBUG Input "<<pid_input<<" Output "<<pid_output" pTerm "<<pTerm<<" iTerm "<<iTerm<<" dTerm "<<dTerm);
//SERIAL_ECHOLN(" PIDDEBUG Input "<<pid_input<<" Output "<<pid_output" pTerm "<<pTerm<<" iTerm "<<iTerm<<" dTerm "<<dTerm);
#endif //PID_DEBUG
HeaterPower=pid_output;
analogWrite(HEATER_0_PIN, pid_output);
#endif //PIDTEMP
@@ -253,7 +254,7 @@ int temp2analogBed(int celsius) {
return (1023 * OVERSAMPLENR) - raw;
#elif defined BED_USES_AD595
return celsius * (1024.0 / (5.0 * 100.0) ) * OVERSAMPLENR;
return lround(celsius * (1024.0 * OVERSAMPLENR/ (5.0 * 100.0) ) );
#endif
}
@@ -464,7 +465,8 @@ ISR(TIMER0_COMPB_vect)
temp_count++;
break;
default:
SERIAL_ERRORLN("Temp measurement error!");
SERIAL_ERROR_START;
SERIAL_ERRORLNPGM("Temp measurement error!");
break;
}
@@ -498,7 +500,8 @@ ISR(TIMER0_COMPB_vect)
if(current_raw[TEMPSENSOR_HOTEND_0] >= maxttemp_0) {
target_raw[TEMPSENSOR_HOTEND_0] = 0;
analogWrite(HEATER_0_PIN, 0);
SERIAL_ERRORLN("Temperature extruder 0 switched off. MAXTEMP triggered !!");
SERIAL_ERROR_START;
SERIAL_ERRORLNPGM("Temperature extruder 0 switched off. MAXTEMP triggered !!");
kill();
}
#endif
@@ -509,7 +512,8 @@ ISR(TIMER0_COMPB_vect)
target_raw[TEMPSENSOR_HOTEND_1] = 0;
if(current_raw[2] >= maxttemp_1) {
analogWrite(HEATER_2_PIN, 0);
SERIAL_ERRORLN("Temperature extruder 1 switched off. MAXTEMP triggered !!");
SERIAL_ERROR_START;
SERIAL_ERRORLNPGM("Temperature extruder 1 switched off. MAXTEMP triggered !!");
kill()
}
#endif
@@ -520,7 +524,8 @@ ISR(TIMER0_COMPB_vect)
if(current_raw[TEMPSENSOR_HOTEND_0] <= minttemp_0) {
target_raw[TEMPSENSOR_HOTEND_0] = 0;
analogWrite(HEATER_0_PIN, 0);
SERIAL_ERRORLN("Temperature extruder 0 switched off. MINTEMP triggered !!");
SERIAL_ERROR_START;
SERIAL_ERRORLNPGM("Temperature extruder 0 switched off. MINTEMP triggered !!");
kill();
}
#endif
@@ -531,7 +536,8 @@ ISR(TIMER0_COMPB_vect)
if(current_raw[TEMPSENSOR_HOTEND_1] <= minttemp_1) {
target_raw[TEMPSENSOR_HOTEND_1] = 0;
analogWrite(HEATER_2_PIN, 0);
SERIAL_ERRORLN("Temperature extruder 1 switched off. MINTEMP triggered !!");
SERIAL_ERROR_START;
SERIAL_ERRORLNPGM("Temperature extruder 1 switched off. MINTEMP triggered !!");
kill();
}
#endif
@@ -542,7 +548,8 @@ ISR(TIMER0_COMPB_vect)
if(current_raw[1] <= bed_minttemp) {
target_raw[1] = 0;
WRITE(HEATER_1_PIN, 0);
SERIAL_ERRORLN("Temperatur heated bed switched off. MINTEMP triggered !!");
SERIAL_ERROR_START;
SERIAL_ERRORLNPGM("Temperatur heated bed switched off. MINTEMP triggered !!");
kill();
}
#endif
@@ -553,7 +560,8 @@ ISR(TIMER0_COMPB_vect)
if(current_raw[1] >= bed_maxttemp) {
target_raw[1] = 0;
WRITE(HEATER_1_PIN, 0);
SERIAL_ERRORLN("Temperature heated bed switched off. MAXTEMP triggered !!");
SERIAL_ERROR_START;
SERIAL_ERRORLNPGM("Temperature heated bed switched off. MAXTEMP triggered !!");
kill();
}
#endif
@@ -561,4 +569,4 @@ ISR(TIMER0_COMPB_vect)
}
}