Running Simscape on the Computer and get Data from a TCP/Client.
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
Jonas
2020-7-3
编辑:Jonas
2020-7-3
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.
回答(1 个)
Vasco Lenzi
2020-7-9
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Model Preparation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!