embeddyn¶
Emulate, test and tune a whole embedded system — the real firmware, the electronics around it and the mechanism it moves — in one deterministic co-simulation.

What it does¶
embeddyn runs each part of a product in the simulator best suited to it and keeps them in lock-step:
| Domain | Simulators | What you get |
|---|---|---|
| Firmware | Renode (unmodified ELF on an emulated MCU) | the real control code, its timers, PWM, ADC, GPIO, UART, CAN, SPI and I²C drivers |
| Electronics | ngspice (shared library, state kept across steps), Python circuit models, FMUs | switching bridges with real ripple, supply sag, sensor front ends |
| Mechanics | MuJoCo multibody, Python ODE plants, FMUs, Webots | gears with backlash, friction, joints, gravity, contacts |
| Thermal / environment | Python plants, FMUs, recorded data | winding heating, derating, ambient profiles |
On top of a run it can measure (step-response, statistics and energy metrics), tune parameters with Nelder–Mead or CMA-ES, compute yield and Sobol sensitivity under component tolerances, estimate physical parameters from bench recordings, verify a model (energy balance, step-size convergence, golden waveforms, scenario matrices), and inject faults (stuck, noisy, drifting or dropped-out signals, lost or corrupted UART and CAN frames) to check that the firmware reacts. The Lab is a browser GUI with a schematic editor, virtual instruments and a 3-D view on the same project files.
flowchart LR
subgraph Project["project.yaml"]
S[signals] --- C[couplings] --- I[instances]
end
Project --> M[Co-simulation master<br/>fixed step · deterministic]
M <--> R[Renode<br/>firmware.elf]
M <--> N[ngspice<br/>H-bridge netlist]
M <--> J[MuJoCo<br/>arm.xml]
M <--> P[Python / FMU<br/>plants]
M --> O[(CSV · telemetry ·<br/>checkpoints)]
O --> A[metrics · tuning ·<br/>tolerance · estimation · verification]
Where to start¶
- Getting started — install, run the first example, learn the five concepts everything else builds on.
- Tutorials — eleven step-by-step lessons from a DC motor loop to an STM32 arm joint with SPI and I²C sensors, tuning and tolerance analysis.
- Theory of operation — how the master algorithm, the adapters and the analysis methods work, with the equations.
- How-to guides — short recipes: a new plant, a new SPI sensor, firmware bindings, parallel runs.
- Reference — every project-file key, CLI command and adapter option.
- Platform — the wider embeddyn Studio: Zephyr builds, RF/EMC, HIL, digital twin.
A taste¶

Every figure in this documentation is produced from a real run of the examples in examples/mechatronics/ by tools/docs/make_figures.py; see Rebuild these docs and figures.
Engineering simulator, not a safety case
embeddyn helps you find problems early and tune before hardware exists. Validate models against measurements before using results for thermal, current, force, lifetime or human-safety decisions.