diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 528d1f37e..682f45fdf 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 228486ee8..2aa634182 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 3f1287e11..e33b05a6e 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 d87f8a39e..72fc5b9e4 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 452f5da81..bed4a8b9b 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 9ee0941d5..199978be2 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 bf764d0f9..34578bd29 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 b5933588f..35d48efce 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 f8c8008df..439c1d6ec 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 3da8d5658..f81d34750 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 224de6415..57bae4d87 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 452f5da81..bed4a8b9b 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 61a4a3f2f..ff0ef5c98 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 bbf712aab..9ad068722 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 cc51dc087..374d39c8d 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 263245cac..616639f2c 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 a4b6743f4..e1b66ca5a 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 2d5e62523..4c3a3e11b 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 b3ee0a405..a7b04097b 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 7b0f09914..a25715d8e 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 {