diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index bdade9adda..20b459fdb4 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -849,8 +849,8 @@ void Planner::calculate_trapezoid_for_block(block_t * const block, const_float_t #endif // Store new block parameters - block->accelerate_until = accelerate_steps; - block->decelerate_after = block->step_event_count - decelerate_steps; + block->accelerate_before = accelerate_steps; + block->decelerate_start = block->step_event_count - decelerate_steps; block->initial_rate = initial_rate; #if ENABLED(S_CURVE_ACCELERATION) block->acceleration_time = acceleration_time; @@ -3074,8 +3074,8 @@ bool Planner::buffer_line(const xyze_pos_t &cart, const_feedRate_t fr_mm_s block->step_event_count = num_steps; block->initial_rate = block->final_rate = block->nominal_rate = last_page_step_rate; // steps/s - block->accelerate_until = 0; - block->decelerate_after = block->step_event_count; + block->accelerate_before = 0; + block->decelerate_start = block->step_event_count; // Will be set to last direction later if directional format. block->direction_bits.reset(); diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 5df0dfad32..c226625a30 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -238,8 +238,8 @@ typedef struct PlannerBlock { #endif // Settings for the trapezoid generator - uint32_t accelerate_until, // The index of the step event on which to stop acceleration - decelerate_after; // The index of the step event on which to start decelerating + uint32_t accelerate_before, // The index of the step event on which to start cruising + decelerate_start; // The index of the step event on which to start decelerating #if ENABLED(S_CURVE_ACCELERATION) uint32_t cruise_rate, // The actual cruise rate to use, between end of the acceleration phase and start of deceleration phase diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 83bc742f32..5c98ea02b2 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -59,8 +59,8 @@ * time -----> * * The trapezoid is the shape the speed curve over time. It starts at block->initial_rate, accelerates - * first block->accelerate_until step_events_completed, then keeps going at constant speed until - * step_events_completed reaches block->decelerate_after after which it decelerates until the trapezoid generator is reset. + * while step_events_completed < block->accelerate_before, then starts cruising at constant speed while + * step_events_completed < block->decelerate_start, then it decelerates until the trapezoid generator is reset. * The slope of acceleration is calculated using v = u + at where t is the accumulated timer values of the steps so far. */ @@ -225,8 +225,8 @@ xyze_long_t Stepper::delta_error{0}; xyze_long_t Stepper::advance_dividend{0}; uint32_t Stepper::advance_divisor = 0, Stepper::step_events_completed = 0, // The number of step events executed in the current block - Stepper::accelerate_until, // The count at which to stop accelerating - Stepper::decelerate_after, // The count at which to start decelerating + Stepper::accelerate_before, // The count at which to start cruising + Stepper::decelerate_start, // The count at which to start decelerating Stepper::step_event_count; // The total event count for the current block #if ANY(HAS_MULTI_EXTRUDER, MIXING_EXTRUDER) @@ -2404,7 +2404,7 @@ hal_timer_t Stepper::block_phase_isr() { // Step events not completed yet... // Are we in acceleration phase ? - if (step_events_completed < accelerate_until) { // Calculate new timer value + if (step_events_completed < accelerate_before) { // Calculate new timer value #if ENABLED(S_CURVE_ACCELERATION) // Get the next speed to use (Jerk limited!) @@ -2461,7 +2461,7 @@ hal_timer_t Stepper::block_phase_isr() { #endif } // Are we in Deceleration phase ? - else if (step_events_completed >= decelerate_after) { + else if (step_events_completed >= decelerate_start) { uint32_t step_rate; #if ENABLED(S_CURVE_ACCELERATION) @@ -2568,7 +2568,7 @@ hal_timer_t Stepper::block_phase_isr() { */ #if ENABLED(LASER_POWER_TRAP) if (cutter.cutter_mode == CUTTER_MODE_CONTINUOUS) { - if (step_events_completed + 1 == accelerate_until) { + if (step_events_completed + 1 == accelerate_before) { if (planner.laser_inline.status.isPowered && planner.laser_inline.status.isEnabled) { if (current_block->laser.trap_ramp_entry_incr > 0) { current_block->laser.trap_ramp_active_pwr = current_block->laser.power; @@ -2727,8 +2727,8 @@ hal_timer_t Stepper::block_phase_isr() { step_events_completed = 0; // Compute the acceleration and deceleration points - accelerate_until = current_block->accelerate_until << oversampling_factor; - decelerate_after = current_block->decelerate_after << oversampling_factor; + accelerate_before = current_block->accelerate_before << oversampling_factor; + decelerate_start = current_block->decelerate_start << oversampling_factor; TERN_(MIXING_EXTRUDER, mixer.stepper_setup(current_block->b_color)); diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index 43d1012f10..cf0348ba59 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -391,8 +391,8 @@ class Stepper { static xyze_long_t advance_dividend; static uint32_t advance_divisor, step_events_completed, // The number of step events executed in the current block - accelerate_until, // The point from where we need to stop acceleration - decelerate_after, // The point from where we need to start decelerating + accelerate_before, // The point from where we need to stop acceleration + decelerate_start, // The point from where we need to start decelerating step_event_count; // The total event count for the current block #if ANY(HAS_MULTI_EXTRUDER, MIXING_EXTRUDER)