Releases: grotius-cnc/s-curve-motion-planning
motion block
Full Changelog: 1.7...1.8
Shared c-c++ library
Full Changelog: 1.5...1.7
example
example
This is a tiny code example of a
- Acceleration scurve
- Deceleration scurve
Specs:
- Curves can use acceleration begin & acceleration end values.
- It shows 2 identical functions, where in the dcc curve function ***** signs are applied to show where and how the scurve mirroring is done.
Advanched S-curve Motion Planner
- Qt project written in c++ containing a s-curve implementation.
- Linuxcnc hal component including a header only s-curve library, a translated c++ project into c kernel style.
simplescreenrecorder-2021-06-21_10.23.16.mp4
fresh code
Fresh qt coded s-curve with no "kink" in displacement curve
Uses the opencascade library.
If you have problems installing qt or opencascade, take a look here : https://sourceforge.net/projects/linux-11-pro/
It will install qt and opencascade for you.
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?