Mechanisms and drivetrains
Skill ferret-physics-mechanisms · download all skills · SKILL.md
When to use#
A gearbox, a winch that cannot run back, a wind or water turbine, a brake, a flywheel.
The model#
A Drivetrain holds shafts (inertia J, friction b) joined by couplings (gear, belt, clutch, differential, worm, cardan). Nothing is free: each mesh passes on part of the torque, the rest is heat, and the network keeps the account. Drivers push torque, loads take it. A gear with a limit or a shaft with diameter and shear breaks (machine:break { element, torque }).
Steps#
d.shaft({ name, J, b }), couple them (d.worm(...),d.brake(...)), drive withd.drive(shaft, torqueFn).- Turbines and propellers:
windTurbine,waterTurbine,propellerwithcpCurve. - Step:
d.step(dt, substeps); tie to a scene body withbind(kinematic) orcouple(dynamic). - A worm whose lead angle satisfies
tan λ < μis self-locking. - Commands:
machine.info|set|state|step.
Check afterwards#
Work by drivers equals what loads took plus losses plus stored spin; a locked worm holds the load; a heavier flywheel ripples less.
What usually goes wrong#
- Output does not move: a brake is on (
command1) or the motor drives the wrong shaft. - A shaft spins up without bound: no load and no friction, give
b. - Everything shakes: huge inertia ratio at a coarse step; raise substeps.
bindthrows: the body is not kinematic.machine:stallappears only on shafts that have a driver.
Files#
reference/mechanisms.md— Gearboxes, differentials, clutches, brakes, turbines and propellers: how rotation is carried from a motor to a load, and what makes a part break.reference/api-physics-mechanisms.md— every export of@ferret/physics-mechanismswith signature and doc commentreference/commands.md— 4 commands of these packages with their argumentsrecipes/machines-and-circuits.md— Six recipes: a lamp that surges and burns, a rectifier that smooths, a transformer, a wind turbine lighting a lamp through a generator, a winch that cannot run back, a flywheel that evens out a pulsing drive.