Commit 5dd1ae24 authored by MagoKimbra's avatar MagoKimbra

Add acc retraction for extruder and ejerk for estruder

parent 284d5489
...@@ -91,8 +91,8 @@ ...@@ -91,8 +91,8 @@
//it is highly recommended you let this Z_SAFE_HOMING enabled!!! //it is highly recommended you let this Z_SAFE_HOMING enabled!!!
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING
#ifdef Z_SAFE_HOMING #ifdef Z_SAFE_HOMING
#define Z_SAFE_HOMING_X_POINT (X_MAX_LENGTH/2) // X point for Z homing when homing all axis (G28) or homing Z #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28)
#define Z_SAFE_HOMING_Y_POINT (Y_MAX_LENGTH/2) // Y point for Z homing when homing all axis (G28) or homing Z #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28)
#endif #endif
//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (ABL) //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (ABL)
...@@ -186,23 +186,23 @@ ...@@ -186,23 +186,23 @@
#define HOMING_FEEDRATE {100*60, 100*60, 2*60, 0} // set the homing speeds (mm/min) #define HOMING_FEEDRATE {100*60, 100*60, 2*60, 0} // set the homing speeds (mm/min)
// default settings // default settings
#define DEFAULT_AXIS_STEPS_PER_UNIT {80,80,3200,625,625,625,625} // X, Y, Z, E0, E1, E2, E3 default steps per unit #define DEFAULT_AXIS_STEPS_PER_UNIT {80,80,3200,625,625,625,625} // X, Y, Z, E0...(per extruder). Default steps per unit
#define DEFAULT_MAX_FEEDRATE {300,300,2,100,100,100,100} // X, Y, Z, E0, E1, E2, E3 (mm/sec) #define DEFAULT_MAX_FEEDRATE {300,300,2,100,100,100,100} // X, Y, Z, E0...(per extruder). (mm/sec)
#define DEFAULT_MAX_ACCELERATION {3000,3000,50,1000,1000,1000,1000} // X, Y, Z, E0, E1, E2, E3 maximum start speed for accelerated moves. #define DEFAULT_MAX_ACCELERATION {3000,3000,50,1000,1000,1000,1000} // X, Y, Z, E0...(per extruder). Maximum start speed for accelerated moves.
#define DEFAULT_ACCELERATION 2500 // X, Y, Z and E max acceleration in mm/s^2 for printing moves #define DEFAULT_RETRACT_ACCELERATION {10000,10000,10000,10000} // E0... (per extruder) max acceleration in mm/s^2 for retracts
#define DEFAULT_RETRACT_ACCELERATION 10000 // E max acceleration in mm/s^2 for retracts #define DEFAULT_ACCELERATION 2500 // X, Y, Z and E* max acceleration in mm/s^2 for printing moves
#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves #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). // 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). // The offset has to be X=0, Y=0 for the hotend 0 (default hotend).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the hotend 0.
//#define HOTEND_OFFSET_X {0.0, 5.00, 0.0, 0.0} // (in mm) for each extruder, offset of the hotend on the X axis //#define HOTEND_OFFSET_X {0.0, 5.00, 0.0, 0.0} // (in mm) for each hotend, offset of the hotend on the X axis
//#define HOTEND_OFFSET_Y {0.0, 5.00, 0.0, 0.0} // (in mm) for each extruder, offset of the hotend on the Y axis //#define HOTEND_OFFSET_Y {0.0, 5.00, 0.0, 0.0} // (in mm) for each hotend, offset of the hotend on the Y axis
// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously) // The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
#define DEFAULT_XYJERK 10.0 // (mm/sec) #define DEFAULT_XYJERK 10.0 // (mm/sec)
#define DEFAULT_ZJERK 0.4 // (mm/sec) #define DEFAULT_ZJERK 0.4 // (mm/sec)
#define DEFAULT_EJERK 5.0 // (mm/sec) #define DEFAULT_EJERK {5.0,5.0,5.0,5.0} // E0... (mm/sec) per extruder, max initial speed for retract moves
//=========================================================================== //===========================================================================
//=============================Additional Features=========================== //=============================Additional Features===========================
......
...@@ -90,9 +90,9 @@ ...@@ -90,9 +90,9 @@
//If you have enabled the Auto Bed Levelling and are using the same Z Probe for Z Homing, //If you have enabled the Auto Bed Levelling and are using the same Z Probe for Z Homing,
//it is highly recommended you let this Z_SAFE_HOMING enabled!!! //it is highly recommended you let this Z_SAFE_HOMING enabled!!!
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING
#ifndef Z_SAFE_HOMING #ifdef Z_SAFE_HOMING
#define Z_SAFE_HOMING_X_POINT (X_MAX_LENGTH/2) // X point for Z homing when homing all axis (G28) or homing Z #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28)
#define Z_SAFE_HOMING_Y_POINT (Y_MAX_LENGTH/2) // Y point for Z homing when homing all axis (G28) or homing Z #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28)
#endif #endif
//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (ABL) //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (ABL)
...@@ -186,23 +186,23 @@ ...@@ -186,23 +186,23 @@
#define HOMING_FEEDRATE {100*60, 100*60, 2*60, 0} // set the homing speeds (mm/min) #define HOMING_FEEDRATE {100*60, 100*60, 2*60, 0} // set the homing speeds (mm/min)
// default settings // default settings
#define DEFAULT_AXIS_STEPS_PER_UNIT {80,80,3200,625,625,625,625} // X, Y, Z, E0, E1, E2, E3 default steps per unit #define DEFAULT_AXIS_STEPS_PER_UNIT {80,80,3200,625,625,625,625} // X, Y, Z, E0...(per extruder). Default steps per unit
#define DEFAULT_MAX_FEEDRATE {300,300,2,100,100,100,100} // X, Y, Z, E0, E1, E2, E3 (mm/sec) #define DEFAULT_MAX_FEEDRATE {300,300,2,100,100,100,100} // X, Y, Z, E0...(per extruder). (mm/sec)
#define DEFAULT_MAX_ACCELERATION {3000,3000,50,1000,1000,1000,1000} // X, Y, Z, E0, E1, E2, E3 maximum start speed for accelerated moves. #define DEFAULT_MAX_ACCELERATION {3000,3000,50,1000,1000,1000,1000} // X, Y, Z, E0...(per extruder). Maximum start speed for accelerated moves.
#define DEFAULT_ACCELERATION 2500 // X, Y, Z and E max acceleration in mm/s^2 for printing moves #define DEFAULT_RETRACT_ACCELERATION {10000,10000,10000,10000} // E0... (per extruder) max acceleration in mm/s^2 for retracts
#define DEFAULT_RETRACT_ACCELERATION 10000 // E max acceleration in mm/s^2 for retracts #define DEFAULT_ACCELERATION 2500 // X, Y, Z and E* max acceleration in mm/s^2 for printing moves
#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves #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). // 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). // The offset has to be X=0, Y=0 for the hotend 0 (default hotend).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the hotend 0.
//#define HOTEND_OFFSET_X {0.0, 5.00, 0.0, 0.0} // (in mm) for each extruder, offset of the hotend on the X axis //#define HOTEND_OFFSET_X {0.0, 5.00, 0.0, 0.0} // (in mm) for each hotend, offset of the hotend on the X axis
//#define HOTEND_OFFSET_Y {0.0, 5.00, 0.0, 0.0} // (in mm) for each extruder, offset of the hotend on the Y axis //#define HOTEND_OFFSET_Y {0.0, 5.00, 0.0, 0.0} // (in mm) for each hotend, offset of the hotend on the Y axis
// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously) // The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
#define DEFAULT_XYJERK 10.0 // (mm/sec) #define DEFAULT_XYJERK 10.0 // (mm/sec)
#define DEFAULT_ZJERK 0.4 // (mm/sec) #define DEFAULT_ZJERK 0.4 // (mm/sec)
#define DEFAULT_EJERK 5.0 // (mm/sec) #define DEFAULT_EJERK {5.0,5.0,5.0,5.0} // E0... (mm/sec) per extruder, max initial speed for retract moves
//=========================================================================== //===========================================================================
//=============================Additional Features=========================== //=============================Additional Features===========================
......
...@@ -134,20 +134,20 @@ ...@@ -134,20 +134,20 @@
// default settings // default settings
// delta speeds must be the same on xyz // delta speeds must be the same on xyz
#define DEFAULT_AXIS_STEPS_PER_UNIT {80,80,80,451,625,625,625} // X, Y, Z, E0, E1, E2, E3 #define DEFAULT_AXIS_STEPS_PER_UNIT {80,80,80,451,625,625,625} // X, Y, Z, E0...(per extruder). Default steps per unit
#define DEFAULT_MAX_FEEDRATE {300,300,300,45,100,100,100} // X, Y, Z, E0, E1, E2, E3 (mm/sec) #define DEFAULT_MAX_FEEDRATE {500,500,500,45,45,45,45} // X, Y, Z, E0...(per extruder). (mm/sec)
#define DEFAULT_MAX_ACCELERATION {2000,2000,2000,1000,1000,1000,1000} // X, Y, Z, E0, E1, E2, E3 maximum start speed for accelerated moves. #define DEFAULT_MAX_ACCELERATION {5000,5000,5000,1000,1000,1000,1000} // X, Y, Z, E0...(per extruder). Maximum start speed for accelerated moves.
#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves #define DEFAULT_RETRACT_ACCELERATION {10000,10000,10000,10000} // E0... (per extruder) max acceleration in mm/s^2 for retracts
#define DEFAULT_RETRACT_ACCELERATION 2500 // X, Y, Z and E max acceleration in mm/s^2 for retracts #define DEFAULT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves
#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves #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). // 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). // The offset has to be X=0, Y=0 for the hotend 0 (default hotend).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the hotend 0.
//#define HOTEND_OFFSET_X {0.0, 5.00, 0.0, 0.0} // (in mm) for each extruder, offset of the hotend on the X axis //#define HOTEND_OFFSET_X {0.0, 5.00, 0.0, 0.0} // (in mm) for each hotend, offset of the hotend on the X axis
//#define HOTEND_OFFSET_Y {0.0, 5.00, 0.0, 0.0} // (in mm) for each extruder, offset of the hotend on the Y axis //#define HOTEND_OFFSET_Y {0.0, 5.00, 0.0, 0.0} // (in mm) for each hotend, offset of the hotend on the Y axis
// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously) // The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
#define DEFAULT_XYJERK 20 // (mm/sec) #define DEFAULT_XYJERK 20 // (mm/sec)
#define DEFAULT_ZJERK 20 // (mm/sec) #define DEFAULT_ZJERK 20 // (mm/sec)
#define DEFAULT_EJERK 5 // (mm/sec) #define DEFAULT_EJERK {5.0,5.0,5.0,5.0} // E0... (mm/sec) per extruder, max initial speed for retract moves
...@@ -97,10 +97,10 @@ ...@@ -97,10 +97,10 @@
#define E_MIN_POS 0 #define E_MIN_POS 0
//===================================================================================== //=====================================================================================
//============================= Bed Manual or Auto Leveling =========================== //================ Manual Bed Leveling (MBL) or Auto Bed Leveling =====================
//===================================================================================== //=====================================================================================
// set the rectangle in which to probe in manual or automatic // set the rectangle in which to probe in MBL or ABL
#define LEFT_PROBE_BED_POSITION 20 #define LEFT_PROBE_BED_POSITION 20
#define RIGHT_PROBE_BED_POSITION 180 #define RIGHT_PROBE_BED_POSITION 180
#define FRONT_PROBE_BED_POSITION 20 #define FRONT_PROBE_BED_POSITION 20
...@@ -112,8 +112,8 @@ ...@@ -112,8 +112,8 @@
//it is highly recommended you let this Z_SAFE_HOMING enabled!!! //it is highly recommended you let this Z_SAFE_HOMING enabled!!!
//#define Z_SAFE_HOMING //#define Z_SAFE_HOMING
#ifdef Z_SAFE_HOMING #ifdef Z_SAFE_HOMING
#define Z_SAFE_HOMING_X_POINT (X_MAX_LENGTH/2) // X point for Z homing when homing all axis (G28) or homing Z #define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2) // X point for Z homing when homing all axis (G28)
#define Z_SAFE_HOMING_Y_POINT (Y_MAX_LENGTH/2) // Y point for Z homing when homing all axis (G28) or homing Z #define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2) // Y point for Z homing when homing all axis (G28)
#endif #endif
//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (ABL) //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (ABL)
...@@ -208,23 +208,23 @@ ...@@ -208,23 +208,23 @@
#define HOMING_FEEDRATE {40*60, 40*60, 10*60, 0} // set the homing speeds (mm/min) #define HOMING_FEEDRATE {40*60, 40*60, 10*60, 0} // set the homing speeds (mm/min)
// default settings // default settings
#define DEFAULT_AXIS_STEPS_PER_UNIT {103.69,103.69,200/1.25,1000,1000,1000,1000} // X, Y, Z, E0, E1, E2, E3 #define DEFAULT_AXIS_STEPS_PER_UNIT {103.69,103.69,200/1.25,1000,1000,1000,1000} // X, Y, Z, E0...(per extruder). Default steps per unit
#define DEFAULT_MAX_FEEDRATE {300,300,4,45,45,45,45} // X, Y, Z, E0, E1, E2, E3 (mm/sec) #define DEFAULT_MAX_FEEDRATE {300,300,4,45,45,45,45} // X, Y, Z, E0...(per extruder). (mm/sec)
#define DEFAULT_MAX_ACCELERATION {5000,5000,50,5000,5000,5000,5000} // X, Y, Z, E0, E1, E2, E3 maximum start speed for accelerated moves. #define DEFAULT_MAX_ACCELERATION {5000,5000,50,5000,5000,5000,5000} // X, Y, Z, E0...(per extruder). Maximum start speed for accelerated moves.
#define DEFAULT_ACCELERATION 400 // X, Y, Z and E max acceleration in mm/s^2 for printing moves #define DEFAULT_RETRACT_ACCELERATION {10000,10000,10000,10000} // E0... (per extruder) max acceleration in mm/s^2 for retracts
#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 max acceleration in mm/s^2 for printing moves
#define DEFAULT_TRAVEL_ACCELERATION 400 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves #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). // 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). // The offset has to be X=0, Y=0 for the hotend 0 (default hotend).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the hotend 0.
//#define HOTEND_OFFSET_X {0.0, 5.00, 0.0, 0.0} // (in mm) for each extruder, offset of the hotend on the X axis //#define HOTEND_OFFSET_X {0.0, 5.00, 0.0, 0.0} // (in mm) for each hotend, offset of the hotend on the X axis
//#define HOTEND_OFFSET_Y {0.0, 5.00, 0.0, 0.0} // (in mm) for each extruder, offset of the hotend on the Y axis //#define HOTEND_OFFSET_Y {0.0, 5.00, 0.0, 0.0} // (in mm) for each hotend, offset of the hotend on the Y axis
// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously) // The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
#define DEFAULT_XYJERK 5 // (mm/sec) #define DEFAULT_XYJERK 5 // (mm/sec)
#define DEFAULT_ZJERK 0.4 // (mm/sec) #define DEFAULT_ZJERK 0.4 // (mm/sec)
#define DEFAULT_EJERK 3 // (mm/sec) #define DEFAULT_EJERK {3.0,3.0,3.0,3.0} // (mm/sec)
//=========================================================================== //===========================================================================
//=============================Additional Features=========================== //=============================Additional Features===========================
......
...@@ -4316,22 +4316,19 @@ inline void gcode_M85() { ...@@ -4316,22 +4316,19 @@ inline void gcode_M85() {
* M92: Set axis_steps_per_unit * M92: Set axis_steps_per_unit
*/ */
inline void gcode_M92() { inline void gcode_M92() {
for(int8_t i = 0; i <= Z_AXIS; i++) { if (setTargetedHotend(92)) return;
if (code_seen(axis_codes[i])) axis_steps_per_unit[i] = code_value();
}
if (code_seen('E')) { for(int8_t i = 0; i <= NUM_AXIS; i++) {
int tmp_extruder = 0; if (code_seen(axis_codes[i])) {
tmp_extruder = code_value(); if (i == E_AXIS)
float value = code_seen('S') ? code_value() : axis_steps_per_unit[E_AXIS + tmp_extruder]; axis_steps_per_unit[i + target_extruder] = code_value();
if (value < 20.0) { else
float factor = axis_steps_per_unit[E_AXIS + tmp_extruder] / value; // increase e constants if M92 E14 is given for netfab. axis_steps_per_unit[i] = code_value();
max_e_jerk *= factor;
max_feedrate[E_AXIS + tmp_extruder] *= factor;
axis_steps_per_sqr_second[E_AXIS + tmp_extruder] *= factor;
} }
axis_steps_per_unit[E_AXIS + tmp_extruder] = value;
} }
st_synchronize();
// This recalculates position in steps in case user has changed steps/unit
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
} }
/** /**
...@@ -4782,31 +4779,37 @@ inline void gcode_M201() { ...@@ -4782,31 +4779,37 @@ inline void gcode_M201() {
/** /**
* M203: Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec * M203: Set maximum feedrate that your machine can sustain in mm/sec
*
* X,Y,Z = AXIS
* T* E = E_AXIS
*
*/ */
inline void gcode_M203() { inline void gcode_M203() {
for(int8_t i = 0; i <= Z_AXIS; i++) { if (setTargetedHotend(203)) return;
if (code_seen(axis_codes[i])) max_feedrate[i] = code_value();
}
if (code_seen('E')) { for(int8_t i = 0; i < NUM_AXIS; i++) {
int tmp_extruder = 0; if (code_seen(axis_codes[i])) {
tmp_extruder = code_value(); if (i == E_AXIS)
float value = code_seen('S') ? code_value() : max_feedrate[E_AXIS + tmp_extruder]; max_feedrate[i + target_extruder] = code_value();
max_feedrate[E_AXIS + tmp_extruder] = value; else
max_feedrate[i] = code_value();
}
} }
} }
/** /**
* M204: Set Accelerations in mm/sec^2 (M204 P1200 R3000 T3000) * M204: Set Accelerations in mm/sec^2 (M204 P1200 T0 R3000 V3000)
* *
* P = Printing moves * P = Printing moves
* R = Retract only (no X, Y, Z) moves * T* R = Retract only (no X, Y, Z) moves
* T = Travel (non printing) moves * V = Travel (non printing) moves
* *
* Also sets minimum segment time in ms (B20000) to prevent buffer under-runs and M20 minimum feedrate * Also sets minimum segment time in ms (B20000) to prevent buffer under-runs and M20 minimum feedrate
*/ */
inline void gcode_M204() { inline void gcode_M204() {
if (setTargetedHotend(204)) return;
if (code_seen('S')) { // Kept for legacy compatibility. Should NOT BE USED for new developments. if (code_seen('S')) { // Kept for legacy compatibility. Should NOT BE USED for new developments.
acceleration = code_value(); acceleration = code_value();
travel_acceleration = acceleration; travel_acceleration = acceleration;
...@@ -4817,10 +4820,10 @@ inline void gcode_M204() { ...@@ -4817,10 +4820,10 @@ inline void gcode_M204() {
ECHO_LMV(DB, "Setting Print Acceleration: ", acceleration ); ECHO_LMV(DB, "Setting Print Acceleration: ", acceleration );
} }
if (code_seen('R')) { if (code_seen('R')) {
retract_acceleration = code_value(); retract_acceleration[target_extruder] = code_value();
ECHO_LMV(DB, "Setting Retract Acceleration: ", retract_acceleration ); ECHO_LMV(DB, "Setting Retract Acceleration: ", retract_acceleration[target_extruder]);
} }
if (code_seen('T')) { if (code_seen('V')) {
travel_acceleration = code_value(); travel_acceleration = code_value();
ECHO_LMV(DB, "Setting Travel Acceleration: ", travel_acceleration ); ECHO_LMV(DB, "Setting Travel Acceleration: ", travel_acceleration );
} }
...@@ -4830,19 +4833,21 @@ inline void gcode_M204() { ...@@ -4830,19 +4833,21 @@ inline void gcode_M204() {
* M205: Set Advanced Settings * M205: Set Advanced Settings
* *
* S = Min Feed Rate (mm/s) * S = Min Feed Rate (mm/s)
* T = Min Travel Feed Rate (mm/s) * V = Min Travel Feed Rate (mm/s)
* B = Min Segment Time (µs) * B = Min Segment Time (µs)
* X = Max XY Jerk (mm/s/s) * X = Max XY Jerk (mm/s/s)
* Z = Max Z Jerk (mm/s/s) * Z = Max Z Jerk (mm/s/s)
* E = Max E Jerk (mm/s/s) * E = Max E Jerk (mm/s/s)
*/ */
inline void gcode_M205() { inline void gcode_M205() {
if (setTargetedHotend(205)) return;
if (code_seen('S')) minimumfeedrate = code_value(); if (code_seen('S')) minimumfeedrate = code_value();
if (code_seen('T')) mintravelfeedrate = code_value(); if (code_seen('V')) mintravelfeedrate = code_value();
if (code_seen('B')) minsegmenttime = code_value(); if (code_seen('B')) minsegmenttime = code_value();
if (code_seen('X')) max_xy_jerk = code_value(); if (code_seen('X')) max_xy_jerk = code_value();
if (code_seen('Z')) max_z_jerk = code_value(); if (code_seen('Z')) max_z_jerk = code_value();
if (code_seen('E')) max_e_jerk = code_value(); if (code_seen('E')) max_e_jerk[target_extruder] = code_value();
} }
/** /**
...@@ -6220,7 +6225,6 @@ void process_next_command() { ...@@ -6220,7 +6225,6 @@ void process_next_command() {
case 92: // G92 case 92: // G92
gcode_G92(); break; gcode_G92(); break;
} }
code_is_good = false;
break; break;
case 'M': switch (codenum) { case 'M': switch (codenum) {
...@@ -6558,7 +6562,6 @@ void process_next_command() { ...@@ -6558,7 +6562,6 @@ void process_next_command() {
gcode_SET_Z_PROBE_OFFSET(); break; gcode_SET_Z_PROBE_OFFSET(); break;
#endif // CUSTOM_M_CODE_SET_Z_PROBE_OFFSET #endif // CUSTOM_M_CODE_SET_Z_PROBE_OFFSET
} }
code_is_good = false;
break; break;
case 'T': case 'T':
......
This diff is collapsed.
...@@ -83,12 +83,12 @@ ...@@ -83,12 +83,12 @@
#define MSG_ACC "Accel" #define MSG_ACC "Accel"
#define MSG_VXY_JERK "Vxy-jerk" #define MSG_VXY_JERK "Vxy-jerk"
#define MSG_VZ_JERK "Vz-jerk" #define MSG_VZ_JERK "Vz-jerk"
#define MSG_VE_JERK "Ve-jerk" #define MSG_VE_JERK "Ve-jerk "
#define MSG_VMAX "Vmax " #define MSG_VMAX "Vmax "
#define MSG_X "x" #define MSG_X "X"
#define MSG_Y "y" #define MSG_Y "Y"
#define MSG_Z "z" #define MSG_Z "Z"
#define MSG_E "e" #define MSG_E "E"
#define MSG_VMIN "Vmin" #define MSG_VMIN "Vmin"
#define MSG_VTRAV_MIN "VTrav min" #define MSG_VTRAV_MIN "VTrav min"
#define MSG_AMAX "Amax " #define MSG_AMAX "Amax "
...@@ -97,10 +97,10 @@ ...@@ -97,10 +97,10 @@
#define MSG_XSTEPS "X steps/mm" #define MSG_XSTEPS "X steps/mm"
#define MSG_YSTEPS "Y steps/mm" #define MSG_YSTEPS "Y steps/mm"
#define MSG_ZSTEPS "Z steps/mm" #define MSG_ZSTEPS "Z steps/mm"
#define MSG_E0STEPS "E0 steps/mm" #define MSG_E0STEPS "E0steps/mm"
#define MSG_E1STEPS "E1 steps/mm" #define MSG_E1STEPS "E1steps/mm"
#define MSG_E2STEPS "E2 steps/mm" #define MSG_E2STEPS "E2steps/mm"
#define MSG_E3STEPS "E3 steps/mm" #define MSG_E3STEPS "E3steps/mm"
#define MSG_TEMPERATURE "Temperature" #define MSG_TEMPERATURE "Temperature"
#define MSG_MOTION "Motion" #define MSG_MOTION "Motion"
#define MSG_VOLUMETRIC "Filament" #define MSG_VOLUMETRIC "Filament"
......
...@@ -83,24 +83,24 @@ ...@@ -83,24 +83,24 @@
#define MSG_ACC "Accel" #define MSG_ACC "Accel"
#define MSG_VXY_JERK "Vxy-jerk" #define MSG_VXY_JERK "Vxy-jerk"
#define MSG_VZ_JERK "Vz-jerk" #define MSG_VZ_JERK "Vz-jerk"
#define MSG_VE_JERK "Ve-jerk" #define MSG_VE_JERK "Ve-jerk "
#define MSG_VMAX "Vmax " #define MSG_VMAX "Vmax "
#define MSG_X "x" #define MSG_X "X"
#define MSG_Y "y" #define MSG_Y "Y"
#define MSG_Z "z" #define MSG_Z "Z"
#define MSG_E "e" #define MSG_E "E"
#define MSG_VMIN "Vmin" #define MSG_VMIN "Vmin"
#define MSG_VTRAV_MIN "VTrav min" #define MSG_VTRAV_MIN "VTrav min"
#define MSG_AMAX "Amax " #define MSG_AMAX "Amax "
#define MSG_A_RETRACT "A-retract" #define MSG_A_RETRACT "A-retract "
#define MSG_A_TRAVEL "A-travel" #define MSG_A_TRAVEL "A-travel"
#define MSG_XSTEPS "X steps/mm" #define MSG_XSTEPS "X steps/mm"
#define MSG_YSTEPS "Y steps/mm" #define MSG_YSTEPS "Y steps/mm"
#define MSG_ZSTEPS "Z steps/mm" #define MSG_ZSTEPS "Z steps/mm"
#define MSG_E0STEPS "E0 steps/mm" #define MSG_E0STEPS "E0steps/mm"
#define MSG_E1STEPS "E1 steps/mm" #define MSG_E1STEPS "E1steps/mm"
#define MSG_E2STEPS "E2 steps/mm" #define MSG_E2STEPS "E2steps/mm"
#define MSG_E3STEPS "E3 steps/mm" #define MSG_E3STEPS "E3steps/mm"
#define MSG_TEMPERATURE "Temperatura" #define MSG_TEMPERATURE "Temperatura"
#define MSG_MOTION "Movimento" #define MSG_MOTION "Movimento"
#define MSG_VOLUMETRIC "Filamento" #define MSG_VOLUMETRIC "Filamento"
......
...@@ -64,12 +64,12 @@ float max_feedrate[3 + EXTRUDERS]; // Max speeds in mm per minute ...@@ -64,12 +64,12 @@ float max_feedrate[3 + EXTRUDERS]; // Max speeds in mm per minute
float axis_steps_per_unit[3 + EXTRUDERS]; float axis_steps_per_unit[3 + EXTRUDERS];
unsigned long max_acceleration_units_per_sq_second[3 + EXTRUDERS]; // Use M201 to override by software unsigned long max_acceleration_units_per_sq_second[3 + EXTRUDERS]; // Use M201 to override by software
float minimumfeedrate; float minimumfeedrate;
float acceleration; // Normal acceleration mm/s^2 DEFAULT ACCELERATION for all printing moves. M204 SXXXX float acceleration; // Normal acceleration mm/s^2 DEFAULT ACCELERATION for all printing moves. M204 SXXXX
float retract_acceleration; // Retract acceleration mm/s^2 filament pull-back and push-forward while standing still in the other axes M204 TXXXX float retract_acceleration[EXTRUDERS]; // mm/s^2 filament pull-back and push-forward while standing still in the other axes M204 TXXXX
float travel_acceleration; // Travel acceleration mm/s^2 DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX float travel_acceleration; // Travel acceleration mm/s^2 DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX
float max_xy_jerk; // The largest speed change requiring no acceleration float max_xy_jerk; // The largest speed change requiring no acceleration
float max_z_jerk; float max_z_jerk;
float max_e_jerk; float max_e_jerk[EXTRUDERS]; // mm/s - initial speed for extruder retract moves
float mintravelfeedrate; float mintravelfeedrate;
unsigned long axis_steps_per_sqr_second[3 + EXTRUDERS]; unsigned long axis_steps_per_sqr_second[3 + EXTRUDERS];
...@@ -879,7 +879,7 @@ float junction_deviation = 0.1; ...@@ -879,7 +879,7 @@ float junction_deviation = 0.1;
float steps_per_mm = block->step_event_count / block->millimeters; float steps_per_mm = block->step_event_count / block->millimeters;
long bsx = block->steps[X_AXIS], bsy = block->steps[Y_AXIS], bsz = block->steps[Z_AXIS], bse = block->steps[E_AXIS]; long bsx = block->steps[X_AXIS], bsy = block->steps[Y_AXIS], bsz = block->steps[Z_AXIS], bse = block->steps[E_AXIS];
if (bsx == 0 && bsy == 0 && bsz == 0) { if (bsx == 0 && bsy == 0 && bsz == 0) {
block->acceleration_st = ceil(retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 block->acceleration_st = ceil(retract_acceleration[extruder] * steps_per_mm); // convert to: acceleration steps/sec^2
} }
else if (bse == 0) { else if (bse == 0) {
block->acceleration_st = ceil(travel_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 block->acceleration_st = ceil(travel_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2
...@@ -951,7 +951,7 @@ float junction_deviation = 0.1; ...@@ -951,7 +951,7 @@ float junction_deviation = 0.1;
// Start with a safe speed // Start with a safe speed
float vmax_junction = max_xy_jerk / 2; float vmax_junction = max_xy_jerk / 2;
float vmax_junction_factor = 1.0; float vmax_junction_factor = 1.0;
float mz2 = max_z_jerk / 2, me2 = max_e_jerk / 2; float mz2 = max_z_jerk / 2, me2 = max_e_jerk[extruder] / 2;
float csz = current_speed[Z_AXIS], cse = current_speed[E_AXIS]; float csz = current_speed[Z_AXIS], cse = current_speed[E_AXIS];
if (fabs(csz) > mz2) vmax_junction = min(vmax_junction, mz2); if (fabs(csz) > mz2) vmax_junction = min(vmax_junction, mz2);
if (fabs(cse) > me2) vmax_junction = min(vmax_junction, me2); if (fabs(cse) > me2) vmax_junction = min(vmax_junction, me2);
...@@ -970,7 +970,7 @@ float junction_deviation = 0.1; ...@@ -970,7 +970,7 @@ float junction_deviation = 0.1;
// } // }
if (jerk > max_xy_jerk) vmax_junction_factor = max_xy_jerk / jerk; if (jerk > max_xy_jerk) vmax_junction_factor = max_xy_jerk / jerk;
if (dz > max_z_jerk) vmax_junction_factor = min(vmax_junction_factor, max_z_jerk / dz); if (dz > max_z_jerk) vmax_junction_factor = min(vmax_junction_factor, max_z_jerk / dz);
if (de > max_e_jerk) vmax_junction_factor = min(vmax_junction_factor, max_e_jerk / de); if (de > max_e_jerk[extruder]) vmax_junction_factor = min(vmax_junction_factor, max_e_jerk[extruder] / de);
vmax_junction = min(previous_nominal_speed, vmax_junction * vmax_junction_factor); // Limit speed to max previous speed vmax_junction = min(previous_nominal_speed, vmax_junction * vmax_junction_factor); // Limit speed to max previous speed
} }
...@@ -1059,7 +1059,7 @@ float junction_deviation = 0.1; ...@@ -1059,7 +1059,7 @@ float junction_deviation = 0.1;
st_set_position(nx, ny, nz, ne); st_set_position(nx, ny, nz, ne);
previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest. previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest.
for (int i=0; i<NUM_AXIS; i++) previous_speed[i] = 0.0; for (int i=0; i < NUM_AXIS; i++) previous_speed[i] = 0.0;
} }
void plan_set_e_position(const float &e) { void plan_set_e_position(const float &e) {
......
...@@ -124,11 +124,11 @@ extern float axis_steps_per_unit[3 + EXTRUDERS]; ...@@ -124,11 +124,11 @@ extern float axis_steps_per_unit[3 + EXTRUDERS];
extern unsigned long max_acceleration_units_per_sq_second[3 + EXTRUDERS]; // Use M201 to override by software extern unsigned long max_acceleration_units_per_sq_second[3 + EXTRUDERS]; // Use M201 to override by software
extern float minimumfeedrate; extern float minimumfeedrate;
extern float acceleration; // Normal acceleration mm/s^2 THIS IS THE DEFAULT ACCELERATION for all moves. M204 SXXXX 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 retract_acceleration[EXTRUDERS]; // 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 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_xy_jerk; //speed than can be stopped at once, if i understand correctly.
extern float max_z_jerk; extern float max_z_jerk;
extern float max_e_jerk; extern float max_e_jerk[EXTRUDERS]; // mm/s - initial speed for extruder retract moves
extern float mintravelfeedrate; extern float mintravelfeedrate;
extern unsigned long axis_steps_per_sqr_second[3 + EXTRUDERS]; extern unsigned long axis_steps_per_sqr_second[3 + EXTRUDERS];
......
...@@ -1178,32 +1178,47 @@ static void lcd_control_motion_menu() { ...@@ -1178,32 +1178,47 @@ static void lcd_control_motion_menu() {
MENU_ITEM_EDIT(float5, MSG_ACC, &acceleration, 10, 99000); MENU_ITEM_EDIT(float5, MSG_ACC, &acceleration, 10, 99000);
MENU_ITEM_EDIT(float3, MSG_VXY_JERK, &max_xy_jerk, 1, 990); MENU_ITEM_EDIT(float3, MSG_VXY_JERK, &max_xy_jerk, 1, 990);
MENU_ITEM_EDIT(float52, MSG_VZ_JERK, &max_z_jerk, 0.1, 990); MENU_ITEM_EDIT(float52, MSG_VZ_JERK, &max_z_jerk, 0.1, 990);
MENU_ITEM_EDIT(float3, MSG_VE_JERK, &max_e_jerk, 1, 990);
MENU_ITEM_EDIT(float3, MSG_VMAX MSG_X, &max_feedrate[X_AXIS], 1, 999); MENU_ITEM_EDIT(float3, MSG_VMAX MSG_X, &max_feedrate[X_AXIS], 1, 999);
MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Y, &max_feedrate[Y_AXIS], 1, 999); MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Y, &max_feedrate[Y_AXIS], 1, 999);
MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Z, &max_feedrate[Z_AXIS], 1, 999); MENU_ITEM_EDIT(float3, MSG_VMAX MSG_Z, &max_feedrate[Z_AXIS], 1, 999);
MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E, &max_feedrate[E_AXIS], 1, 999);
MENU_ITEM_EDIT(float3, MSG_VMIN, &minimumfeedrate, 0, 999); MENU_ITEM_EDIT(float3, MSG_VMIN, &minimumfeedrate, 0, 999);
MENU_ITEM_EDIT(float3, MSG_VTRAV_MIN, &mintravelfeedrate, 0, 999); MENU_ITEM_EDIT(float3, MSG_VTRAV_MIN, &mintravelfeedrate, 0, 999);
MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_X, &max_acceleration_units_per_sq_second[X_AXIS], 100, 99000, reset_acceleration_rates); MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_X, &max_acceleration_units_per_sq_second[X_AXIS], 100, 99000, reset_acceleration_rates);
MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Y, &max_acceleration_units_per_sq_second[Y_AXIS], 100, 99000, reset_acceleration_rates); MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Y, &max_acceleration_units_per_sq_second[Y_AXIS], 100, 99000, reset_acceleration_rates);
MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &max_acceleration_units_per_sq_second[Z_AXIS], 10, 99000, reset_acceleration_rates); MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &max_acceleration_units_per_sq_second[Z_AXIS], 10, 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(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_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(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); MENU_ITEM_EDIT(float51, MSG_ZSTEPS, &axis_steps_per_unit[Z_AXIS], 5, 9999);
MENU_ITEM_EDIT(float51, MSG_E0STEPS, &axis_steps_per_unit[E_AXIS+0], 5, 9999); #if EXTRUDERS > 0
#if EXTRUDERS > 1 MENU_ITEM_EDIT(float3, MSG_VE_JERK MSG_E "0", &max_e_jerk[0], 1, 990);
MENU_ITEM_EDIT(float51, MSG_E1STEPS, &axis_steps_per_unit[E_AXIS+1], 5, 9999); MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E "0", &max_feedrate[E_AXIS], 1, 999);
#endif MENU_ITEM_EDIT(long5, MSG_AMAX MSG_E "0", &max_acceleration_units_per_sq_second[E_AXIS], 100, 99000);
#if EXTRUDERS > 2 MENU_ITEM_EDIT(float5, MSG_A_RETRACT MSG_E "0", &retract_acceleration[0], 100, 99000);
MENU_ITEM_EDIT(float51, MSG_E2STEPS, &axis_steps_per_unit[E_AXIS+2], 5, 9999); MENU_ITEM_EDIT(float51, MSG_E0STEPS, &axis_steps_per_unit[E_AXIS], 5, 9999);
#endif #if EXTRUDERS > 1
#if EXTRUDERS > 3 MENU_ITEM_EDIT(float3, MSG_VE_JERK MSG_E "1", &max_e_jerk[1], 1, 990);
MENU_ITEM_EDIT(float51, MSG_E3STEPS, &axis_steps_per_unit[E_AXIS+3], 5, 9999); MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E "1", &max_feedrate[E_AXIS + 1], 1, 999);
#endif MENU_ITEM_EDIT(long5, MSG_AMAX MSG_E "1", &max_acceleration_units_per_sq_second[E_AXIS + 1], 100, 99000);
MENU_ITEM_EDIT(float5, MSG_A_RETRACT MSG_E "1", &retract_acceleration[1], 100, 99000);
MENU_ITEM_EDIT(float51, MSG_E1STEPS, &axis_steps_per_unit[E_AXIS + 1], 5, 9999);
#if EXTRUDERS > 2
MENU_ITEM_EDIT(float3, MSG_VE_JERK MSG_E "2", &max_e_jerk[2], 1, 990);
MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E "2", &max_feedrate[E_AXIS + 2], 1, 999);
MENU_ITEM_EDIT(long5, MSG_AMAX MSG_E "2", &max_acceleration_units_per_sq_second[E_AXIS + 2], 100, 99000);
MENU_ITEM_EDIT(float5, MSG_A_RETRACT MSG_E "2", &retract_acceleration[2], 100, 99000);
MENU_ITEM_EDIT(float51, MSG_E2STEPS, &axis_steps_per_unit[E_AXIS + 2], 5, 9999);
#if EXTRUDERS > 3
MENU_ITEM_EDIT(float3, MSG_VE_JERK MSG_E "3", &max_e_jerk[3], 1, 990);
MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E "3", &max_feedrate[E_AXIS + 3], 1, 999);
MENU_ITEM_EDIT(long5, MSG_AMAX MSG_E "3", &max_acceleration_units_per_sq_second[E_AXIS + 3], 100, 99000);
MENU_ITEM_EDIT(float5, MSG_A_RETRACT MSG_E "3", &retract_acceleration[3], 100, 99000);
MENU_ITEM_EDIT(float51, MSG_E3STEPS, &axis_steps_per_unit[E_AXIS + 3], 5, 9999);
#endif // EXTRUDERS > 3
#endif // EXTRUDERS > 2
#endif // EXTRUDERS > 1
#endif // EXTRUDERS > 0
#ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &abort_on_endstop_hit); MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &abort_on_endstop_hit);
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment