Simscape Multibody close to real time animation of model "ball on plate", solver and contact library question

6 次查看(过去 30 天)
Dear Matlab Folks
In the process of a project for university I developed a simulation of a ball on plate model. I created a CAD-model and imported it with the "SimscapeMultibody Link Inventor Plug-In". Then I added a spheric solid as ball and included a "sphere to plane force" from the "contact forces library.
The goal of the project was to have a simulation that is close to real time and animation of the model. Providing input angles for the motors with udp and receive the position of the ball, also with udp.
The problems I am encountering, are at the moment that the simulation and animation is too slow. It is not near real time and I was wondering if there are certain steps that can be taken to improve the speed of the simulation and animation. A Problem that appeared lately is also, that the "sphere to plane force" block doesn't seem to know where the end of the plate is and the ball just keeps rolling.
I would be glad for any help or advice on the topic of simulating and animating with Simscape Multibody.
I attached a zip with the whole project if someone wants to try itself. I also included a screenshot of the simulink blocks here.
Thank you for your time
  1 个评论
David Brodmann
David Brodmann 2020-10-22
编辑:David Brodmann 2020-10-24
UPDATE: I managed to get the model really close to realtime, if anyone else is wondering how, here are my steps.
  • I set the solver to variable step size with ode23 solver and a minimum step size of 2e-4. This lead to a performance increase and as far as I can say it the simulation is stable with no unexpected behaviour.
  • I tried simulating with a desktop processor with a bigger single thread performance at 4.6Ghz, this lead to a big improvement obviously.
  • I removed the udp receiver block. This was definitely not obvious to me, but the udp receiver block kind of interrupted the simulation every 0.01s because of the sample time chose in it. I really thought the udp receiver would be executed in parallel but I was wrong. This leads to the question, how I can implement a udp receiver without delaying the simulation?

请先登录,再进行评论。

采纳的回答

Juan Sagarduy
Juan Sagarduy 2020-10-24
Hello David,
I believe you took the right steps in your previous test. Keep in mind that in recent releases of Multibody (20a, 20b), we have the spatial force contact block to model contacts between various bodies (including now point and line contacts).
This could be good to test out, as it is most robust and convenient.
In some mechanic simulations, even ode45 can be an alternative from a performance perspective.
Regards Juan
  3 个评论
David Brodmann
David Brodmann 2020-10-25
UPDATE: So I tried out the "Spatial Contact Force"-block in my model. The result is, that with "Frictional Force" enabled the model computes slower. Without "Frictional Force" though the model computes alot faster, which is absolutely great. Also it is nice that there are fewer steps to set up the contact force. I am glad the Frictional Force is not absolutely necessary for my model, so I am hapyy to use the new block now.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulation and Analysis 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by