From 33bb044d7c8faa269e538e46858ed5d62292f27a Mon Sep 17 00:00:00 2001 From: Bernhard Date: Sun, 22 Apr 2012 20:04:39 +0200 Subject: [PATCH 1/9] fixed catsting to (int)e in serial error messages. see https://github.com/ErikZalm/Marlin/issues/148 --- Marlin/temperature.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index a8ec619a2..2180f8003 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -710,7 +710,7 @@ void max_temp_error(uint8_t e) { disable_heater(); if(IsStopped() == false) { SERIAL_ERROR_START; - SERIAL_ERRORLN(e); + SERIAL_ERRORLN((int)e); SERIAL_ERRORLNPGM(": Extruder switched off. MAXTEMP triggered !"); } } @@ -719,7 +719,7 @@ void min_temp_error(uint8_t e) { disable_heater(); if(IsStopped() == false) { SERIAL_ERROR_START; - SERIAL_ERRORLN(e); + SERIAL_ERRORLN((int)e); SERIAL_ERRORLNPGM(": Extruder switched off. MINTEMP triggered !"); } } From 44fd8d46d2d0d7a3e91cd400f16bda48f5f4fec1 Mon Sep 17 00:00:00 2001 From: Bernhard Date: Sun, 22 Apr 2012 20:44:27 +0200 Subject: [PATCH 2/9] fixed quickhome --- Marlin/Marlin.pde | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde index 083e80352..a7c4c11f2 100644 --- a/Marlin/Marlin.pde +++ b/Marlin/Marlin.pde @@ -609,7 +609,7 @@ void process_commands() feedrate = 0.0; home_all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2]))); #ifdef QUICK_HOME - if( code_seen(axis_codes[X_AXIS]) && code_seen(axis_codes[Y_AXIS]) ) //first diagonal move + if((home_all_axis)||( code_seen(axis_codes[X_AXIS]) && code_seen(axis_codes[Y_AXIS])) ) //first diagonal move { current_position[X_AXIS] = 0;current_position[Y_AXIS] = 0; From 464b755918bc6090de10e5fdee6440ebe001b688 Mon Sep 17 00:00:00 2001 From: Bernhard Date: Sun, 22 Apr 2012 20:55:56 +0200 Subject: [PATCH 3/9] added support for the UltiController --- Marlin/Configuration.h | 11 ++++++++++- Marlin/pins.h | 16 ++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 18942a5a6..67a32a690 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -196,7 +196,16 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th //#define ULTRA_LCD //general lcd support, also 16x2 //#define SDSUPPORT // Enable SD Card Support in Hardware Console -#define ULTIPANEL +//#define ULTIMAKERCONTROLLER //as available from the ultimaker online store. +//#define ULTIPANEL //the ultipanel as on thingiverse + + +#ifdef ULTIMAKERCONTROLLER //automatic expansion + #define ULTIPANEL + #define NEWPANEL +#endif + + #ifdef ULTIPANEL // #define NEWPANEL //enable this if you have a click-encoder panel #define SDSUPPORT diff --git a/Marlin/pins.h b/Marlin/pins.h index ced9b350f..0d6b6022e 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -729,10 +729,18 @@ #define LCD_PINS_D7 19 //encoder rotation values - #define encrot0 0 - #define encrot1 2 - #define encrot2 3 - #define encrot3 1 + #ifndef ULTIMAKERCONTROLLER + #define encrot0 0 + #define encrot1 2 + #define encrot2 3 + #define encrot3 1 + #else + #define encrot0 0 + #define encrot1 1 + #define encrot2 3 + #define encrot3 2 + + #endif #define SDCARDDETECT -1 //bits in the shift register that carry the buttons for: From e4d2138dbd0856d550d523e6a4b689b045144ffe Mon Sep 17 00:00:00 2001 From: Bernhard Date: Sun, 22 Apr 2012 21:12:17 +0200 Subject: [PATCH 4/9] reinitialize the lcd, if the SD card is inserted or removed. It seems that LCDs can confused by electrical discharges from time to time. Since a removal or insert of the sd card takes a long time in firmware, just reinitializing the lcd does not hurt. actually, it solves a problem with the UltiControlle --- Marlin/ultralcd.pde | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Marlin/ultralcd.pde b/Marlin/ultralcd.pde index e3888903f..f2a2b59f4 100644 --- a/Marlin/ultralcd.pde +++ b/Marlin/ultralcd.pde @@ -95,6 +95,7 @@ FORCE_INLINE void clear() void lcd_init() { //beep(); + byte Degree[8] = { B01100, @@ -2080,6 +2081,7 @@ void MainMenu::update() { force_lcd_update=true; oldcardstatus=CARDINSERTED; + lcd_init(); // to maybe revive the lcd if static electricty killed it. //Serial.println("echo: SD CHANGE"); if(CARDINSERTED) { From 3eacb4c16df1ecf7887a4d432335950047693775 Mon Sep 17 00:00:00 2001 From: Logan Bowers Date: Wed, 25 Apr 2012 19:22:38 -0700 Subject: [PATCH 5/9] Wrap the call to turn off the bed heater in a #if to prevent a compile error on boards that do not have a bed heater --- Marlin/temperature.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 2180f8003..783aa232d 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -725,7 +725,9 @@ void min_temp_error(uint8_t e) { } void bed_max_temp_error(void) { +#if HEATER_BED_PIN > -1 WRITE(HEATER_BED_PIN, 0); +#endif if(IsStopped() == false) { SERIAL_ERROR_START; SERIAL_ERRORLNPGM("Temperature heated bed switched off. MAXTEMP triggered !!"); From 8503b78876a7cd5b308c4dfdf6f0ca6c0d124dc7 Mon Sep 17 00:00:00 2001 From: Daid Date: Fri, 27 Apr 2012 14:51:32 +0200 Subject: [PATCH 6/9] Added support for 2nd extruder temperature to UltraLCD --- Marlin/language.h | 6 +- Marlin/temperature.h | 4 ++ Marlin/ultralcd.pde | 140 ++++++++++++++++++++++++++++++++++++------- 3 files changed, 126 insertions(+), 24 deletions(-) diff --git a/Marlin/language.h b/Marlin/language.h index 0178e21c2..4747ce626 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -29,6 +29,8 @@ #define MSG_MOVE_AXIS " Move Axis \x7E" #define MSG_SPEED " Speed:" #define MSG_NOZZLE " \002Nozzle:" + #define MSG_NOZZLE1 " \002Nozzle2:" + #define MSG_NOZZLE2 " \002Nozzle3:" #define MSG_BED " \002Bed:" #define MSG_FAN_SPEED " Fan speed:" #define MSG_FLOW " Flow:" @@ -174,6 +176,8 @@ #define MSG_MOVE_AXIS " Achsen verfahren \x7E" #define MSG_SPEED " Geschw:" #define MSG_NOZZLE " \002Duese:" + #define MSG_NOZZLE1 " \002Duese2:" + #define MSG_NOZZLE2 " \002Duese3:" #define MSG_BED " \002Bett:" #define MSG_FAN_SPEED " Luefter geschw.:" #define MSG_FLOW " Fluss:" @@ -296,4 +300,4 @@ #define MSG_ERR_LONG_EXTRUDE_STOP " too long extrusion prevented" #endif -#endif // ifndef LANGUAGE_H +#endif // ifndef LANGUAGE_H diff --git a/Marlin/temperature.h b/Marlin/temperature.h index e122a31f9..1848c703d 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -129,6 +129,8 @@ FORCE_INLINE bool isCoolingBed() { #define setTargetHotend1(_celsius) setTargetHotend((_celsius), 1) #define isHeatingHotend1() isHeatingHotend(1) #define isCoolingHotend1() isCoolingHotend(1) +#else +#define setTargetHotend1(_celsius) do{}while(0) #endif #if EXTRUDERS > 2 #define degHotend2() degHotend(2) @@ -136,6 +138,8 @@ FORCE_INLINE bool isCoolingBed() { #define setTargetHotend2(_celsius) setTargetHotend((_celsius), 2) #define isHeatingHotend2() isHeatingHotend(2) #define isCoolingHotend2() isCoolingHotend(2) +#else +#define setTargetHotend2(_celsius) do{}while(0) #endif #if EXTRUDERS > 3 #error Invalid number of extruders diff --git a/Marlin/ultralcd.pde b/Marlin/ultralcd.pde index f2a2b59f4..d99e9a2f4 100644 --- a/Marlin/ultralcd.pde +++ b/Marlin/ultralcd.pde @@ -323,6 +323,8 @@ void MainMenu::showStatus() lcd.setCursor(0,0);lcdprintPGM("\002---/---\001 "); #if defined BED_USES_THERMISTOR || defined BED_USES_AD595 lcd.setCursor(10,0);lcdprintPGM("B---/---\001 "); + #elif EXTRUDERS > 1 + lcd.setCursor(10,0);lcdprintPGM("\002---/---\001 "); #endif } @@ -357,6 +359,23 @@ void MainMenu::showStatus() lcd.print(ftostr3(targetBed)); oldtargetBed=targetBed; } + #elif EXTRUDERS > 1 + static int olddegHotEnd1=-1; + static int oldtargetHotEnd1=-1; + int tHotEnd1=intround(degHotend1()); + if((tHotEnd1!=olddegHotEnd1)||force_lcd_update) + { + lcd.setCursor(11,0); + lcd.print(ftostr3(tHotEnd0)); + olddegHotEnd0=tHotEnd0; + } + int ttHotEnd1=intround(degTargetHotend1()); + if((ttHotEnd1!=oldtargetHotEnd0)||force_lcd_update) + { + lcd.setCursor(15,0); + lcd.print(ftostr3(ttHotEnd1)); + oldtargetHotEnd0=ttHotEnd1; + } #endif //starttime=2; static uint16_t oldtime=0; @@ -431,10 +450,7 @@ void MainMenu::showStatus() if(force_lcd_update) //initial display of content { encoderpos=feedmultiply; - lcd.setCursor(0,0);lcdprintPGM("\002123/567\001 "); - #if defined BED_USES_THERMISTOR || defined BED_USES_AD595 - lcd.setCursor(10,0);lcdprintPGM("B123/567\001 "); - #endif + lcd.setCursor(0,0);lcdprintPGM("\002---/---\001 "); } int tHotEnd0=intround(degHotend0()); @@ -521,7 +537,7 @@ void MainMenu::showPrepare() beepshort(); ); break; case ItemP_cooldown: - MENUITEM( lcdprintPGM(MSG_COOLDOWN) , BLOCK;setTargetHotend0(0);setTargetBed(0);beepshort(); ) ; + MENUITEM( lcdprintPGM(MSG_COOLDOWN) , BLOCK;setTargetHotend0(0);setTargetHotend1(0);setTargetHotend2(0);setTargetBed(0);beepshort(); ) ; break; // case ItemP_extrude: // MENUITEM( lcdprintPGM(" Extrude") , BLOCK;enquecommand("G92 E0");enquecommand("G1 F700 E50");beepshort(); ) ; @@ -924,12 +940,18 @@ void MainMenu::showTune() // enum { - ItemCT_exit,ItemCT_nozzle, + ItemCT_exit,ItemCT_nozzle0, #ifdef AUTOTEMP ItemCT_autotempactive, ItemCT_autotempmin,ItemCT_autotempmax,ItemCT_autotempfact, #endif -#if (HEATER_BED_PIN > -1) +#if EXTRUDERS > 1 + ItemCT_nozzle1, +#endif +#if EXTRUDERS > 2 + ItemCT_nozzle2, +#endif +#if defined BED_USES_THERMISTOR || BED_USES_AD595 ItemCT_bed, #endif ItemCT_fan, @@ -947,7 +969,7 @@ void MainMenu::showControlTemp() case ItemCT_exit: MENUITEM( lcdprintPGM(MSG_CONTROL) , BLOCK;status=Main_Control;beepshort(); ) ; break; - case ItemCT_nozzle: + case ItemCT_nozzle0: { if(force_lcd_update) { @@ -981,8 +1003,80 @@ void MainMenu::showControlTemp() } }break; - #ifdef AUTOTEMP - case ItemCT_autotempmin: + #if EXTRUDERS > 1 + case ItemCT_nozzle1: + { + if(force_lcd_update) + { + lcd.setCursor(0,line);lcdprintPGM(MSG_NOZZLE1); + lcd.setCursor(13,line);lcd.print(ftostr3(intround(degTargetHotend1()))); + } + + if((activeline!=line) ) + break; + + if(CLICKED) + { + linechanging=!linechanging; + if(linechanging) + { + encoderpos=intround(degTargetHotend1()); + } + else + { + setTargetHotend1(encoderpos); + encoderpos=activeline*lcdslow; + beepshort(); + } + BLOCK; + } + if(linechanging) + { + if(encoderpos<0) encoderpos=0; + if(encoderpos>260) encoderpos=260; + lcd.setCursor(13,line);lcd.print(itostr3(encoderpos)); + } + + }break; + #endif + #if EXTRUDERS > 2 + case ItemCT_nozzle2: + { + if(force_lcd_update) + { + lcd.setCursor(0,line);lcdprintPGM(MSG_NOZZLE2); + lcd.setCursor(13,line);lcd.print(ftostr3(intround(degTargetHotend2()))); + } + + if((activeline!=line) ) + break; + + if(CLICKED) + { + linechanging=!linechanging; + if(linechanging) + { + encoderpos=intround(degTargetHotend2()); + } + else + { + setTargetHotend1(encoderpos); + encoderpos=activeline*lcdslow; + beepshort(); + } + BLOCK; + } + if(linechanging) + { + if(encoderpos<0) encoderpos=0; + if(encoderpos>260) encoderpos=260; + lcd.setCursor(13,line);lcd.print(itostr3(encoderpos)); + } + + }break; + #endif + #ifdef AUTOTEMP + case ItemCT_autotempmin: { if(force_lcd_update) { @@ -1016,7 +1110,7 @@ void MainMenu::showControlTemp() } }break; - case ItemCT_autotempmax: + case ItemCT_autotempmax: { if(force_lcd_update) { @@ -1050,7 +1144,7 @@ void MainMenu::showControlTemp() } }break; - case ItemCT_autotempfact: + case ItemCT_autotempfact: { if(force_lcd_update) { @@ -1084,7 +1178,7 @@ void MainMenu::showControlTemp() } }break; - case ItemCT_autotempactive: + case ItemCT_autotempactive: { if(force_lcd_update) { @@ -1111,9 +1205,9 @@ void MainMenu::showControlTemp() } }break; - #endif //autotemp - #if (HEATER_BED_PIN > -1) - case ItemCT_bed: + #endif //autotemp + #if defined BED_USES_THERMISTOR || BED_USES_AD595 + case ItemCT_bed: { if(force_lcd_update) { @@ -1146,8 +1240,8 @@ void MainMenu::showControlTemp() lcd.setCursor(13,line);lcd.print(itostr3(encoderpos)); } }break; - #endif - case ItemCT_fan: + #endif + case ItemCT_fan: { if(force_lcd_update) { @@ -1182,8 +1276,8 @@ void MainMenu::showControlTemp() } }break; - #ifdef PIDTEMP - case ItemCT_PID_P: + #ifdef PIDTEMP + case ItemCT_PID_P: { if(force_lcd_update) { @@ -1253,7 +1347,7 @@ void MainMenu::showControlTemp() } }break; - case ItemCT_PID_D: + case ItemCT_PID_D: { if(force_lcd_update) { @@ -1325,8 +1419,8 @@ void MainMenu::showControlTemp() } } - #endif #endif + #endif break; default: break; @@ -2284,4 +2378,4 @@ char *ftostr52(const float &x) #endif //ULTRA_LCD - + From 8e68c6cf89218636a2b6cce4fd3e6dcfe2c287fe Mon Sep 17 00:00:00 2001 From: Daid Date: Fri, 27 Apr 2012 15:00:01 +0200 Subject: [PATCH 7/9] Show proper temperature for extruder 2 --- Marlin/ultralcd.pde | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/ultralcd.pde b/Marlin/ultralcd.pde index d99e9a2f4..c6cd15bb0 100644 --- a/Marlin/ultralcd.pde +++ b/Marlin/ultralcd.pde @@ -366,15 +366,15 @@ void MainMenu::showStatus() if((tHotEnd1!=olddegHotEnd1)||force_lcd_update) { lcd.setCursor(11,0); - lcd.print(ftostr3(tHotEnd0)); - olddegHotEnd0=tHotEnd0; + lcd.print(ftostr3(tHotEnd1)); + olddegHotEnd1=tHotEnd1; } int ttHotEnd1=intround(degTargetHotend1()); - if((ttHotEnd1!=oldtargetHotEnd0)||force_lcd_update) + if((ttHotEnd1!=oldtargetHotEnd1)||force_lcd_update) { lcd.setCursor(15,0); lcd.print(ftostr3(ttHotEnd1)); - oldtargetHotEnd0=ttHotEnd1; + oldtargetHotEnd1=ttHotEnd1; } #endif //starttime=2; From e11e072eca83ec72863bff98691914356288436c Mon Sep 17 00:00:00 2001 From: sefi Date: Sat, 28 Apr 2012 17:31:22 +0300 Subject: [PATCH 8/9] adding M120 and 121 for turning on and off the endstops only for homing function --- Marlin/Marlin.pde | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde index a7c4c11f2..d91e355c5 100644 --- a/Marlin/Marlin.pde +++ b/Marlin/Marlin.pde @@ -1100,6 +1100,12 @@ void process_commands() SERIAL_PROTOCOLLN(""); break; + case 120: // M120 + enable_endstops(false) ; + break; + case 121: // M121 + enable_endstops(true) ; + break; case 119: // M119 #if (X_MIN_PIN > -1) SERIAL_PROTOCOLPGM(MSG_X_MIN); From c27081aa4a509414eb34b978edf9e978c617e83f Mon Sep 17 00:00:00 2001 From: sefi Date: Sat, 28 Apr 2012 17:35:51 +0300 Subject: [PATCH 9/9] Fix to allow M120/M121 --- Marlin/stepper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 29be5c6d9..85e9bbb98 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -85,7 +85,7 @@ volatile char count_direction[NUM_AXIS] = { 1, 1, 1, 1}; #ifdef ENDSTOPS_ONLY_FOR_HOMING #define CHECK_ENDSTOPS if(check_endstops) #else - #define CHECK_ENDSTOPS + #define CHECK_ENDSTOPS if(check_endstops) #endif // intRes = intIn1 * intIn2 >> 16