Merge branch 'Marlin_v1' of https://github.com/ErikZalm/Marlin into Marlin_v1

master
Bernhard Kubicek 13 years ago
commit eeb4f029db

@ -80,7 +80,7 @@
// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure! // 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. // You should use MINTEMP for thermistor short/failure protection.
#define HEATER_0_MAXTEMP 275 #define HEATER_0_MAXTEMP 275
//#define_HEATER_1_MAXTEMP 275 //#define HEATER_1_MAXTEMP 275
//#define BED_MAXTEMP 150 //#define BED_MAXTEMP 150

@ -90,50 +90,12 @@ static unsigned long previous_millis_heater, previous_millis_bed_heater;
#endif //WATCHPERIOD #endif //WATCHPERIOD
// Init min and max temp with extreme values to prevent false errors during startup // Init min and max temp with extreme values to prevent false errors during startup
#ifdef HEATER_0_MINTEMP static int minttemp_0 = 0;
#ifdef HEATER_0_USES_AD595 static int maxttemp_0 = 16383;
static int minttemp_0 = 0; static int minttemp_1 = 0;
#else static int maxttemp_1 = 16383;
static int minttemp_0 = 16383; static int bed_minttemp = 0;
#endif static int bed_maxttemp = 16383;
#endif //MINTEMP
#ifdef HEATER_0_MAXTEMP
#ifdef HEATER_0_USES_AD595
static int maxttemp_0 = 16383;
#else
static int maxttemp_0 = 0;
#endif
#endif //MAXTEMP
#ifdef HEATER_1_MINTEMP
#ifdef HEATER_1_USES_AD595
static int minttemp_1 = 0;
#else
static int minttemp_1 = 16383;
#endif
#endif //MINTEMP
#ifdef HEATER_1_MAXTEMP
#ifdef HEATER_1_USES_AD595
static int maxttemp_1 = 16383;
#else
static int maxttemp_1 = 0;
#endif
#endif //MAXTEMP
#ifdef BED_MINTEMP
#ifdef BED_USES_AD595
static int bed_minttemp = 0;
#else
static int bed_minttemp = 16383;
#endif
#endif //BED_MINTEMP
#ifdef BED_MAXTEMP
#ifdef BED_USES_AD595
static int bed_maxttemp = 16383;
#else
static int bed_maxttemp = 0;
#endif
#endif //BED_MAXTEMP
//=========================================================================== //===========================================================================
//=============================functions ============================ //=============================functions ============================
@ -198,17 +160,27 @@ void manage_heater()
//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 #endif //PID_DEBUG
HeaterPower=pid_output; HeaterPower=pid_output;
analogWrite(HEATER_0_PIN, pid_output); // Check if temperature is within the correct range
if((current_raw[TEMPSENSOR_HOTEND_0] > minttemp_0) && (current_raw[TEMPSENSOR_HOTEND_0] < maxttemp_0)) {
analogWrite(HEATER_0_PIN, pid_output);
}
else {
analogWrite(HEATER_0_PIN, 0);
}
#endif //PIDTEMP #endif //PIDTEMP
#ifndef PIDTEMP #ifndef PIDTEMP
if(current_raw[0] >= target_raw[0]) // Check if temperature is within the correct range
{ if((current_raw[TEMPSENSOR_HOTEND_0] > minttemp_0) && (current_raw[TEMPSENSOR_HOTEND_0] < maxttemp_0)) {
WRITE(HEATER_0_PIN,LOW); if(current_raw[TEMPSENSOR_HOTEND_0] >= target_raw[TEMPSENSOR_HOTEND_0]) {
WRITE(HEATER_0_PIN,LOW);
}
else {
WRITE(HEATER_0_PIN,HIGH);
}
} }
else else {
{ WRITE(HEATER_0_PIN,LOW);
WRITE(HEATER_0_PIN,HIGH);
} }
#endif #endif
@ -217,13 +189,19 @@ void manage_heater()
previous_millis_bed_heater = millis(); previous_millis_bed_heater = millis();
#if TEMP_1_PIN > -1 #if TEMP_1_PIN > -1
if(current_raw[TEMPSENSOR_BED] >= target_raw[TEMPSENSOR_BED]) // Check if temperature is within the correct range
{ if((current_raw[TEMPSENSOR_BED] > bed_minttemp) && (current_raw[TEMPSENSOR_BED] < bed_maxttemp)) {
WRITE(HEATER_1_PIN,LOW); if(current_raw[TEMPSENSOR_BED] >= target_raw[TEMPSENSOR_BED])
{
WRITE(HEATER_1_PIN,LOW);
}
else
{
WRITE(HEATER_1_PIN,HIGH);
}
} }
else else {
{ WRITE(HEATER_1_PIN,LOW);
WRITE(HEATER_1_PIN,HIGH);
} }
#endif #endif
} }
@ -370,6 +348,34 @@ void tp_init()
// Set analog inputs // Set analog inputs
ADCSRA = 1<<ADEN | 1<<ADSC | 1<<ADIF | 0x07; ADCSRA = 1<<ADEN | 1<<ADSC | 1<<ADIF | 0x07;
DIDR0 = 0;
#ifdef DIDR2
DIDR2 = 0;
#endif
#if (TEMP_0_PIN > -1)
#if TEMP_0_PIN < 8
DIDR0 |= 1 << TEMP_0_PIN;
#else
DIDR2 |= 1<<(TEMP_0_PIN - 8);
ADCSRB = 1<<MUX5;
#endif
#endif
#if (TEMP_1_PIN > -1)
#if TEMP_1_PIN < 8
DIDR0 |= 1<<TEMP_1_PIN;
#else
DIDR2 |= 1<<(TEMP_1_PIN - 8);
ADCSRB = 1<<MUX5;
#endif
#endif
#if (TEMP_2_PIN > -1)
#if TEMP_2_PIN < 8
DIDR0 |= 1 << TEMP_2_PIN;
#else
DIDR2 = 1<<(TEMP_2_PIN - 8);
ADCSRB = 1<<MUX5;
#endif
#endif
// Use timer0 for temperature measurement // Use timer0 for temperature measurement
// Interleave temperature interrupt with millies interrupt // Interleave temperature interrupt with millies interrupt
@ -456,10 +462,7 @@ ISR(TIMER0_COMPB_vect)
switch(temp_state) { switch(temp_state) {
case 0: // Prepare TEMP_0 case 0: // Prepare TEMP_0
#if (TEMP_0_PIN > -1) #if (TEMP_0_PIN > -1)
#if TEMP_0_PIN < 8 #if TEMP_0_PIN > 7
DIDR0 = 1 << TEMP_0_PIN;
#else
DIDR2 = 1<<(TEMP_0_PIN - 8);
ADCSRB = 1<<MUX5; ADCSRB = 1<<MUX5;
#endif #endif
ADMUX = ((1 << REFS0) | (TEMP_0_PIN & 0x07)); ADMUX = ((1 << REFS0) | (TEMP_0_PIN & 0x07));
@ -478,10 +481,7 @@ ISR(TIMER0_COMPB_vect)
break; break;
case 2: // Prepare TEMP_1 case 2: // Prepare TEMP_1
#if (TEMP_1_PIN > -1) #if (TEMP_1_PIN > -1)
#if TEMP_1_PIN < 7 #if TEMP_1_PIN > 7
DIDR0 = 1<<TEMP_1_PIN;
#else
DIDR2 = 1<<(TEMP_1_PIN - 8);
ADCSRB = 1<<MUX5; ADCSRB = 1<<MUX5;
#endif #endif
ADMUX = ((1 << REFS0) | (TEMP_1_PIN & 0x07)); ADMUX = ((1 << REFS0) | (TEMP_1_PIN & 0x07));
@ -500,10 +500,7 @@ ISR(TIMER0_COMPB_vect)
break; break;
case 4: // Prepare TEMP_2 case 4: // Prepare TEMP_2
#if (TEMP_2_PIN > -1) #if (TEMP_2_PIN > -1)
#if TEMP_2_PIN < 7 #if TEMP_2_PIN > 7
DIDR0 = 1 << TEMP_2_PIN;
#else
DIDR2 = 1<<(TEMP_2_PIN - 8);
ADCSRB = 1<<MUX5; ADCSRB = 1<<MUX5;
#endif #endif
ADMUX = ((1 << REFS0) | (TEMP_2_PIN & 0x07)); ADMUX = ((1 << REFS0) | (TEMP_2_PIN & 0x07));
@ -556,7 +553,7 @@ ISR(TIMER0_COMPB_vect)
#if (HEATER_0_PIN > -1) #if (HEATER_0_PIN > -1)
if(current_raw[TEMPSENSOR_HOTEND_0] >= maxttemp_0) { if(current_raw[TEMPSENSOR_HOTEND_0] >= maxttemp_0) {
target_raw[TEMPSENSOR_HOTEND_0] = 0; target_raw[TEMPSENSOR_HOTEND_0] = 0;
analogWrite(HEATER_0_PIN, 0); digitalWrite(HEATER_0_PIN, 0);
SERIAL_ERROR_START; SERIAL_ERROR_START;
SERIAL_ERRORLNPGM("Temperature extruder 0 switched off. MAXTEMP triggered !!"); SERIAL_ERRORLNPGM("Temperature extruder 0 switched off. MAXTEMP triggered !!");
kill(); kill();
@ -567,11 +564,10 @@ ISR(TIMER0_COMPB_vect)
#if (HEATER_1_PIN > -1) #if (HEATER_1_PIN > -1)
if(current_raw[TEMPSENSOR_HOTEND_1] >= maxttemp_1) { if(current_raw[TEMPSENSOR_HOTEND_1] >= maxttemp_1) {
target_raw[TEMPSENSOR_HOTEND_1] = 0; target_raw[TEMPSENSOR_HOTEND_1] = 0;
if(current_raw[2] >= maxttemp_1) { digitalWrite(HEATER_2_PIN, 0);
analogWrite(HEATER_2_PIN, 0);
SERIAL_ERROR_START; SERIAL_ERROR_START;
SERIAL_ERRORLNPGM("Temperature extruder 1 switched off. MAXTEMP triggered !!"); SERIAL_ERRORLNPGM("Temperature extruder 1 switched off. MAXTEMP triggered !!");
kill() kill();
} }
#endif #endif
#endif //MAXTEMP #endif //MAXTEMP
@ -580,7 +576,7 @@ ISR(TIMER0_COMPB_vect)
#if (HEATER_0_PIN > -1) #if (HEATER_0_PIN > -1)
if(current_raw[TEMPSENSOR_HOTEND_0] <= minttemp_0) { if(current_raw[TEMPSENSOR_HOTEND_0] <= minttemp_0) {
target_raw[TEMPSENSOR_HOTEND_0] = 0; target_raw[TEMPSENSOR_HOTEND_0] = 0;
analogWrite(HEATER_0_PIN, 0); digitalWrite(HEATER_0_PIN, 0);
SERIAL_ERROR_START; SERIAL_ERROR_START;
SERIAL_ERRORLNPGM("Temperature extruder 0 switched off. MINTEMP triggered !!"); SERIAL_ERRORLNPGM("Temperature extruder 0 switched off. MINTEMP triggered !!");
kill(); kill();
@ -592,7 +588,7 @@ ISR(TIMER0_COMPB_vect)
#if (HEATER_2_PIN > -1) #if (HEATER_2_PIN > -1)
if(current_raw[TEMPSENSOR_HOTEND_1] <= minttemp_1) { if(current_raw[TEMPSENSOR_HOTEND_1] <= minttemp_1) {
target_raw[TEMPSENSOR_HOTEND_1] = 0; target_raw[TEMPSENSOR_HOTEND_1] = 0;
analogWrite(HEATER_2_PIN, 0); digitalWrite(HEATER_2_PIN, 0);
SERIAL_ERROR_START; SERIAL_ERROR_START;
SERIAL_ERRORLNPGM("Temperature extruder 1 switched off. MINTEMP triggered !!"); SERIAL_ERRORLNPGM("Temperature extruder 1 switched off. MINTEMP triggered !!");
kill(); kill();
@ -604,7 +600,7 @@ ISR(TIMER0_COMPB_vect)
#if (HEATER_1_PIN > -1) #if (HEATER_1_PIN > -1)
if(current_raw[1] <= bed_minttemp) { if(current_raw[1] <= bed_minttemp) {
target_raw[1] = 0; target_raw[1] = 0;
WRITE(HEATER_1_PIN, 0); digitalWrite(HEATER_1_PIN, 0);
SERIAL_ERROR_START; SERIAL_ERROR_START;
SERIAL_ERRORLNPGM("Temperatur heated bed switched off. MINTEMP triggered !!"); SERIAL_ERRORLNPGM("Temperatur heated bed switched off. MINTEMP triggered !!");
kill(); kill();
@ -616,7 +612,7 @@ ISR(TIMER0_COMPB_vect)
#if (HEATER_1_PIN > -1) #if (HEATER_1_PIN > -1)
if(current_raw[1] >= bed_maxttemp) { if(current_raw[1] >= bed_maxttemp) {
target_raw[1] = 0; target_raw[1] = 0;
WRITE(HEATER_1_PIN, 0); digitalWrite(HEATER_1_PIN, 0);
SERIAL_ERROR_START; SERIAL_ERROR_START;
SERIAL_ERRORLNPGM("Temperature heated bed switched off. MAXTEMP triggered !!"); SERIAL_ERRORLNPGM("Temperature heated bed switched off. MAXTEMP triggered !!");
kill(); kill();

@ -10,7 +10,7 @@ This RepRap firmware is a mashup between <a href="https://github.com/kliment/Spr
Derived from Sprinter and Grbl by Erik van der Zalm. Derived from Sprinter and Grbl by Erik van der Zalm.
Sprinters lead developers are Kliment and caru. Sprinters lead developers are Kliment and caru.
Grbls lead developer is Simen Svale Skogsrud. Grbls lead developer is Simen Svale Skogsrud. Sonney Jeon (Chamnit) improved some parts of grbl
A fork by bkubicek for the Ultimaker was merged, and further development was aided by him. A fork by bkubicek for the Ultimaker was merged, and further development was aided by him.
Some features have been added by: Some features have been added by:
Lampmaker, Bradley Feldman, and others... Lampmaker, Bradley Feldman, and others...
@ -23,7 +23,7 @@ Features:
* Look ahead (Keep the speed high when possible. High cornering speed) * Look ahead (Keep the speed high when possible. High cornering speed)
* Interrupt based temperature protection * Interrupt based temperature protection
* preliminary support for Matthew Roberts advance algorithm * preliminary support for Matthew Roberts advance algorithm
* For more info see: http://reprap.org/pipermail/reprap-dev/2011-May/003323.html For more info see: http://reprap.org/pipermail/reprap-dev/2011-May/003323.html
* Full endstop support * Full endstop support
* SD Card support * SD Card support
* SD Card folders (works in pronterface) * SD Card folders (works in pronterface)
@ -39,8 +39,6 @@ Features:
* Updated sdcardlib * Updated sdcardlib
* Heater power reporting. Useful for PID monitoring. * Heater power reporting. Useful for PID monitoring.
This firmware is optimized for Ultimaker's gen6 electronics (including the Ultimaker 1.5.x daughterboard and Arduino Mega 2560).
The default baudrate is 250000. This baudrate has less jitter and hence errors than the usual 115200 baud, but is less supported by drivers and host-environments. The default baudrate is 250000. This baudrate has less jitter and hence errors than the usual 115200 baud, but is less supported by drivers and host-environments.
@ -156,13 +154,16 @@ EEPROM:
* M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily). * M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
* M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. * M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to.
Configuring and compilation: Configuring and compilation:
============================ ============================
Install the arduino software IDE/toolset v22 Install the arduino software IDE/toolset v22
http://www.arduino.cc/en/Main/Software http://www.arduino.cc/en/Main/Software
For gen6 and sanguinololu the Sanguino directory in the Marlin dir needs to be copied to the arduino environment.
copy Marlin\sanguino <arduino home>\hardware\Sanguino
Install Ultimaker's RepG 25 build Install Ultimaker's RepG 25 build
http://software.ultimaker.com http://software.ultimaker.com
For SD handling and as better substitute (apart from stl manipulation) download For SD handling and as better substitute (apart from stl manipulation) download

Loading…
Cancel
Save