Running Simscape on the Computer and get Data from a TCP/Client.
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I want to couple a simscape Model in Simulink with a TCP Client for Software in the Loop testing. How can i execute Simscape on my Computer nearly in Real Time? How can i send data to the client with a fix Delay like 100ms. I tried a lot in the solvers, but i am far away from a good solution. I didnt want to use a hardware like speedgoat to execute my programm. I want to execute it on the computer and want to comunicate to a client on the network card. Is there any oppertunity to run the simulation with a constant timedelay (frequency). I wan to Send Data To the Client, and get Data from the Client an want to put the data into the simscape modell.
2 comentarios
Jonas
el 3 de Jul. de 2020
Editada: Jonas
el 3 de Jul. de 2020
What is the sample time you are using to calculate the Simscape model?
Which domains have you implemented in Simscape?
For high sample rates and complex models you will need an FPGA with a SpeedGoat to be able to execute the Simscape model in real-time. Your desktop PC won't be able to reach the sample rate.
If you are calculating something like a slow temperature fluid model it may work, but certainly not for fast electrical systems for example.
Respuestas (1)
Vasco Lenzi
el 9 de Jul. de 2020
Hi David
As you anticipated the solution that will work for sure with robustness and precision is Speedgoat.
If this is not possible for any reason, you can try the Instrument Control Toolbox. It offers a Simulink Library of TCP/IP, Serial and UDP input/output blocks. This should do the trick.
If your model is not fast enought, you can try to speed up execution by isolating simscape within a subsytem and use simulink coder to transform it in a s-function. This will convert the Simscape network in a C-based "black box" that execute fast.
For the real time part, you can then use the new Real-Time pacing feature of simulink starting from 2018a
You don't need the RT Pacer block from aerospace blockset anymore.
Alternatively for real-time you can take a look at Simulink Desktop Real-Time, which creates a real-time kernel on your windows machine where the simulink model is executed at near real-time.
0 comentarios
Ver también
Categorías
Más información sobre Model Preparation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!