S-curve Velocity Profiling
Jerk-limited motion profiles achieving smooth lift operation with reduced noise and vibration
Context
Wally (wall-mounted lift system) moves vertically along a guide rail.
Problem: Trapezoidal velocity profiles cause abrupt acceleration changes—resulting in audible noise and mechanical vibration at transition points.
Goal: Achieve smooth, quiet lift motion without sacrificing responsiveness.
Core Problem
Trapezoidal profiles have infinite jerk at transitions:
Trapezoidal: S-curve:
___ ___
/ \ / \
/ \ / \ ← smooth transitions
At each corner, acceleration changes instantaneously → mechanical shock → noise + vibration.
Key insight
Limit jerk (rate of acceleration change) to eliminate abrupt transitions. S-curve profiles provide continuous acceleration with zero jerk at endpoints.
Approach
1) Smoothstep function for S-curve shape
Use Hermite interpolation (smoothstep):
S(t) = t² × (3 - 2t) where t ∈ [0, 1]
Properties:
- S(0) = 0, S(1) = 1
- S’(0) = 0, S’(1) = 0 (zero derivative at endpoints)
- Continuous first and second derivatives
2) Two-stage acceleration with symmetric jerk
Split acceleration time into two equal stages:
| Stage | Duration | Jerk | Acceleration |
|---|---|---|---|
| Stage 1 | 0 → T/2 | +J | Increasing (0 → peak) |
| Stage 2 | T/2 → T | -J | Decreasing (peak → 0) |
Jerk calculation: J = 4 × (v_target - v_current) / T²
The factor 4 comes from symmetric S-curve math—jerk magnitude is constant, only sign changes at midpoint.
3) Integration chain: Jerk → Acceleration → Velocity
Each control loop iteration:
// Stage 1: acceleration increases
if (step < stage1) {
accel += jerk × dt;
}
// Stage 2: acceleration decreases
else if (step < stage2) {
accel -= jerk × dt;
}
velocity += accel × dt;
Result: Velocity follows smooth S-curve from current to target.
4) State machine for motion phases
STOP ←→ ACCELERATING → CONSTANT_VELOCITY → DECELERATING → STOP
Each state handles:
- STOP: Zero velocity, waiting for command
- ACCELERATING: S-curve ramp up
- CONSTANT_VELOCITY: Cruising at target speed
- DECELERATING: S-curve ramp down
Tradeoffs & Limitations
- Slightly longer motion time: S-curve trades speed for smoothness compared to trapezoidal
- Accumulation errors: Integrating jerk→accel→velocity can accumulate numerical errors over long motions
- Fixed symmetry: Equal ramp-up and ramp-down durations; cannot optimize asymmetrically
Validation
Tested on deployed Wally units:
- A/B comparison: Trapezoidal vs S-curve with same target velocity and acceleration time
- Noise measurement: Audible clicks eliminated at motion start/stop transitions
- Vibration check: No visible oscillation on guide rail during acceleration phase
- Long-term: Continuous operation over months with no regression
Results
| Metric | Trapezoidal | S-curve |
|---|---|---|
| Jerk at transitions | Infinite | Bounded |
| Audible noise | Noticeable clicks | Smooth, quiet |
| Mechanical vibration | Present | Minimal |
- Same algorithm, two platforms: ESP-IDF C (v1) and ROS2 C++ (v2)
- Field validated: Deployed on Wally units with no noise complaints
Key Takeaway
Jerk-limited S-curve profiles eliminate the mechanical shock of trapezoidal motion:
- Smoothstep function:
t² × (3 - 2t)provides smooth transitions - Symmetric jerk: +J for first half, -J for second half
- Integration chain: Jerk → Acceleration → Velocity for continuous motion
- Result: Quiet, vibration-free lift operation