pub fn play_margin(play: &[LoopPoint], closed: &[LoopPoint]) -> f64Expand description
The describing function’s gain margin of a velocity loop across its gearbox’s play, dB, from the loop measured with
the play (play: small signals, the rotor swinging inside it) and with the flanks held together (closed, the
config with effects.gearbox_backlash off). Two things in the loop depend on the swing’s amplitude A. Across the
play the flanks pass their spring’s and their damper’s force only while in contact (Gearbox::torque): over a swing
about it the first harmonic of both is kappa(A) = 1 - (2 / pi) (asin(b / A) + (b / A) sqrt(1 - (b / A)^2)) of the
gear’s impedance y (b the half play), 0 inside the play, 1 far beyond it. And the friction on the rotor (its seals,
the gearbox’s drag, the mesh), which damps the small-signal measurement (Re(1/P) some 0.2 N m s/rad on the five-bar’s
tool turn, three times its J w at 650 Hz), is a Coulomb force whose first harmonic, 4 F / (pi A w), fades as the
swing grows. The margin is taken with it faded: the rotor alone, J_m s (J_m the median of Im(1/P) / w over the upper
half of the play’s band), on kappa y to the load J_L (J_m + J_L from the closed plant at its lowest frequency),
1 / P(kappa) = J_m s + kappa y J_L s / (kappa y + J_L s), y at each frequency from the closed plant (which so holds
the friction’s small-signal share, scaled with kappa), and the rest of the loop, C = L / P, from the closed
measurement. The least gain margin (loop_margins) of L(kappa) = C P(kappa) over kappa from 1e-3 to 1 (301 values,
log spaced), each on 3000 frequencies over the band (C’s log gain and unwrapped phase and y interpolated in log f).
A swing that the friction still damps is quieter: the five-bar’s tool turn reads -3.07 dB at 0.08 N m s/rad, so it
would hammer from 0.0562, where the time run (backlash_hammering, bisected) hammers from 0.0782 with its friction
and from 0.0478 with it off (the impacts’ harmonics and the damper that cannot pull, which the first harmonic leaves
out). NaN where the play does not change the loop (none on that motor: the two measurements within 1e-3 at every
common frequency), where a measurement is not valid, or the inertias do not come out positive.