Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silkit FMU Importer #161

Open
qureshiappliedev opened this issue Dec 17, 2024 · 1 comment
Open

Silkit FMU Importer #161

qureshiappliedev opened this issue Dec 17, 2024 · 1 comment

Comments

@qureshiappliedev
Copy link

Hi Community,

I am not sure whether this issue should be raised in the Silkit repo or the SilKit FMU importer repo. I think it should be fine as Silkit FMU importer is an extension of the Silkit.
I am working on using the silkit as a virtual CAN communication bridge for multiple SIL participants e.g VECU CANs, FMUs, CAN probes etc. Currently we are working on using the Silkit CAN only. I am able to attach the silkit to VECU CANs and connect a CAN probe which i built from the demo CANReader to verify the VECU CAN data being transmitted into the SilKit. The issue now is i want to add FMU as a CAN participant into the same CAN network. I have tried the FMU Importer but obviously by default it acts as a simple publisher and subscriber. I read about the CID and FMU importer config file but still am confused how to use them for this purpose. I came across the following options:

  1. To create a custom CAN participant using SilKit SDK and adding some C++ FMU library with it to load the FMU and map/parse it's I/O to the SilKit SDK.
  2. To use the SocketCAN adapter for the SilKit and using FMpy library with it to load the FMU and map/parse it's I/O using FMpy and create a python application.
  3. To use combination of CID, FMU importer config and Silkit config files to somehow map the I/O of the FMU into a structure type which can be represented as a CAN frame and added to the same CAN network on the SilKit as a CAN controller/participant.

Considering all three mentioned options, i guess the option 1 & 2 are rather complex and will encounter time synchronization issues and would have to be dealt with manually. Option 3 can be the easiest, fastest, time synced and convenient solution for this but i am not sure whether it's possible or not?

I would like you guys to comment/suggest on this and if my understanding is correct it would be great to have a simple example how that can be done.

Thanks in advance.

@KonradBkd
Copy link
Contributor

Hello qureshiappliedev,

with your solutions 1. and 2., you also will have to connect the FMU and SIL Kit (driving the simulation, IO exchange, time synchronization). This is already done in a configurable way in the SIL Kit FMU Importer. There, you can specify a mapping between the names in the model description and the publish/subscribe topics on the SIL Kit side.
Then you can create a SIL Kit participant that also uses these publish/subscribe topics. On incoming data from the FMU importer on your subscribers, you deserialize the data, map it to a Can frame and send out the frame. Vice versa, on an incoming Can frame, you map it to a topic, serialize the Can payload for your publisher and publish it to the FMU importer.

So technically this is possible and I see the point of re-using the control logic of existing FMUs in a ECU system under development. However be aware that the mapping between the FMI I/Os and bus systems is not straightforward and will be a custom design choice you impose to the system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants