Add jerk-limited motion planning#1731
Open
MitchBradley wants to merge 8 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds per-axis jerk configuration and starts integrating jerk-limited ramp shaping into FluidNC’s planner/stepper motion pipeline.
Changes:
- Adds
_jerkaxis configuration and YAML handler support. - Adds jerk limiting calculations alongside acceleration/rate axis limits.
- Extends planner blocks and stepper segment prep to use jerk-aware acceleration state.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
FluidNC/src/Stepper.cpp |
Adds current acceleration state and jerk-shaped accel/decel segment logic. |
FluidNC/src/Planner.h |
Extends planner blocks with max acceleration and jerk fields. |
FluidNC/src/Planner.cpp |
Computes jerk limits and effective acceleration for lookahead. |
FluidNC/src/NutsBolts.h |
Declares jerk axis-limit helper. |
FluidNC/src/NutsBolts.cpp |
Implements per-axis jerk limiting and unit conversion. |
FluidNC/src/Machine/Axis.h |
Adds default per-axis jerk setting. |
FluidNC/src/Machine/Axis.cpp |
Exposes jerk as jerk_mm_per_sec3 config item. |
Comments suppressed due to low confidence (2)
FluidNC/src/Stepper.cpp:647
- The deceleration path has the same integration error as acceleration: it updates
current_accelerationbefore applying it over the whole timestep, so jerk-up/down segments use a constant acceleration instead of the linear jerk integral. That over-decelerates segments and can force an abrupt correction toexit_speednear the end of the block.
if (prep.current_speed > jerk_rampdown) {
prep.current_acceleration = MIN(prep.current_acceleration + accel_var, pl_block->max_acceleration);
} else {
prep.current_acceleration = MAX(prep.current_acceleration - accel_var, accel_var);
}
speed_var = prep.current_acceleration * time_var;
FluidNC/src/Stepper.cpp:645
- This clamp likewise prevents deceleration from tapering below one segment's
accel_var, so the deceleration ramp cannot smoothly return acceleration to zero at the target exit speed. That undermines the jerk limit and can leave the final segment relying on the hardcurrent_speed = exit_speedcorrection.
prep.current_acceleration = MAX(prep.current_acceleration - accel_var, accel_var);
Collaborator
Author
|
The documentation, suitable for a FluidNC Wiki page, is at https://gist.github.com/MitchBradley/efc5772e52ce9e65a72f7250087fcd53 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.