From fcce94653d36bf646ff9ae61dd586c04c5cc4322 Mon Sep 17 00:00:00 2001 From: Greg Dahlman Date: Wed, 2 Nov 2011 17:01:19 -0700 Subject: Added support for Gen7 Board --- Sprinter/pins.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'Sprinter') diff --git a/Sprinter/pins.h b/Sprinter/pins.h index fbe6a6e..cc6265c 100644 --- a/Sprinter/pins.h +++ b/Sprinter/pins.h @@ -687,6 +687,53 @@ #endif +/**************************************************************************************** +* Gen7 pin assignment +* +****************************************************************************************/ +#if MOTHERBOARD == 7 +#define KNOWN_BOARD 1 + +#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega1284P__) + #error Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu. +#endif + +//x axis pins + #define X_STEP_PIN 15 + #define X_DIR_PIN 18 + #define X_ENABLE_PIN 33 + #define X_MIN_PIN 8 + #define X_MAX_PIN 7 + + //y axis pins + #define Y_STEP_PIN 29 + #define Y_DIR_PIN 28 + #define Y_ENABLE_PIN 33 + #define Y_MIN_PIN 3 + #define Y_MAX_PIN 6 + + //z axis pins + #define Z_STEP_PIN 35 + #define Z_DIR_PIN 34 + #define Z_ENABLE_PIN 33 + #define Z_MIN_PIN 2 + #define Z_MAX_PIN 1 + + //extruder pins + #define E_STEP_PIN 37 + #define E_DIR_PIN 36 + #define E_ENABLE_PIN 33 + #define TEMP_0_PIN 39 // Extruder + #define HEATER_0_PIN 5 // Extruder + #define HEATER_1_PIN 4 // Bed + + + #define SDPOWER -1 + #define SDSS -1 + #define LED_PIN -1 + #define TEMP_1_PIN 38 //Bed + #define FAN_PIN -1 + #define PS_ON_PIN 21 /**************************************************************************************** * Teensylu 0.7 pin assingments (ATMEGA90USB) * Requires the Teensyduino software with Teensy2.0++ selected in arduino IDE! -- cgit v1.2.1 From 105eedeffa6b9947d9a1fed3274d39958017173c Mon Sep 17 00:00:00 2001 From: Greg Dahlman Date: Wed, 2 Nov 2011 18:13:37 -0700 Subject: Added Pin 33-40 digital defs to fastio.h for the 644 --- Sprinter/fastio.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'Sprinter') diff --git a/Sprinter/fastio.h b/Sprinter/fastio.h index 6b5572a..5f1f5d1 100644 --- a/Sprinter/fastio.h +++ b/Sprinter/fastio.h @@ -625,6 +625,54 @@ pins #define DIO31_DDR DDRA #define DIO31_PWM NULL +#define DIO33_PIN PINA7 +#define DIO33_RPORT PINA +#define DIO33_WPORT PORTA +#define DIO33_DDR DDRA +#define DIO33_PWM NULL + +#define DIO34_PIN PINA6 +#define DIO34_RPORT PINA +#define DIO34_WPORT PORTA +#define DIO34_DDR DDRA +#define DIO34_PWM NULL + +#define DIO35_PIN PINA5 +#define DIO35_RPORT PINA +#define DIO35_WPORT PORTA +#define DIO35_DDR DDRA +#define DIO35_PWM NULL + +#define DIO36_PIN PINA4 +#define DIO36_RPORT PINA +#define DIO36_WPORT PORTA +#define DIO36_DDR DDRA +#define DIO36_PWM NULL + +#define DIO37_PIN PINA3 +#define DIO37_RPORT PINA +#define DIO37_WPORT PORTA +#define DIO37_DDR DDRA +#define DIO37_PWM NULL + +#define DIO38_PIN PINA2 +#define DIO38_RPORT PINA +#define DIO38_WPORT PORTA +#define DIO38_DDR DDRA +#define DIO38_PWM NULL + +#define DIO39_PIN PINA1 +#define DIO39_RPORT PINA +#define DIO39_WPORT PORTA +#define DIO39_DDR DDRA +#define DIO39_PWM NULL + +#define DIO40_PIN PINA0 +#define DIO40_RPORT PINA +#define DIO40_WPORT PORTA +#define DIO40_DDR DDRA +#define DIO40_PWM NULL + #define AIO0_PIN PINA0 #define AIO0_RPORT PINA #define AIO0_WPORT PORTA -- cgit v1.2.1 From 318c7b4f64ec0a1734106a5858d2345905b48929 Mon Sep 17 00:00:00 2001 From: Greg Dahlman Date: Thu, 3 Nov 2011 23:32:57 -0700 Subject: Edited pins.h to add missing #endif --- Sprinter/pins.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Sprinter') diff --git a/Sprinter/pins.h b/Sprinter/pins.h index cc6265c..ed0420f 100644 --- a/Sprinter/pins.h +++ b/Sprinter/pins.h @@ -734,6 +734,9 @@ #define TEMP_1_PIN 38 //Bed #define FAN_PIN -1 #define PS_ON_PIN 21 + +#endif + /**************************************************************************************** * Teensylu 0.7 pin assingments (ATMEGA90USB) * Requires the Teensyduino software with Teensy2.0++ selected in arduino IDE! -- cgit v1.2.1 From f5c05d94393b79d52b9ada67fe4bdffa3c39da52 Mon Sep 17 00:00:00 2001 From: Chris Dieringer Date: Sun, 6 Nov 2011 07:57:57 -0800 Subject: osc reduction --- Sprinter/Configuration.h | 6 ++++++ Sprinter/Sprinter.pde | 44 ++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 48 insertions(+), 2 deletions(-) (limited to 'Sprinter') diff --git a/Sprinter/Configuration.h b/Sprinter/Configuration.h index df52a08..950387a 100644 --- a/Sprinter/Configuration.h +++ b/Sprinter/Configuration.h @@ -99,6 +99,12 @@ bool axis_relative_modes[] = {false, false, false, false}; // If you enable this, make sure STEP_DELAY_MICROS is disabled. (except for Gen6: both need to be enabled.) //#define STEP_DELAY_RATIO 0.25 +///Oscillation reduction. Forces x,y,or z axis to be stationary for ## ms before allowing axis to switch direcitons. Alternative method to prevent skipping steps. Uncomment the line below to activate. +//#define RAPID_OSCILLATION_REDUCTION +#ifdef RAPID_OSCILLATION_REDUCTION +long min_time_before_dir_change = 30; //milliseconds +#endif + // Comment this to disable ramp acceleration #define RAMP_ACCELERATION diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde index 657efed..bc8a2ac 100644 --- a/Sprinter/Sprinter.pde +++ b/Sprinter/Sprinter.pde @@ -91,7 +91,12 @@ float axis_diff[NUM_AXIS] = {0, 0, 0, 0}; #ifdef STEP_DELAY_RATIO long long_step_delay_ratio = STEP_DELAY_RATIO * 100; #endif - +///oscillation reduction +ifdef RAPID_OSCILLATION_REDUCTION + float cumm_wait_time_in_dir[NUM_AXIS]={0.0,0.0,0.0,0.0}; + bool prev_move_direction[NUM_AXIS]={1,1,1,1}; + float osc_wait_remainder = 0.0; +#endif // comm variables #define MAX_CMD_SIZE 96 @@ -1081,11 +1086,46 @@ void prepare_move() time_for_move = time_for_move / max_feedrate[i] * (abs(axis_diff[i]) / (time_for_move / 60000000.0)); } } + +#ifdef RAPID_OSCILLATION_REDUCTION //VERBOSE commenting for peer review. tested on multiple prints--works! + for(int i=0; i < NUM_AXIS-1; i++) { //do for each axis, except for extruder (refer to the -1 value) + if(prev_move_direction[i] != move_direction[i]){ //check if we've changed direcitons + osc_wait_remainder=min_time_before_dir_change; //if we changed directions, then shit the bed! We better make sure to wait & chill out time before jerkin' over in the opposite direction! + if(cumm_wait_time_in_dir[i]osc_wait_remainder){ //if not, dont overwrite the remaining wait time if we already have to wait LONGER for a different axis + osc_wait_remainder=min_time_before_dir_change-cumm_wait_time_in_dir[i]; + } + } + cumm_wait_time_in_dir[i] = 0.0; //we've changed directions! now that we've either set a wait period, or we had already waited long enough after a direction change, let's reset our wait variable for this axis + } + else{ //we haven't changed directions! so, lets make sure to increase our wait time for the time we have not been moving back on the same axis + if(cumm_wait_time_in_dir[i]==0.0){ + cumm_wait_time_in_dir[i] = 0.001; //if the cumm wait variable = 0.0, that means we've just completed our first move after a dir change. we really haven't waited at all. so, let's increment the wait value insignifcant value so that we may proceed, but not hit this line again. + } + else{ + //Serial.print("It is will take [ESTIMATED] this many seconds to perform this move:"); Serial.println(time_for_move/1000000); + cumm_wait_time_in_dir[i] = cumm_wait_time_in_dir[i] + time_for_move/1000; //increment the time we've waited in this axis + } + } + } + + //update prev_moves for next move. again, excluded extruder + for(int i=0; i < NUM_AXIS-1; i++) { + prev_move_direction[i]=move_direction[i]; + } + + //now WAIT if you are oscillating back & forth too fast in any given axis + if(osc_wait_remainder>0.0){ + delay(osc_wait_remainder); + osc_wait_remainder=0.0; + } +#endif + //Calculate the full speed stepper interval for each axis for(int i=0; i < NUM_AXIS; i++) { if(move_steps_to_take[i]) axis_interval[i] = time_for_move / move_steps_to_take[i] * 100; } - + #ifdef DEBUG_PREPARE_MOVE log_float("_PREPARE_MOVE - Move distance on the XY plane", xy_d); log_float("_PREPARE_MOVE - Move distance on the XYZ space", d); -- cgit v1.2.1 From d196068a8ca3d47ec9f92525644b12fb70aeb29b Mon Sep 17 00:00:00 2001 From: Philip Kin Date: Wed, 16 Nov 2011 09:16:14 -0600 Subject: M30/M31 fast sd block transfer --- Sprinter/Configuration.h | 6 ++- Sprinter/Sprinter.pde | 106 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+), 1 deletion(-) (limited to 'Sprinter') diff --git a/Sprinter/Configuration.h b/Sprinter/Configuration.h index 950387a..be42e0b 100644 --- a/Sprinter/Configuration.h +++ b/Sprinter/Configuration.h @@ -50,9 +50,13 @@ const bool Z_ENDSTOP_INVERT = false; // Comment out (using // at the start of the line) to disable SD support: #define SDSUPPORT - //// ADVANCED SETTINGS - to tweak parameters +#ifdef SDSUPPORT + //Fast transfer chunk size (> 1024 is unstable, change at your own risk). + #define SD_FAST_XFER_CHUNK_SIZE 1024 +#endif + #include "thermistortables.h" // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde index bc8a2ac..b189744 100644 --- a/Sprinter/Sprinter.pde +++ b/Sprinter/Sprinter.pde @@ -167,6 +167,9 @@ unsigned long stepper_inactive_time = 0; bool sdactive = false; bool savetosd = false; int16_t n; + char fastxferbuffer[SD_FAST_XFER_CHUNK_SIZE + 1]; + int lastxferchar; + long xferbytes; void initsd(){ sdactive = false; @@ -205,6 +208,102 @@ unsigned long stepper_inactive_time = 0; Serial.println("error writing to file"); } } + + void fast_xfer() + { + char *pstr; + boolean done = false; + + //force heater pins low + if(HEATER_0_PIN > -1) WRITE(HEATER_0_PIN,LOW); + if(HEATER_1_PIN > -1) WRITE(HEATER_1_PIN,LOW); + + lastxferchar = 1; + xferbytes = 0; + + pstr = strstr(strchr_pointer+4, " "); + + if(pstr == NULL) + { + SerialMgr.cur()->println("invalid command"); + return; + } + + *pstr = '\0'; + + //check mode (currently only RAW is supported + if(strcmp(strchr_pointer+4, "RAW") != 0) + { + SerialMgr.cur()->println("Invalid transfer codec"); + return; + }else{ + SerialMgr.cur()->print("Selected codec: "); + SerialMgr.cur()->println(strchr_pointer+4); + } + + if (!file.open(&root, pstr+1, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) + { + SerialMgr.cur()->print("open failed, File: "); + SerialMgr.cur()->print(pstr+1); + SerialMgr.cur()->print("."); + }else{ + SerialMgr.cur()->print("Writing to file: "); + SerialMgr.cur()->println(pstr+1); + } + + SerialMgr.cur()->println("ok"); + + //RAW transfer codec + //Host sends \0 then up to SD_FAST_XFER_CHUNK_SIZE then \0 + //when host is done, it sends \0\0. + //if a non \0 character is recieved at the beginning, host has failed somehow, kill the transfer. + + //read SD_FAST_XFER_CHUNK_SIZE bytes (or until \0 is recieved) + while(!done) + { + while(!SerialMgr.cur()->available()) + { + } + if(SerialMgr.cur()->peek() != 0) + { + //host has failed, this isn't a RAW chunk, it's an actual command + file.sync(); + file.close(); + return; + } + //clear the initial 0 + SerialMgr.cur()->read(); + for(int i=0;iavailable()) + { + } + lastxferchar = SerialMgr.cur()->read(); + //buffer the data... + fastxferbuffer[i] = lastxferchar; + + xferbytes++; + + if(lastxferchar == 0) + break; + } + + if(fastxferbuffer[0] != 0) + { + fastxferbuffer[SD_FAST_XFER_CHUNK_SIZE] = 0; + file.write(fastxferbuffer); + SerialMgr.cur()->println("ok"); + }else{ + SerialMgr.cur()->print("Wrote "); + SerialMgr.cur()->print(xferbytes); + SerialMgr.cur()->println(" bytes."); + done = true; + } + } + + file.sync(); + file.close(); + } #endif @@ -750,6 +849,13 @@ inline void process_commands() //processed in write to file routine above //savetosd = false; break; + case 30: //M30 - fast SD transfer + fast_xfer(); + break; + case 31: //M31 - high speed xfer capabilities + SerialMgr.cur()->print("RAW:"); + SerialMgr.cur()->println(SD_FAST_XFER_CHUNK_SIZE); + break; #endif case 42: //M42 -Change pin status via gcode if (code_seen('S')) -- cgit v1.2.1 From fa1a0e7def0c3c0049953639cc17b8a21e8da163 Mon Sep 17 00:00:00 2001 From: Philip Kin Date: Wed, 16 Nov 2011 09:17:33 -0600 Subject: M30/M31 fast sd block transfer --- Sprinter/Sprinter.pde | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'Sprinter') diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde index b189744..1322b30 100644 --- a/Sprinter/Sprinter.pde +++ b/Sprinter/Sprinter.pde @@ -225,7 +225,7 @@ unsigned long stepper_inactive_time = 0; if(pstr == NULL) { - SerialMgr.cur()->println("invalid command"); + Serial.println("invalid command"); return; } @@ -234,24 +234,24 @@ unsigned long stepper_inactive_time = 0; //check mode (currently only RAW is supported if(strcmp(strchr_pointer+4, "RAW") != 0) { - SerialMgr.cur()->println("Invalid transfer codec"); + Serial.println("Invalid transfer codec"); return; }else{ - SerialMgr.cur()->print("Selected codec: "); - SerialMgr.cur()->println(strchr_pointer+4); + Serial.print("Selected codec: "); + Serial.println(strchr_pointer+4); } if (!file.open(&root, pstr+1, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) { - SerialMgr.cur()->print("open failed, File: "); - SerialMgr.cur()->print(pstr+1); - SerialMgr.cur()->print("."); + Serial.print("open failed, File: "); + Serial.print(pstr+1); + Serial.print("."); }else{ - SerialMgr.cur()->print("Writing to file: "); - SerialMgr.cur()->println(pstr+1); + Serial.print("Writing to file: "); + Serial.println(pstr+1); } - SerialMgr.cur()->println("ok"); + Serial.println("ok"); //RAW transfer codec //Host sends \0 then up to SD_FAST_XFER_CHUNK_SIZE then \0 @@ -261,10 +261,10 @@ unsigned long stepper_inactive_time = 0; //read SD_FAST_XFER_CHUNK_SIZE bytes (or until \0 is recieved) while(!done) { - while(!SerialMgr.cur()->available()) + while(!Serial.available()) { } - if(SerialMgr.cur()->peek() != 0) + if(Serial.peek() != 0) { //host has failed, this isn't a RAW chunk, it's an actual command file.sync(); @@ -272,13 +272,13 @@ unsigned long stepper_inactive_time = 0; return; } //clear the initial 0 - SerialMgr.cur()->read(); + Serial.read(); for(int i=0;iavailable()) + while(!Serial.available()) { } - lastxferchar = SerialMgr.cur()->read(); + lastxferchar = Serial.read(); //buffer the data... fastxferbuffer[i] = lastxferchar; @@ -292,11 +292,11 @@ unsigned long stepper_inactive_time = 0; { fastxferbuffer[SD_FAST_XFER_CHUNK_SIZE] = 0; file.write(fastxferbuffer); - SerialMgr.cur()->println("ok"); + Serial.println("ok"); }else{ - SerialMgr.cur()->print("Wrote "); - SerialMgr.cur()->print(xferbytes); - SerialMgr.cur()->println(" bytes."); + Serial.print("Wrote "); + Serial.print(xferbytes); + Serial.println(" bytes."); done = true; } } @@ -853,8 +853,8 @@ inline void process_commands() fast_xfer(); break; case 31: //M31 - high speed xfer capabilities - SerialMgr.cur()->print("RAW:"); - SerialMgr.cur()->println(SD_FAST_XFER_CHUNK_SIZE); + Serial.print("RAW:"); + Serial.println(SD_FAST_XFER_CHUNK_SIZE); break; #endif case 42: //M42 -Change pin status via gcode -- cgit v1.2.1 From b331d4810168001ef18d7ab034dfd03e2b03cf00 Mon Sep 17 00:00:00 2001 From: Kliment Yanev Date: Mon, 28 Nov 2011 16:23:52 +0100 Subject: Add gen7 to list of boards in configuration Allow ATmega644 (non-P version) for Gen7 --- Sprinter/Configuration.h | 1 + Sprinter/pins.h | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'Sprinter') diff --git a/Sprinter/Configuration.h b/Sprinter/Configuration.h index be42e0b..2a57812 100644 --- a/Sprinter/Configuration.h +++ b/Sprinter/Configuration.h @@ -9,6 +9,7 @@ // Gen6 = 5, // Sanguinololu up to 1.1 = 6 // Sanguinololu 1.2 and above = 62 +// Gen 7 = 7 // Teensylu (at90usb) = 8 // Gen 3 Plus = 21 // gen 3 Monolithic Electronics = 22 diff --git a/Sprinter/pins.h b/Sprinter/pins.h index ed0420f..01f29ed 100644 --- a/Sprinter/pins.h +++ b/Sprinter/pins.h @@ -143,7 +143,6 @@ #endif - /**************************************************************************************** * RepRap Motherboard ****---NOOOOOO RS485/EXTRUDER CONTROLLER!!!!!!!!!!!!!!!!!---******* * @@ -694,7 +693,7 @@ #if MOTHERBOARD == 7 #define KNOWN_BOARD 1 -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega1284P__) +#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega1284P__) && !defined(__AVR_ATmega644__) #error Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu. #endif -- cgit v1.2.1 From 2c00d1580fcfac3d3719f83f660f63e7e8523120 Mon Sep 17 00:00:00 2001 From: Greg Dahlman Date: Mon, 5 Dec 2011 20:34:02 -0800 Subject: Fixing issues in pins.h and fastio.h, I created them not understanding it was using arduino pin numbers I also put in a note that Gen 7 only works at 16 MHZ due to timing issues with WProgram.h and wiring.h --- Sprinter/Configuration.h | 2 +- Sprinter/fastio.h | 48 ------------------------------------------------ Sprinter/pins.h | 47 ++++++++++++++++++++++++----------------------- 3 files changed, 25 insertions(+), 72 deletions(-) (limited to 'Sprinter') diff --git a/Sprinter/Configuration.h b/Sprinter/Configuration.h index 2a57812..344a7bd 100644 --- a/Sprinter/Configuration.h +++ b/Sprinter/Configuration.h @@ -9,7 +9,7 @@ // Gen6 = 5, // Sanguinololu up to 1.1 = 6 // Sanguinololu 1.2 and above = 62 -// Gen 7 = 7 +// Gen 7 @ 16MHZ only= 7 // Teensylu (at90usb) = 8 // Gen 3 Plus = 21 // gen 3 Monolithic Electronics = 22 diff --git a/Sprinter/fastio.h b/Sprinter/fastio.h index 5f1f5d1..6b5572a 100644 --- a/Sprinter/fastio.h +++ b/Sprinter/fastio.h @@ -625,54 +625,6 @@ pins #define DIO31_DDR DDRA #define DIO31_PWM NULL -#define DIO33_PIN PINA7 -#define DIO33_RPORT PINA -#define DIO33_WPORT PORTA -#define DIO33_DDR DDRA -#define DIO33_PWM NULL - -#define DIO34_PIN PINA6 -#define DIO34_RPORT PINA -#define DIO34_WPORT PORTA -#define DIO34_DDR DDRA -#define DIO34_PWM NULL - -#define DIO35_PIN PINA5 -#define DIO35_RPORT PINA -#define DIO35_WPORT PORTA -#define DIO35_DDR DDRA -#define DIO35_PWM NULL - -#define DIO36_PIN PINA4 -#define DIO36_RPORT PINA -#define DIO36_WPORT PORTA -#define DIO36_DDR DDRA -#define DIO36_PWM NULL - -#define DIO37_PIN PINA3 -#define DIO37_RPORT PINA -#define DIO37_WPORT PORTA -#define DIO37_DDR DDRA -#define DIO37_PWM NULL - -#define DIO38_PIN PINA2 -#define DIO38_RPORT PINA -#define DIO38_WPORT PORTA -#define DIO38_DDR DDRA -#define DIO38_PWM NULL - -#define DIO39_PIN PINA1 -#define DIO39_RPORT PINA -#define DIO39_WPORT PORTA -#define DIO39_DDR DDRA -#define DIO39_PWM NULL - -#define DIO40_PIN PINA0 -#define DIO40_RPORT PINA -#define DIO40_WPORT PORTA -#define DIO40_DDR DDRA -#define DIO40_PWM NULL - #define AIO0_PIN PINA0 #define AIO0_RPORT PINA #define AIO0_WPORT PORTA diff --git a/Sprinter/pins.h b/Sprinter/pins.h index 01f29ed..63719f4 100644 --- a/Sprinter/pins.h +++ b/Sprinter/pins.h @@ -686,6 +686,7 @@ #endif + /**************************************************************************************** * Gen7 pin assignment * @@ -693,46 +694,46 @@ #if MOTHERBOARD == 7 #define KNOWN_BOARD 1 -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega1284P__) && !defined(__AVR_ATmega644__) +#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega1284P__) #error Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu. #endif //x axis pins - #define X_STEP_PIN 15 + #define X_STEP_PIN 19 #define X_DIR_PIN 18 - #define X_ENABLE_PIN 33 - #define X_MIN_PIN 8 - #define X_MAX_PIN 7 + #define X_ENABLE_PIN -1 + #define X_MIN_PIN 7 + #define X_MAX_PIN 6 //y axis pins - #define Y_STEP_PIN 29 - #define Y_DIR_PIN 28 - #define Y_ENABLE_PIN 33 - #define Y_MIN_PIN 3 - #define Y_MAX_PIN 6 + #define Y_STEP_PIN 23 + #define Y_DIR_PIN 22 + #define Y_ENABLE_PIN -1 + #define Y_MIN_PIN 5 + #define Y_MAX_PIN 2 //z axis pins - #define Z_STEP_PIN 35 - #define Z_DIR_PIN 34 - #define Z_ENABLE_PIN 33 - #define Z_MIN_PIN 2 - #define Z_MAX_PIN 1 + #define Z_STEP_PIN 26 + #define Z_DIR_PIN 25 + #define Z_ENABLE_PIN 24 + #define Z_MIN_PIN 1 + #define Z_MAX_PIN 0 //extruder pins - #define E_STEP_PIN 37 - #define E_DIR_PIN 36 - #define E_ENABLE_PIN 33 - #define TEMP_0_PIN 39 // Extruder - #define HEATER_0_PIN 5 // Extruder - #define HEATER_1_PIN 4 // Bed + #define E_STEP_PIN 28 + #define E_DIR_PIN 27 + #define E_ENABLE_PIN -1 + #define TEMP_0_PIN 1 // Extruder + #define HEATER_0_PIN 4 // Extruder + #define HEATER_1_PIN 3 // Bed #define SDPOWER -1 #define SDSS -1 #define LED_PIN -1 - #define TEMP_1_PIN 38 //Bed + #define TEMP_1_PIN 2 //Bed #define FAN_PIN -1 - #define PS_ON_PIN 21 + #define PS_ON_PIN 15 #endif -- cgit v1.2.1 From 49c5c65dcf22941e581b89307730cc6f450fea1f Mon Sep 17 00:00:00 2001 From: Greg Dahlman Date: Tue, 6 Dec 2011 12:30:56 -0800 Subject: Fix ifdef with missing # in Sprinter.pde and add 644 non P to the Gen 7 board in pins.h --- Sprinter/Sprinter.pde | 2 +- Sprinter/pins.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'Sprinter') diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde index 1322b30..c8acc67 100644 --- a/Sprinter/Sprinter.pde +++ b/Sprinter/Sprinter.pde @@ -92,7 +92,7 @@ float axis_diff[NUM_AXIS] = {0, 0, 0, 0}; long long_step_delay_ratio = STEP_DELAY_RATIO * 100; #endif ///oscillation reduction -ifdef RAPID_OSCILLATION_REDUCTION +#ifdef RAPID_OSCILLATION_REDUCTION float cumm_wait_time_in_dir[NUM_AXIS]={0.0,0.0,0.0,0.0}; bool prev_move_direction[NUM_AXIS]={1,1,1,1}; float osc_wait_remainder = 0.0; diff --git a/Sprinter/pins.h b/Sprinter/pins.h index 63719f4..3bc337e 100644 --- a/Sprinter/pins.h +++ b/Sprinter/pins.h @@ -694,7 +694,7 @@ #if MOTHERBOARD == 7 #define KNOWN_BOARD 1 -#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega1284P__) +#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega1284P__) && !defined(__AVR_ATmega644__) #error Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu. #endif -- cgit v1.2.1 From e7fb583df933a7012f2c42d84375b99ced0202c4 Mon Sep 17 00:00:00 2001 From: blddk Date: Sun, 22 Jan 2012 15:27:27 +0100 Subject: Added option to set a delay after enabeling stepper driver, to allow the driver to enable (time needed according to datasheet) --- Sprinter/Sprinter.pde | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'Sprinter') diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde index c8acc67..5387923 100644 --- a/Sprinter/Sprinter.pde +++ b/Sprinter/Sprinter.pde @@ -1284,10 +1284,33 @@ inline void linear_move(unsigned long axis_steps_remaining[]) // make linear mov //Only enable axis that are moving. If the axis doesn't need to move then it can stay disabled depending on configuration. // TODO: maybe it's better to refactor into a generic enable(int axis) function, that will probably take more ram, // but will reduce code size +#ifdef DELAY_ENABLE + if(axis_steps_remaining[0]) + { + enable_x(); + delayMicroseconds(DELAY_ENABLE); + } + if(axis_steps_remaining[1]) + { + enable_y(); + delayMicroseconds(DELAY_ENABLE); + } + if(axis_steps_remaining[2]) + { + enable_z(); + delayMicroseconds(DELAY_ENABLE); + } + if(axis_steps_remaining[3]) + { + enable_e(); + delayMicroseconds(DELAY_ENABLE); + } +#else if(axis_steps_remaining[0]) enable_x(); if(axis_steps_remaining[1]) enable_y(); if(axis_steps_remaining[2]) enable_z(); if(axis_steps_remaining[3]) enable_e(); +#endif //Define variables that are needed for the Bresenham algorithm. Please note that Z is not currently included in the Bresenham algorithm. unsigned long delta[] = {axis_steps_remaining[0], axis_steps_remaining[1], axis_steps_remaining[2], axis_steps_remaining[3]}; //TODO: implement a "for" to support N axes -- cgit v1.2.1 From eb7a192c945677d09ddd669cc047480bc5ddeeae Mon Sep 17 00:00:00 2001 From: blddk Date: Sun, 22 Jan 2012 15:28:46 +0100 Subject: Added option to set a delay after enabling a stepper driver, default turned off to keep current behavior. --- Sprinter/Configuration.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Sprinter') diff --git a/Sprinter/Configuration.h b/Sprinter/Configuration.h index 344a7bd..250a2d2 100644 --- a/Sprinter/Configuration.h +++ b/Sprinter/Configuration.h @@ -66,6 +66,9 @@ const bool Z_ENDSTOP_INVERT = false; #define Z_ENABLE_ON 0 #define E_ENABLE_ON 0 +//Uncomment if you have problems with a stepper driver enabeling too late, this will also set how many microseconds delay there will be after enabeling the driver +//#define DELAY_ENABLE 15 + // Disables axis when it's not being used. const bool DISABLE_X = false; const bool DISABLE_Y = false; -- cgit v1.2.1 From d8b6c5f233e905dbb5282a255dddd68deb1c3d7f Mon Sep 17 00:00:00 2001 From: blddk Date: Sun, 22 Jan 2012 15:43:51 +0100 Subject: Changed temperature table for bed, to the one for the bed, instead of for the heater. --- Sprinter/Sprinter.pde | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Sprinter') diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde index 5387923..e793891 100644 --- a/Sprinter/Sprinter.pde +++ b/Sprinter/Sprinter.pde @@ -971,7 +971,7 @@ inline void process_commands() break; case 190: // M190 - Wait bed for heater to reach target. #if TEMP_1_PIN > -1 - if (code_seen('S')) target_bed_raw = temp2analogh(code_value()); + if (code_seen('S')) target_bed_raw = temp2analogBed(code_value()); codenum = millis(); while(current_bed_raw < target_bed_raw) { if( (millis()-codenum) > 1000 ) //Print Temp Reading every 1 second while heating up. -- cgit v1.2.1 From 908bc5314ca92dd673509e7a60e371752692be4b Mon Sep 17 00:00:00 2001 From: blddk Date: Sun, 22 Jan 2012 21:51:56 +0100 Subject: Reported wrong temperature while heating up --- Sprinter/Sprinter.pde | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Sprinter') diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde index e793891..874c333 100644 --- a/Sprinter/Sprinter.pde +++ b/Sprinter/Sprinter.pde @@ -980,7 +980,7 @@ inline void process_commands() Serial.print("T:"); Serial.print( tt ); Serial.print(" B:"); - Serial.println( analog2temp(current_bed_raw) ); + Serial.println(analog2tempBed(current_bed_raw)); codenum = millis(); } manage_heater(); -- cgit v1.2.1