FreeCAD as pre-post processor for MBDyn

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
mfasano
Posts: 113
Joined: Wed Apr 11, 2018 12:31 pm

Re: FreeCAD as pre-post processor for MBDyn

Postby mfasano » Tue Nov 17, 2020 3:06 pm

I have written a tutorial on how to simulate a slide crank as done in the sky engineering tutorial below.
https://www.sky-engin.jp/en/MBDynTutori ... hap17.html

I hope it helps. The tutorial is in the WB's repository wiki; linked below.
https://github.com/mfasano727/MBDynFCwb ... k-Tutorial

There is a bug it the axial rotation joint and the revolut hinge joint. the simulation still works it just not quit the way it is supposed to, The bug fix will not change the tutorial.

The first picture shows the initial position of the mechanism. you can see how the parts side by side(not overlapping). The next picture shows the final position of the mechanism. you can see the part overlap. That is not what should happen.

I know how to fix this case, but my misunderstanding of how the MBDyn works makes me less confident this will fix it in gerneral.
Attachments
init_crank.jpg
init_crank.jpg (45.87 KiB) Viewed 239 times
final_crank.jpg
final_crank.jpg (40.02 KiB) Viewed 239 times
Kappa
Posts: 2
Joined: Thu Nov 26, 2020 5:55 pm

Re: FreeCAD as pre-post processor for MBDyn

Postby Kappa » Fri Nov 27, 2020 5:30 pm

Hello,
I was wondering if this post processor allows the export to Matlab of the results obtained from the simulation. The original software, MBDyn, has this function, which is why I was wondering if this feature was also provided in this post processor.
I also wondered if it would be possible to export the multibody model to Simulink using a block (for example S-function), or to obtain the symbolic equations of the model to perform a parametric analysis
julieng
Posts: 100
Joined: Sun Nov 25, 2018 8:57 pm

Re: FreeCAD as pre-post processor for MBDyn

Postby julieng » Sun Nov 29, 2020 12:12 am

Hello,

I am interested in using MBDyn with FreeCAD. I have try some years ago a similar module in Comsol.
If I remember well, it has an extra cost in term of memory and time to be able to calculate the constraints in bodies with the dynamic module (elastic bodies). When computing only displacement, velocities, acceleration simulations was lighter (rigid bodies).

My question is, is it possible to calculate also von Mises stresses with MBDyn?

Julien
User avatar
mfasano
Posts: 113
Joined: Wed Apr 11, 2018 12:31 pm

Re: FreeCAD as pre-post processor for MBDyn

Postby mfasano » Sun Nov 29, 2020 6:13 pm

Kappa wrote:
Fri Nov 27, 2020 5:30 pm
Hello,
I was wondering if this post processor allows the export to Matlab of the results obtained from the simulation. The original software, MBDyn, has this function, which is why I was wondering if this feature was also provided in this post processor.
I also wondered if it would be possible to export the multibody model to Simulink using a block (for example S-function), or to obtain the symbolic equations of the model to perform a parametric analysis
There is mention about using simulink on the MBDyn homepage. Sky Engineering's MBDyn tutorial has a discussion about using Matlab for post-processing.
https://www.sky-engin.jp/en/MBDynTutori ... hap07.html

We will probably sticking to FreeCAD for the pre and post processing for now.
User avatar
mfasano
Posts: 113
Joined: Wed Apr 11, 2018 12:31 pm

Re: FreeCAD as pre-post processor for MBDyn

Postby mfasano » Sun Nov 29, 2020 6:18 pm

julieng wrote:
Sun Nov 29, 2020 12:12 am
Hello,

I am interested in using MBDyn with FreeCAD. I have try some years ago a similar module in Comsol.
If I remember well, it has an extra cost in term of memory and time to be able to calculate the constraints in bodies with the dynamic module (elastic bodies). When computing only displacement, velocities, acceleration simulations was lighter (rigid bodies).

My question is, is it possible to calculate also von Mises stresses with MBDyn?
For now we are concentrating on simulations with rigid bodies. I hope someday we will be able to model others. I do not know if MBDyn can simulate Von Mises stresses.
Kappa
Posts: 2
Joined: Thu Nov 26, 2020 5:55 pm

