Skip to content

tp: apply parabolic half-accel only during an actual blend - #4221

Merged
andypugh merged 1 commit into
LinuxCNC:masterfrom
grandixximo:fix/tp-half-accel-nonblend
Aug 16, 2026
Merged

tp: apply parabolic half-accel only during an actual blend#4221
andypugh merged 1 commit into
LinuxCNC:masterfrom
grandixximo:fix/tp-half-accel-nonblend

Conversation

@grandixximo

Copy link
Copy Markdown
Contributor

Fixes #4220.

What

The trajectory planner halves acceleration on segments that never blend (single MDI move, first segment from rest, last segment decelerating to a stop). See #4220 for the full analysis and evidence.

This gates the half reduction on an actual parabolic blend overlap instead of a term-condition flag.

Change

  • src/emc/tp/tc.c: keep tcGetOverallMaxAccel / tcGetTangentialMaxAccel reduced (used for corner-speed sizing, unchanged). Add tcGetCycleMaxAccel(tc, in_overlap) that applies the half only when the segment overlaps a neighbor in an active blend, otherwise returns the full path acceleration.
  • src/emc/tp/tp.c: thread an in_overlap flag through tpUpdateCycle and the trapezoidal / ramp / s-curve per-cycle accel functions. Overlap is true for the secondary segment of an active blend and for the primary while blending_next is latched; false for lone / first-from-rest / last-to-stop portions and tangent hand-offs.
  • tests/motion/g0: updated to expect full acceleration on a lone rapid (it previously asserted exactly half).

Result

  • Lone MDI / one-line program: full acceleration.
  • First segment: full from rest, half only once it blends into the next.
  • Last segment: half during the entry blend, full for the deceleration to a stop.
  • Real blend overlap: both segments still half, so per-axis sums stay within limits and corner speeds are unchanged.

The full path acceleration from canon already respects every joint limit for the segment direction, so a single moving segment at full accel violates nothing.

Testing

runtests tests/abort tests/motion tests/lathe: all pass with the g0 update. Blend, stop, abort, and lathe behavior is unchanged.

…4220)

Lone/first/last non-blending segments now use full path acceleration; the 1/2 reservation is gated on an active parabolic overlap. Updates tests/motion/g0 to expect full accel on a lone rapid.
@andypugh
andypugh merged commit 5e6af04 into LinuxCNC:master Aug 16, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TP reserves half of max acceleration on segments that never blend

2 participants