Did you know? - EC-Simulator can do Functional Mock-up Interface (FMI)

Content

Introduction

Time is money, development cycles in different industries get shorter and shorter. We see, especially in the industrial automation industry, that new systems, machines and robots need to be developed, built, tested and set up in ever shorter times.

Simulation – that’s the answer to the current challenges in this industry. Simulation reduces testing and commissioning time, increases quality of the delivered systems, enables error detection and optimization and also enables training possibilities for engineers and operators. Complex plants and machines, including robot movements and specific processes can be simulated by various simulation tools.

The FMI (Functional Mock-up Interface) is a simulation standard which perfectly supports the virtual commissioning of complex systems. In this blog, the Functional Mock-up Interface and its advantages will be explained in detail.

In the practical part of this blog, we will setup an EtherCAT network where EC-Engineer and EC-Simulator are running with an FMI simulation model.

So, we are looking forward an interesting and exciting blog…

 

What is Functional Mock-up Interface (FMI)?

The Functional Mock-up Interface, in short FMI, is an open standard for exchanging and co-simulating dynamic models between different simulation tools and software packages. It is developed by the Modelica Association and allows the creation of Functional Mock-up Units (FMUs) . FMUs are self-contained files which are representing system components or entire systems.

This FMI standard can be used to accelerate product development, simplify model integration, and reduce costs in fields like digital twin development, virtual commissioning and system simulation.

With the help of the EC-Simulator and it’s FMI library, a complete process data simulation of the EtherCAT communication can be simulated using this model implemented as FMU (see figure 1). The additional mapping csv file allows that all process data variables are mapped from the FMU to the EtherCAT interface. The mandatory ENI or EXI xml file are generated by the EC-Engineer.

To get access to the FMU, the FMI library provides all necessary APIs. The demo application “EcSimulatorHilDemoFmi” shows in an easy way how to handle the simulation. There is no FMU specific coding needed.

System architecture of EC-Simulator with FMI library

Figure 1: System architecture of EC-Simulator with FMI library

 

Set-up of the system

To test the system, we decided to simulate a HiL (Hardware-in-the-Loop) system on the operating system Windows. A HiL system is defined as simulated system which is running on an external hardware while the EtherCAT MainDevice is running on another system (see figure 2).

System with HiL simulation

Figure 2: System with HiL simulation

 

For our test, we use one system where we ensure the separation of the two systems. This is realized with two separate physical Ethernet adapters which are connected via an Ethernet cable. As shown in figure 3 below, EC-Engineer with its integrated EC-Master MainDevice stack is dedicated to Ethernet adapter #1 while the EC-Simulator is using Ethernet adapter #2.

Test System with two Network Adapters

Figure 3: Test System with two Network Adapters

 

Running EC-Simulator with FMI

After installing EC-Engineer and EC-Simulator with the additional feature pack for FMI, we are ready to start the simulation.

As we are working on a Windows-based computer, we start the simulation in the Windows terminal with following command:

EcSimulatorHilDemoFmi -ndis 192.168.2.1 0 -f ENI.xml -fmu FMU.fmu Mapping.csv -v 3 -perf

The application EcSimulatorHilDemoFmi is communicating with the Windows Driver NDIS (Network Driver Interface Specification) on the IP-address of the Ethernet adapter #2. The ENI-file of the simulation is one parameter of the command and with the command -fmu, the FMU-file and the corresponding mapping file is read by the application. The parameter -v sets the verbosity level and the performance measurement is activated with the command -perf.

To see the results of the running simulation, we now start the EC-Engineer and connect to the second Network Adapter #2. As the EC-Engineer is now acting as the EtherCAT MainDevice, we can see the simulation of the EC-Simulator. The EC-Simulator, containing the FMI library, executes the FMU file. The FMU is simulating a sawtooth, which is showed in the figure 4 below.

 

EC-Engineer

Figure 4: EC-Engineer

 

Some notes:

The FMU file is created with OMEdit, the simulation tool of OpenModelica (see figure 5).

OMEdit Editor from OpenModelica

Figure 5: OMEdit Editor from OpenModelica

 

As an example, a sawtooth was coded with the editor (see figure 6). After successful coding, the FMU file can be exported as saved as FMU file.

Screenshot of OMEdit Editor with the sawtooth code

Figure 6: Screenshot of OMEdit Editor with the sawtooth code

 

To link the process data variables from the FMU file to the EC-Simulator, the so-called Mapping csv file is mandatory. This csv file is a simple file where the variable names of the EtherCAT interface are linked with the corresponding variable names of the FMU file (see figure 7).

 

Screenshot of Mapping csv file

Figure 7: Screenshot of Mapping csv file

Summary

This blog dives into the world of simulation tools, digital twins and virtual commissioning.

EC-Simulator is able to handle the Functional Mock-Up Interface (FMI) with its FMI library and is now prepared for future applications and requirements in the industrial industry.

We prepared a HiL simulation on a Windows system and with a little effort we managed to show a sample application with a sawtooth on the EC-Engineer.

 

Please check out our webpage (www.acontis.com) for more interesting blogs. Also feel free to subscribe our YouTube channel (www.youtube.com/@acontistechnologies) where we offer exciting videos of EtherCAT technologies, products, news and others.