Support : Knowledge base

Knowledge Base

Welcome to OPAL-RT’s Knowledge Base

OPAL-RT offers a repository of support information for optimal use of its technology.

Loading…

Please note that OPAL-RT knowledge base is not fully optimized for mobile platforms.

For optimal experience, use a desktop computer.

Reference Number: AA-02281// Views: AA-02281// Created: 2024-03-06 07:29:30// Last Updated: 2024-03-06 10:18:05
HowTo
How to do Amesim (FMU) and RT-LAB co-simulation

Software version:

Amesim 2304

RT-LAB 2023.2

Hardeware:

XG series


(For earlier version, please refer to AMESim v10 and RT-LAB 10; AMESim 15 and RT-LAB 2019)


Co-sim instruction:

  1. Generate FMU for 64bit linux system for run in real time
    1. Model modification

                                 For example, modify from AMESIM demo Articulated. Made a FMU interface with one input/output for steering command and a measurement from the steering block.

             In Sketch mode, made a FMI interface:

Right click on the block “internal sensor”, selected the first one as measurement output. A new pin will be added to the block and we can then connect it to the FMI input

b. Tools – preference setting


c. Switch to “simulation mode”, in “interfaces – FMU export assistant”


Next:

Then generate the FMU.


2. FMI interface in RT-LAB

Follow the comprehensive instruction: Functional Mock-up Interface (FMI)


The workflow is easy in short:

  • Create the RT-LAB project and use FMUConfGenerator.exe in RT-LAB installation folder/common/bin with the command to unzip the .fmu file:

FMUConfGenerator.exe -f \fmu_file_name.fmu

  • Add the files to files tab:

  • In RT-LAB project, add Orchestra Framework to the I/O interface, use DDF Importer to import the generated .xml file from step 1.

  • Set the  “External executable” command for corresponding urtmain_xxx.json

  • In the Simulink model use OpDilInterface block to select the OrchestraFrame.jason file under project’s configuration/SynExchangeRegistry/DriverConfigs folder:

  • It is then ready to build and associate the subsystem to I/O interface, run on x64 simulator. 




Articulated.zip 17.2 Mb 17.2 Mb
How%2BTo%2Bdo%2BAMESIM%2B%28FMU%29%2Band%2BRT-LAB%2Bco-simulation.pdf 0.3 Mb 0.3 Mb