TT Lab
Blog

한국어 English 日本語 中文

Get started
Blog

Blog

Ball Flight Equations: Gravity, Drag, Magnus, Euler and RK4, Bounce Model, Kalman Filter

Status: Draft (2026-10-18), Measured. The numbers are simulation values calculated directly 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/'s common.py, m06_flight.py, m06b_constants.py, out/m06_flight.json, out/m06b_constants.json. Since the "true trajectory" is also generated using the same model, the difference between the model and the real ball is not included in the numbers in this post (comparison with real ball trajectories has not been measured). The initial ball state is from the DeepMind dataset (CC-BY 4.0). References were accessed on 2026-10-18. Writing rules: Measured data is the default, unmeasurable values are marked as "Unmeasured", and unverified items are marked as "Unverified".

Table of Contents

1. Intuition: A Light and Fast-Spinning Ball

A table tennis ball weighs 2.7 g and has a diameter of 40 mm (ITTF Statutes 2026, 2.3.1 and 2.3.2). Being much lighter than a steel ball of the same size, the pushing force of the air is large relative to its weight. When flying at 5 m/s, the drag is about one-third of the ball's weight, and at 10 m/s, it exceeds the weight. Moreover, a player's ball spins at tens of revolutions per second. A spinning ball drags air more on one side and receives a sideways deflecting force. This is the Magnus effect, and it is why topspin balls drop sharply and backspin balls float.

Therefore, a parabolic trajectory in a vacuum is insufficient for a table tennis robot predictor. However, the more complex the model, the more constants (drag coefficient, Magnus coefficient, restitution, and friction) and states (spin) need to be known. This post looks at that trade-off in numbers.

2. Equations of Motion

m · dv/dt = m g  −  ½ ρ C_D A |v| v  +  ½ ρ A r C_M (ω × v)
dp/dt     = v
m = 2.7 g, r = 0.02 m, A = π r², ρ = 1.225 kg/m³

Table Bounceis modeled as an instantaneous impulse. The normal velocity is inverted by the coefficient of restitution e, and the sliding velocity at the contact point is reduced by Coulomb friction μ, stopping when rolling is reached (contact point velocity of 0). For a thin-shell sphere (I = ⅔ m r²), eliminating two-fifths of the sliding velocity results in rolling.

def bounce(v, w, e=0.876, mu=0.25):
    ux, uy = v[0] - R*w[1], v[1] + R*w[0]          # 접점(공 아래쪽)의 미끄럼 속도
    us = hypot(ux, uy)
    jn = (1 + e) * abs(v[2])                       # 질량당 법선 충격량
    dv = min(mu * jn, 0.4 * us)                    # 마찰은 굴림에 닿으면 멈춤
    jx, jy = -dv*ux/us, -dv*uy/us
    k = M / I_BALL                                 # = 1.5 / R²
    return (v[0]+jx, v[1]+jy, -e*v[2]), (w[0] + k*R*jy, w[1] - k*R*jx, w[2])

2.1 Where Do Constants Come From?

Constant This series Values and conditions verified in literature
Drag coefficient C_D 0.47 Sony AI 2026 Table I: 0.55 at 2.5 m/s, 0.37–0.51 at 17.5 m/s depending on spin ratio. PyBullet setting in Google 2023 is 0.47. Converting the lumped constant 0.141 1/m from Koç et al. 2018 Table A.3 using an air density of 1.2 gives about 0.50 (our calculation)
Magnus (per mass) 3.4×10⁻³ Lift constant 1.0×10⁻³ 1/rad from Koç et al. 2018 Table A.3. Effective value 7.6×10⁻³ measured in the MuJoCo simulator of the same project (DeepMind coefficients). The three values differ by more than 7 times
Table restitution e 0.876 ITTF 2.1.3 (30 cm → approx. 23 cm) converted without air. Measured 0.93 by Nakashima et al. 2010, estimated 0.883 by Koç et al. 2018
Table friction μ 0.25 Kinetic friction measured as 0.25 by Nakashima et al. 2010 (Sony AI 2026 uses the same value). Estimated 0.102 by Koç et al. 2018

The reason Magnus coefficients vary widely across literature is due to differences in definitions (what is lumped and called a constant) and measurement conditions (speed, spin ratio). Sony AI 2026 tuned C_M to change linearly or quadratically depending on the spin ratio. Section 5 of this post directly measures how much this uncertainty shakes predictions.

3. Euler and RK4

