diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 528d1f37eb7c0de69e60a5837a23dfb15f305f93..682f45fdfa514392e89400b5ba3f06749366889d 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -530,7 +530,8 @@ // Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. //#define BEZIER_CURVE_SUPPORT -const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// Moves with fewer segments than this will be ignored and joined with the next movement +#define MIN_SEGMENTS_FOR_MOVE 6 // @section temperature diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 228486ee87dc405eb2d7020e79994b1d93a7669d..2aa6341828f6b3dc923e0edc20861b2a60ce4abe 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -133,6 +133,8 @@ #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_PROBE_DEPLOY_HEIGHT instead." #elif defined(Z_RAISE_PROBE_DEPLOY_STOW) || defined(Z_RAISE_BETWEEN_PROBINGS) #error "Z_RAISE_PROBE_DEPLOY_STOW and Z_RAISE_BETWEEN_PROBINGS are now Z_PROBE_DEPLOY_HEIGHT and Z_PROBE_TRAVEL_HEIGHT Please update your configuration." +#elif !defined(MIN_SEGMENTS_FOR_MOVE) + #error "\"dropsegments\" is replaced with MIN_SEGMENTS_FOR_MOVE (and increases by 1). Please update Configuration_adv.h." #endif /** diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index 3f1287e1190685eee282fab6cf7d2a811b4d57f2..e33b05a6ee2ed213ca75b99aa8463cbf41ca4eba 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -530,7 +530,8 @@ // Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. //#define BEZIER_CURVE_SUPPORT -const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// Moves with fewer segments than this will be ignored and joined with the next movement +#define MIN_SEGMENTS_FOR_MOVE 6 // @section temperature diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index d87f8a39e40d91bdc1eb5c5f00cc4bb2ccc74c0f..72fc5b9e4694c7b0bcce21a7c96ce80b6034bccc 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -530,7 +530,8 @@ // Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. //#define BEZIER_CURVE_SUPPORT -const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// Moves with fewer segments than this will be ignored and joined with the next movement +#define MIN_SEGMENTS_FOR_MOVE 6 // @section temperature diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index 452f5da815e73417fafe74a865ab632d55d7798e..bed4a8b9b36db23d4907bf8efc45381f9453bab6 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -530,7 +530,8 @@ // Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. //#define BEZIER_CURVE_SUPPORT -const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// Moves with fewer segments than this will be ignored and joined with the next movement +#define MIN_SEGMENTS_FOR_MOVE 6 // @section temperature diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index 9ee0941d5de9b9091991d31f6eff05c3107efd86..199978be2e6190ec123e0a5464c0b08acb65b823 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -530,7 +530,8 @@ // Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. //#define BEZIER_CURVE_SUPPORT -const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// Moves with fewer segments than this will be ignored and joined with the next movement +#define MIN_SEGMENTS_FOR_MOVE 6 // @section temperature diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index bf764d0f9eeef70225d200779b8bb1a3b4aad64c..34578bd29b2925b36160cd02b47741ed179cde55 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -536,7 +536,8 @@ // Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. //#define BEZIER_CURVE_SUPPORT -const unsigned int dropsegments = 2; //everything with less than this number of steps will be ignored as move and joined with the next movement +// Moves with fewer segments than this will be ignored and joined with the next movement +#define MIN_SEGMENTS_FOR_MOVE 3 // @section temperature diff --git a/Marlin/example_configurations/K8400/Configuration_adv.h b/Marlin/example_configurations/K8400/Configuration_adv.h index b5933588f4cb645b2aa3f01a7d7cdf269066e752..35d48efcec9ce782f03c1b0f2bdb85b7c0f5825d 100644 --- a/Marlin/example_configurations/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/K8400/Configuration_adv.h @@ -530,7 +530,8 @@ // Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. //#define BEZIER_CURVE_SUPPORT -const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// Moves with fewer segments than this will be ignored and joined with the next movement +#define MIN_SEGMENTS_FOR_MOVE 6 // @section temperature diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index f8c8008dfefd54931fb4ad4b1a602d7d2c48886a..439c1d6eca0ebd068bbf62fa086c49531e0fd235 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -530,7 +530,8 @@ // Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. //#define BEZIER_CURVE_SUPPORT -const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// Moves with fewer segments than this will be ignored and joined with the next movement +#define MIN_SEGMENTS_FOR_MOVE 6 // @section temperature diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 3da8d5658792468aac5c60b18ee3849944caaa13..f81d34750d83ee291b1332270366ce89070c6d27 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -530,7 +530,8 @@ // Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. //#define BEZIER_CURVE_SUPPORT -const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// Moves with fewer segments than this will be ignored and joined with the next movement +#define MIN_SEGMENTS_FOR_MOVE 6 // @section temperature diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index 224de641538aada872a516a6114e3c4f2e528930..57bae4d87f7f2105e2ab6a1c9c1cc19113207375 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -538,7 +538,8 @@ // Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. //#define BEZIER_CURVE_SUPPORT -const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// Moves with fewer segments than this will be ignored and joined with the next movement +#define MIN_SEGMENTS_FOR_MOVE 6 // @section temperature diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index 452f5da815e73417fafe74a865ab632d55d7798e..bed4a8b9b36db23d4907bf8efc45381f9453bab6 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -530,7 +530,8 @@ // Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. //#define BEZIER_CURVE_SUPPORT -const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// Moves with fewer segments than this will be ignored and joined with the next movement +#define MIN_SEGMENTS_FOR_MOVE 6 // @section temperature diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index 61a4a3f2fb5c33687c279505052a40ee417e036a..ff0ef5c9855d0631977d128a97f402b64856c0f8 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -532,7 +532,8 @@ // Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. //#define BEZIER_CURVE_SUPPORT -const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// Moves with fewer segments than this will be ignored and joined with the next movement +#define MIN_SEGMENTS_FOR_MOVE 6 // @section temperature diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index bbf712aab0c1ddb1ab38413a4b0545e7f00fad6a..9ad068722e725bfcb3967013ed3f6ce53b96fedf 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -532,7 +532,8 @@ // Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. //#define BEZIER_CURVE_SUPPORT -const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// Moves with fewer segments than this will be ignored and joined with the next movement +#define MIN_SEGMENTS_FOR_MOVE 6 // @section temperature diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index cc51dc087510255b1336cd6a59c10067f7066c27..374d39c8dded383fe9506083201dec3e636b3b45 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -531,7 +531,8 @@ // Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. //#define BEZIER_CURVE_SUPPORT -const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// Moves with fewer segments than this will be ignored and joined with the next movement +#define MIN_SEGMENTS_FOR_MOVE 6 // @section temperature diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index 263245cac3af29a70313c0677c6509fde3db62b7..616639f2c807e06d3a9dced2125a41d238d75ec1 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -536,7 +536,8 @@ // Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. //#define BEZIER_CURVE_SUPPORT -const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// Moves with fewer segments than this will be ignored and joined with the next movement +#define MIN_SEGMENTS_FOR_MOVE 6 // @section temperature diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index a4b6743f47dd2358671f1adf91fc15ce3b2b3419..e1b66ca5aecbfa4b301f762ef2f0178eb1e747ec 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -532,7 +532,8 @@ // Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. //#define BEZIER_CURVE_SUPPORT -const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// Moves with fewer segments than this will be ignored and joined with the next movement +#define MIN_SEGMENTS_FOR_MOVE 6 // @section temperature diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 2d5e625233b34b36cee0b5457a976a00c3a0e2ce..4c3a3e11bcb65e5e422ef0304d0abcad8a5d44af 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -530,7 +530,8 @@ // Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. //#define BEZIER_CURVE_SUPPORT -const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// Moves with fewer segments than this will be ignored and joined with the next movement +#define MIN_SEGMENTS_FOR_MOVE 6 // @section temperature diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index b3ee0a40571258d7364f204a2a236d81b616372a..a7b04097b05b4e78f6d9503fc27d503b2f4bf6ff 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -530,7 +530,8 @@ // Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. //#define BEZIER_CURVE_SUPPORT -const unsigned int dropsegments = 5; //everything with less than this number of steps will be ignored as move and joined with the next movement +// Moves with fewer segments than this will be ignored and joined with the next movement +#define MIN_SEGMENTS_FOR_MOVE 6 // @section temperature diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 7b0f09914b6916e9efc457f44e77dfc00fa7e85a..a25715d8e17ff3c34bbf35ea29c6d85fc98d10d2 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -626,7 +626,7 @@ void Planner::check_axes_activity() { block->step_event_count = MAX4(block->steps[X_AXIS], block->steps[Y_AXIS], block->steps[Z_AXIS], block->steps[E_AXIS]); // Bail if this is a zero-length block - if (block->step_event_count <= dropsegments) return; + if (block->step_event_count < MIN_SEGMENTS_FOR_MOVE) return; // For a mixing extruder, get a magnified step_event_count for each #if ENABLED(MIXING_EXTRUDER) @@ -808,7 +808,7 @@ void Planner::check_axes_activity() { #endif delta_mm[E_AXIS] = 0.01 * (de * steps_to_mm[E_AXIS]) * volumetric_multiplier[extruder] * flow_percentage[extruder]; - if (block->steps[X_AXIS] <= dropsegments && block->steps[Y_AXIS] <= dropsegments && block->steps[Z_AXIS] <= dropsegments) { + if (block->steps[X_AXIS] < MIN_SEGMENTS_FOR_MOVE && block->steps[Y_AXIS] < MIN_SEGMENTS_FOR_MOVE && block->steps[Z_AXIS] < MIN_SEGMENTS_FOR_MOVE) { block->millimeters = fabs(delta_mm[E_AXIS]); } else {