pub struct Gearbox {Show 19 fields
pub ratio: f64,
pub stiffness: f64,
pub damping: f64,
pub half_backlash: f64,
pub efficiency: f64,
pub band: f64,
pub band_compliance: f64,
pub hysteresis: f64,
pub dahl_stiffness: f64,
pub back_ratio: f64,
pub anchor: [f64; 2],
pub twist_scale: f64,
pub knees: [f64; 2],
pub upper: [f64; 2],
pub mesh_stiffness: f64,
pub mesh_anchor: f64,
pub relax_stiffness: f64,
pub relax_time: f64,
pub travel: Option<TravelCompliance>,
}Expand description
Gearbox between motor shaft and pulley: ratio, torsional stiffness, backlash as a dead zone, efficiency. Stiffness, damping and backlash are given at the output side.
The torsional characteristic, as makers measure it with the input locked (e the twist beyond half the backlash):
- Lost motion (effects.gearbox_lost_motion): the flanks do not take the load at once. Over a band b beyond the backlash the stiffness rises from 0 to K1, T = K1 e^2 / (2 b); beyond it T = K1 (e - b/2). And a hysteresis: the twist under load lags the torque by a friction torque T_h in the flanks and bearings, so that loading and unloading run on two curves apart by 2 T_h / K1 in angle (Harmonic Drive: “hysteresis loss”, the loop’s width at zero torque). The friction is a state, Dahl’s model on the contact twist x (the twist beyond the backlash, signed): dz/dx = sigma (1 - sgn(dx) z / T_h), in parallel with the spring. It holds its torque at rest, and at small amplitudes it is a spring of sigma (the gear is stiffer, K1 + sigma, not locked); over a twist of a few T_h / sigma it reaches +-T_h. Both 0 with the effect off.
- Three-segment stiffness (effects.gearbox_stiffness_curve): K1 up to T1, K2 from T1 to T2, K3 beyond, as Harmonic Drive gives it for its strain wave gears; the twist at T is T / K1 below T1, T1 / K1 + (T - T1) / K2 below T2, T1 / K1 + (T2 - T1) / K2 + (T - T2) / K3 above. Off: K1 throughout.
Fields§
§ratio: f64§stiffness: f64K1, N m/rad.
damping: f64§half_backlash: f64§efficiency: f64§band: f64b, rad.
band_compliance: f64c, rad / (N m): a spring in series with the gear’s flanks that K1 (and K2, K3) already hold, 0 for a gear alone.
Behind a converter it is the converter’s own compliance (Converter::apply_to): over the band the flanks stiffen
and the converter’s spring does not, so the band’s curve is the flanks’ plus c T (spring).
hysteresis: f64T_h, N m.
dahl_stiffness: f64Dahl’s sigma, the hysteresis’s stiffness at a reversal, N m/rad: gearbox.hysteresis_stiffness_factor times K1,
K1 itself where the key is absent (no maker publishes the loop’s shape at a reversal).
back_ratio: f64The efficiency driven back over the efficiency driving, 1 for a gear that loses alike both ways (loss_factor).
A screw sets it from its lead angle (Converter::apply_back).
anchor: [f64; 2]The hysteresis’s state where the last step ended: the contact twist x and its torque z there (commit; behind a
screw whose stiffness follows the nut, on the reference’s twist y = r x, at). Within a
step z follows Dahl’s law exactly from it for a twist that runs one way (hysteresis_torque). A NaN twist: not
stepped yet, z is 0 at the twist of the first step’s end.
twist_scale: f64r of at, the gear’s own twist y = r x over the contact twist x: 1 on the gear itself, where anchor is in x. On
at’s gear the anchor’s twist stays the reference’s y0, so that the branch at the anchor compares x r with it,
the same product commit stored, not x with y0 / r, which rounding puts an ulp to either side.
knees: [f64; 2][T1, T2], N m; infinite with the curve off.
upper: [f64; 2][K2, K3], N m/rad.
mesh_stiffness: f64With effects.gearbox_mesh_friction: the stiffness of the mesh friction’s bristle against the housing (presliding),
N m/rad at the output (N/m behind a screw, rack or drum: Converter::apply), MESH_STIFFNESS times K1; 0 with
the effect off (mesh_friction).
mesh_anchor: f64The output angle at which the mesh friction’s bristle is relaxed, where the last step ended (commit); NaN before
the first step (no friction yet).
relax_stiffness: f64Behind a converter with a damper (Converter::apply_back): the damper bridges the gear’s spring and not the
converter’s in series with it, a three-element (Zener) solid. It stands here in its Maxwell form, the series
spring as above in parallel with an arm of a spring K_m (relax_stiffness, N/m) and a damper of time constant
tau (relax_time, s) in series, whose end u is a state of the machine (arm). 0 for none: the damping then
bridges the whole spring (damping), as it does in the slow limit of an arm faster than the integrator follows.
relax_time: f64§travel: Option<TravelCompliance>Behind a ball screw with effects.screw_stiffness_with_position: the shaft’s compliance follows the nut
(TravelCompliance); the fields above hold it at the reference position. None: one stiffness for the stroke.
Implementations§
Source§impl Gearbox
impl Gearbox
pub fn from_config(cfg: &Config) -> Result<Self, ConfigError>
Sourcepub fn at(&self, travel: f64) -> Cow<'_, Self>
pub fn at(&self, travel: f64) -> Cow<'_, Self>
The gear with the nut at travel along the screw: behind a screw whose stiffness follows the nut (travel), its
springs K1, K2, K3 each in series with the shaft’s compliance there less the reference’s, dc, and the band’s
series spring c + dc (the flanks’ own k_f stays: 1 / k_f = 1 / K1 - c). The screw’s damper keeps its damping
ratio, and it and the gear’s damper in series are laid out at the screw’s stiffness there, the damper and the
Maxwell arm (TravelCompliance::dampers; an arm the build folded into the damper, faster than the integrator
follows, stays folded). Itself otherwise. The nut sits on the shaft’s point the rotor has turned to it, the rotor’s
angle over the ratio (nut); at a pose the joint’s travel, which is that less the twist.
The hysteresis is a friction across the gear’s own flanks, so it acts on the gear’s own twist, which the spring’s
force tells (F / K_g), not on the twist through the gear and the screw, which grows with the shaft at a force: its
state lives on y = r x, x the contact twist and r = K1(here) / K1 (the reference’s K1 x and K1(here) x are the
same force), with the reference’s T_h and sigma. Seen in x that is T_h r, sigma r^2 and the anchor (y0 / r, r z0),
its twist kept as y0 with r beside it (twist_scale):
the friction at the joint, K1 lever T_h / K_g, follows K1 as Converter::apply_back has it at the reference, the
loop keeps its width 2 T_h / K1 in the twist, and a load carried along the stroke leaves the state where it was.
Its store z^2 / (2 sigma) is the reference’s in y; what the nut’s place adds to y, x r’(s), is work on it the rotor
does (hysteresis_place). The mesh friction’s bristle, a stiffness of the gear’s own flanks as the hysteresis’s
Dahl stiffness is, follows K1 as well: sigma_m r (its bound follows the spring’s force there).
Sourcepub fn softest(&self, (lo, hi): (f64, f64)) -> Cow<'_, Self>
pub fn softest(&self, (lo, hi): (f64, f64)) -> Cow<'_, Self>
The gear where the screw behind it is softest over the joint’s travel lo..=hi (at): the shaft’s compliance
grows with the nut’s distance from the fixed bearing, so an end of the travel, or with both ends held the
shaft’s middle where the travel reaches it. Itself without a screw that follows the nut.
Sourcepub fn configured_efficiency(cfg: &Config) -> Result<f64, ConfigError>
pub fn configured_efficiency(cfg: &Config) -> Result<f64, ConfigError>
The efficiency as configured: 1 with effects.gearbox_efficiency off. With effects.gearbox_drag the teeth’s
alone (GearDrag::tooth_efficiency): gearbox.efficiency holds at gearbox.efficiency_torque_nm with the drag.
Sourcepub fn is_coupling(&self) -> bool
pub fn is_coupling(&self) -> bool
A ratio of 1 is a direct drive: the table describes the coupling between motor and pulley, there is no
gearbox, and what loss_power gives is the coupling’s damping.
Sourcepub fn spring(&self, e: f64) -> (f64, f64)
pub fn spring(&self, e: f64) -> (f64, f64)
The spring’s (torque, energy) at a twist e >= 0 beyond the dead zone: the lost-motion band, then the three
segments in x = e - b/2.
In the band the flanks twist e_f = sqrt(2 b T / k_f) and the series spring c T, so e = e_f + c T, a quadratic in sqrt(T), with the energy T e_f / 3 + c T^2 / 2; the band ends at e = b + c T_b. Beyond it the line K1 x reaches T_b at x = b/2 + c T_b (1 / K1 = 1 / k_f + c), and the energy there is k_f b^2 / 24 + K1 x^2 / 2. Without the series spring T = K1 e^2 / (2 b).
Sourcepub fn spring_twist(&self, torque: f64) -> f64
pub fn spring_twist(&self, torque: f64) -> f64
The twist beyond the dead zone that the spring needs for torque >= 0: the inverse of spring.
Sourcepub fn loss_factor(&self, output_torque: f64, output_speed: f64) -> f64
pub fn loss_factor(&self, output_torque: f64, output_speed: f64) -> f64
Factor on a torque at the output: efficiency when driving, 1 / (back efficiency) when driven back, the back
efficiency being the efficiency times back_ratio (the same, 1 / efficiency, for a gear that loses alike).
Sourcepub fn fade_damping(&self, output_torque: f64, output_speed: f64) -> f64
pub fn fade_damping(&self, output_torque: f64, output_speed: f64) -> f64
The damper the efficiency’s switch puts on the output’s speed while the gear passes output_torque near zero
power: the two flanks meet over tanh(T w / 0.5 W), so the factor changes with w by up to T^2 |ln eta| / 0.5 W
(N m s/rad, or N s/m on a travel). 0 while the power output_torque times output_speed stands more than
FADE_NEAR times the 0.5 W off zero, where the factor stands still (fade_substeps refines the step by it).
0 too where the mesh friction holds (its anchor committed, torque_arm): the friction’s bristle then sticks and
slides between the drive’s and the driven-back bound, and the faded factor is not in the torque at all.
Sourcepub fn hysteresis_torque(&self, x: f64, rate: f64) -> (f64, f64)
pub fn hysteresis_torque(&self, x: f64, rate: f64) -> (f64, f64)
The hysteresis torque z at the contact twist x and its slope dz/dx: Dahl’s law solved from the anchor for a twist
that ran one way to x, z = s T_h - (s T_h - z0) exp(-sigma |x - x0| / T_h), s the sign of x - x0, or of the
twist’s rate at the anchor itself (where a step has just ended). Behind a screw whose stiffness follows the nut
the anchor’s twist is y0 and x - x0 is (x r - y0) / r (twist_scale), and at the anchor rate is the gear’s own
twist’s, y’ / r (loss_arm).
Sourcepub fn anchors<'a>(gears: impl IntoIterator<Item = &'a Gearbox>) -> Vec<f64>
pub fn anchors<'a>(gears: impl IntoIterator<Item = &'a Gearbox>) -> Vec<f64>
The hysteresis anchors of gears, two numbers each, and the mesh friction’s where it has one: what commit
carries between steps (Machine::memory).
Sourcepub fn set_anchors<'a>(
gears: impl IntoIterator<Item = &'a mut Gearbox>,
memory: &[f64],
)
pub fn set_anchors<'a>( gears: impl IntoIterator<Item = &'a mut Gearbox>, memory: &[f64], )
Sets back what anchors gave (Machine::set_memory).
Sourcepub fn commit(&mut self, rotor_angle: f64, out_angle: f64)
pub fn commit(&mut self, rotor_angle: f64, out_angle: f64)
Ends a step: the hysteresis’s state moves on to the twist the step ended at (Machine::after_step).
Sourcepub fn torque(
&self,
rotor_angle: f64,
rotor_speed: f64,
out_angle: f64,
out_speed: f64,
) -> GearTorque
pub fn torque( &self, rotor_angle: f64, rotor_speed: f64, out_angle: f64, out_speed: f64, ) -> GearTorque
The torques without the Maxwell arm (arm): a gear’s whole torque where it has none.
Sourcepub fn torque_with(
&self,
rotor_angle: f64,
rotor_speed: f64,
out_angle: f64,
out_speed: f64,
u: f64,
) -> GearTorque
pub fn torque_with( &self, rotor_angle: f64, rotor_speed: f64, out_angle: f64, out_speed: f64, u: f64, ) -> GearTorque
torque with the Maxwell arm at its state u (arm).
Sourcepub fn mesh_friction(&self, held: f64, out_angle: f64) -> f64
pub fn mesh_friction(&self, held: f64, out_angle: f64) -> f64
With effects.gearbox_mesh_friction: the friction in the mesh at the output, against the housing, when the gear
passes held (its spring’s and hysteresis’s torque) at the output angle out_angle. It opposes the output’s
motion, bounded by mu |held| with mu = 1 - eta (eta the teeth’s efficiency), so that driving the output gets
eta held and driven back it takes (1 + mu) held: the back-driving efficiency is 1 / (1 + mu) = 1 / (2 - eta).
A gear with its own back efficiency (back_ratio r not 1: a screw’s or a worm’s lead angle) is driven back at
exactly eta r, as loss_factor has it: the bound there is 1 / (eta r) - 1 (a worm of 0.763 driving and 0.693
back would get 0.734 back from r / (2 - eta)). At
rest it sticks: an elastic-plastic bristle of mesh_stiffness from the anchor where the last step left it, the
friction sigma (out - anchor) up to the bound. 0 before the first step’s commit (the gear then has the faded
efficiency) and with the effect off.
Sourcepub fn arm(&self, rotor_angle: f64, out_angle: f64, u: f64) -> (f64, f64)
pub fn arm(&self, rotor_angle: f64, out_angle: f64, u: f64) -> (f64, f64)
The Maxwell arm’s force and the rate of its state u (relax_stiffness): with x the contact twist (0 in the dead
zone), F = K_m (x - u) and du/dt = (x - u) / tau. At rest u = x and the arm carries nothing, so the static
stiffness is the series spring’s. (0, 0) without an arm.
For a gear of K1 at the joint, K_g, damping c across it and a converter of K_c in series (node between them
massless), the series pair is K_c (K_g + c s) / (K_c + K_g + c s); the arm’s K_m = K_c^2 / (K_c + K_g) and
tau = c / (K_c + K_g) give the same beside K_s = K_c K_g / (K_c + K_g): K_s + K_m tau s / (1 + tau s). The arm
is the K1 line’s: over the lost-motion band and the stiffness curve’s upper segments the gear is softer, and
there the arm stays the K1 line’s. In the dead zone its force does not reach the flanks (torque_with) and it
relaxes towards x = 0 by the same law.
Sourcepub fn arm_rest(&self, rotor_angle: f64, out_angle: f64) -> f64
pub fn arm_rest(&self, rotor_angle: f64, out_angle: f64) -> f64
The arm’s state at rest: the contact twist, where it carries nothing.
Sourcepub fn energy_with(&self, rotor_angle: f64, out_angle: f64, u: f64) -> f64
pub fn energy_with(&self, rotor_angle: f64, out_angle: f64, u: f64) -> f64
energy with the arm’s spring at its state u, K_m (x - u)^2 / 2 (K_m at the nut’s place, at).
Sourcepub fn damping_at(&self, omega: f64) -> f64
pub fn damping_at(&self, omega: f64) -> f64
The viscous damping the gear puts on a ring of omega rad/s for the modes: damping, and the arm’s
K_m tau / (1 + (omega tau)^2) (the imaginary part of its K_m i omega tau / (1 + i omega tau) over omega).
Sourcepub fn spring_twist_signed(&self, output_torque: f64) -> f64
pub fn spring_twist_signed(&self, output_torque: f64) -> f64
The twist beyond the backlash that transmits output_torque at rest, with its sign: the spring’s alone.
Sourcepub fn static_twist(&self, output_torque: f64) -> f64
pub fn static_twist(&self, output_torque: f64) -> f64
Twist at rest that transmits output_torque, on the matching side of the backlash.
Sourcepub fn static_twist_at(&self, travel: f64, output_torque: f64) -> f64
pub fn static_twist_at(&self, travel: f64, output_torque: f64) -> f64
static_twist at the joint’s travel travel: the nut on the shaft’s point travel plus the twist (at), which
one step from the twist at travel finds to (c’ x)^2 of it.
Sourcepub fn held_at(&self, travel: f64, output_torque: f64) -> f64
pub fn held_at(&self, travel: f64, output_torque: f64) -> f64
What the rotor holds at rest, times the ratio, against a torque F at the output with the nut at travel: the
spring passes F, and behind a screw whose stiffness follows the nut the rotor feels F - F^2 c’ / 2
(travel_force). F itself otherwise.
Sourcepub fn energy(&self, rotor_angle: f64, out_angle: f64) -> f64
pub fn energy(&self, rotor_angle: f64, out_angle: f64) -> f64
The energy in the spring and in the hysteresis’s state, z^2 / (2 sigma). Not the mesh friction’s bristle: see
loss_power.
Sourcepub fn loss_power(
&self,
rotor_angle: f64,
rotor_speed: f64,
out_angle: f64,
out_speed: f64,
) -> f64
pub fn loss_power( &self, rotor_angle: f64, rotor_speed: f64, out_angle: f64, out_speed: f64, ) -> f64
Power the gearbox takes, W: what the rotor puts in less what the output gives the pulley and what spring and hysteresis store. The efficiency loss, the damping and the hysteresis’s friction, s x’ z^2 / T_h.
The mesh friction counts as F w, all of its power: its bristle’s store F^2 / (2 sigma) is neither in energy
nor taken off here. Its rate, F dF/dt / sigma, depends on whether the bristle sticks or slides, which at a
step’s end (where commit leaves it exactly at its bound) says nothing about the step itself: there the anchor
stands, the output runs many bristle lengths (0.1 m/s over 62.5 us is 6e-6 m against mu |held| / sigma = 1e-7 m on
a carriage hung in four cables) and the friction slides at the bound throughout, also where the bound grew faster than
sigma w at the ends. Booked that way it missed 1.80 J of 38.17 J on that carriage’s cycle, at any step
(dt / 4 the same), and 10.8 J at 3 sigma. Left out, what is not booked is the store itself, at most
(mu |held|)^2 / (2 sigma) per gear: 4e-7 J there.