Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CJ-JD Leftover Code Cleanup #20639

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -945,11 +945,9 @@
#endif

// This flag indicates some kind of jerk storage is needed
#if EITHER(CLASSIC_JERK, IS_KINEMATIC)
#if ENABLED(CLASSIC_JERK)
#define HAS_CLASSIC_JERK 1
#endif

#if DISABLED(CLASSIC_JERK)
#else
#define HAS_JUNCTION_DEVIATION 1
#endif

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
/**
* Junction deviation is incompatible with kinematic systems.
*/
#if HAS_JUNCTION_DEVIATION && IS_KINEMATIC
#if BOTH(HAS_JUNCTION_DEVIATION, IS_KINEMATIC)
#error "CLASSIC_JERK is required for DELTA and SCARA."
#endif

Expand Down
8 changes: 0 additions & 8 deletions Marlin/src/lcd/menu/menu_advanced.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,14 +442,6 @@ void menu_backlash();
START_MENU();
BACK_ITEM(MSG_ADVANCED_SETTINGS);

#if HAS_JUNCTION_DEVIATION
#if ENABLED(LIN_ADVANCE)
EDIT_ITEM(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.001f, 0.3f, planner.recalculate_max_e_jerk);
#else
EDIT_ITEM(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.001f, 0.5f);
#endif
#endif

