How to connect a Simsacpe multibody to simulink control system?

2 views (last 30 days)
This simspcae model was imported from Solidworks and modified. The control system in simulink is a bit complicated with many subsystems and hardware communications. I want to add the simscape model as a subsystem, and the output of the control system implemented on this subsystem. I tried to implement it by adding the simscape model with attached files into the folder of the control systems and add the model into the system in simulink. The system is very slow and doesn't work. Could you please advice me how to save the simscape model as a model can be added directly to any control system such as block??? and How can I increase my system speed?

Answers (1)

Julia Antoniou
Julia Antoniou on 6 Sep 2017
Hi Karem,
Based on my understanding of your question, you have a Simscape model you would like to incorporate into a control system simulation. If you create this control system using Simulink blocks, you could then interface with your Simscape blocks using the "Simulink-PS" and "PS-Simulink" converter blocks. These conversion blocks allow for communication between Simscape elements and Simulink elements within a model. See the documentation page linked below for more information about these conversion blocks. https://www.mathworks.com/help/physmod/simscape/ref/simulinkpsconverter.html
Linked below is an example of incorporating a Simscape model into a Simulink control system. https://www.mathworks.com/help/physmod/simscape/examples/mass-spring-damper-with-controller.html
The Simscape portion of the model shown in this example above can easily be converted into a subsystem by selecting all Simscape elements, right-clicking, and selecting "Create Subsystem from Selection".
In reference to question about increasing your simulation speed - there are a number of different ways to do this, and most of them are specific to how your individual model is set up. See the MATLAB Answers post linked below for a list of ways to increase simulation speed. https://www.mathworks.com/matlabcentral/answers/94052-how-can-i-speed-up-simulation-of-my-simulink-model
  1 Comment
Karem Abuowda
Karem Abuowda on 6 Sep 2017
Dear, Thanks for your answer, I have a previous knowledge of these solution. What I have discovered that Simscape mulitbody isn't supported with acceleration mode which makes my systems very slow as overall. Do you have any suggestion

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!