Physics is the source of truth
Lothal has one physics model. The numbers on every page in Lab, the benches, the HUD in Sim, the sound of the motors and the recorded flight logs all read from the same model. Nothing on screen does its own arithmetic about the drone. That is why the flight time on the Battery row and the flight time left on the Sim HUD agree: both come from the same calculation.
What the model is
Section titled “What the model is”- A flight model running at about 1,000 steps a second. Sim takes eight small steps inside each of its 120-per-second physics ticks. The benches use the same model at the same rate.
- Motors and propellers from measured thrust data. Thrust and torque coefficients are fitted from manufacturers’ published thrust tables, not guessed. A motor’s RPM follows the pack’s live voltage, and it reaches a new speed with a short lag rather than instantly.
- Packs that sag. Voltage drops under load and as the pack empties. Motors are limited by the current the pack, the ESC and the motor itself can supply.
- Inertia from where each part sits. The mass and inertia of the drone are built up from every part at its real position: the pack where it is strapped, the flight controller on its standoffs, the motors at the ends of the arms.
- Air. Thrust depends on air density, so the site’s elevation and the day’s temperature change it. Propellers make less thrust at the same RPM as the drone flies faster.
- A flight controller with an inner rate loop, a gyro with noise, and angle and acro modes.
The heavy parts of the physics run in a compiled Rust library, which is why building from source needs a Rust toolchain.
Why it matters
Section titled “Why it matters”Because Sim flies the model and Lab shows the model, what you read in the garage is what you fly in the field. Swap a 4S pack for 6S and the thrust-to-weight, hover throttle and flight time change in Lab, and the drone in Sim feels different, for the same reason.
What it is not
Section titled “What it is not”A model is not the real drone. See Guessed, sourced and measured for how sure Lothal is about each kind of number, and What Lothal does not model yet for the gaps.
Related
Section titled “Related”Documentation licensed underCC BY 4.0. Lothal itself is GPL-3.0-or-later.Report a problem.Roadmap.