Dyshlo — C++ motor control and simulation
Dyshlo is a platform-agnostic, highly abstract, header-only C++20 library designed for use in hard real-time embedded systems devoted to electric motor control, as well as for simulation and research of new control strategies in SITL/HITL environments. It is designed to work with any hardware platform that can implement the simple and well-defined software interface between the library and the underlying power stage driver (or its virtual SITL/HITL model). Both baremetal and RTOS environments are supported.
Dyshlo is designed for use in high-integrity systems. It comes with an extensive on-target verification suite (usable in baremetal environments) and is continuously checked by multiple static analyzers that ensure compliance with AUTOSAR C++ and other safety standards.
Dyshlo contains a built-in SITL/HITL electromechanical simulation engine that can be used to accurately predict the behavior of the drive under various operating conditions (incl. noise, disturbance, and failure injection), and thus facilitate safety compliance. The simulation results are exported in the standard JSON/TSV formats which can be further processed with standard data science frameworks (examples with Python+Pandas+Plotly are provided).
Architecture
As shown in the diagram, Dyshlo contains the core library (red) and extensive on-target verification scaffolding (blue). Only the items shown in red are used in the embedded system. POSIX SITL builds are supported for SITL/HITL environments.
The library is architected in the flow-based/message-passing paradigm using the open-source RAMEN real-time flow-based programming library.

SITL/HITL simulation framework
The SITL/HITL electromechanical simulation supports various formulations of the machine and inverter models. It can be used for V&V and research purposes.

