Status: Draft (2026-10-18), Measured. Numbers were directly calculated using Python 3.9.6 and numpy 2.0.2 on a laptop (Apple M1 Max, macOS 26.5). Raw data and code: working directory
measure/robot-arm-basics/'sm08_traj.py,out/m08_traj.json. Joint velocity/acceleration limits and inertia are assumed values and not measured with actual motors (hardware not measured). Reference materials were accessed on 2026-10-18. Writing conventions: Measured data is the default; unmeasured items are marked as "Unmeasured", and unverified items are marked as "Unverified".
Table of Contents
- 1. Intuition: Like Driving
- 2. Figures: Shapes of Velocity
- 3. Calculations
- 5. Measurements
- 6. Limitations
- 7. Conclusion
- References
1. Intuition: Like Driving
There are multiple ways to go from one traffic light to the next. Pushing the accelerator pedal to the floor and slamming on the brakes at the end arrives the fastest, but passengers lurch forward. Pressing it gently and releasing it gently is comfortable but slightly delayed. Robot joints are the same. Even when traveling the same distance in the same time, the peak velocity, torque required by the motor, and shock received by the arm vary depending on the shape of the velocity.
Table tennis robot trajectories have one additional special requirement. Instead of arriving at a stopped position, it must pass through at a specified time and a specified velocity because the racket speed determined in Part 7 must be produced at the moment of impact.
2. Figures: Shapes of Velocity
3. Calculations
3.1 Polynomial Time Scaling
When a single joint goes from q0 to q1 in time T, using τ = t/T, we write q(t) = q0 + (q1 − q0)·s(τ), where s is a function going from 0 to 1.
3차: s = 3τ² − 2τ³ 끝점 조건: 위치·속도 (4개)
5차: s = 10τ³ − 15τ⁴ + 6τ⁵ 끝점 조건: 위치·속도·가속도 (6개)
Section 9.2.2.1 of Modern Robotics states that the peak velocity of a cubic is (3/2)·Δ/T (at the middle) and the peak acceleration is 6·Δ/T² (at both ends). Since the acceleration of a cubic suddenly changes from 0 to 6Δ/T² at the starting moment, the jerk (rate of change of acceleration) is infinite at that moment, and the same section explains that this can cause vibration. The quintic eliminates this problem by matching even the endpoint acceleration to 0. The quintic's peak velocity of 15/8·Δ/T and peak acceleration of 10/√3·Δ/T² were left as exercises rather than in the main text of the book, so they were calculated directly and verified numerically in Section 4.
3.2 Minimum Jerk and Minimum Acceleration
Quintic polynomials have another name. Among all smooth trajectories from rest to rest, it is the trajectory that minimizes the integral of squared jerk. Viewed through the calculus of variations, the function minimizing ∫(q⃛)² satisfies q⁽⁶⁾ = 0, making it a quintic polynomial, and 6 endpoint conditions uniquely determine the coefficients (our derivation). Flash and Hogan (1985) reported that human hand movement is well explained by a model that minimizes the integral of squared hand jerk (verified from the abstract, main text unverified).
By the same logic, minimizing the integral of squared accelerationyields q⁽⁴⁾ = 0, resulting in a cubic polynomial. The table tennis robot by Koç et al. (2018) optimized cubic polynomial trajectories for each joint based on this criterion. Since squared acceleration is proportional to squared torque, i.e., copper losses (heat) in the motor, this is an energy-based choice.
3.3 Trapezoidal, S-Curve, and Time-Optimal
When only velocity limits v_max and acceleration limits a_max are given, the fastest motion is "maximum acceleration → maintain peak velocity → maximum deceleration." Because the velocity curve is trapezoidal, it is called a trapezoidal profile, and if the distance is too short to reach peak velocity, it becomes a triangle (bang-bang).
Δ ≤ v_max²/a_max: T_opt = 2·√(Δ / a_max) (삼각형)
그 밖: T_opt = Δ / v_max + v_max / a_max (사다리꼴)
The trapezoidal profile also has infinite jerk because acceleration changes stepwise. Limiting even acceleration changes results in a 7-segment S-curve where the acceleration phase is split into three parts again (Modern Robotics Section 9.2.2.3).
3.4 Hit Trajectory: Final Velocity is Not Zero
The joint trajectory of a table tennis robot consists of two parts.
- Swing: From the current state (rest) to (q_h, q̇_h, q̈ = 0) at hitting time T. Setting the acceleration to 0 at the moment of impact keeps the racket speed nearly constant during the brief contact duration.
- Stop (Follow-through): Returning to rest from that state.
Since a quintic polynomial can take any values for its 6 endpoint conditions, it can form both parts using the same function. A single 6x6 linear system yields the coefficients, and this calculation took 7.2 µs. This is also why Mülling et al. (2013) replaced the target movement of Dynamic Movement Primitives (DMPs) with a quintic polynomial to match endpoint velocity and acceleration (Section 3.2, Eq. 8).
def quintic_coeffs(q0, v0, a0, q1, v1, a1, T):
A = [[1, 0, 0, 0, 0, 0 ],
[0, 1, 0, 0, 0, 0 ],
[0, 0, 2, 0, 0, 0 ],
[1, T, T**2, T**3, T**4, T**5 ],
[0, 1, 2*T, 3*T**2, 4*T**3, 5*T**4 ],
[0, 0, 2, 6*T, 12*T**2, 20*T**3]]
return np.linalg.solve(A, [q0, v0, a0, q1, v1, a1]) # q(t) = Σ c_k t^k
When ball prediction is updated, the current state (position, velocity, acceleration) is taken as a new starting point and re-solved for the remaining time. Because it connects continuously up to the starting point's acceleration, acceleration does not jump when corrections are made.
4. Measurements
4.1 Same Distance, Same Time, Different Shapes
Four trajectories moving Δ = 1 rad in T = 0.3 s were sampled at 100,001 points and numerically differentiated.
| Trajectory | Peak Velocity | Peak Acceleration | Starting Acceleration | Peak Jerk (Internal) | ∫Acceleration² dt |
|---|---|---|---|---|---|
| Cubic | 5.00 rad/s | 66.7 rad/s² | 66.7 | 457 rad/s³ | 444 |
| Quintic (Min Jerk) | 6.25 | 64.2 | 0.01 | 2,262 | 635 |
| Trapezoidal (1/3 each) | 5.00 | 50.0 | 50.0 | (Step) | 500 |
| S-Curve (10% jerk phase) | 5.00 | 71.4 | 0.03 | 2,385 | 612 |
Official values are cubic 5.0·66.7, quintic 6.25·64.15·2,222 (jerk), trapezoidal 5.0·50.0. Numerical differentiation results matched the formulas (quintic jerk is 2% larger due to finite difference error).
- Smoothness has a cost. Instead of making starting acceleration 0, the quintic has a peak velocity 25% higher than the cubic.
- ∫Acceleration² is smallest for the cubic. Exactly as stated in Section 3.2. To save squared torque (heat), choose cubic; to avoid vibration, choose quintic.
- When changing to a joint with 0.03 kg·m² inertia, the peak torques are cubic 2.0, quintic 1.9, trapezoidal 1.5, and S-curve 2.1 N·m. The trapezoidal profile is the lightest in terms of peak torque.
4.2 How Fast Can We Go Within Limits
Given joint limits (v_max, a_max), the minimum time of each trajectory was compared.
| Limits | Δ | Time-Optimal | Quintic | Cubic | Quintic ÷ Optimal |
|---|---|---|---|---|---|
| 20 rad/s, 300 rad/s² | 0.2 rad | 0.052 s | 0.062 s | 0.063 s | 1.20 |
| 20 rad/s, 300 rad/s² | 1.0 rad | 0.115 s | 0.139 s | 0.141 s | 1.20 |
| 20 rad/s, 300 rad/s² | 2.0 rad | 0.167 s | 0.196 s | 0.200 s | 1.18 |
| 10 rad/s, 100 rad/s² | 1.0 rad | 0.200 s | 0.240 s | 0.245 s | 1.20 |
| 10 rad/s, 100 rad/s² | 2.0 rad | 0.300 s | 0.375 s | 0.346 s | 1.25 |
Quintic polynomials are generally 20% slower than time-optimal. In short movements constrained by acceleration limits, this ratio remains constant at √(10/√3 ÷ 4) = 1.20 (our calculation). For fast balls where the time budget in Part 1 is tight, this 20% is precious. Therefore, time-optimal-like trajectories (trapezoidal, S-curve, or optimization with limits as constraints) are used, while smoothness is handled via S-curve jerk limits.
4.3 Minimum Time for Hit Trajectory
Trajectories starting from rest, passing Δ, and reaching q̇_h at that instant were minimized in time under a velocity limit of 20 rad/s and acceleration limits of 300 and 600 rad/s². For quintic, the shortest T was found via bisection, and time-optimal was found from the form "maximum acceleration → (if needed) maximum deceleration to q̇_h".
| Δ | q̇_h | a_max | Quintic T | Time-Optimal T | Extra angle/time to stop |
|---|---|---|---|---|---|
| 0.3 rad | 10 rad/s | 300 | 0.054 s | 0.046 s | 0.17 rad, 33 ms |
| 0.6 rad | 10 rad/s | 300 | 0.082 s | 0.068 s | 0.17 rad, 33 ms |
| 0.6 rad | 10 rad/s | 600 | 0.062 s | 0.051 s | 0.08 rad, 17 ms |
| 0.6 rad | 15 rad/s | 300 | 0.076 s | 0.064 s | 0.38 rad, 50 ms |
| 1.0 rad | 15 rad/s | 300 | 0.102 s | 0.085 s | 0.38 rad, 50 ms |
- Even for the same 0.6 rad, a trajectory with a higher final velocity (15 rad/s) took less time than a slower one (10 rad/s). This is because it can simply keep accelerating from rest. Conversely, passing slowly requires decelerating in the middle.
- The angle q̇_h²/(2·a_max) required to stop after a hit must be reserved in the workspace beforehand. At 15 rad/s, this is 0.38 rad (22°). Hitting right near the joint limit leaves no room to stop.
- Connecting this with the time budget of Part 1, swinging takes 0.05 to 0.1 seconds. Doubling the acceleration limit from 300 to 600 rad/s² reduces it by about 25%. Combined with the velocity limit from Part 5, the acceleration limit (i.e., torque ÷ inertia) is the second key figurein motor selection.
4.4 Via-Points: Stop or Continue
When a joint needs to pass through multiple via-points, two methods were compared: (a) quintic segments stopping at each via-point, and (b) cubic splines not stopping at via-points (zero velocity at both ends). For the splines, both equal segment timing and timing proportional to the square root of travel distance were used, and the minimum total time within limits (20 rad/s, 300 rad/s²) was found via bisection.
| Via-Points (rad) | Stopping Quintic | Spline (Equal Intervals) | Spline (Prop. to √Distance) |
|---|---|---|---|
| 0 → 0.3 → 0.7 → 1.0 (One direction) | 0.240 s | 0.170 s | 0.184 s |
| 0 → 0.6 → 0.2 → 1.0 (Reversing) | 0.319 s | 0.357 s | 0.325 s |
For paths going in one direction, not stopping was 29% faster, but for paths changing direction, the speed has to drop to zero there anyway, making the quintic stop actually faster. The intuition that splines are always fast can be wrong, and how segment times are allocated is as important as the shape(Modern Robotics Section 9.3 covers via-point polynomials).
5. Limitations
- We planned for each joint separately. To align multiple joints at the same time, the others are stretched to match the slowest joint (synchronization). This post did not cover that.
- We set limits as constants. Actual torque limits vary depending on posture (gravity, inertia coupling) and speed (motor torque-speed curve). Part 9 measures the maximum inverse dynamics torque of a two-link arm.
- We only covered joint space trajectories. Task space trajectories, which make the racket draw a straight line in space, require solving inverse kinematics at every moment and can pass through singularities (not measured here).
6. Conclusion
- Cubic polynomials have a sudden starting acceleration, while quintic (minimum jerk) polynomials are smooth but have a 25% higher peak velocity. Cubic minimizes ∫acceleration² (heat), while quintic minimizes ∫jerk² (vibration).
- Within limits, quintic is about 20% slower than time-optimal.
- Table tennis joint trajectories consist of two segments: "passing through a given position at a given velocity" + "stopping", and both can be created with a single quintic polynomial. If the prediction changes, we re-solve from the current state.
- Determining the swing time and the stopping position is governed by acceleration limits.
Titi's Note: You should swing the racket toward where you are passing, not where you are stopping. And you must leave room to stop after hitting. Otherwise, your arm will hit the wall!
References
All materials were accessed on 2026-10-18.
- Lynch, Park, Modern Robotics, 2017, Open Preprint, Chapter 9 (9.2.2.1 Polynomials, 9.2.2.2 Trapezoidal, 9.2.2.3 S-curve, 9.3 Via points, 9.4 Time optimal).
- Flash, Hogan, The coordination of arm movements: an experimentally confirmed mathematical model, J. Neuroscience 5(7) (1985) 1688–1703, Abstract (Europe PMC).
- Koç, Maeda, Peters, Online optimal trajectory generation for robot table tennis, RAS 105 (2018), Author's Open Version.
- Mülling et al., Learning to select and generalize striking movements in robot table tennis, IJRR 32(3) (2013), Author's Open Version, Section 3.2.