Running Simscape on the Computer and get Data from a TCP/Client.
조회 수: 1 (최근 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!