From 94a095afa61985e6283cf23da888c3a01f5ce405 Mon Sep 17 00:00:00 2001 From: Maik Stohn Date: Tue, 10 Jan 2012 13:10:11 +0100 Subject: [PATCH 01/18] fix menu scrlloing of main menu for 2 line lcd --- Marlin/ultralcd.pde | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/ultralcd.pde b/Marlin/ultralcd.pde index 69be85959a99..931f0933c6b2 100644 --- a/Marlin/ultralcd.pde +++ b/Marlin/ultralcd.pde @@ -1677,9 +1677,10 @@ void MainMenu::showMainMenu() } } clearIfNecessary(); - for(int8_t line=0;line Date: Tue, 10 Jan 2012 16:44:32 +0100 Subject: [PATCH 02/18] added SUMPOD specific configuration Signed-off-by: Maik Stohn --- Marlin/Configuration.h | 41 ++++++++++++++++----------------- Marlin/pins.h | 51 ++++++++++++++++++++++++++++++++---------- 2 files changed, 60 insertions(+), 32 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 85fd389688f6..6aed46c1a9e0 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -29,7 +29,7 @@ // Sanguinololu 1.2 and above = 62 // Ultimaker = 7, // Teensylu = 8 -#define MOTHERBOARD 7 +#define MOTHERBOARD 33 //[SUMPOD specific, uses RAMPS1.3] //=========================================================================== //=============================Thermal Settings ============================ @@ -44,14 +44,14 @@ // 6 is EPCOS 100k // 7 is 100k Honeywell thermistor 135-104LAG-J01 -//#define THERMISTORHEATER_0 3 +#define THERMISTORHEATER_0 1 //#define THERMISTORHEATER_1 1 //#define THERMISTORHEATER_2 1 -//#define HEATER_0_USES_THERMISTOR +#define HEATER_0_USES_THERMISTOR //#define HEATER_1_USES_THERMISTOR //#define HEATER_2_USES_THERMISTOR -#define HEATER_0_USES_AD595 +//#define HEATER_0_USES_AD595 //#define HEATER_1_USES_AD595 //#define HEATER_2_USES_AD595 @@ -199,7 +199,7 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th // Disables axis when it's not being used. #define DISABLE_X false #define DISABLE_Y false -#define DISABLE_Z false +#define DISABLE_Z true //[SUMPOD specific] #define DISABLE_E false // For all extruders // Inverting axis direction @@ -217,25 +217,25 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th //// ENDSTOP SETTINGS: // Sets direction of endstops when homing; 1=MAX, -1=MIN -#define X_HOME_DIR -1 -#define Y_HOME_DIR -1 -#define Z_HOME_DIR -1 +#define X_HOME_DIR 1 +#define Y_HOME_DIR 1 +#define Z_HOME_DIR 1 #define min_software_endstops true //If true, axis won't move to coordinates less than zero. #define max_software_endstops true //If true, axis won't move to coordinates greater than the defined lengths below. -#define X_MAX_LENGTH 205 -#define Y_MAX_LENGTH 205 -#define Z_MAX_LENGTH 200 +#define X_MAX_LENGTH 130 //[SUMPOD specific, CHANGE FOR YOUR SUMPOD] +#define Y_MAX_LENGTH 125 //[SUMPOD specific, CHANGE FOR YOUR SUMPOD] +#define Z_MAX_LENGTH 94.5 //[SUMPOD specific, CHANGE FOR YOUR SUMPOD] //// MOVEMENT SETTINGS #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E -#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min) +#define HOMING_FEEDRATE {50*60, 50*60, 5*60, 0} // set the homing speeds (mm/min) //[SUMPOD specific] //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: #define X_HOME_RETRACT_MM 5 #define Y_HOME_RETRACT_MM 5 #define Z_HOME_RETRACT_MM 1 -#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. +//#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. //[SUMPOD specific] #define AXIS_RELATIVE_MODES {false, false, false, false} @@ -243,7 +243,8 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th // default settings -#define DEFAULT_AXIS_STEPS_PER_UNIT {78.7402,78.7402,200*8/3,760*1.1} // default steps per unit for ultimaker +#define DEFAULT_AXIS_STEPS_PER_UNIT {106.76, 106.76, 800, 67.16} //[SUMPOD specific] +//#define DEFAULT_AXIS_STEPS_PER_UNIT {78.7402,78.7402,200*8/3,760*1.1} // default steps per unit for ultimaker //#define DEFAULT_AXIS_STEPS_PER_UNIT {40, 40, 3333.92, 360} //sells mendel with v9 extruder //#define DEFAULT_AXIS_STEPS_PER_UNIT {80.3232, 80.8900, 2284.7651, 757.2218} // SAE Prusa w/ Wade extruder #define DEFAULT_MAX_FEEDRATE {500, 500, 5, 45} // (mm/sec) @@ -320,13 +321,13 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th #define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers? #define SD_FINISHED_RELEASECOMMAND "M84 X Y E" // no z because of layer shift. -//#define ULTIPANEL +#define ULTIPANEL //[SUMPOD specific] #ifdef ULTIPANEL - //#define NEWPANEL //enable this if you have a click-encoder panel - #define SDSUPPORT - #define ULTRA_LCD - #define LCD_WIDTH 20 - #define LCD_HEIGHT 4 + #define NEWPANEL //[SUMPOD specific] + #define SDSUPPORT //[SUMPOD specific] + #define ULTRA_LCD //[SUMPOD specific] + #define LCD_WIDTH 16 //20 //[SUMPOD specific] + #define LCD_HEIGHT 2 //4 //[SUMPOD specific] #else //no panel but just lcd #ifdef ULTRA_LCD #define LCD_WIDTH 16 diff --git a/Marlin/pins.h b/Marlin/pins.h index 6451d7425006..53ccaef3cf1d 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -239,20 +239,20 @@ #define X_STEP_PIN 54 #define X_DIR_PIN 55 #define X_ENABLE_PIN 38 -#define X_MIN_PIN 3 -#define X_MAX_PIN 2 //2 //Max endstops default to disabled "-1", set to commented value to enable. +#define X_MIN_PIN -1 //3 //[SUMPOD specific] +#define X_MAX_PIN 2 //2 //[SUMPOD specific] //Max endstops default to disabled "-1", set to commented value to enable. #define Y_STEP_PIN 60 #define Y_DIR_PIN 61 #define Y_ENABLE_PIN 56 -#define Y_MIN_PIN 14 -#define Y_MAX_PIN 15 //15 +#define Y_MIN_PIN -1 //14 //[SUMPOD specific] +#define Y_MAX_PIN 15 //15 //[SUMPOD specific] #define Z_STEP_PIN 46 #define Z_DIR_PIN 48 #define Z_ENABLE_PIN 62 -#define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 //19 +#define Z_MIN_PIN -1 //18 //[SUMPOD specific] +#define Z_MAX_PIN 19 //19 //[SUMPOD specific] #define E0_STEP_PIN 26 #define E0_DIR_PIN 28 @@ -265,19 +265,46 @@ #define SDPOWER -1 #define SDSS 53 #define LED_PIN 13 -#define FAN_PIN 4 +#define FAN_PIN 10 //[SUMPOD specific] #define PS_ON_PIN 12 #define KILL_PIN -1 -#define HEATER_0_PIN 10 // EXTRUDER 1 -#define HEATER_1_PIN 9 // EXTRUDER 2 -#define HEATER_2_PIN -1 // EXTRUDER 2 +#define HEATER_0_PIN 8 // EXTRUDER 1 //[SUMPOD specific] +#define HEATER_1_PIN -1 // EXTRUDER 2 //[SUMPOD specific] +#define HEATER_2_PIN -1 // EXTRUDER 3 //[SUMPOD specific] #define TEMP_0_PIN 13 // ANALOG NUMBERING -#define TEMP_1_PIN 15 // ANALOG NUMBERING +#define TEMP_1_PIN -1 // ANALOG NUMBERING #define TEMP_2_PIN -1 // ANALOG NUMBERING -#define HEATER_BED_PIN 8 // BED +#define HEATER_BED_PIN 9 // BED //[SUMPOD specific] #define TEMP_BED_PIN 14 // ANALOG NUMBERING +//extra for SUMPOD LCD + click encoder + buzzer +#define LCD_PINS_RS 16 //[SUMPOD specific] +#define LCD_PINS_ENABLE 17 //[SUMPOD specific] +#define LCD_PINS_D4 23 //[SUMPOD specific] +#define LCD_PINS_D5 25 //[SUMPOD specific] +#define LCD_PINS_D6 27 //[SUMPOD specific] +#define LCD_PINS_D7 29 //[SUMPOD specific] + +//beeper +#define BEEPER 59 //AUX-2 //[SUMPOD specific] + +//encoder pins are directly attached +#define BTN_EN1 42 //AUX-2 //[SUMPOD specific] +#define BTN_EN2 44 //AUX-2 //[SUMPOD specific] +#define BTN_ENC 64 //AUX-2 (the click) //[SUMPOD specific] + +#define BLEN_A 0 +#define BLEN_B 1 +#define BLEN_C 2 + +//encoder rotation values +#define encrot0 0 +#define encrot1 2 +#define encrot2 3 +#define encrot3 1 + +#define SDCARDDETECT 49 //[SUMPOD specific] #else // RAMPS_V_1_1 or RAMPS_V_1_2 as default From e993230c7aa42f2d536d985f55cfebb42c7b2648 Mon Sep 17 00:00:00 2001 From: Maik Stohn Date: Tue, 10 Jan 2012 16:46:15 +0100 Subject: [PATCH 03/18] removed min temp check to use machine for milling (no sensor attached) Signed-off-by: Maik Stohn --- Marlin/temperature.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 371c6e589b6f..95ae617e330b 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -768,8 +768,8 @@ ISR(TIMER0_COMPB_vect) } if(current_raw[e] <= minttemp[e]) { target_raw[e] = 0; - min_temp_error(e); - kill(); + //min_temp_error(e); //[SUMPOD specific] when milling no temperature sensor is attached ==> no kill for mintemp + //kill(); } } From c4a4b3368a6c1225294bc2f0c3b4aee25880599c Mon Sep 17 00:00:00 2001 From: stohn Date: Wed, 11 Jan 2012 17:21:34 +0100 Subject: [PATCH 04/18] fixed lcd refresh after leaving menu, changed initial display to SUMPOD --- Marlin/ultralcd.pde | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Marlin/ultralcd.pde b/Marlin/ultralcd.pde index 931f0933c6b2..39a995527176 100644 --- a/Marlin/ultralcd.pde +++ b/Marlin/ultralcd.pde @@ -122,7 +122,8 @@ void lcd_init() lcd.createChar(3,uplevel); lcd.createChar(4,refresh); lcd.createChar(5,folder); - LCD_MESSAGEPGM("UltiMarlin ready."); + //LCD_MESSAGEPGM("UltiMarlin ready."); + LCD_MESSAGEPGM("Sumpod-Marlin ok"); //[SUMPOD] } @@ -407,6 +408,7 @@ void MainMenu::showStatus() static int oldtargetHotEnd0=-1; if(force_lcd_update) //initial display of content { + clear(); encoderpos=feedmultiply; lcd.setCursor(0,0);lcdprintPGM("\002123/567\001 "); #if defined BED_USES_THERMISTOR || defined BED_USES_AD595 From e24cdd4ab9081f7dfd516aa0e725701a0b38acb2 Mon Sep 17 00:00:00 2001 From: stohn Date: Wed, 11 Jan 2012 17:21:59 +0100 Subject: [PATCH 05/18] corrected extruder heater / bed pin for RAMPS1.3 --- Marlin/pins.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/pins.h b/Marlin/pins.h index 53ccaef3cf1d..e26bbf755dc7 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -269,13 +269,13 @@ #define PS_ON_PIN 12 #define KILL_PIN -1 -#define HEATER_0_PIN 8 // EXTRUDER 1 //[SUMPOD specific] +#define HEATER_0_PIN 9 // EXTRUDER 1 //[SUMPOD specific] #define HEATER_1_PIN -1 // EXTRUDER 2 //[SUMPOD specific] #define HEATER_2_PIN -1 // EXTRUDER 3 //[SUMPOD specific] #define TEMP_0_PIN 13 // ANALOG NUMBERING #define TEMP_1_PIN -1 // ANALOG NUMBERING #define TEMP_2_PIN -1 // ANALOG NUMBERING -#define HEATER_BED_PIN 9 // BED //[SUMPOD specific] +#define HEATER_BED_PIN 11 // BED //[SUMPOD specific] #define TEMP_BED_PIN 14 // ANALOG NUMBERING //extra for SUMPOD LCD + click encoder + buzzer From c04024ee4d45614a31f1fb6345a031b0a1ad248f Mon Sep 17 00:00:00 2001 From: stohn Date: Thu, 12 Jan 2012 17:49:44 +0100 Subject: [PATCH 06/18] slow down of homing feed rate to get stable result --- Marlin/Configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 6aed46c1a9e0..5e7a339d890b 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -229,7 +229,7 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th //// MOVEMENT SETTINGS #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E -#define HOMING_FEEDRATE {50*60, 50*60, 5*60, 0} // set the homing speeds (mm/min) //[SUMPOD specific] +#define HOMING_FEEDRATE {20*60, 20*60, 3*60, 0} // set the homing speeds (mm/min) //[SUMPOD specific] //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: #define X_HOME_RETRACT_MM 5 From 4efff8e793d224138086cd7b34b9ce458cb2a317 Mon Sep 17 00:00:00 2001 From: stohn Date: Thu, 12 Jan 2012 17:50:13 +0100 Subject: [PATCH 07/18] changed SPI to half speed to make it work with adafruit.com sd card shield --- Marlin/cardreader.pde | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/cardreader.pde b/Marlin/cardreader.pde index a1f23ce068f2..689946847b43 100644 --- a/Marlin/cardreader.pde +++ b/Marlin/cardreader.pde @@ -136,7 +136,7 @@ void CardReader::initsd() cardOK = false; if(root.isOpen()) root.close(); - if (!card.init(SPI_FULL_SPEED,SDSS)) + if (!card.init(SPI_HALF_SPEED,SDSS)) //[SUMPOD, half speed to make adafruit.com sd shield work] { //if (!card.init(SPI_HALF_SPEED,SDSS)) SERIAL_ECHO_START; From 0c7c9e61ffd6f95554f5607502ed75b91fc4d61b Mon Sep 17 00:00:00 2001 From: stohn Date: Thu, 12 Jan 2012 17:51:29 +0100 Subject: [PATCH 08/18] changed sd card detect logic to reflect adafruit.com sd shield --- Marlin/ultralcd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index 08ac950d38e1..c0015fcfe1e3 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -27,7 +27,7 @@ #define CLICKED (buttons&EN_C) #define BLOCK {blocking=millis()+blocktime;} - #define CARDINSERTED (READ(SDCARDDETECT)==0) + #define CARDINSERTED (READ(SDCARDDETECT)!=0) //[SUMPOD specific, changed for adafruit.com sd shield] #else From eb8163261f7405a0b63836175d1b6f5dc68a81b2 Mon Sep 17 00:00:00 2001 From: stohn Date: Thu, 12 Jan 2012 17:52:03 +0100 Subject: [PATCH 09/18] added new menu entry to move axis freely --- Marlin/ultralcd.h | 5 ++- Marlin/ultralcd.pde | 106 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 107 insertions(+), 4 deletions(-) diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index c0015fcfe1e3..492d6c84d649 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -50,7 +50,7 @@ #define blocktime 500 #define lcdslow 5 - enum MainStatus{Main_Status, Main_Menu, Main_Prepare, Main_Control, Main_SD,Sub_TempControl,Sub_MotionControl}; + enum MainStatus{Main_Status, Main_Menu, Main_Prepare, Main_Control, Main_SD,Sub_TempControl,Sub_MotionControl,Sub_MoveAxes}; class MainMenu{ public: @@ -67,13 +67,14 @@ void showControl(); void showControlMotion(); void showControlTemp(); + void showMoveAxes(); void showSD(); bool force_lcd_update; int lastencoderpos; int8_t lineoffset; int8_t lastlineoffset; - bool linechanging; + int linechanging; bool tune; diff --git a/Marlin/ultralcd.pde b/Marlin/ultralcd.pde index 39a995527176..630ebe7133d1 100644 --- a/Marlin/ultralcd.pde +++ b/Marlin/ultralcd.pde @@ -447,7 +447,7 @@ void MainMenu::showStatus() force_lcd_update=false; } -enum {ItemP_exit, ItemP_autostart,ItemP_disstep,ItemP_home, ItemP_origin, ItemP_preheat, ItemP_cooldown,ItemP_extrude}; +enum {ItemP_exit, ItemP_autostart,ItemP_disstep,ItemP_home, ItemP_move, ItemP_origin, ItemP_preheat, ItemP_cooldown,ItemP_extrude}; //any action must not contain a ',' character anywhere, or this breaks: #define MENUITEM(repaint_action, click_action) \ @@ -475,7 +475,10 @@ void MainMenu::showPrepare() MENUITEM( lcdprintPGM(" Disable Steppers") , BLOCK;enquecommand("M84");beepshort(); ) ; break; case ItemP_home: - MENUITEM( lcdprintPGM(" Auto Home") , BLOCK;enquecommand("G28 X-105 Y-105 Z0");beepshort(); ) ; + MENUITEM( lcdprintPGM(" Auto Home") , BLOCK;enquecommand("G28");beepshort(); ) ; + break; + case ItemP_move: + MENUITEM( lcdprintPGM(" Move Axes") , BLOCK;status=Sub_MoveAxes;beepshort(); ) ; break; case ItemP_origin: MENUITEM( lcdprintPGM(" Set Origin") , BLOCK;enquecommand("G92 X0 Y0 Z0");beepshort(); ) ; @@ -1464,6 +1467,84 @@ void MainMenu::showControlMotion() updateActiveLines(ItemCM_esteps,encoderpos); } +enum { + ItemMA_exit, + ItemMA_X,ItemMA_Y,ItemMA_Z +}; + +void MainMenu::showMoveAxes() +{ + uint8_t line=0; + clearIfNecessary(); + for(int8_t i=lineoffset;i990) encoderpos=990; + + char cmd[10]; + lcd.setCursor(8,line);lcd.print(ftostr52(encoderpos*10/((1==linechanging)?2.:100.))); + sprintf(cmd,"G0 %c%s",'X'+aidx,conv); + enquecommand(cmd); + } + + } + break; + + default: + break; + } + line++; + } + updateActiveLines(ItemMA_Z,encoderpos); +} + enum { ItemC_exit,ItemC_temp,ItemC_move, @@ -1817,6 +1898,10 @@ void MainMenu::update() { showControlTemp(); }break; + case Sub_MoveAxes: + { + showMoveAxes(); + }break; case Main_SD: { showSD(); @@ -1931,6 +2016,23 @@ char *ftostr51(const float &x) return conv; } +// convert float to string with +1234.56 format +char *ftostr52(const float &x) +{ + int xx=x*10; + conv[0]=(xx>=0)?'+':'-'; + xx=abs(xx); + conv[1]=(xx/100000)%10+'0'; + conv[2]=(xx/10000)%10+'0'; + conv[3]=(xx/1000)%10+'0'; + conv[4]=(xx/100)%10+'0'; + conv[5]='.'; + conv[6]=(xx/10)%10+'0'; + conv[7]=(xx)%10+'0'; + conv[8]=0; + return conv; +} + #endif //ULTRA_LCD From 7b44289db6b56950e97e59d1555bff8f408fbd76 Mon Sep 17 00:00:00 2001 From: stohn Date: Sat, 14 Jan 2012 20:48:23 +0100 Subject: [PATCH 10/18] enabled endstops during operation (much safer with manual axes moving) --- Marlin/Configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 5e7a339d890b..eaaa637dbd35 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -188,7 +188,7 @@ const bool Y_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops. // For optos H21LOB set to true, for Mendel-Parts newer optos TCST2103 set to false -#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing +//#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 #define X_ENABLE_ON 0 From 552fc5f637ef53479eb3c0c5ecb5991f1e08d1e8 Mon Sep 17 00:00:00 2001 From: stohn Date: Sat, 14 Jan 2012 20:49:10 +0100 Subject: [PATCH 11/18] check_axes_activity now return a bool (try if any activity was detected) --- Marlin/planner.cpp | 4 +++- Marlin/planner.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index f3007af531b3..ca2e6f5101bc 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -410,7 +410,7 @@ void getHighESpeed() } #endif -void check_axes_activity() { +bool check_axes_activity() { unsigned char x_active = 0; unsigned char y_active = 0; unsigned char z_active = 0; @@ -432,6 +432,8 @@ void check_axes_activity() { if((DISABLE_Y) && (y_active == 0)) disable_y(); if((DISABLE_Z) && (z_active == 0)) disable_z(); if((DISABLE_E) && (e_active == 0)) { disable_e0();disable_e1();disable_e2(); } + + return( (x_active != 0) || (y_active != 0) || (z_active != 0) || (e_active != 0) ); } diff --git a/Marlin/planner.h b/Marlin/planner.h index ac9719fbcf5a..2abc8bd46350 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -75,7 +75,7 @@ void plan_set_e_position(const float &e); -void check_axes_activity(); +bool check_axes_activity(); uint8_t movesplanned(); //return the nr of buffered moves extern unsigned long minsegmenttime; From f64de142da328bfacf9b0dd53d696c7f92bf173b Mon Sep 17 00:00:00 2001 From: stohn Date: Sat, 14 Jan 2012 20:50:21 +0100 Subject: [PATCH 12/18] changed encoderpos to long to be able to use bigger values for axes moving --- Marlin/ultralcd.h | 8 +++++--- Marlin/ultralcd.pde | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index 492d6c84d649..7186ad4757de 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -70,7 +70,7 @@ void showMoveAxes(); void showSD(); bool force_lcd_update; - int lastencoderpos; + long lastencoderpos; int8_t lineoffset; int8_t lastlineoffset; @@ -79,11 +79,11 @@ bool tune; private: - FORCE_INLINE void updateActiveLines(const uint8_t &maxlines,volatile int &encoderpos) + FORCE_INLINE void updateActiveLines(const uint8_t &maxlines,volatile long &encoderpos) { if(linechanging) return; // an item is changint its value, do not switch lines hence lastlineoffset=lineoffset; - int curencoderpos=encoderpos; + long curencoderpos=encoderpos; force_lcd_update=false; if( (abs(curencoderpos-lastencoderpos) Date: Sat, 14 Jan 2012 20:51:21 +0100 Subject: [PATCH 13/18] better menu entries --- Marlin/ultralcd.pde | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/ultralcd.pde b/Marlin/ultralcd.pde index ce6706fcd2b1..e186f39f0015 100644 --- a/Marlin/ultralcd.pde +++ b/Marlin/ultralcd.pde @@ -478,7 +478,7 @@ void MainMenu::showPrepare() MENUITEM( lcdprintPGM(" Auto Home") , BLOCK;enquecommand("G28");beepshort(); ) ; break; case ItemP_move: - MENUITEM( lcdprintPGM(" Move Axes") , BLOCK;status=Sub_MoveAxes;beepshort(); ) ; + MENUITEM( lcdprintPGM(" Move Axes \x7E") , BLOCK;status=Sub_MoveAxes;beepshort(); ) ; break; case ItemP_origin: MENUITEM( lcdprintPGM(" Set Origin") , BLOCK;enquecommand("G92 X0 Y0 Z0");beepshort(); ) ; @@ -1766,14 +1766,14 @@ void MainMenu::showMainMenu() switch(i) { case ItemM_watch: - MENUITEM( lcdprintPGM(" Watch \003") , BLOCK;status=Main_Status;beepshort(); ) ; + MENUITEM( lcdprintPGM(" Watch \003") , BLOCK;status=Main_Status;beepshort(); ) ; break; case ItemM_prepare: - MENUITEM( if(!tune) lcdprintPGM(" Prepare \x7E");else lcdprintPGM(" Tune \x7E"); , BLOCK;status=Main_Prepare;beepshort(); ) ; + MENUITEM( if(!tune) lcdprintPGM(" Prepare \x7E");else lcdprintPGM(" Tune \x7E"); , BLOCK;status=Main_Prepare;beepshort(); ) ; break; case ItemM_control: - MENUITEM( lcdprintPGM(" Control \x7E") , BLOCK;status=Main_Control;beepshort(); ) ; + MENUITEM( lcdprintPGM(" Control \x7E") , BLOCK;status=Main_Control;beepshort(); ) ; break; #ifdef SDSUPPORT case ItemM_file: @@ -1788,9 +1788,9 @@ void MainMenu::showMainMenu() #endif { if(card.sdprinting) - lcdprintPGM(" Stop Print \x7E"); + lcdprintPGM(" Stop Print \x7E"); else - lcdprintPGM(" Card Menu \x7E"); + lcdprintPGM(" Card Menu \x7E"); } else { From 479cccb694d46fab3d1b368cfb1da42297496f4d Mon Sep 17 00:00:00 2001 From: stohn Date: Sat, 14 Jan 2012 20:52:15 +0100 Subject: [PATCH 14/18] encoder moves axes only in case there is no activity before --- Marlin/ultralcd.pde | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Marlin/ultralcd.pde b/Marlin/ultralcd.pde index e186f39f0015..6de10e486e96 100644 --- a/Marlin/ultralcd.pde +++ b/Marlin/ultralcd.pde @@ -1516,24 +1516,27 @@ void MainMenu::showMoveAxes() encoderpos=(long)(current_position[aidx]*100); break; default: + lcdprintPGM(" "); encoderpos=activeline*lcdslow; linechanging=0; } BLOCK; beepshort(); } + if(linechanging) { + if(!check_axes_activity()) //check if axes is not moving + { + char cmd[10]; + sprintf(cmd,"G0 %c%s",'X'+aidx,ftostr52(encoderpos*10/((1==linechanging)?1.:100.))); + enquecommand(cmd); + } + else + encoderpos=(long)(current_position[aidx]*((1==linechanging)?1:100)); -//QQQ limit ??? if(encoderpos<5) encoderpos=5; -//QQQ limit ??? if(encoderpos>990) encoderpos=990; - - char cmd[10]; - lcd.setCursor(8,line);lcd.print(ftostr52(encoderpos*10/((1==linechanging)?2.:100.))); - sprintf(cmd,"G0 %c%s",'X'+aidx,conv); - enquecommand(cmd); + lcd.setCursor(8,line);lcd.print(ftostr52(current_position[aidx]*10)); } - } break; From 9658a557ab12686c66ca64a80230c935cc91cc61 Mon Sep 17 00:00:00 2001 From: stohn Date: Thu, 19 Jan 2012 17:23:39 +0100 Subject: [PATCH 15/18] fixed wrong comment --- Marlin/Marlin.pde | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde index b650909ad177..2bd04d52d30b 100644 --- a/Marlin/Marlin.pde +++ b/Marlin/Marlin.pde @@ -1121,7 +1121,7 @@ FORCE_INLINE void process_commands() } break; - case 302: // finish all moves + case 302: // allow cold extrude { allow_cold_extrudes(true); } From c458ed32d7cfe6c96319c8b96b49d336bd67d53b Mon Sep 17 00:00:00 2001 From: stohn Date: Thu, 19 Jan 2012 17:24:07 +0100 Subject: [PATCH 16/18] removed unused/doubled code --- Marlin/Marlin.pde | 1 - 1 file changed, 1 deletion(-) diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde index 2bd04d52d30b..399368b90873 100644 --- a/Marlin/Marlin.pde +++ b/Marlin/Marlin.pde @@ -616,7 +616,6 @@ FORCE_INLINE void process_commands() st_synchronize(); for(int8_t i=0; i < NUM_AXIS; i++) { if(code_seen(axis_codes[i])) { - current_position[i] = code_value()+add_homeing[i]; if(i == E_AXIS) { current_position[i] = code_value(); plan_set_e_position(current_position[E_AXIS]); From 02c510efdf170a14bb151a9781bf59a47118f497 Mon Sep 17 00:00:00 2001 From: stohn Date: Thu, 19 Jan 2012 17:24:34 +0100 Subject: [PATCH 17/18] changed version string to reflect special firmware --- Marlin/Marlin.pde | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde index 399368b90873..6fa89c92c703 100644 --- a/Marlin/Marlin.pde +++ b/Marlin/Marlin.pde @@ -40,9 +40,7 @@ -#define VERSION_STRING "1.0.0 Beta 1" - - +#define VERSION_STRING "1.0.0 Beta 1 - SUMPOD" // look here for descriptions of gcodes: http://linuxcnc.org/handbook/gcode/g-code.html From 81b6b792c37175f42db93898a1b508e9a162ba96 Mon Sep 17 00:00:00 2001 From: stohn Date: Thu, 19 Jan 2012 17:26:03 +0100 Subject: [PATCH 18/18] try to use st_synchronize to wait for movement stop? --- Marlin/ultralcd.pde | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/ultralcd.pde b/Marlin/ultralcd.pde index 6de10e486e96..63521c28705a 100644 --- a/Marlin/ultralcd.pde +++ b/Marlin/ultralcd.pde @@ -1531,6 +1531,7 @@ void MainMenu::showMoveAxes() char cmd[10]; sprintf(cmd,"G0 %c%s",'X'+aidx,ftostr52(encoderpos*10/((1==linechanging)?1.:100.))); enquecommand(cmd); + //QQQ better use this? st_synchronize(); //wait for all moves to finish } else encoderpos=(long)(current_position[aidx]*((1==linechanging)?1:100));