scurve trajectory planner

More
1 year 2 months ago #333746 by yrsiddhapura
I would love to use on mine horizontal boring mill. Does it supports Mesa based setup ?

Please Log in to join the conversation.

More
1 year 2 months ago #333750 by Grotius
Replied by Grotius on topic scurve trajectory planner
Pcw had no luck on Mesa. The install script
destroyed his home directory back then.
This was done by a rm -rf command 
wich can do nasty things so we dont use that any more for cleaning up environment.

I only tested it on Ethercat with el2124 driven steppers and delta servo. 


 

Please Log in to join the conversation.

More
1 year 6 days ago #337053 by heaven
Replied by heaven on topic scurve trajectory planner
Hi Grotis, your work is absolutely impressive! I've been diving into LinuxCNC and your code to better understand motion control, and it's been a fantastic learning experience. I have a couple of questions I'd love your insights on:

Does your S-curve motion profile support an online trajectory generator like Ruckig for multi-axis systems?

Regarding LinuxCNC, I'm still unclear on how the trajectory planner functions. Could you provide a detailed explanation of how it processes a command like G1 to generate inputs for the kinematic module? Specifically, what roles do the trajectory planner and generator play in this process?

Please Log in to join the conversation.

More
11 months 3 weeks ago #338124 by endian
Replied by endian on topic scurve trajectory planner
Hello,

Is here any capable gentelman which understands Grotius repo with scurve trajectory planner and can help others with them?

thanks End

Please Log in to join the conversation.

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 to join the conversation.

More
9 months 4 weeks ago #340833 by grandixximo
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.

---
test signature

Please Log in to join the conversation.

More
9 months 5 days ago #341918 by fsabbatini
Good job my friend!
Can you provide any paper or info of the math background you used for it?

Please Log in to join the conversation.

More
9 months 5 days ago #341920 by grandixximo
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.

---
test signature

Please Log in to join the conversation.

Time to create page: 1.163 seconds
Powered by Kunena Forum