To solve differential equations on a computer, time is divided into small steps to advance step by step. The simplest Euler method moves straight by dt using the current slope. RK4 (Fourth-order Runge-Kutta) measures the slope four times within a single step and takes a weighted average.

오일러:  v ← v + a(v)·dt,   p ← p + v·dt                        (걸음당 기울기 1번, 오차 ∝ dt)
RK4:     k1 = f(x), k2 = f(x + k1·dt/2), k3 = f(x + k2·dt/2), k4 = f(x + k3·dt)
         x ← x + (k1 + 2k2 + 2k3 + k4)·dt/6                    (걸음당 4번, 오차 ∝ dt⁴)

3.1 Measurement: Position Error after 0.4 Seconds

A ball starting at position (0, 1.2, 0.25) m, velocity (0.3, −7.0, 1.2) m/s (speed 7.1 m/s), and topspin 80 rad/s was flown for 0.4 seconds without bouncing. The reference is RK4 with dt = 0.01 ms.

적분 간격과 0.4초 뒤 위치 오차 0.5 1 2 5 10 1e-12 1e-09 1e-06 0.001 1 100 적분 간격 dt(ms, 로그) 오차(mm, 로그) 오일러 반암시적 오일러 RK4 기준: RK4 dt = 0.01 ms. 출발 7.1 m/s, 탑스핀 80 rad/s, 바운스 없음. 오일러는 dt 를 반으로 줄이면 오차도 반(1차), RK4 는 16분의 1(4차).
Figure: Position error of Euler, semi-implicit Euler, and RK4 according to integration interval
Method dt Error after 0.4 s Time per trajectory calculation
Euler 0.5 ms 0.96 mm 808 µs
Euler 1 ms 1.92 mm 406 µs
Euler 10 ms 19.3 mm 42 µs
Semi-implicit Euler 1 ms 2.81 mm 430 µs
RK4 1 ms 9.4×10⁻¹¹ mm 3,296 µs
RK4 5 ms 5.7×10⁻⁸ mm 658 µs
RK4 10 ms 9.1×10⁻⁷ mm 339 µs

4. What Spin and Bounce Change

4.1 Spin Shifts the Bounce Point

We compared the points where a ball starting from the opponent's side at (0, 1.2, 0.25) m with velocity (0, −6, 1) m/s first hits the robot's side of the table, varying only the spin.

Spin 50 rad/s 100 rad/s 150 rad/s
Topspin: Bounce shifts toward the net +10.3 cm +19.4 cm +27.3 cm
Backspin: Bounce shifts toward the end line −11.8 cm −25.7 cm −41.7 cm

Without spin, it lands at y = −0.62 m in 0.344 seconds. Since the median spin immediately after a shot in the dataset of Part 1 was 49 rad/s and the 95th percentile was 100 rad/s, spin shifts the bounce point by 10 to 25 cm even for an average amateur ball.

4.2 Bounce Check: ITTF Drop Test

The bottom of the ball was dropped from a 30 cm height, and the rebound height was measured. If e = 0.876, it should be 23 cm without air resistance, but in our model with drag, it was 21.5 cm . This is because drag robs energy during the fall and rise. To match 23 cm while including drag, e = 0.907 was required (bisection method). This value lies between the measured 0.93 by Nakashima et al. 2010 and 0.883 by Koç et al. 2018. Even a single coefficient of restitution varies by 3% depending on "what was ignored when matching".

4.3 Friction Coefficient and Spin

Assuming the same ball is received at a plane 23 cm behind the end line (y = −1.6 m), changing the table friction μ altered the passing height (above the table) as follows.

Spin μ = 0.10 μ = 0.25 μ = 0.40
Backspin 100 rad/s 0.19 m 0.18 m 0.15 m
No spin 0.17 m 0.12 m 0.02 m
Topspin 100 rad/s 0.10 m 0.005 m 0.005 m

For topspin balls, μ = 0.25 and 0.40 yield the same result. This is because the contact point reaches a rolling state during the bounce, and friction no longer does work. Balls without spin were most sensitive to friction. Spin and friction cannot be tuned separately; they must be tuned together.

5. How Much Do Uncertainties in Constants Shake Predictions?

We measured the difference in passing position and time at the racket surface (y = −1.6 m) between running 1,000 dataset balls with default constants and running them with a single constant changed (m06b_constants.py).

