Racing Lounge

Best practices and teamwork for student competitions

Import CAD assemblies to Simscape Multibody™ 15

Posted by Christoph Hahn,

With this post, let me talk about 3D multibody simulation and specifically focus on getting CAD data into a simulation environment.

Motivation

Vehicle dynamics engineers want to simulate dynamic behavior of their suspension designs during early stages of development. They may ask questions such as “Can we keep the roll center between certain bounds while racing a specific track?”.  These questions can be addressed using 3D multibody simulation.

As a starting point on that field, the MathWorks student competition team has developed a Simscape Multibody™ online training course. This course teaches the basics of multibody simulation. To complement the course, I have created some video podcast episodes on more involved topics such as parametric CAD import or hands-on know-how about numerical optimization.

Onshape CAD Import

Now to the specific step of getting CAD data into your preferred simulation environment. Release 2017a of MATLAB® / Simulink® introduces an interface to a browser based CAD tool called Onshape. I found this feature quite interesting and want to share it with you. I am also interested in your thoughts about whether that feature may simplify your workflow. Find here a link to Onshape in case you want to try it out on your own after watching the video below.

[VIDEO] MATLAB and Simulink Racing Lounge “Importing CAD Assemblies into Simscape Multibody

Bigger Picture – The General Workflow

I hope you found the video helpful. Let me now try to embed the new feature into the bigger picture of supported workflows. No matter what CAD tool you are using, getting CAD assemblies into Simscape Multibody™ is a two-step process.

  1. Generate the files needed to import into the Simscape Multibody™.
  2. Import a multibody model from a URDF or Simscape Multibody™ XML file using >>smimport.

Note: Step #1 may differ depending on the CAD tool you are using.

  • Onshape Import, >>smexportonshape, see video above
  • Simscape Multibody Link plugin. Currently this option is available for PTC Creo® (Pro/ENGINEER®), SOLIDWORKS®, and Autodesk® Inventor® (checked: April 6th 2017).
  • Convert models to one of the tools supported by the Simscape Multibody Link plugin.
  • MathWorks partner tools such as from Saneon
  • Convert to CAD neutral formats: IGES, SAT, STEP, ACIS, JT, Parasolid, DXF, etc.

Conclusion

I am interested to read your comments and questions! I am interested in your opinion whether Onshape has the potential to become the “one-fits-most” tool.

Cheers Christoph

15 CommentsOldest to Newest

Maik replied on : 1 of 15
I have read so many articles or reviews concerning the blogger lovers except this paragraph is actually a good post, keep it up.
Colleen replied on : 2 of 15
Greetings I am so thrilled I found your blog, I really found you by accident, while I was browsing on Askjeeve for something else, Nonetheless I am here now and would just like to say many thanks for a remarkable post and a all round exciting blog (I also love the theme/design), I don't have time to read through it all at the moment but I have book-marked it and also included your RSS feeds, so when I have time I will be back to read more, Please do keep up the excellent work.
Rosetta replied on : 4 of 15
This website truly has all the information and facts I needed about this subject and didn't know who to ask.
Ross replied on : 5 of 15
Every weekend i used to pay a visit this site, because i want enjoyment, for the reason that this this web page conations genuinely nice funny information too.
Christoph Hahn replied on : 6 of 15
Thanks everybody for that feedback! I definitively will keep on blogging ... Are there some topics that you are interested in and you want me to cover in future? Happy to take productive feedback!
kong replied on : 7 of 15
Wenn I use Live Editor, I write the code "smexportonshape(('https://cad.onshape.com/documents/2d5c0c72cf8a49f59d60fb1b/w/a005335084f044cfae483209/e/089ef407bf5e40ac8ab5b6b4/[assembly URL]', " ,the Matlab tells me " Undefined function ' smexportonshape ' for input argument",what can i do?
Christoph Hahn replied on : 8 of 15
Hi, Thanks for the note! Could you please send the link to the OnShape assembly to racinglounge@mathworks.com. I will give it a try and let you know. Cheers Christoph
xinggao replied on : 9 of 15
Reply to Kong - smexportonshape became a builtin function of Simscape Multibody starting from 2017a. The issue you were facing is probably caused by the wrong MATLAB version. Also, if 2016b is the latest version you could get, you may use this. https://www.mathworks.com/matlabcentral/fileexchange/60820-onshape-cad-export-to-simscape-multibody
Christoph Hahn replied on : 10 of 15
Thanks Alycia for your feedback! Of course, feel more than welcome to subscribe to that blog or other MathWorks blogs.
Ahsan Ali replied on : 11 of 15
Hi Christoph Hahn, hope you'll be fine. Your post is quite informative and useful. I follow all the steps as described, to import my Catia Assembly into simmechanics via Onshape, but it seems that all of assembly joints have been converted into Rigid joint and that's why simulation is not possible with such joint. will be thankful for your assistance..............
Christoph Hahn replied on : 12 of 15
Hi Ahsan Ali, thanks for the detailed question. I fear supporting in the comments here might become tedious. Please feel invited to post this question on MATLAB Answers (https://www.mathworks.com/matlabcentral/answers) and tag it with 'racinglounge'. To ease the support please provide a detailed description including models. Please let us know the URL of your question asked. Thanks and Best, Christoph
Omar Mustafa replied on : 13 of 15
Hello christophe, So we built a simple rock crushing mechanism for our dynamics project and assembled it in onshape and followed the instructions in the video to export it to matlab in order to obtain the simscape model diagram. Everything is successful up until we compile the simscape model to obtain the 3d model in matlab where we get the following error: ['Assembly1']: The following errors were found in the model Assembly1. Caused by: ['Assembly1/Solver Configuration']: *** Model not assembled: position violation *** Resolve this issue in order to simulate the model. I am not sure what is wrong with our assembly but we are sure its assembled correctly and it operates perfectly in onshape. However for some reason it outputs that single error in matlab when compiling the simscape model or running it. We were wondering if you can help us in any way possible maybe have a look at the assembly or if we share the file to you then that would be of great help. Thank you and I look forward to hearing back from you
Thanga Pandiyan replied on : 14 of 15
sir i am working in analysis of cantilever beam by importing cad assembly model of the beam from solidworks but i could not be able to give point load at the tip of the beam in simscape...could you please guide me