scurve trajectory planner

More
11 months 2 weeks ago #338359 by abs32
Replied by abs32 on topic scurve trajectory planner
Colleagues, does this apply for version 2.8.4?

Please Log in or Create an account to join the conversation.

More
10 months 2 hours ago #340833 by grandixximo
Replied by grandixximo on topic scurve trajectory planner
github.com/grandixximo/linuxcnc

I've committed a working multi axis s-curve optional trajectory planner in this fork, happy to get some feedback from the community, it is based on master.
The following user(s) said Thank You: akb1212, tommylight, tivoi, endian, Alexandrion, nwallace, Unlogic

Please Log in or Create an account to join the conversation.

More
9 months 6 days ago #341918 by fsabbatini
Replied by fsabbatini on topic scurve trajectory planner
Good job my friend!
Can you provide any paper or info of the math background you used for it?

Please Log in or Create an account to join the conversation.

More
9 months 6 days ago - 9 months 6 days ago #341920 by grandixximo
Replied by grandixximo on topic scurve trajectory planner
The sp_scurve code is based on S-curve (7-segment) trajectory planning mathematics, which uses jerk-limited motion profiles derived from the kinematics equations of motion.

Mathematical Foundation
The core math is based on third-order polynomial motion equations with controlled jerk (rate of change of acceleration):


Position: P(t) = P₀ + V₀·t + ½·A₀·t² + ⅙·J·t³
Velocity: V(t) = V₀ + A₀·t + ½·J·t²
Acceleration: A(t) = A₀ + J·t
These equations appear explicitly throughout the code (e.g., lines sp_scurve.c:187-197, 842-844, 1089-1091).

Key Mathematical Components
7-Segment S-Curve Profile - The trajectory is divided into 7 phases (S0-S6/n0-n6):

S0: Increasing jerk (acceleration ramps up)
S1: Constant acceleration
S2: Decreasing jerk (acceleration ramps down to 0)
S3: Constant velocity (cruise)
S4: Decreasing jerk (deceleration begins)
S5: Constant deceleration
S6: Increasing jerk (deceleration ramps to 0)
Cubic Equation Solving - The solve_cubic() function at lines 80-184 solves cubic equations using Cardano's formula and trigonometric method for finding roots.

There is a Newton-Raphson Method - The solute() function at lines 54-68 uses Newton-Raphson iteration to solve polynomial equations, but it is not in use, Cardano's formula is computationally superior.

Stopping Distance Calculation - Based on the relationship Amax² = V·J + 0.5·a² (line 949), derived from integrating the jerk-limited motion equations.

Attribution
The code credits go to 杨阳 (Yang Yang) as the original author, he also referenced a Chinese technical document at doc88.com/p-9119146814737.html for the S-curve formulation.
Last edit: 9 months 6 days ago by grandixximo.
The following user(s) said Thank You: akb1212, Derriell

Please Log in or Create an account to join the conversation.

Time to create page: 0.127 seconds
Powered by Kunena Forum