From 901b03d0208f65f1e193f6172f05d4d4be35f330 Mon Sep 17 00:00:00 2001 From: Greg Alexander Date: Sat, 7 Mar 2015 17:24:26 -0500 Subject: [PATCH 01/12] use strtol() instead of strtod() when an integer value is desired --- Marlin/Marlin_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index b3c1702a5..322573060 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -765,7 +765,7 @@ void get_command() while(cmdbuffer[bufindw][count] != '*') checksum = checksum^cmdbuffer[bufindw][count++]; strchr_pointer = strchr(cmdbuffer[bufindw], '*'); - if( (int)(strtod(strchr_pointer + 1, NULL)) != checksum) { + if(strtol(strchr_pointer + 1, NULL, 10) != checksum) { SERIAL_ERROR_START; SERIAL_ERRORPGM(MSG_ERR_CHECKSUM_MISMATCH); SERIAL_ERRORLN(gcode_LastN); @@ -801,7 +801,7 @@ void get_command() } if((strchr(cmdbuffer[bufindw], 'G') != NULL)){ strchr_pointer = strchr(cmdbuffer[bufindw], 'G'); - switch((int)((strtod(strchr_pointer + 1, NULL)))){ + switch(strtol(strchr_pointer + 1, NULL, 10)){ case 0: case 1: case 2: From b9dfa5cad4730c5bb665bc8edc6f4bc945ecdf68 Mon Sep 17 00:00:00 2001 From: Greg Alexander Date: Sat, 7 Mar 2015 17:33:15 -0500 Subject: [PATCH 02/12] use code_value_long() instead of (int)code_value() --- Marlin/Marlin_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 322573060..db53c0e13 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4198,7 +4198,7 @@ inline void gcode_M350() { */ inline void gcode_M351() { #if defined(X_MS1_PIN) && X_MS1_PIN > -1 - if (code_seen('S')) switch((int)code_value()) { + if (code_seen('S')) switch(code_value_long()) { case 1: for(int i=0;i Date: Tue, 10 Mar 2015 14:08:32 -0300 Subject: [PATCH 03/12] Add speed configuration for home-bumping movement --- Marlin/Configuration.h | 9 ++- Marlin/Configuration_adv.h | 1 + Marlin/Marlin_main.cpp | 66 +++++++++++-------- .../Hephestos/Configuration.h | 2 + .../Hephestos/Configuration_adv.h | 1 + .../K8200/Configuration.h | 2 + .../K8200/Configuration_adv.h | 1 + .../SCARA/Configuration.h | 2 + .../SCARA/Configuration_adv.h | 1 + .../WITBOX/Configuration.h | 2 + .../WITBOX/Configuration_adv.h | 1 + .../delta/Configuration_adv.h | 1 + .../makibox/Configuration.h | 2 + .../makibox/Configuration_adv.h | 1 + .../tvrrug/Round2/Configuration.h | 2 + .../tvrrug/Round2/Configuration_adv.h | 1 + 16 files changed, 67 insertions(+), 28 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index f3723de18..20599a6d5 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -407,6 +407,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define RIGHT_PROBE_BED_POSITION 170 #define FRONT_PROBE_BED_POSITION 20 #define BACK_PROBE_BED_POSITION 170 + + #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this // Set the number of grid points per dimension // You probably don't need more than 3 (squared=9) @@ -429,8 +431,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Offsets to the probe relative to the extruder tip (Hotend - Probe) // X and Y offsets must be integers - #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // -left +right - #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // -front +behind + #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // Probe on: -left +right + #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // Probe on: -front +behind #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // -below (always!) #define Z_RAISE_BEFORE_HOMING 4 // (in mm) Raise Z before homing (G28) for Probe Clearance. @@ -441,6 +443,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points + #define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" //These commands will be executed in the end of G29 routine. + //Useful to retract a deployable probe. + //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index f2b312441..11f4e43b9 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -214,6 +214,7 @@ #define X_HOME_RETRACT_MM 5 #define Y_HOME_RETRACT_MM 5 #define Z_HOME_RETRACT_MM 2 +#define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 4883db180..291cb808c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -201,6 +201,7 @@ #endif float homing_feedrate[] = HOMING_FEEDRATE; +int homing_bump_divisor[] = HOMING_BUMP_DIVISOR; bool axis_relative_modes[] = AXIS_RELATIVE_MODES; int feedmultiply = 100; //100->1 200->2 int saved_feedmultiply; @@ -1131,7 +1132,18 @@ static void run_z_probe() { st_synchronize(); // move back down slowly to find bed - feedrate = homing_feedrate[Z_AXIS]/4; + + if (homing_bump_divisor[Z_AXIS] >= 1) + { + feedrate = homing_feedrate[Z_AXIS]/homing_bump_divisor[Z_AXIS]; + } + else + { + feedrate = homing_feedrate[Z_AXIS]/10; + SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less then 1"); + } + + zPosition -= home_retract_mm(Z_AXIS) * 2; plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder); st_synchronize(); @@ -1293,11 +1305,17 @@ static void homeaxis(int axis) { st_synchronize(); destination[axis] = 2*home_retract_mm(axis) * axis_home_dir; -#ifdef DELTA - feedrate = homing_feedrate[axis]/10; -#else - feedrate = homing_feedrate[axis]/2 ; -#endif + + if (homing_bump_divisor[axis] >= 1) + { + feedrate = homing_feedrate[axis]/homing_bump_divisor[axis]; + } + else + { + feedrate = homing_feedrate[axis]/10; + SERIAL_ECHOLN("Warning: The Homing Bump Feedrate Divisor cannot be less then 1"); + } + plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); st_synchronize(); #ifdef DELTA @@ -1756,41 +1774,32 @@ inline void gcode_G28() { #ifdef AUTO_BED_LEVELING_GRID - #define MIN_PROBE_EDGE 20 // The probe square sides can be no smaller than this - // Make sure probing points are reachable #if LEFT_PROBE_BED_POSITION < MIN_PROBE_X - #error The given LEFT_PROBE_BED_POSITION can't be reached by the probe. + #error "The given LEFT_PROBE_BED_POSITION can't be reached by the probe." #elif RIGHT_PROBE_BED_POSITION > MAX_PROBE_X - #error The given RIGHT_PROBE_BED_POSITION can't be reached by the probe. + #error "The given RIGHT_PROBE_BED_POSITION can't be reached by the probe." #elif FRONT_PROBE_BED_POSITION < MIN_PROBE_Y - #error The given FRONT_PROBE_BED_POSITION can't be reached by the probe. + #error "The given FRONT_PROBE_BED_POSITION can't be reached by the probe." #elif BACK_PROBE_BED_POSITION > MAX_PROBE_Y - #error The given BACK_PROBE_BED_POSITION can't be reached by the probe. - - // Check if Probe_Offset * Grid Points is greater than Probing Range - - #elif abs(X_PROBE_OFFSET_FROM_EXTRUDER) * (AUTO_BED_LEVELING_GRID_POINTS-1) >= RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION - #error "The X axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS" - #elif abs(Y_PROBE_OFFSET_FROM_EXTRUDER) * (AUTO_BED_LEVELING_GRID_POINTS-1) >= BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION - #error "The Y axis probing range is not enough to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS" + #error "The given BACK_PROBE_BED_POSITION can't be reached by the probe." #endif #else // !AUTO_BED_LEVELING_GRID #if ABL_PROBE_PT_1_X < MIN_PROBE_X || ABL_PROBE_PT_1_X > MAX_PROBE_X - #error The given ABL_PROBE_PT_1_X can't be reached by the probe. + #error "The given ABL_PROBE_PT_1_X can't be reached by the probe." #elif ABL_PROBE_PT_2_X < MIN_PROBE_X || ABL_PROBE_PT_2_X > MAX_PROBE_X - #error The given ABL_PROBE_PT_2_X can't be reached by the probe. + #error "The given ABL_PROBE_PT_2_X can't be reached by the probe." #elif ABL_PROBE_PT_3_X < MIN_PROBE_X || ABL_PROBE_PT_3_X > MAX_PROBE_X - #error The given ABL_PROBE_PT_3_X can't be reached by the probe. + #error "The given ABL_PROBE_PT_3_X can't be reached by the probe." #elif ABL_PROBE_PT_1_Y < MIN_PROBE_Y || ABL_PROBE_PT_1_Y > MAX_PROBE_Y - #error The given ABL_PROBE_PT_1_Y can't be reached by the probe. + #error "The given ABL_PROBE_PT_1_Y can't be reached by the probe." #elif ABL_PROBE_PT_2_Y < MIN_PROBE_Y || ABL_PROBE_PT_2_Y > MAX_PROBE_Y - #error The given ABL_PROBE_PT_2_Y can't be reached by the probe. + #error "The given ABL_PROBE_PT_2_Y can't be reached by the probe." #elif ABL_PROBE_PT_3_Y < MIN_PROBE_Y || ABL_PROBE_PT_3_Y > MAX_PROBE_Y - #error The given ABL_PROBE_PT_3_Y can't be reached by the probe. + #error "The given ABL_PROBE_PT_3_Y can't be reached by the probe." #endif #endif // !AUTO_BED_LEVELING_GRID @@ -1862,7 +1871,7 @@ inline void gcode_G28() { SERIAL_PROTOCOLPGM("G29 Auto Bed Leveling\n"); int auto_bed_leveling_grid_points = code_seen('P') ? code_value_long() : AUTO_BED_LEVELING_GRID_POINTS; - if (auto_bed_leveling_grid_points < 2 || auto_bed_leveling_grid_points > AUTO_BED_LEVELING_GRID_POINTS) { + if (auto_bed_leveling_grid_points < 2) { SERIAL_PROTOCOLPGM("?Number of probed (P)oints is implausible (2 minimum).\n"); return; } @@ -2095,6 +2104,11 @@ inline void gcode_G28() { #ifdef Z_PROBE_SLED dock_sled(true, -SLED_DOCKING_OFFSET); // dock the probe, correcting for over-travel #endif + + #ifdef Z_PROBE_END_SCRIPT + enquecommands_P(PSTR(Z_PROBE_END_SCRIPT)); + st_synchronize(); + #endif } #ifndef Z_PROBE_SLED diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 57d0753d9..cf2199d94 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -413,6 +413,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define RIGHT_PROBE_BED_POSITION 170 #define FRONT_PROBE_BED_POSITION 20 #define BACK_PROBE_BED_POSITION 170 + + #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this // Set the number of grid points per dimension // You probably don't need more than 3 (squared=9) diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 0a9c8a129..cf18b9585 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -214,6 +214,7 @@ #define X_HOME_RETRACT_MM 5 #define Y_HOME_RETRACT_MM 5 #define Z_HOME_RETRACT_MM 2 +#define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index de0764269..112c228bd 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -419,6 +419,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define FRONT_PROBE_BED_POSITION 20 #define BACK_PROBE_BED_POSITION 170 + #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this + // Set the number of grid points per dimension // You probably don't need more than 3 (squared=9) #define AUTO_BED_LEVELING_GRID_POINTS 2 diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index bf2daede0..0e0d88464 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -214,6 +214,7 @@ #define X_HOME_RETRACT_MM 5 #define Y_HOME_RETRACT_MM 5 #define Z_HOME_RETRACT_MM 3 +#define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index f29a9103d..c74ea6a99 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -443,6 +443,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define FRONT_PROBE_BED_POSITION 20 #define BACK_PROBE_BED_POSITION 170 + #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this + // Set the number of grid points per dimension // You probably don't need more than 3 (squared=9) #define AUTO_BED_LEVELING_GRID_POINTS 2 diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index a32669881..e90728b9c 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -214,6 +214,7 @@ #define X_HOME_RETRACT_MM 3 #define Y_HOME_RETRACT_MM 3 #define Z_HOME_RETRACT_MM 3 +#define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. #ifdef SCARA #define QUICK_HOME //SCARA needs Quickhome diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 4e9c748c8..b45e90796 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -413,6 +413,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define FRONT_PROBE_BED_POSITION 20 #define BACK_PROBE_BED_POSITION 170 + #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this + // Set the number of grid points per dimension // You probably don't need more than 3 (squared=9) #define AUTO_BED_LEVELING_GRID_POINTS 2 diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 0a9c8a129..cf18b9585 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -214,6 +214,7 @@ #define X_HOME_RETRACT_MM 5 #define Y_HOME_RETRACT_MM 5 #define Z_HOME_RETRACT_MM 2 +#define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/example_configurations/delta/Configuration_adv.h b/Marlin/example_configurations/delta/Configuration_adv.h index 9b49bfe1e..28b1db7ae 100644 --- a/Marlin/example_configurations/delta/Configuration_adv.h +++ b/Marlin/example_configurations/delta/Configuration_adv.h @@ -214,6 +214,7 @@ #define X_HOME_RETRACT_MM 5 #define Y_HOME_RETRACT_MM 5 #define Z_HOME_RETRACT_MM 5 // deltas need the same for all three axis +#define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 5fd92f439..78e736e4d 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -411,6 +411,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define FRONT_PROBE_BED_POSITION 20 #define BACK_PROBE_BED_POSITION 170 + #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this + // Set the number of grid points per dimension // You probably don't need more than 3 (squared=9) #define AUTO_BED_LEVELING_GRID_POINTS 2 diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 1033b9989..efb8943aa 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -214,6 +214,7 @@ #define X_HOME_RETRACT_MM 5 #define Y_HOME_RETRACT_MM 5 #define Z_HOME_RETRACT_MM 2 +#define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. #define AXIS_RELATIVE_MODES {false, false, false, false} diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 21c589d71..88ad8b869 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -412,6 +412,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define RIGHT_PROBE_BED_POSITION 170 #define FRONT_PROBE_BED_POSITION 20 #define BACK_PROBE_BED_POSITION 170 + + #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this // Set the number of grid points per dimension // You probably don't need more than 3 (squared=9) diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index df413f6e6..cfb2a4983 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -214,6 +214,7 @@ #define X_HOME_RETRACT_MM 5 #define Y_HOME_RETRACT_MM 5 #define Z_HOME_RETRACT_MM 1 +#define HOMING_BUMP_DIVISOR {10, 10, 20} // Re-Bump Speed Divisor (Divides the Homing Feedrate) //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. #define AXIS_RELATIVE_MODES {false, false, false, false} From 8a4b62d081c97db40cbac1bae8de44c45dbab225 Mon Sep 17 00:00:00 2001 From: alexborro Date: Tue, 10 Mar 2015 14:41:21 -0300 Subject: [PATCH 04/12] Set more regular setup in configuration.h --- Marlin/Configuration.h | 81 ++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 47 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 20599a6d5..b586da2ed 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -59,7 +59,7 @@ Here are some standard links for getting your machine calibrated: // The following define selects which electronics board you have. // Please choose the name from boards.h that matches your setup #ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_ULTIMAKER + #define MOTHERBOARD BOARD_RAMPS_13 #endif // Define this to set a custom name for your generic Mendel, @@ -123,8 +123,8 @@ Here are some standard links for getting your machine calibrated: // #define DUMMY_THERMISTOR_998_VALUE 25 // #define DUMMY_THERMISTOR_999_VALUE 100 -#define TEMP_SENSOR_0 -1 -#define TEMP_SENSOR_1 -1 +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_BED 0 @@ -301,35 +301,21 @@ your extruder heater takes 2 minutes to hit the target on heating. // Enable this option for Toshiba steppers // #define CONFIG_STEPPERS_TOSHIBA -// coarse Endstop Settings -#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors +// The pullups are needed if you directly connect a mechanical endstop between the signal and ground pins. +#define ENDSTOPPULLUP_XMAX +#define ENDSTOPPULLUP_YMAX +#define ENDSTOPPULLUP_ZMAX +#define ENDSTOPPULLUP_XMIN +#define ENDSTOPPULLUP_YMIN +#define ENDSTOPPULLUP_ZMIN -#ifndef ENDSTOPPULLUPS - // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined - // #define ENDSTOPPULLUP_XMAX - // #define ENDSTOPPULLUP_YMAX - // #define ENDSTOPPULLUP_ZMAX - // #define ENDSTOPPULLUP_XMIN - // #define ENDSTOPPULLUP_YMIN - // #define ENDSTOPPULLUP_ZMIN -#endif - -#ifdef ENDSTOPPULLUPS - #define ENDSTOPPULLUP_XMAX - #define ENDSTOPPULLUP_YMAX - #define ENDSTOPPULLUP_ZMAX - #define ENDSTOPPULLUP_XMIN - #define ENDSTOPPULLUP_YMIN - #define ENDSTOPPULLUP_ZMIN -#endif - -// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins. -const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. -const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop. +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. +const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. //#define DISABLE_MAX_ENDSTOPS //#define DISABLE_MIN_ENDSTOPS @@ -346,13 +332,14 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DISABLE_E false // For all extruders #define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled -#define INVERT_X_DIR true // for Mendel set to false, for Orca set to true -#define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false -#define INVERT_Z_DIR true // for Mendel set to false, for Orca set to true -#define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false -#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +// If you motor turns to wrong direction, you can invert it here: +#define INVERT_X_DIR false +#define INVERT_Y_DIR false +#define INVERT_Z_DIR false +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false // ENDSTOP SETTINGS: // Sets direction of endstops when homing; 1=MAX, -1=MIN @@ -364,9 +351,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. // Travel limits after homing (units are in mm) -#define X_MAX_POS 205 +#define X_MAX_POS 200 #define X_MIN_POS 0 -#define Y_MAX_POS 205 +#define Y_MAX_POS 200 #define Y_MIN_POS 0 #define Z_MAX_POS 200 #define Z_MIN_POS 0 @@ -443,7 +430,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. #define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points - #define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" //These commands will be executed in the end of G29 routine. +// #define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" //These commands will be executed in the end of G29 routine. //Useful to retract a deployable probe. //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell @@ -493,9 +480,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // default settings -#define DEFAULT_AXIS_STEPS_PER_UNIT {78.7402,78.7402,200.0*8/3,760*1.1} // default steps per unit for Ultimaker -#define DEFAULT_MAX_FEEDRATE {500, 500, 5, 25} // (mm/sec) -#define DEFAULT_MAX_ACCELERATION {9000,9000,100,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot. +#define DEFAULT_AXIS_STEPS_PER_UNIT {80,80,4000,500} // default steps per unit for Ultimaker +#define DEFAULT_MAX_FEEDRATE {300, 300, 5, 25} // (mm/sec) +#define DEFAULT_MAX_ACCELERATION {3000,3000,100,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot. #define DEFAULT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves #define DEFAULT_RETRACT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for retracts @@ -539,11 +526,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Preheat Constants #define PLA_PREHEAT_HOTEND_TEMP 180 #define PLA_PREHEAT_HPB_TEMP 70 -#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define PLA_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255 #define ABS_PREHEAT_HOTEND_TEMP 240 -#define ABS_PREHEAT_HPB_TEMP 100 -#define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 +#define ABS_PREHEAT_HPB_TEMP 110 +#define ABS_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255 //==============================LCD and SD support============================= From 5bf42066faf7bd125f892493ce233ebe2a745c25 Mon Sep 17 00:00:00 2001 From: alexborro Date: Tue, 10 Mar 2015 15:06:34 -0300 Subject: [PATCH 05/12] Fix typo in configuration.h --- Marlin/Configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index b586da2ed..890a87dd2 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -59,7 +59,7 @@ Here are some standard links for getting your machine calibrated: // The following define selects which electronics board you have. // Please choose the name from boards.h that matches your setup #ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_RAMPS_13 + #define MOTHERBOARD BOARD_RAMPS_13_EFB #endif // Define this to set a custom name for your generic Mendel, From 33fe89f53907b7389c2eceb26cd1a564b0b13360 Mon Sep 17 00:00:00 2001 From: Bo Herrmannsen Date: Wed, 11 Mar 2015 10:24:56 +0100 Subject: [PATCH 06/12] removed irc archive link removed the link as the software i had did not work, nor does anyone hardly use irc chat but just hang out there --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5107cf004..a0e3aeee5 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ What bugs are we working on: [Bug Fixing Round 2](https://github.com/MarlinFirmw ## Contact -__IRC:__ #marlin-firmware @freenode ([WebChat Client](https://webchat.freenode.net/?channels=marlin-firmware), [Archive](http://energymonitor-dk.dns4e.net/marlin-firmware-log/)) +__IRC:__ #marlin-firmware @freenode ([WebChat Client](https://webchat.freenode.net/?channels=marlin-firmware) __Mailing List:__ marlin@lists.0l.de ([Subscribe](http://lists.0l.de/mailman/listinfo/marlin), [Archive](http://lists.0l.de/pipermail/marlin/)) From 749e5b9b848c72cc839d125d7f7042d0009fdb51 Mon Sep 17 00:00:00 2001 From: Bo Herrmannsen Date: Wed, 11 Mar 2015 10:30:03 +0100 Subject: [PATCH 07/12] updated milestone link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a0e3aeee5..155e916f5 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ We are actively looking for testers. So please try the current development versi [![Coverity Scan Build Status](https://scan.coverity.com/projects/2224/badge.svg)](https://scan.coverity.com/projects/2224) [![Travis Build Status](https://travis-ci.org/MarlinFirmware/Marlin.svg)](https://travis-ci.org/MarlinFirmware/Marlin) -What bugs are we working on: [Bug Fixing Round 2](https://github.com/MarlinFirmware/Marlin/milestones/Bug%20Fixing%20Round%202) +What bugs are we working on: [Bug Fixing Round 3](https://github.com/MarlinFirmware/Marlin/milestones/Bug%20Fixing%20Round%203) ## Contact From af63b5456264f0698216b32a04edbb16140d8699 Mon Sep 17 00:00:00 2001 From: alexborro Date: Wed, 11 Mar 2015 09:51:56 -0300 Subject: [PATCH 08/12] Add travel speed option to G29 command line --- Marlin/Marlin_main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 291cb808c..1cacfba7a 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -201,6 +201,7 @@ #endif float homing_feedrate[] = HOMING_FEEDRATE; +int xy_travel_speed = XY_TRAVEL_SPEED; int homing_bump_divisor[] = HOMING_BUMP_DIVISOR; bool axis_relative_modes[] = AXIS_RELATIVE_MODES; int feedmultiply = 100; //100->1 200->2 @@ -1162,7 +1163,7 @@ static void do_blocking_move_to(float x, float y, float z) { plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate/60, active_extruder); st_synchronize(); - feedrate = XY_TRAVEL_SPEED; + feedrate = xy_travel_speed; current_position[X_AXIS] = x; current_position[Y_AXIS] = y; @@ -1815,6 +1816,8 @@ inline void gcode_G28() { * P Set the size of the grid that will be probed (P x P points). * Example: "G29 P4" * + * S Set the XY travel speed between probe points (in mm/min) + * * V Set the verbose level (0-4). Example: "G29 V3" * * T Generate a Bed Topology Report. Example: "G29 P5 T" for a detailed report. @@ -1876,6 +1879,8 @@ inline void gcode_G28() { return; } + xy_travel_speed = code_seen('S') ? code_value_long() : XY_TRAVEL_SPEED; + int left_probe_bed_position = code_seen('L') ? code_value_long() : LEFT_PROBE_BED_POSITION, right_probe_bed_position = code_seen('R') ? code_value_long() : RIGHT_PROBE_BED_POSITION, front_probe_bed_position = code_seen('F') ? code_value_long() : FRONT_PROBE_BED_POSITION, From 888cf161bdfa4fc426580b5a69714ba818da6675 Mon Sep 17 00:00:00 2001 From: alexborro Date: Wed, 11 Mar 2015 10:03:32 -0300 Subject: [PATCH 09/12] fix travel speed option for G29 I forgot to enclousure the variable with #ifdef --- Marlin/Marlin_main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 1cacfba7a..13ebb43cb 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -201,7 +201,9 @@ #endif float homing_feedrate[] = HOMING_FEEDRATE; +#ifdef ENABLE_AUTO_BED_LEVELING int xy_travel_speed = XY_TRAVEL_SPEED; +#endif int homing_bump_divisor[] = HOMING_BUMP_DIVISOR; bool axis_relative_modes[] = AXIS_RELATIVE_MODES; int feedmultiply = 100; //100->1 200->2 From 9157cbd8f340579958901c2e77dbcfba687d54d7 Mon Sep 17 00:00:00 2001 From: alexborro Date: Wed, 11 Mar 2015 13:19:02 -0300 Subject: [PATCH 10/12] Add Travel Acceleration and change the M204 options Added option to set Travel Acceleration (non printing moves). The M204 options was a non sense (S for printing moves and T for retract moves). It has been changed to: P = Printing moves R = Retract only (no X, Y, Z) moves T = Travel (non printing) moves I will add this info o G-Code wiki in reprap.org. I also advise to put this info in Marlin next version changelog. --- Marlin/Configuration.h | 5 ++-- Marlin/ConfigurationStore.cpp | 15 ++++++---- Marlin/Marlin_main.cpp | 28 +++++++++++++++---- .../Hephestos/Configuration.h | 7 +++-- .../K8200/Configuration.h | 6 ++-- .../SCARA/Configuration.h | 7 +++-- .../WITBOX/Configuration.h | 5 ++-- .../delta/Configuration.h | 6 ++-- .../makibox/Configuration.h | 5 ++-- .../tvrrug/Round2/Configuration.h | 6 ++-- Marlin/language_en.h | 3 ++ Marlin/planner.cpp | 7 ++++- Marlin/planner.h | 1 + Marlin/ultralcd.cpp | 1 + 14 files changed, 75 insertions(+), 27 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 890a87dd2..f279ef032 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -484,8 +484,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #define DEFAULT_MAX_FEEDRATE {300, 300, 5, 25} // (mm/sec) #define DEFAULT_MAX_ACCELERATION {3000,3000,100,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot. -#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves -#define DEFAULT_RETRACT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for retracts +#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E acceleration in mm/s^2 for printing moves +#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration in mm/s^2 for retracts +#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). diff --git a/Marlin/ConfigurationStore.cpp b/Marlin/ConfigurationStore.cpp index b80aa038d..0dee05ba7 100644 --- a/Marlin/ConfigurationStore.cpp +++ b/Marlin/ConfigurationStore.cpp @@ -3,7 +3,7 @@ * * Configuration and EEPROM storage * - * V15 EEPROM Layout: + * V16 EEPROM Layout: * * ver * axis_steps_per_unit (x4) @@ -11,6 +11,7 @@ * max_acceleration_units_per_sq_second (x4) * acceleration * retract_acceleration + * travel_aceeleration * minimumfeedrate * mintravelfeedrate * minsegmenttime @@ -104,7 +105,7 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) { // wrong data being written to the variables. // ALSO: always make sure the variables in the Store and retrieve sections are in the same order. -#define EEPROM_VERSION "V15" +#define EEPROM_VERSION "V16" #ifdef EEPROM_SETTINGS @@ -118,6 +119,7 @@ void Config_StoreSettings() { EEPROM_WRITE_VAR(i, max_acceleration_units_per_sq_second); EEPROM_WRITE_VAR(i, acceleration); EEPROM_WRITE_VAR(i, retract_acceleration); + EEPROM_WRITE_VAR(i, travel_acceleration); EEPROM_WRITE_VAR(i, minimumfeedrate); EEPROM_WRITE_VAR(i, mintravelfeedrate); EEPROM_WRITE_VAR(i, minsegmenttime); @@ -253,6 +255,7 @@ void Config_RetrieveSettings() { EEPROM_READ_VAR(i, acceleration); EEPROM_READ_VAR(i, retract_acceleration); + EEPROM_READ_VAR(i, travel_acceleration); EEPROM_READ_VAR(i, minimumfeedrate); EEPROM_READ_VAR(i, mintravelfeedrate); EEPROM_READ_VAR(i, minsegmenttime); @@ -380,6 +383,7 @@ void Config_ResetDefault() { acceleration = DEFAULT_ACCELERATION; retract_acceleration = DEFAULT_RETRACT_ACCELERATION; + travel_acceleration = DEFAULT_TRAVEL_ACCELERATION; minimumfeedrate = DEFAULT_MINIMUMFEEDRATE; minsegmenttime = DEFAULT_MINSEGMENTTIME; mintravelfeedrate = DEFAULT_MINTRAVELFEEDRATE; @@ -516,11 +520,12 @@ void Config_PrintSettings(bool forReplay) { SERIAL_EOL; SERIAL_ECHO_START; if (!forReplay) { - SERIAL_ECHOLNPGM("Acceleration: S=acceleration, T=retract acceleration"); + SERIAL_ECHOLNPGM("Accelerations: P=printing, R=retract and T=travel"); SERIAL_ECHO_START; } - SERIAL_ECHOPAIR(" M204 S", acceleration ); - SERIAL_ECHOPAIR(" T", retract_acceleration); + SERIAL_ECHOPAIR(" M204 P", acceleration ); + SERIAL_ECHOPAIR(" R", retract_acceleration); + SERIAL_ECHOPAIR(" T", travel_acceleration); SERIAL_EOL; SERIAL_ECHO_START; diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 13ebb43cb..6fd2999dd 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3263,16 +3263,34 @@ inline void gcode_M203() { } /** - * M204: Set Default Acceleration and/or Default Filament Acceleration in mm/sec^2 (M204 S3000 T7000) + * M204: Set Accelerations in mm/sec^2 (M204 P1200 R3000 T3000) * - * S = normal moves - * T = filament only moves + * P = Printing moves + * R = Retract only (no X, Y, Z) moves + * T = Travel (non printing) moves * * Also sets minimum segment time in ms (B20000) to prevent buffer under-runs and M20 minimum feedrate */ inline void gcode_M204() { - if (code_seen('S')) acceleration = code_value(); - if (code_seen('T')) retract_acceleration = code_value(); + if (code_seen('P')) + { + acceleration = code_value(); + SERIAL_ECHOPAIR("Setting Printing Acceleration: ", acceleration ); + SERIAL_EOL; + } + if (code_seen('R')) + { + retract_acceleration = code_value(); + SERIAL_ECHOPAIR("Setting Retract Acceleration: ", retract_acceleration ); + SERIAL_EOL; + } + if (code_seen('T')) + { + travel_acceleration = code_value(); + SERIAL_ECHOPAIR("Setting Travel Acceleration: ", travel_acceleration ); + SERIAL_EOL; + } + } /** diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index cf2199d94..a5d3c8eb5 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -500,8 +500,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DEFAULT_MAX_FEEDRATE {250, 250, 3.3, 25} // (mm/sec) #define DEFAULT_MAX_ACCELERATION {3000,3000,100,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot. -#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves -#define DEFAULT_RETRACT_ACCELERATION 1000 // X, Y, Z and E max acceleration in mm/s^2 for retracts +#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration in mm/s^2 for printing moves +#define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration in mm/s^2 for retracts +#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves + + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 112c228bd..1aee050c7 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -505,8 +505,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DEFAULT_MAX_FEEDRATE {500, 500, 5, 500} // (mm/sec) #define DEFAULT_MAX_ACCELERATION {9000,9000,100,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot. -#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves -#define DEFAULT_RETRACT_ACCELERATION 1000 // X, Y, Z and E max acceleration in mm/s^2 for retracts +#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration in mm/s^2 for printing moves +#define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration in mm/s^2 for retracts +#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index c74ea6a99..665517194 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -530,8 +530,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DEFAULT_MAX_FEEDRATE {300, 300, 30, 25} // (mm/sec) #define DEFAULT_MAX_ACCELERATION {300,300,20,1000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot. -#define DEFAULT_ACCELERATION 400 // X, Y, Z and E max acceleration in mm/s^2 for printing moves -#define DEFAULT_RETRACT_ACCELERATION 2000 // X, Y, Z and E max acceleration in mm/s^2 for retracts +#define DEFAULT_ACCELERATION 400 // X, Y, Z and E acceleration in mm/s^2 for printing moves +#define DEFAULT_RETRACT_ACCELERATION 2000 // E acceleration in mm/s^2 for retracts +#define DEFAULT_TRAVEL_ACCELERATION 400 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves + + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index b45e90796..2e99c8227 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -499,8 +499,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DEFAULT_MAX_FEEDRATE {350, 350, 7.2, 80} // (mm/sec) #define DEFAULT_MAX_ACCELERATION {1000,1000,10,1000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot. -#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves -#define DEFAULT_RETRACT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for retracts +#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E acceleration in mm/s^2 for printing moves +#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration in mm/s^2 for retracts +#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). diff --git a/Marlin/example_configurations/delta/Configuration.h b/Marlin/example_configurations/delta/Configuration.h index e44d3c786..696bd4726 100644 --- a/Marlin/example_configurations/delta/Configuration.h +++ b/Marlin/example_configurations/delta/Configuration.h @@ -440,8 +440,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DEFAULT_MAX_FEEDRATE {500, 500, 500, 25} // (mm/sec) #define DEFAULT_MAX_ACCELERATION {9000,9000,9000,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for skeinforge 40+, for older versions raise them a lot. -#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves -#define DEFAULT_RETRACT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for retracts +#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E acceleration in mm/s^2 for printing moves +#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration in mm/s^2 for retracts +#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 78e736e4d..1f6489328 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -497,8 +497,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DEFAULT_MAX_FEEDRATE {60, 60, 20, 45} // (mm/sec) #define DEFAULT_MAX_ACCELERATION {2000,2000,30,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for skeinforge 40+, for older versions raise them a lot. -#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves -#define DEFAULT_RETRACT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for retracts +#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E acceleration in mm/s^2 for printing moves +#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration in mm/s^2 for retracts +#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 88ad8b869..ee326c182 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -503,8 +503,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define DEFAULT_MAX_ACCELERATION {9000,9000,100,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot. /* MICHEL: This has an impact on the "ripples" in print walls */ -#define DEFAULT_ACCELERATION 500 // X, Y, Z and E max acceleration in mm/s^2 for printing moves -#define DEFAULT_RETRACT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for retracts +#define DEFAULT_ACCELERATION 500 // X, Y, Z and E acceleration in mm/s^2 for printing moves +#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration in mm/s^2 for retracts +#define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). diff --git a/Marlin/language_en.h b/Marlin/language_en.h index 1ba950af9..636d622ab 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -233,6 +233,9 @@ #ifndef MSG_A_RETRACT #define MSG_A_RETRACT "A-retract" #endif +#ifndef MSG_A_TRAVEL +#define MSG_A_TRAVEL "A-travel" +#endif #ifndef MSG_XSTEPS #define MSG_XSTEPS "Xsteps/mm" #endif diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index cee1981bc..be1574e42 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -67,8 +67,9 @@ float max_feedrate[NUM_AXIS]; // set the max speeds float axis_steps_per_unit[NUM_AXIS]; unsigned long max_acceleration_units_per_sq_second[NUM_AXIS]; // Use M201 to override by software float minimumfeedrate; -float acceleration; // Normal acceleration mm/s^2 THIS IS THE DEFAULT ACCELERATION for all moves. M204 SXXXX +float acceleration; // Normal acceleration mm/s^2 THIS IS THE DEFAULT ACCELERATION for all printing moves. M204 SXXXX float retract_acceleration; // mm/s^2 filament pull-pack and push-forward while standing still in the other axis M204 TXXXX +float travel_acceleration; // Travel acceleration mm/s^2 THIS IS THE DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX float max_xy_jerk; //speed than can be stopped at once, if i understand correctly. float max_z_jerk; float max_e_jerk; @@ -907,6 +908,10 @@ Having the real displacement of the head, we can calculate the total movement le { block->acceleration_st = ceil(retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 } + else if(block->steps_e == 0) + { + block->acceleration_st = ceil(travel_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 + } else { block->acceleration_st = ceil(acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 diff --git a/Marlin/planner.h b/Marlin/planner.h index 0952b9dd3..a64a0f0d3 100644 --- a/Marlin/planner.h +++ b/Marlin/planner.h @@ -112,6 +112,7 @@ extern unsigned long max_acceleration_units_per_sq_second[NUM_AXIS]; // Use M201 extern float minimumfeedrate; extern float acceleration; // Normal acceleration mm/s^2 THIS IS THE DEFAULT ACCELERATION for all moves. M204 SXXXX extern float retract_acceleration; // mm/s^2 filament pull-pack and push-forward while standing still in the other axis M204 TXXXX +extern float travel_acceleration; // Travel acceleration mm/s^2 THIS IS THE DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX extern float max_xy_jerk; //speed than can be stopped at once, if i understand correctly. extern float max_z_jerk; extern float max_e_jerk; diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 2f83afe2d..39b092344 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -903,6 +903,7 @@ static void lcd_control_motion_menu() { MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &max_acceleration_units_per_sq_second[Z_AXIS], 100, 99000, reset_acceleration_rates); MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &max_acceleration_units_per_sq_second[E_AXIS], 100, 99000, reset_acceleration_rates); MENU_ITEM_EDIT(float5, MSG_A_RETRACT, &retract_acceleration, 100, 99000); + MENU_ITEM_EDIT(float5, MSG_A_TRAVEL, &travel_acceleration, 100, 99000); MENU_ITEM_EDIT(float52, MSG_XSTEPS, &axis_steps_per_unit[X_AXIS], 5, 9999); MENU_ITEM_EDIT(float52, MSG_YSTEPS, &axis_steps_per_unit[Y_AXIS], 5, 9999); MENU_ITEM_EDIT(float51, MSG_ZSTEPS, &axis_steps_per_unit[Z_AXIS], 5, 9999); From c7067edddf143ffa8f3e5661ee11b599c8386188 Mon Sep 17 00:00:00 2001 From: Bo Herrmannsen Date: Wed, 11 Mar 2015 18:56:46 +0100 Subject: [PATCH 11/12] initial empty change log --- Documentation/changelog.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Documentation/changelog.md diff --git a/Documentation/changelog.md b/Documentation/changelog.md new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/Documentation/changelog.md @@ -0,0 +1 @@ + From c0b6075f7774b425f67f416dd5ff7edc29bb3c5a Mon Sep 17 00:00:00 2001 From: alexborro Date: Wed, 11 Mar 2015 15:07:35 -0300 Subject: [PATCH 12/12] Fix max acceleration limits in planner The max acceleration limiting was in wrong place. --- Marlin/planner.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index be1574e42..999716612 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -915,16 +915,17 @@ Having the real displacement of the head, we can calculate the total movement le else { block->acceleration_st = ceil(acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 - // Limit acceleration per axis - if(((float)block->acceleration_st * (float)block->steps_x / (float)block->step_event_count) > axis_steps_per_sqr_second[X_AXIS]) - block->acceleration_st = axis_steps_per_sqr_second[X_AXIS]; - if(((float)block->acceleration_st * (float)block->steps_y / (float)block->step_event_count) > axis_steps_per_sqr_second[Y_AXIS]) - block->acceleration_st = axis_steps_per_sqr_second[Y_AXIS]; - if(((float)block->acceleration_st * (float)block->steps_e / (float)block->step_event_count) > axis_steps_per_sqr_second[E_AXIS]) - block->acceleration_st = axis_steps_per_sqr_second[E_AXIS]; - if(((float)block->acceleration_st * (float)block->steps_z / (float)block->step_event_count ) > axis_steps_per_sqr_second[Z_AXIS]) - block->acceleration_st = axis_steps_per_sqr_second[Z_AXIS]; } + // Limit acceleration per axis + if(((float)block->acceleration_st * (float)block->steps_x / (float)block->step_event_count) > axis_steps_per_sqr_second[X_AXIS]) + block->acceleration_st = axis_steps_per_sqr_second[X_AXIS]; + if(((float)block->acceleration_st * (float)block->steps_y / (float)block->step_event_count) > axis_steps_per_sqr_second[Y_AXIS]) + block->acceleration_st = axis_steps_per_sqr_second[Y_AXIS]; + if(((float)block->acceleration_st * (float)block->steps_e / (float)block->step_event_count) > axis_steps_per_sqr_second[E_AXIS]) + block->acceleration_st = axis_steps_per_sqr_second[E_AXIS]; + if(((float)block->acceleration_st * (float)block->steps_z / (float)block->step_event_count ) > axis_steps_per_sqr_second[Z_AXIS]) + block->acceleration_st = axis_steps_per_sqr_second[Z_AXIS]; + block->acceleration = block->acceleration_st / steps_per_mm; block->acceleration_rate = (long)((float)block->acceleration_st * (16777216.0 / (F_CPU / 8.0)));