FMU Generator is a tool used in TSMaster to package models to generate FMU files, currently supports FMI3.0 and FMI2.0 versions, FMU type only supports Co-Simulation (CS), i.e., Co-Simulation FMU.In this article, we will introduce the FMU Generator User's Manual and the related examples, ultra-detailed introduction, come to watch!
Keywords: TSMaster, FMU, FMI
About the manual
The following table lists the styles and symbols used in the manual.
FMU Function Summary
FMU is a cross-language simulation interface for describing simulation models that follow the FMI standard.There are three FMU types for the FMI standard, namely:
- The Model Exchange (ME) FMU describes a simulation using mathematical equations. To properly simulate a real system, the FMU Import tool must connect the FMU to a numerical solver. The numerical solver sets the FMU state, asks for the state derivatives, determines the appropriate step size, and decides how to compute the state at the next time step.
- The Co-Simulation (CS) FMU includes a built-in numerical solver. To properly simulate the real system, the FMU Import tool sets up the FMU inputs, asks the FMU to advance at a given time, and reads the FMU outputs.
- The Scheduled Execution (SE) scheduled execution interface exposes each model partition. The scheduler provided by the importer can control the execution of each model partition separately.
Windows Forms
The FMU generator consists of the following four main areas:
- toolbar area
- Export Settings Area
- Signal display and editing area
- Database/System Variables Browser Area
3.1 Toolbar area
For exporting FMUs, deleting signals and updating the database.
The toolbar icons are described below:
3.2 Export settings area
Used to configure the FMI/FMU identifier, description, version, type, simulation step, and RPC type.
The FMU export configuration parameters are as follows:
parameters | descriptive |
identifiers | Can only contain letters, numbers and underscores, and must begin with a letter or underscore |
descriptive | Can be any character |
FMU version | Currently available in either version 3.0 or 2.0 |
FMU type | Currently only co-simulation (CS) is supported |
pacemaker | Setting the co-simulation step size |
RPC Type | Currently, only local RPC is supported, and the FMU exported by local RPC is not supported to be called by TSMaster. |
3.3 Signal Display and Editing Area
It is used to display the signals in the FMU file that need to be exported, and you can configure the category, channel, and value type of the signal. The checkbox in the first column is used to select whether to activate this signal or variable.
FMU Generator Usage Flow
- Select the FMU version and set parameters such as identifier, description, FMU type, simulation step, and RPC type
- Add the desired signal or variable to the database, system variable browser
- Modify the category of the signal in the signal display and editing area, and edit the checkboxes to confirm that they need to be exported.
- Click the Export button in the toolbar and select the export path to generate the FMU file.
- Import the generated FMUs into the simulation software and realize co-simulation with TSMaster.
typical example
The FMU example is used to demonstrate the functionality of TSMaster and Simulink co-simulation. The example simulates the following equation:
Where Torque is the input of FMU and Carspeed is the output of FMU, the value of Torque is obtained from Simulink and Carspeed is calculated from TSMaster, the example flow is as follows.
▲ First, use the FMU generator in TSMaster to generate an FMU for FMU version 2.0. The configuration interface of the FMU generator is shown in the following figure.
▲ Then import fmu in Simulink and build the model shown below, with sine wave amplitude of 10, bias of 10, and other parameters by default.
▲ Create python applet in TSMaster to simulate the relationship between Torque and Carspeed (virtual relationship).
▲ Start Simulink simulation and get the result as shown below. In the following figure, the blue color is the Torque input and the yellow line is the Carspeed output.
Tip:
1. Software download:
Click on the software download link below to download and install directly, beta version is recommended:
2. Software upgrades:
You can check for upgrades to the latest version within the software, provided that your computer has an Internet connection.
Note: TOSUN Technical Support Email:support@tosunai.cnWe welcome inquiries! (Company and contact information must be indicated)