Add HAS_JUNCTION_DEVIATION

This commit is contained in:
Scott Lahteine
2020-04-23 20:49:11 -05:00
parent df22b96d72
commit 55d66fb897
16 changed files with 34 additions and 30 deletions

View File

@ -2393,7 +2393,7 @@ void MarlinSettings::reset() {
TERN_(HAS_CLASSIC_E_JERK, planner.max_jerk.e = DEFAULT_EJERK;);
#endif
#if DISABLED(CLASSIC_JERK)
#if HAS_JUNCTION_DEVIATION
planner.junction_deviation_mm = float(JUNCTION_DEVIATION_MM);
#endif
@ -2862,7 +2862,7 @@ void MarlinSettings::reset() {
CONFIG_ECHO_HEADING(
"Advanced: B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate>"
#if DISABLED(CLASSIC_JERK)
#if HAS_JUNCTION_DEVIATION
" J<junc_dev>"
#endif
#if HAS_CLASSIC_JERK
@ -2875,7 +2875,7 @@ void MarlinSettings::reset() {
PSTR(" M205 B"), LINEAR_UNIT(planner.settings.min_segment_time_us)
, PSTR(" S"), LINEAR_UNIT(planner.settings.min_feedrate_mm_s)
, SP_T_STR, LINEAR_UNIT(planner.settings.min_travel_feedrate_mm_s)
#if DISABLED(CLASSIC_JERK)
#if HAS_JUNCTION_DEVIATION
, PSTR(" J"), LINEAR_UNIT(planner.junction_deviation_mm)
#endif
#if HAS_CLASSIC_JERK

View File

@ -132,7 +132,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 DISABLED(CLASSIC_JERK)
#if HAS_JUNCTION_DEVIATION
float Planner::junction_deviation_mm; // (mm) M205 J
#if ENABLED(LIN_ADVANCE)
#if ENABLED(DISTINCT_E_FACTORS)
@ -2151,7 +2151,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
#if ENABLED(LIN_ADVANCE)
#if DISABLED(CLASSIC_JERK)
#if HAS_JUNCTION_DEVIATION
#if ENABLED(DISTINCT_E_FACTORS)
#define MAX_E_JERK max_e_jerk[extruder]
#else
@ -2238,7 +2238,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 DISABLED(CLASSIC_JERK)
#if HAS_JUNCTION_DEVIATION
/**
* 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
@ -2285,7 +2285,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
;
unit_vec *= inverse_millimeters;
#if IS_CORE && DISABLED(CLASSIC_JERK)
#if IS_CORE && HAS_JUNCTION_DEVIATION
/**
* 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".
@ -2460,7 +2460,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
previous_safe_speed = safe_speed;
#if DISABLED(CLASSIC_JERK)
#if HAS_JUNCTION_DEVIATION
vmax_junction_sqr = _MIN(vmax_junction_sqr, sq(vmax_junction));
#else
vmax_junction_sqr = sq(vmax_junction);
@ -2649,7 +2649,7 @@ bool Planner::buffer_line(const float &rx, const float &ry, const float &rz, con
#if IS_KINEMATIC
#if DISABLED(CLASSIC_JERK)
#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
@ -2675,7 +2675,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 DISABLED(CLASSIC_JERK)
#if HAS_JUNCTION_DEVIATION
, cart_dist_mm
#endif
, feedrate, extruder, mm

View File

@ -61,7 +61,7 @@
manual_feedrate_mm_s { _mf.x / 60.0f, _mf.y / 60.0f, _mf.z / 60.0f, _mf.e / 60.0f };
#endif
#if IS_KINEMATIC && DISABLED(CLASSIC_JERK)
#if IS_KINEMATIC && HAS_JUNCTION_DEVIATION
#define HAS_DIST_MM_ARG 1
#endif
@ -304,7 +304,7 @@ class Planner {
static uint32_t max_acceleration_steps_per_s2[XYZE_N]; // (steps/s^2) Derived from mm_per_s2
static float steps_to_mm[XYZE_N]; // Millimeters per step
#if DISABLED(CLASSIC_JERK)
#if HAS_JUNCTION_DEVIATION
static float junction_deviation_mm; // (mm) M205 J
#if ENABLED(LIN_ADVANCE)
static float max_e_jerk // Calculated from junction_deviation_mm
@ -900,7 +900,7 @@ class Planner {
static void recalculate();
#if DISABLED(CLASSIC_JERK)
#if HAS_JUNCTION_DEVIATION
FORCE_INLINE static void normalize_junction_vector(xyze_float_t &vector) {
float magnitude_sq = 0;