Decel Ramp Calculations Updated

This commit is contained in:
Dietz0r
2023-10-30 22:08:46 +01:00
committed by GitHub
parent 4c3cf5eac3
commit 418e063b35
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -506,7 +506,7 @@ bool plan_buffer_line (float *target, plan_line_data_t *pl_data)
#endif
// Calculate the unit vector of the line move and the block maximum feed rate and acceleration scaled
// down such that no individual axes maximum values are exceeded with respect to the line direction.l
// down such that no individual axes maximum values are exceeded with respect to the line direction.
#if N_AXIS > 3 && ROTARY_FIX
// NOTE: This calculation assumes all block motion axes are orthogonal (Cartesian), and if also rotational, then
// motion mode must be inverse time mode. Operates on the absolute value of the unit vector.
+2 -2
View File
@@ -955,8 +955,8 @@ void st_prep_buffer (void)
default: // case Ramp_Decel:
// NOTE: mm_var used as a misc worker variable to prevent errors when near zero speed.
if (((prep.decelerate_after - mm_remaining) / (prep.current_speed + 1.0f)) <= (pl_block->max_acceleration / pl_block->jerk)) { //+1.0f to avoid divide by 0 speed, minor effect on jerk ramp
// Check if we are on ramp up or ramp down. Ramp down if time to end of acceleration is less than time needed to reach 0 acceleration.
if ((mm_remaining / (prep.current_speed + 1.0f)) <= (pl_block->max_acceleration / pl_block->jerk)) { //+1.0f to avoid divide by 0 speed, minor effect on jerk ramp
// Check if we are on ramp up or ramp down. Ramp down if time to end of deceleration is less than time needed to reach 0 acceleration.
// Then limit acceleration change by jerk up to max acceleration and update for next segment.
last_segment_accel = max(last_segment_accel - pl_block->jerk * time_var, 0.0f);
} else {