Advanched S-curve Motion Planner
Qt project to compute a s-curve. This code took quite a while to set up.
So far it's more advanched then my previous attempts.
Curve = Concave (upwards curve) + Convex (downwards curve)
Grey = Travelled in time
Black = Acceleration
If the "vel" (velocity) can not be reached by the users motion input values, the "vel" is sampled until max "vel" value fit's the path lenght.
This code includes Vo (initial velocity value) and Ve (velocity at end of motion).
The program code stategy.
- It uses a path calculator, which calculates motion path's in classical lineair way. At this stage no s-curve implementation is used.
- When path lenghts (L1,L2,L3), and path times (T1,T2,T3) are known, we do a s-curve calculation.
The program implementation.
- The program can be used as pre-processor for cnc- ,robotic movements.
- Within the s-curve calculation's, path lenght's are calculated as "Sa, Sb" etc. This value's can be used to interpolate to your current path x,y,z coordinate, for example Sa/Stotal * yourpathlenght will give you an idea where you are.
- You can push multiple point's into the waypoint buffer to create your path, example is inside.
The s-curve coding
- The attached pdf document provides the basic formula's for coding the s-curve. Jerk is implemented.
- The front curve is the most important. This formula's are quite clear to walk trough.
- The back end curve is in fact a mirror function of the front curve. This back end curve is harder to understand to all kind of mirror pollution.
- Visualising the output code is a must. Without visualising the output in a graph, coding failures are hard to spot.
- When you agree with the code, you can strip down the code to your own program, maybe you compile it as shared library?