Overview
- an S-curve profile is a time law that limits velocity, acceleration and jerk, so the acceleration ramps up and down instead of jumping
- it has 7 segments of constant jerk, which makes the velocity curve look like an S
- in Cartesian motion it drives a normalised path parameter that both the position and the orientation interpolation share
The parabolic blend in the vault keeps velocity continuous, but its acceleration jumps from to at the start of each blend. A jump in acceleration means an infinite jerk, which shakes the arm and excites the structure. The S-curve fixes this by putting a hard limit on jerk.
Mathematical Formulation
Problem setup
Move a distance along a path, starting and ending at rest:
subject to:
Seven segments
| Segment | Jerk | Duration | What happens |
|---|---|---|---|
| 1 | acceleration ramps up from | ||
| 2 | constant acceleration | ||
| 3 | acceleration ramps down to , velocity reaches | ||
| 4 | cruise at | ||
| 5 | deceleration ramps up | ||
| 6 | constant deceleration | ||
| 7 | deceleration ramps down to , robot stops at |
Integration inside one segment
Inside segment the jerk is constant. With local time and start state :
The end state of segment becomes the start state of segment .
Segment durations (long move, all limits reached)
When , the acceleration reaches :
When , the acceleration never reaches :
The acceleration phase lasts . Its velocity curve is point symmetric, so its average speed is and the distance it covers is . Acceleration and deceleration together cover , so:
Short move (cruise speed never reached)
If , the move is too short to reach . Lower the peak speed to so that .
Case with still reached, :
This is valid only if . Otherwise , , and:
Use in Cartesian space
Let be the straight line length and define :
Position and orientation have separate limits. Plan a profile for the distance with linear limits and another for the rotation angle with angular limits, then use the longer total time for both, so they start and finish together.
Setpoint vector layout
The generator outputs one setpoint per control tick:
| Field | Symbol | Dim |
|---|---|---|
| position | 3 | |
| orientation (unit quaternion) | 4 | |
| linear velocity | 3 | |
| angular velocity | 3 | |
| linear acceleration | 3 |
Here is the fixed rotation axis and the half angle used by SLERP.
Algorithmic / Architectural Flow
flowchart LR A["Start and goal pose"] --> B["Path length L and rotation angle theta"] B --> C["Times T_j, T_a, T_v for each limit set"] C --> D{"T_v below 0?"} D -- yes --> E["Lower peak speed v_p, recompute"] D -- no --> F["Take longer T, rescale both profiles"] E --> F F --> G["Sample s(t) at control rate"] G --> H["sigma = s / L"] H --> I["Position lerp and orientation SLERP"] I --> J["Setpoint to IK or Cartesian controller"]
Per tick sampling:
def sample(t, segs, L): # segs: list of (T_k, j_k, s_k, v_k, a_k)
for T_k, j, s0, v0, a0 in segs:
if t <= T_k:
return (s0 + v0*t + 0.5*a0*t**2 + j*t**3/6,
v0 + a0*t + 0.5*j*t**2,
a0 + j*t)
t -= T_k
return (L, 0.0, 0.0) # past the end: hold at goalComparing the common time laws:
| Profile | Continuous up to | Jerk | Typical use |
|---|---|---|---|
| Trapezoid / parabolic blend | velocity | infinite spikes at blend edges | simple PTP moves |
| S-curve (7 segment) | acceleration | bounded by , steps in value | industrial arms, fast pick and place |
| Quintic polynomial | acceleration | smooth inside, steps at the two ends | short smooth reaches, via points |
Sim-to-Real & Hardware Failure Modes
Things that break on hardware:
- Cartesian limits are not joint limits: grows without bound near a singularity, so a profile that respects in Cartesian space can still saturate a wrist joint, check joint speeds over the whole path and stretch if needed
- jerk segments shorter than the control period: if is close to the controller period (for example 2 ms at 500 Hz), the sampled profile skips the ramp and the robot sees an acceleration step anyway
- structural resonance: a ramp time near of the arm or the humanoid torso excites that mode, choose so is several times longer than the resonance period
- online replanning from a moving state: the formulas above assume rest to rest, replanning mid motion from with them causes a jump, use a solver that starts from any state (for example the Ruckig library)
- rounding at segment edges: clamp to and snap to the exact goal at , or tiny overshoot makes SLERP step past the target
- payload changes: tuned for an empty gripper can exceed motor torque with a load, scale and with the estimated payload
Cross-Links
- the profile improves on the Parabolic Blend Trajectory by bounding jerk
- the same drives orientation in Spherical Linear Interpolation (SLERP)
- a smoother alternative for short reaches is the Quintic Polynomial Trajectory