Remove JUNCTION_DEVIATION_INCLUDE_E option (#11147)

2.0.x
Scott Lahteine 6 years ago committed by GitHub
parent fbf1c9b496
commit bd7f5848f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -450,7 +450,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -449,7 +449,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -449,7 +449,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -449,7 +449,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -449,7 +449,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -449,7 +449,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -454,7 +454,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -449,7 +449,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -447,7 +447,6 @@
//#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge
//#define JUNCTION_DEVIATION_INCLUDE_E
#endif
/**

@ -2230,21 +2230,13 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
already calculated in a different place. */
// Unit vector of previous path line segment
static float previous_unit_vec[
#if ENABLED(JUNCTION_DEVIATION_INCLUDE_E)
XYZE
#else
XYZ
#endif
];
static float previous_unit_vec[XYZE];
float unit_vec[] = {
delta_mm[A_AXIS] * inverse_millimeters,
delta_mm[B_AXIS] * inverse_millimeters,
delta_mm[C_AXIS] * inverse_millimeters
#if ENABLED(JUNCTION_DEVIATION_INCLUDE_E)
, delta_mm[E_AXIS] * inverse_millimeters
#endif
delta_mm[C_AXIS] * inverse_millimeters,
delta_mm[E_AXIS] * inverse_millimeters
};
// Skip first block or when previous_nominal_speed is used as a flag for homing and offset cycles.
@ -2254,9 +2246,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
float junction_cos_theta = -previous_unit_vec[X_AXIS] * unit_vec[X_AXIS]
-previous_unit_vec[Y_AXIS] * unit_vec[Y_AXIS]
-previous_unit_vec[Z_AXIS] * unit_vec[Z_AXIS]
#if ENABLED(JUNCTION_DEVIATION_INCLUDE_E)
-previous_unit_vec[E_AXIS] * unit_vec[E_AXIS]
#endif
-previous_unit_vec[E_AXIS] * unit_vec[E_AXIS]
;
// NOTE: Computed without any expensive trig, sin() or acos(), by trig half angle identity of cos(theta).
@ -2267,15 +2257,13 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
else {
NOLESS(junction_cos_theta, -0.999999); // Check for numerical round-off to avoid divide by zero.
float junction_unit_vec[JD_AXES] = {
// Convert delta vector to unit vector
float junction_unit_vec[XYZE] = {
unit_vec[X_AXIS] - previous_unit_vec[X_AXIS],
unit_vec[Y_AXIS] - previous_unit_vec[Y_AXIS],
unit_vec[Z_AXIS] - previous_unit_vec[Z_AXIS]
#if ENABLED(JUNCTION_DEVIATION_INCLUDE_E)
, unit_vec[E_AXIS] - previous_unit_vec[E_AXIS]
#endif
unit_vec[Z_AXIS] - previous_unit_vec[Z_AXIS],
unit_vec[E_AXIS] - previous_unit_vec[E_AXIS]
};
// Convert delta vector to unit vector
normalize_junction_vector(junction_unit_vec);
const float junction_acceleration = limit_value_by_axis_maximum(block->acceleration, junction_unit_vec),

@ -830,22 +830,16 @@ class Planner {
#if ENABLED(JUNCTION_DEVIATION)
#if ENABLED(JUNCTION_DEVIATION_INCLUDE_E)
#define JD_AXES XYZE
#else
#define JD_AXES XYZ
#endif
FORCE_INLINE static void normalize_junction_vector(float (&vector)[JD_AXES]) {
FORCE_INLINE static void normalize_junction_vector(float (&vector)[XYZE]) {
float magnitude_sq = 0.0;
for (uint8_t idx = 0; idx < JD_AXES; idx++) if (vector[idx]) magnitude_sq += sq(vector[idx]);
LOOP_XYZE(idx) if (vector[idx]) magnitude_sq += sq(vector[idx]);
const float inv_magnitude = 1.0 / SQRT(magnitude_sq);
for (uint8_t idx = 0; idx < JD_AXES; idx++) vector[idx] *= inv_magnitude;
LOOP_XYZE(idx) vector[idx] *= inv_magnitude;
}
FORCE_INLINE static float limit_value_by_axis_maximum(const float &max_value, float (&unit_vec)[JD_AXES]) {
FORCE_INLINE static float limit_value_by_axis_maximum(const float &max_value, float (&unit_vec)[XYZE]) {
float limit_value = max_value;
for (uint8_t idx = 0; idx < JD_AXES; idx++) if (unit_vec[idx]) // Avoid divide by zero
LOOP_XYZE(idx) if (unit_vec[idx]) // Avoid divide by zero
NOMORE(limit_value, ABS(max_acceleration_mm_per_s2[idx] / unit_vec[idx]));
return limit_value;
}

Loading…
Cancel
Save