|
|
@ -1352,7 +1352,9 @@ void Planner::_buffer_steps(const int32_t (&target)[XYZE], float fr_mm_s, const
|
|
|
|
|
|
|
|
|
|
|
|
// Initialize block entry speed. Compute based on deceleration to user-defined MINIMUM_PLANNER_SPEED.
|
|
|
|
// Initialize block entry speed. Compute based on deceleration to user-defined MINIMUM_PLANNER_SPEED.
|
|
|
|
const float v_allowable = max_allowable_speed(-block->acceleration, MINIMUM_PLANNER_SPEED, block->millimeters);
|
|
|
|
const float v_allowable = max_allowable_speed(-block->acceleration, MINIMUM_PLANNER_SPEED, block->millimeters);
|
|
|
|
block->entry_speed = min(vmax_junction, v_allowable);
|
|
|
|
// If stepper ISR is disabled, this indicates buffer_segment wants to add a split block.
|
|
|
|
|
|
|
|
// In this case start with the max. allowed speed to avoid an interrupted first move.
|
|
|
|
|
|
|
|
block->entry_speed = STEPPER_ISR_ENABLED() ? MINIMUM_PLANNER_SPEED : min(vmax_junction, v_allowable);
|
|
|
|
|
|
|
|
|
|
|
|
// Initialize planner efficiency flags
|
|
|
|
// Initialize planner efficiency flags
|
|
|
|
// Set flag if block will always reach maximum junction speed regardless of entry/exit speeds.
|
|
|
|
// Set flag if block will always reach maximum junction speed regardless of entry/exit speeds.
|
|
|
@ -1362,7 +1364,7 @@ void Planner::_buffer_steps(const int32_t (&target)[XYZE], float fr_mm_s, const
|
|
|
|
// block nominal speed limits both the current and next maximum junction speeds. Hence, in both
|
|
|
|
// block nominal speed limits both the current and next maximum junction speeds. Hence, in both
|
|
|
|
// the reverse and forward planners, the corresponding block junction speed will always be at the
|
|
|
|
// the reverse and forward planners, the corresponding block junction speed will always be at the
|
|
|
|
// the maximum junction speed and may always be ignored for any speed reduction checks.
|
|
|
|
// the maximum junction speed and may always be ignored for any speed reduction checks.
|
|
|
|
block->flag |= BLOCK_FLAG_RECALCULATE | (block->nominal_speed <= v_allowable ? BLOCK_FLAG_NOMINAL_LENGTH : 0);
|
|
|
|
block->flag |= block->nominal_speed <= v_allowable ? BLOCK_FLAG_RECALCULATE | BLOCK_FLAG_NOMINAL_LENGTH : BLOCK_FLAG_RECALCULATE;
|
|
|
|
|
|
|
|
|
|
|
|
// Update previous path unit_vector and nominal speed
|
|
|
|
// Update previous path unit_vector and nominal speed
|
|
|
|
COPY(previous_speed, current_speed);
|
|
|
|
COPY(previous_speed, current_speed);
|
|
|
@ -1398,9 +1400,6 @@ void Planner::_buffer_steps(const int32_t (&target)[XYZE], float fr_mm_s, const
|
|
|
|
|
|
|
|
|
|
|
|
#endif // LIN_ADVANCE
|
|
|
|
#endif // LIN_ADVANCE
|
|
|
|
|
|
|
|
|
|
|
|
const float bnsr = 1.0 / block->nominal_speed;
|
|
|
|
|
|
|
|
calculate_trapezoid_for_block(block, block->entry_speed * bnsr, safe_speed * bnsr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Move buffer head
|
|
|
|
// Move buffer head
|
|
|
|
block_buffer_head = next_buffer_head;
|
|
|
|
block_buffer_head = next_buffer_head;
|
|
|
|
|
|
|
|
|
|
|
|