From d23d9f4c290d649c44d6f003440cc552c652b349 Mon Sep 17 00:00:00 2001 From: Tom Brazier Date: Sun, 19 Jun 2022 14:49:28 +0100 Subject: [PATCH] Just do it! --- Marlin/Configuration_adv.h | 3 --- Marlin/src/gcode/motion/G2_G3.cpp | 4 +--- Marlin/src/module/planner.cpp | 31 +++++++++++++------------------ Marlin/src/module/planner.h | 9 ++++----- 4 files changed, 18 insertions(+), 29 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 8396257bb0bf2..96a3e04d0b779 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -2193,9 +2193,6 @@ #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles //#define SF_ARC_FIX // Enable only if using SkeinForge with "Arc Point" fillet procedure - #if HAS_JUNCTION_DEVIATION - #define ARC_ASSISTED_JD // Pass the arc radius to the junction deviation code to save processor cycles - #endif #endif // G5 Bézier Curve Support with XYZE destination and IJPQ offsets diff --git a/Marlin/src/gcode/motion/G2_G3.cpp b/Marlin/src/gcode/motion/G2_G3.cpp index aaf69a5e6b206..9369aba7eecf3 100644 --- a/Marlin/src/gcode/motion/G2_G3.cpp +++ b/Marlin/src/gcode/motion/G2_G3.cpp @@ -346,9 +346,7 @@ void plan_arc( #endif if (!planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, 0 - OPTARG(SCARA_FEEDRATE_SCALING, inv_duration) - OPTARG(ARC_ASSISTED_JD, i > 1 ? radius : 0.0) - )) + OPTARG(SCARA_FEEDRATE_SCALING, inv_duration), i > 1 ? radius : 0.0)) break; } } diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 5bd0af9da324c..e0b61149fcc15 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1783,7 +1783,7 @@ bool Planner::_buffer_steps(const xyze_long_t &target OPTARG(HAS_POSITION_FLOAT, const xyze_pos_t &target_float) OPTARG(HAS_DIST_MM_ARG, const xyze_float_t &cart_dist_mm) , feedRate_t fr_mm_s, const uint8_t extruder, const_float_t millimeters - OPTARG(ARC_ASSISTED_JD, const_float_t arc_radius/*=0.0*/) + , const_float_t arc_radius/*=0.0*/ ) { // Wait for the next available block @@ -1799,8 +1799,7 @@ bool Planner::_buffer_steps(const xyze_long_t &target if (!_populate_block(block, false, target OPTARG(HAS_POSITION_FLOAT, target_float) OPTARG(HAS_DIST_MM_ARG, cart_dist_mm) - , fr_mm_s, extruder, millimeters - OPTARG(ARC_ASSISTED_JD, arc_radius) + , fr_mm_s, extruder, millimeters, arc_radius )) { // Movement was not queued, probably because it was too short. // Simply accept that as movement queued and done @@ -1843,7 +1842,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, OPTARG(HAS_POSITION_FLOAT, const xyze_pos_t &target_float) OPTARG(HAS_DIST_MM_ARG, const xyze_float_t &cart_dist_mm) , feedRate_t fr_mm_s, const uint8_t extruder, const_float_t millimeters/*=0.0*/ - OPTARG(ARC_ASSISTED_JD, const_float_t arc_radius/*=0.0*/) + , const_float_t arc_radius/*=0.0*/ ) { int32_t LOGICAL_AXIS_LIST( de = target.e - position.e, @@ -2655,11 +2654,9 @@ bool Planner::_populate_block(block_t * const block, bool split_move, normalize_junction_vector(junction_unit_vec); const float junction_acceleration = limit_value_by_axis_maximum(block->acceleration, junction_unit_vec); - #if ENABLED(ARC_ASSISTED_JD) - if (arc_radius > 0.0) - vmax_junction_sqr = junction_acceleration * arc_radius; - else - #endif + if (arc_radius > 0.0) + vmax_junction_sqr = junction_acceleration * arc_radius; + else { NOLESS(junction_cos_theta, -0.999999f); // Check for numerical round-off to avoid divide by zero. @@ -2973,8 +2970,8 @@ void Planner::buffer_sync_block(TERN_(LASER_SYNCHRONOUS_M106_M107, uint8_t sync_ */ bool Planner::buffer_segment(const abce_pos_t &abce OPTARG(HAS_DIST_MM_ARG, const xyze_float_t &cart_dist_mm) - , const_feedRate_t fr_mm_s, const uint8_t extruder/*=active_extruder*/, const_float_t millimeters/*=0.0*/ - OPTARG(ARC_ASSISTED_JD, const_float_t arc_radius/*=0.0*/) + , const_feedRate_t fr_mm_s, const uint8_t extruder/*=active_extruder*/ + , const_float_t millimeters/*=0.0*/, const_float_t arc_radius/*=0.0*/ ) { // If we are cleaning, do not accept queuing of movements @@ -3080,9 +3077,8 @@ bool Planner::buffer_segment(const abce_pos_t &abce if (!_buffer_steps(target OPTARG(HAS_POSITION_FLOAT, target_float) OPTARG(HAS_DIST_MM_ARG, cart_dist_mm) - , fr_mm_s, extruder, millimeters - OPTARG(ARC_ASSISTED_JD, arc_radius) - )) return false; + , fr_mm_s, extruder, millimeters, arc_radius) + ) return false; stepper.wake_up(); return true; @@ -3100,8 +3096,7 @@ bool Planner::buffer_segment(const abce_pos_t &abce * inv_duration - the reciprocal if the duration of the movement, if known (kinematic only if feeedrate scaling is enabled) */ bool Planner::buffer_line(const xyze_pos_t &cart, const_feedRate_t fr_mm_s, const uint8_t extruder/*=active_extruder*/, const float millimeters/*=0.0*/ - OPTARG(SCARA_FEEDRATE_SCALING, const_float_t inv_duration/*=0.0*/) - OPTARG(ARC_ASSISTED_JD, const_float_t arc_radius/*=0.0*/) + OPTARG(SCARA_FEEDRATE_SCALING, const_float_t inv_duration/*=0.0*/), const_float_t arc_radius/*=0.0*/ ) { xyze_pos_t machine = cart; TERN_(HAS_POSITION_MODIFIERS, apply_modifiers(machine)); @@ -3138,13 +3133,13 @@ bool Planner::buffer_line(const xyze_pos_t &cart, const_feedRate_t fr_mm_s, cons const feedRate_t feedrate = fr_mm_s; #endif TERN_(HAS_EXTRUDERS, delta.e = machine.e); - if (buffer_segment(delta OPTARG(HAS_DIST_MM_ARG, cart_dist_mm), feedrate, extruder, mm OPTARG(ARC_ASSISTED_JD, arc_radius))) { + if (buffer_segment(delta OPTARG(HAS_DIST_MM_ARG, cart_dist_mm), feedrate, extruder, mm, arc_radius)) { position_cart = cart; return true; } return false; #else - return buffer_segment(machine, fr_mm_s, extruder, millimeters OPTARG(ARC_ASSISTED_JD, arc_radius)); + return buffer_segment(machine, fr_mm_s, extruder, millimeters, arc_radius); #endif } // buffer_line() diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index ac413f1c4e424..f6af3166931a8 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -733,7 +733,7 @@ class Planner { OPTARG(HAS_POSITION_FLOAT, const xyze_pos_t &target_float) OPTARG(HAS_DIST_MM_ARG, const xyze_float_t &cart_dist_mm) , feedRate_t fr_mm_s, const uint8_t extruder, const_float_t millimeters=0.0 - OPTARG(ARC_ASSISTED_JD, const_float_t arc_radius=0.0) + , const_float_t arc_radius=0.0 ); /** @@ -752,7 +752,7 @@ class Planner { OPTARG(HAS_POSITION_FLOAT, const xyze_pos_t &target_float) OPTARG(HAS_DIST_MM_ARG, const xyze_float_t &cart_dist_mm) , feedRate_t fr_mm_s, const uint8_t extruder, const_float_t millimeters=0.0 - OPTARG(ARC_ASSISTED_JD, const_float_t arc_radius=0.0) + , const_float_t arc_radius=0.0 ); /** @@ -786,7 +786,7 @@ class Planner { static bool buffer_segment(const abce_pos_t &abce OPTARG(HAS_DIST_MM_ARG, const xyze_float_t &cart_dist_mm) , const_feedRate_t fr_mm_s, const uint8_t extruder=active_extruder, const_float_t millimeters=0.0 - OPTARG(ARC_ASSISTED_JD, const_float_t arc_radius=0.0) + , const_float_t arc_radius=0.0 ); public: @@ -803,8 +803,7 @@ class Planner { * inv_duration - the reciprocal if the duration of the movement, if known (kinematic only if feeedrate scaling is enabled) */ static bool buffer_line(const xyze_pos_t &cart, const_feedRate_t fr_mm_s, const uint8_t extruder=active_extruder, const float millimeters=0.0 - OPTARG(SCARA_FEEDRATE_SCALING, const_float_t inv_duration=0.0) - OPTARG(ARC_ASSISTED_JD, const_float_t arc_radius=0.0) + OPTARG(SCARA_FEEDRATE_SCALING, const_float_t inv_duration=0.0), const_float_t arc_radius=0.0 ); #if ENABLED(DIRECT_STEPPING)