TOML configuration
Keep reusable settings in source TOML overlays and generate a complete TOML
for each run. The generated file records the firmware, tools, model, parameters,
and helper commands. The generator resolves tool locations and replaces legacy
${NAME:-default} expressions with their literal defaults.
For reusable changes, write a small overlay, for example my-copter.toml:
[FMU.models.quadrotor.parameters]
mass = 2.7
[Run.processes.mission]
enabled = false
Then generate the complete configuration:
fastdyn-config --base configs/copter462.toml \
--overlay my-copter.toml --output out/my-copter.toml
Overlays merge tables recursively; an array or scalar replaces the previous
value. Repeat --overlay to apply files in order. Model parameters in an overlay
are merged with the base parameters, so explicitly override every physical
quantity that changes with the vehicle.
Tools and model selection
[FMU]
compiler = "rumoca"
active = "quadrotor"
auto_build = true
[FMU.models.quadrotor]
model = "FastDyn.Copter"
model_file = "modelica/FastDyn/Copter.mo"
source_roots = ["modelica", "third_party/common/modelica_models"]
output = "out/fmi3/Copter"
build = true
release = false
[FMU.models.quadrotor.parameters]
mass = 2.5644001
arm_length = 0.25
compiler can be a name on PATH or the executable path generated by Nix.
Without it, FastDyn runs Cargo in the pinned Rumoca submodule. release
selects Cargo’s build profile and has no effect on a prebuilt compiler.
auto_build checks whether the FMU is absent or older than the Modelica source
files. After changing the compiler revision, explicitly rebuild with
utils/build_fmi3_fmu.py; the timestamp check does not detect compiler changes.
Numeric scalars and rectangular arrays are passed during FMI initialization.
Unknown names and incompatible dimensions are rejected. A compiler can fold
derived expressions into constants: when changing physical properties, prefer
a Modelica variant and rebuild, then verify the values evaluated by the FMU.
The payload study compiles every variant for this reason.
Vehicle parameters
For FastDyn.Copter, mass is in kg and inertia[3,3] is the body
inertia tensor in kg m². For a diagonal tensor, a TOML override is:
[FMU.models.quadrotor.parameters]
inertia = [[0.02601237985, 0.0, 0.0], [0.0, 0.02590943825, 0.0], [0.0, 0.0, 0.045571756801]]
An override must refer to an independent FMI parameter. A Modelica parameter
bound to another parameter can be exported as calculatedParameter; FastDyn
rejects writing it before launching the firmware. Set the independent source
parameter instead, or change the Modelica binding and rebuild. The payload’s
attachment_b uses explicit motor coordinates so all three components remain
editable from TOML.
Use the parameter names exposed by the model you are compiling.
arm_length is the center-to-motor distance, so the motor
diagonal is twice that number. Thrust is Ct * omega²; Cm is the rotor
torque-to-thrust ratio in meters. PWM spans pwm_min to pwm_max, mapped to
omega_min through omega_max in rad/s. tau_up and tau_down set the
motor response times in seconds.
lat0, lon0, and ground_alt_wgs84 define the geodetic origin. If you move
it, update the mission waypoint coordinates too. The model source files list
the parameters for Plane and Rover.
Firmware and helpers
[[CPU.cpu0]] selects the firmware binary, plugin library, and existing
peripheral configuration. [Machine] selects QEMU, the board, and timing.
The supplied ArduPilot examples use a 1 ms timer IRQ; keep that setting for
these firmware builds.
[Run.processes.mavproxy] records telemetry and starts the viewer.
[Run.processes.mission].command supplies the MAVLink endpoint, ArduPilot
parameter file, and QGC WPL waypoint file. Edit those literal arguments in
TOML to select another mission or tune. ArduPilot’s native parameter file is
separate from the plant’s TOML parameters: controller gains change firmware
behavior, while mass and inertia change the simulated vehicle.
Set a helper’s enabled = false to disable it. Use terminate_run_on_exit = true for a mission that should end the simulation when it completes.
[Rumoca].enabled controls a separate optional Rumoca process; it is false
for the FMI-in-QEMU examples.
The repository’s docs/Configuration.md provides the broader peripheral and
device-model reference.