mirror of
https://github.com/grblHAL/core.git
synced 2026-08-18 00:47:25 +08:00
Decel Ramp Calculations Updated
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user