Enable junction deviation by default (#15481)
This commit is contained in:
@ -125,7 +125,7 @@ uint32_t Planner::max_acceleration_steps_per_s2[XYZE_N]; // (steps/s^2) Derived
|
||||
|
||||
float Planner::steps_to_mm[XYZE_N]; // (mm) Millimeters per step
|
||||
|
||||
#if ENABLED(JUNCTION_DEVIATION)
|
||||
#if DISABLED(CLASSIC_JERK)
|
||||
float Planner::junction_deviation_mm; // (mm) M205 J
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
#if ENABLED(DISTINCT_E_FACTORS)
|
||||
@ -136,7 +136,7 @@ float Planner::steps_to_mm[XYZE_N]; // (mm) Millimeters per step
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_CLASSIC_JERK
|
||||
#if BOTH(JUNCTION_DEVIATION, LIN_ADVANCE)
|
||||
#if HAS_LINEAR_E_JERK
|
||||
xyz_pos_t Planner::max_jerk; // (mm/s^2) M205 XYZ - The largest speed change requiring no acceleration.
|
||||
#else
|
||||
xyze_pos_t Planner::max_jerk; // (mm/s^2) M205 XYZE - The largest speed change requiring no acceleration.
|
||||
@ -1564,7 +1564,7 @@ bool Planner::_buffer_steps(const xyze_long_t &target
|
||||
#if HAS_POSITION_FLOAT
|
||||
, const xyze_pos_t &target_float
|
||||
#endif
|
||||
#if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION)
|
||||
#if IS_KINEMATIC && DISABLED(CLASSIC_JERK)
|
||||
, const xyze_float_t &delta_mm_cart
|
||||
#endif
|
||||
, feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters
|
||||
@ -1582,7 +1582,7 @@ bool Planner::_buffer_steps(const xyze_long_t &target
|
||||
#if HAS_POSITION_FLOAT
|
||||
, target_float
|
||||
#endif
|
||||
#if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION)
|
||||
#if IS_KINEMATIC && DISABLED(CLASSIC_JERK)
|
||||
, delta_mm_cart
|
||||
#endif
|
||||
, fr_mm_s, extruder, millimeters
|
||||
@ -1628,7 +1628,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
||||
#if HAS_POSITION_FLOAT
|
||||
, const xyze_pos_t &target_float
|
||||
#endif
|
||||
#if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION)
|
||||
#if IS_KINEMATIC && DISABLED(CLASSIC_JERK)
|
||||
, const xyze_float_t &delta_mm_cart
|
||||
#endif
|
||||
, feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/
|
||||
@ -2164,7 +2164,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
|
||||
#if ENABLED(JUNCTION_DEVIATION)
|
||||
#if DISABLED(CLASSIC_JERK)
|
||||
#if ENABLED(DISTINCT_E_FACTORS)
|
||||
#define MAX_E_JERK max_e_jerk[extruder]
|
||||
#else
|
||||
@ -2252,7 +2252,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
||||
|
||||
float vmax_junction_sqr; // Initial limit on the segment entry velocity (mm/s)^2
|
||||
|
||||
#if ENABLED(JUNCTION_DEVIATION)
|
||||
#if DISABLED(CLASSIC_JERK)
|
||||
/**
|
||||
* Compute maximum allowable entry speed at junction by centripetal acceleration approximation.
|
||||
* Let a circle be tangent to both previous and current path line segments, where the junction
|
||||
@ -2291,7 +2291,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
||||
static xyze_float_t prev_unit_vec;
|
||||
|
||||
xyze_float_t unit_vec =
|
||||
#if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION)
|
||||
#if IS_KINEMATIC && DISABLED(CLASSIC_JERK)
|
||||
delta_mm_cart
|
||||
#else
|
||||
{ delta_mm.x, delta_mm.y, delta_mm.z, delta_mm.e }
|
||||
@ -2299,7 +2299,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
||||
;
|
||||
unit_vec *= inverse_millimeters;
|
||||
|
||||
#if IS_CORE && ENABLED(JUNCTION_DEVIATION)
|
||||
#if IS_CORE && DISABLED(CLASSIC_JERK)
|
||||
/**
|
||||
* On CoreXY the length of the vector [A,B] is SQRT(2) times the length of the head movement vector [X,Y].
|
||||
* So taking Z and E into account, we cannot scale to a unit vector with "inverse_millimeters".
|
||||
@ -2369,7 +2369,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
||||
float safe_speed = nominal_speed;
|
||||
|
||||
uint8_t limited = 0;
|
||||
#if BOTH(JUNCTION_DEVIATION, LIN_ADVANCE)
|
||||
#if HAS_LINEAR_E_JERK
|
||||
LOOP_XYZ(i)
|
||||
#else
|
||||
LOOP_XYZE(i)
|
||||
@ -2406,7 +2406,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
||||
|
||||
// Now limit the jerk in all axes.
|
||||
const float smaller_speed_factor = vmax_junction / previous_nominal_speed;
|
||||
#if BOTH(JUNCTION_DEVIATION, LIN_ADVANCE)
|
||||
#if HAS_LINEAR_E_JERK
|
||||
LOOP_XYZ(axis)
|
||||
#else
|
||||
LOOP_XYZE(axis)
|
||||
@ -2444,7 +2444,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
||||
|
||||
previous_safe_speed = safe_speed;
|
||||
|
||||
#if ENABLED(JUNCTION_DEVIATION)
|
||||
#if DISABLED(CLASSIC_JERK)
|
||||
vmax_junction_sqr = _MIN(vmax_junction_sqr, sq(vmax_junction));
|
||||
#else
|
||||
vmax_junction_sqr = sq(vmax_junction);
|
||||
@ -2538,7 +2538,7 @@ void Planner::buffer_sync_block() {
|
||||
* millimeters - the length of the movement, if known
|
||||
*/
|
||||
bool Planner::buffer_segment(const float &a, const float &b, const float &c, const float &e
|
||||
#if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION)
|
||||
#if IS_KINEMATIC && DISABLED(CLASSIC_JERK)
|
||||
, const xyze_float_t &delta_mm_cart
|
||||
#endif
|
||||
, const feedRate_t &fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/
|
||||
@ -2610,7 +2610,7 @@ bool Planner::buffer_segment(const float &a, const float &b, const float &c, con
|
||||
#if HAS_POSITION_FLOAT
|
||||
, target_float
|
||||
#endif
|
||||
#if IS_KINEMATIC && ENABLED(JUNCTION_DEVIATION)
|
||||
#if IS_KINEMATIC && DISABLED(CLASSIC_JERK)
|
||||
, delta_mm_cart
|
||||
#endif
|
||||
, fr_mm_s, extruder, millimeters
|
||||
@ -2644,7 +2644,7 @@ bool Planner::buffer_line(const float &rx, const float &ry, const float &rz, con
|
||||
|
||||
#if IS_KINEMATIC
|
||||
|
||||
#if ENABLED(JUNCTION_DEVIATION)
|
||||
#if DISABLED(CLASSIC_JERK)
|
||||
const xyze_pos_t delta_mm_cart = {
|
||||
rx - position_cart.x, ry - position_cart.y,
|
||||
rz - position_cart.z, e - position_cart.e
|
||||
@ -2668,7 +2668,7 @@ bool Planner::buffer_line(const float &rx, const float &ry, const float &rz, con
|
||||
const feedRate_t feedrate = fr_mm_s;
|
||||
#endif
|
||||
if (buffer_segment(delta.a, delta.b, delta.c, machine.e
|
||||
#if ENABLED(JUNCTION_DEVIATION)
|
||||
#if DISABLED(CLASSIC_JERK)
|
||||
, delta_mm_cart
|
||||
#endif
|
||||
, feedrate, extruder, mm
|
||||
@ -2769,7 +2769,7 @@ void Planner::reset_acceleration_rates() {
|
||||
if (AXIS_CONDITION) NOLESS(highest_rate, max_acceleration_steps_per_s2[i]);
|
||||
}
|
||||
cutoff_long = 4294967295UL / highest_rate; // 0xFFFFFFFFUL
|
||||
#if BOTH(JUNCTION_DEVIATION, LIN_ADVANCE)
|
||||
#if HAS_LINEAR_E_JERK
|
||||
recalculate_max_e_jerk();
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user