Clean up use of extra_xyjerk

This commit is contained in:
Scott Lahteine 2020-03-01 19:08:21 -06:00
parent ac93df43cd
commit 362c9ae79a

View file

@ -2404,12 +2404,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
#endif #endif
{ {
const float jerk = ABS(current_speed[i]), // cs : Starting from zero, change in speed for this axis const float jerk = ABS(current_speed[i]), // cs : Starting from zero, change in speed for this axis
maxj = (max_jerk[i] // mj : The max jerk setting for this axis maxj = (max_jerk[i] + (i == X_AXIS || i == Y_AXIS ? extra_xyjerk : 0.0f)); // mj : The max jerk setting for this axis
#ifdef TRAVEL_EXTRA_XYJERK
+ (i == X_AXIS || i == Y_AXIS ? extra_xyjerk : 0)
#endif
);
if (jerk > maxj) { // cs > mj : New current speed too fast? if (jerk > maxj) { // cs > mj : New current speed too fast?
if (limited) { // limited already? if (limited) { // limited already?
const float mjerk = nominal_speed * maxj; // ns*mj const float mjerk = nominal_speed * maxj; // ns*mj
@ -2461,11 +2456,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
: // v_exit <= v_entry coasting axis reversal : // v_exit <= v_entry coasting axis reversal
( (v_entry < 0 || v_exit > 0) ? (v_entry - v_exit) : _MAX(-v_exit, v_entry) ); ( (v_entry < 0 || v_exit > 0) ? (v_entry - v_exit) : _MAX(-v_exit, v_entry) );
const float maxj = (max_jerk[axis] const float maxj = (max_jerk[axis] + (axis == X_AXIS || axis == Y_AXIS ? extra_xyjerk : 0.0f));
#ifdef TRAVEL_EXTRA_XYJERK
+ (axis == X_AXIS || axis == Y_AXIS ? extra_xyjerk : 0)
#endif
);
if (jerk > maxj) { if (jerk > maxj) {
v_factor *= maxj / jerk; v_factor *= maxj / jerk;