Re: FreeCAD as pre-post processor for MBDyn

Postby Kappa » Tue Dec 01, 2020 6:29 pm

mfasano wrote:
Sun Nov 29, 2020 6:13 pm
There is mention about using simulink on the MBDyn homepage. Sky Engineering's MBDyn tutorial has a discussion about using Matlab for post-processing.
https://www.sky-engin.jp/en/MBDynTutori ... hap07.html

We will probably sticking to FreeCAD for the pre and post processing for now.
Thank you for your answer

I honestly find it very handy to build the multibody model using FreeCAD, so I was wondering if, after having built it and run the simulation, it was possible to export the file ". mov" (also present in the tutorial you posted). If this is not possible, a future implementation of this feature in FreeCAD may be interesting. The same goes for the possibility to export the model in Simulink, so as to be able to perform a cosimulation (as happens for example in software like MSC Adams).

Best regards
User avatar
mfasano
Posts: 113
Joined: Wed Apr 11, 2018 12:31 pm

Re: FreeCAD as pre-post processor for MBDyn

Postby mfasano » Fri Dec 04, 2020 2:15 pm

Kappa wrote:
Tue Dec 01, 2020 6:29 pm

I honestly find it very handy to build the multibody model using FreeCAD, so I was wondering if, after having built it and run the simulation, it was possible to export the file ". mov" (also present in the tutorial you posted). If this is not possible, a future implementation of this feature in FreeCAD may be interesting. The same goes for the possibility to export the model in Simulink, so as to be able to perform a cosimulation (as happens for example in software like MSC Adams).
The .mov file is just a text file I guess it could be easily read into matlab. Exporting the model to simulink sounds ambitious, I don't see doing that is the near future. MSC Adams does not mention simulink in there page about cosimulations. A search showed a group at the University of Wisconsin doing it.
User avatar
mfasano
Posts: 113
Joined: Wed Apr 11, 2018 12:31 pm

Re: FreeCAD as pre-post processor for MBDyn

Postby mfasano » Fri Dec 04, 2020 2:21 pm

I have rewritten the slide crank tutorial so the part offsets in the z-direction are maintained. I did not realise the 2 positions in the hinge joints needed to be the same position in the global frame. I guess this a case of instead of fixing the bug, I changed the documentation and called it a feature.
josegegas
Posts: 60
Joined: Sat Feb 11, 2017 12:54 am
Location: New Zealand

Re: FreeCAD as pre-post processor for MBDyn

Postby josegegas » Fri Dec 11, 2020 2:36 am

Hi everyone... I apologize for such a long time not being in touch with the forum. The thing is that I had my thesis defense, ammendments, etc, and all this got combined with the pandemics and all the problems that came with it. My life is just slowly coming back to normal, so planning on getting back into FreeCAD + MBDyn.... I see that soeone else has taken the lead in developing this idea. This is great! I just wanted to shere with you a few thing I did last time. I was able to define several bodies and constraints, and perform the MBDyn simulation and visualize the results using both an animation and Mathplotlib plots. Here are a couple of videos I did last year

https://www.youtube.com/watch?v=8dWsutquRi0&t=183s

https://www.youtube.com/watch?v=x_lCrEkQUrE&t=618s

I actually started writing a tutorial on how to use my workbench. Here is the progress I made until december last year

https://drive.google.com/file/d/1h-tQPR ... ArcDP/view

Any way, let me know what do you think, and if someone can summarize what you guys have donde so far with MBDyn + FreeCAD, I would appreciate it.

Cheers!
User avatar
Kunda1
Posts: 9185
Joined: Thu Jan 05, 2017 9:03 pm

Re: FreeCAD as pre-post processor for MBDyn

Postby Kunda1 » Fri Dec 11, 2020 4:47 am

josegegas wrote:
Fri Dec 11, 2020 2:36 am
Hi everyone... I apologize for such a long time not being in touch with the forum. The thing is that I had my thesis defense, ammendments, etc, and all this got combined with the pandemics and all the problems that came with it. My life is just slowly coming back to normal, so planning on getting back into FreeCAD + MBDyn....
Welcome back!
How did your defense go??
Alone you go faster. Together we go farther
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features