hitgavin

Gravity doesn't matter for joint PID tuning

A placeholder, here to prove the pipeline works end to end: frontmatter, series filing, KaTeX, and code highlighting.

The claim

A robot joint under a PD loop sees gravity in two distinct ways, and they are ninety degrees out of phase with each other. Hanging straight down there is no gravity torque but maximum gravitational stiffness; held horizontally it is the reverse.

The plant is

P(s)=ΔθΔτ=1Js2+bs+kg,kg≡∂g∂θP(s) = \frac{\Delta\theta}{\Delta\tau} = \frac{1}{Js^2 + bs + k_g}, \qquad k_g \equiv \frac{\partial g}{\partial \theta}

The constant torque τg\tau_g never appears in P(s)P(s) at all. It shifts the operating point and nothing else, so

∂(any stability margin)∂τg≡0\frac{\partial(\text{any stability margin})}{\partial \tau_g} \equiv 0

exactly, by linearity. Not approximately. Exactly.

Where kgk_g goes

The stiffness term does survive, but only through a single dimensionless group:

ε≡(ωgωc)2,ωg=∣kg∣J\varepsilon \equiv \left(\frac{\omega_g}{\omega_c}\right)^2, \qquad \omega_g = \sqrt{\frac{|k_g|}{J}}

and ωg\omega_g is bounded by geometry alone. Because J≥mℓ2J \ge m\ell^2 by the parallel axis theorem while ∣kg∣max⁡=mgℓ|k_g|_{\max} = mg\ell, the mass cancels:

ωg≤g/ℓ\omega_g \le \sqrt{g/\ell}

For a human-scale limb this caps the gravity corner near 1 Hz regardless of how heavy the arm is.

Code renders too

import numpy as np

def gravity_corner_hz(k_g: float, inertia: float) -> float:
    """Gravity corner frequency in Hz, the only place gravity enters tuning."""
    return np.sqrt(abs(k_g) / inertia) / (2 * np.pi)

Replace this file with the real article. Omitting draft entirely marks a post as a draft — publishing is opt-in, so nothing ships by accident.


Filed under Equations to Encoders.Tags: control, system identification, robotics.