Changed constant Position difference median / 90% Time difference median Balls not reaching the racket surface
C_D 0.47 → 0.40 3.1 / 12.4 cm 30 ms 21
C_D 0.47 → 0.55 3.9 / 14.8 cm 35 ms 35
Magnus → Koç value (1.0×10⁻³) 5.4 / 11.5 cm 6.7 ms 43
Magnus → MuJoCo effective value (7.6×10⁻³) 10.4 / 22.3 cm 11.3 ms 53
No Magnus 7.4 / 15.5 cm 9.6 ms 72

The drag coefficient changes timemore significantly than position. A difference of 0.07 created a 30 ms shift, which corresponds to four camera frames in the time budget of Part 1. The Magnus coefficient significantly changes position. Simply shifting between literature values caused the racket surface position to vary by 5 to 10 cm. These constants must be re-tuned for our balls and table after building the robot. Sony AI 2026 reports that re-tuning coefficients using about 58,000 trajectories gathered from 9 cameras reduced the landing point median error from 0.37 m to 0.15 m.

6. Kalman Filter: Extracting State from Noisy Observations

Cameras only provide positions, and those positions also contain noise. Velocity requires differentiating position, but differentiation amplifies noise. The Kalman filter blends the "state predicted by the model" and "new observations" according to their respective uncertainties to estimate position and velocity together. If the model is non-linear (drag), it becomes the Extended Kalman Filter (EKF), which linearizes the model at every step.

sp = f_state(s, dt)                               # 예측: RK4 로 한 프레임 앞으로
F  = finite_difference_jacobian(f_state, s, dt)   # 선형화
P  = F @ P @ F.T + Q                              # 불확실성도 함께 전파
K  = P @ H.T @ inv(H @ P @ H.T + R)               # 칼만 이득: 모델과 관측의 신뢰 비율
s  = sp + K @ (z - H @ sp)                        # 갱신: 관측 z(위치 3개)로 고침
P  = (I - K @ H) @ P

6.1 Measurement: What Improves Prediction?

We selected 200 actual ball trajectories leading up to the striking surface from the dataset to create the true trajectories (drag + actual spin + bounce). Camera observations were simulated at 60, 120, and 240 fps with per-axis Gaussian noise sigma of 3 and 10 mm. After observing for 0.1, 0.2, and 0.3 seconds immediately after impact, the filter state predicted the crossing position at the striking surface y = −1.6 m. There are three filter models.

타격면 예측 오차: 관측 시간보다 모델이 중요하다 0 5 10 15 15.3 7.0 1.3 처음 0.1초 관측 13.3 5.6 0.5 처음 0.2초 관측 10.5 4.8 0.5 처음 0.3초 관측 A 중력만 B +항력 C +항력+참 회전 중앙 오차(cm) 120 fps, 잡음 σ 3 mm, 실제 타구 200개. 타격면은 끝줄 뒤 23 cm(y = −1.6 m).
Figure: Observation time and striking surface prediction error by model

Results for 120 fps, sigma = 3 mm (median of 200 balls).

Observation time A Position error B Position error C Position error B Time error C Time error
0.1 s 15.3 cm 7.0 cm 1.3 cm 14 ms 2.9 ms
0.2 s 13.3 cm 5.6 cm 0.5 cm 13 ms 1.3 ms
0.3 s 10.5 cm 4.8 cm 0.5 cm 10 ms 1.2 ms

Results varying frame rate and noise (0.2 s observation, median position error).

Condition B (Unknown spin) C (Known spin)
60 fps, sigma 3 mm 5.9 cm 0.77 cm
120 fps, sigma 3 mm 5.6 cm 0.51 cm
240 fps, sigma 3 mm 5.9 cm 0.39 cm
60 fps, sigma 10 mm 6.2 cm 2.0 cm
240 fps, sigma 10 mm 6.0 cm 1.2 cm

Mülling et al. (2013) used four 60 Hz cameras and an EKF, but omitted spin from the EKF model because spin is difficult to observe (Section 3.1). Koç et al. (2018) also used four 60 Hz cameras and an EKF, including a lift term in the flight model, but did not verify how the filter handles spin (unverified). This actual measurement shows that the cost of that choice is several centimeters. Since the racket face radius is around 7 to 8 cm, it is manageable, but as seen in Part 7, it directly impacts landing point accuracy.

7. Limitations

8. Conclusion

TT Takeaway. Even if you upgrade to a camera four times faster, if you don't know the spin, the ball will arrive about 5 cm off. Figuring out how the ball is spinning comes first!

References

All materials were accessed on 2026-10-18.

Sign in to like

Comments

No comments yet.

Sign in to leave a comment