constexpr xyze_float_t max_jerk_edit =
#ifdef MAX_JERK_EDIT_VALUES
MAX_JERK_EDIT_VALUES
Expand Down
11 changes: 1 addition & 10 deletions Marlin/src/module/motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1341,18 +1341,9 @@ void do_homing_move(const AxisEnum axis, const float distance, const feedRate_t
target[axis] = 0; // Set the single homing axis to 0
planner.set_machine_position_mm(target); // Update the machine position

#if HAS_DIST_MM_ARG
const xyze_float_t cart_dist_mm{0};
#endif

// Set delta/cartesian axes directly
target[axis] = distance; // The move will be towards the endstop
planner.buffer_segment(target
#if HAS_DIST_MM_ARG
, cart_dist_mm
#endif
, home_fr_mm_s, active_extruder
);
planner.buffer_segment(target, home_fr_mm_s, active_extruder);
#endif

planner.synchronize();
Expand Down
45 changes: 4 additions & 41 deletions Marlin/src/module/planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1684,9 +1684,6 @@ bool Planner::_buffer_steps(const xyze_long_t &target
#if HAS_POSITION_FLOAT
, const xyze_pos_t &target_float
#endif
#if HAS_DIST_MM_ARG
, const xyze_float_t &cart_dist_mm
#endif
, feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters
) {

Expand All @@ -1702,9 +1699,6 @@ bool Planner::_buffer_steps(const xyze_long_t &target
#if HAS_POSITION_FLOAT
, target_float
#endif
#if HAS_DIST_MM_ARG
, cart_dist_mm
#endif
, fr_mm_s, extruder, millimeters
)) {
// Movement was not queued, probably because it was too short.
Expand Down Expand Up @@ -1748,9 +1742,6 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
#if HAS_POSITION_FLOAT
, const xyze_pos_t &target_float
#endif
#if HAS_DIST_MM_ARG
, const xyze_float_t &cart_dist_mm
#endif
, feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/
) {

Expand Down Expand Up @@ -2348,13 +2339,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
// Unit vector of previous path line segment
static xyze_float_t prev_unit_vec;

xyze_float_t unit_vec =
#if HAS_DIST_MM_ARG
cart_dist_mm
#else
{ steps_dist_mm.x, steps_dist_mm.y, steps_dist_mm.z, steps_dist_mm.e }
#endif
;
xyze_float_t unit_vec = { steps_dist_mm.x, steps_dist_mm.y, steps_dist_mm.z, steps_dist_mm.e };

/**
* On CoreXY the length of the vector [A,B] is SQRT(2) times the length of the head movement vector [X,Y].
Expand Down Expand Up @@ -2591,11 +2576,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,

previous_safe_speed = safe_speed;

#if HAS_JUNCTION_DEVIATION
NOMORE(vmax_junction_sqr, sq(vmax_junction)); // Throttle down to max speed
#else
vmax_junction_sqr = sq(vmax_junction); // Go up or down to the new speed
#endif
vmax_junction_sqr = sq(vmax_junction); // Go up or down to the new speed

#endif // Classic Jerk Limiting

Expand Down Expand Up @@ -2679,9 +2660,6 @@ void Planner::buffer_sync_block() {
* Return 'false' if no segment was queued due to cleaning, cold extrusion, full queue, etc.
*/
bool Planner::buffer_segment(const float &a, const float &b, const float &c, const float &e
#if HAS_DIST_MM_ARG
, const xyze_float_t &cart_dist_mm
#endif
, const feedRate_t &fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/
) {

Expand Down Expand Up @@ -2751,9 +2729,6 @@ bool Planner::buffer_segment(const float &a, const float &b, const float &c, con
#if HAS_POSITION_FLOAT
, target_float
#endif
#if HAS_DIST_MM_ARG
, cart_dist_mm
#endif
, fr_mm_s, extruder, millimeters)
) return false;

Expand Down Expand Up @@ -2782,14 +2757,7 @@ bool Planner::buffer_line(const float &rx, const float &ry, const float &rz, con

#if IS_KINEMATIC

#if HAS_JUNCTION_DEVIATION
const xyze_pos_t cart_dist_mm = {
rx - position_cart.x, ry - position_cart.y,
rz - position_cart.z, e - position_cart.e
};
#else
const xyz_pos_t cart_dist_mm = { rx - position_cart.x, ry - position_cart.y, rz - position_cart.z };
#endif
const xyz_pos_t cart_dist_mm = { rx - position_cart.x, ry - position_cart.y, rz - position_cart.z };

float mm = millimeters;
if (mm == 0.0)
Expand All @@ -2807,12 +2775,7 @@ bool Planner::buffer_line(const float &rx, const float &ry, const float &rz, con
#else
const feedRate_t feedrate = fr_mm_s;
#endif
if (buffer_segment(delta.a, delta.b, delta.c, machine.e
#if HAS_JUNCTION_DEVIATION
, cart_dist_mm
#endif
, feedrate, extruder, mm
)) {
if (buffer_segment(delta.a, delta.b, delta.c, machine.e, feedrate, extruder, mm)) {
position_cart.set(rx, ry, rz, e);
return true;
}
Expand Down
22 changes: 1 addition & 21 deletions Marlin/src/module/planner.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@
manual_feedrate_mm_s { _mf.x / 60.0f, _mf.y / 60.0f, _mf.z / 60.0f, _mf.e / 60.0f };
#endif

#if IS_KINEMATIC && HAS_JUNCTION_DEVIATION
#define HAS_DIST_MM_ARG 1
#endif

enum BlockFlagBit : char {
// Recalculate trapezoids on entry junction. For optimization.
BLOCK_BIT_RECALCULATE,
Expand Down Expand Up @@ -673,9 +669,6 @@ class Planner {
#if HAS_POSITION_FLOAT
, const xyze_pos_t &target_float
#endif
#if HAS_DIST_MM_ARG
, const xyze_float_t &cart_dist_mm
#endif
, feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters=0.0
);

Expand All @@ -696,9 +689,6 @@ class Planner {
#if HAS_POSITION_FLOAT
, const xyze_pos_t &target_float
#endif
#if HAS_DIST_MM_ARG
, const xyze_float_t &cart_dist_mm
#endif
, feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters=0.0
);

Expand Down Expand Up @@ -728,23 +718,13 @@ class Planner {
* millimeters - the length of the movement, if known
*/
static bool buffer_segment(const float &a, const float &b, const float &c, const float &e
#if HAS_DIST_MM_ARG
, const xyze_float_t &cart_dist_mm
#endif
, const feedRate_t &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0
);

FORCE_INLINE static bool buffer_segment(abce_pos_t &abce
#if HAS_DIST_MM_ARG
, const xyze_float_t &cart_dist_mm
#endif
, const feedRate_t &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0
) {
return buffer_segment(abce.a, abce.b, abce.c, abce.e
#if HAS_DIST_MM_ARG
, cart_dist_mm
#endif
, fr_mm_s, extruder, millimeters);
return buffer_segment(abce.a, abce.b, abce.c, abce.e, fr_mm_s, extruder, millimeters);
}

public:
Expand Down