FreeCAD as pre-post processor for MBDyn

About the development of the FEM module/workbench.

Moderator: bernd

josegegas
Posts: 255
Joined: Sat Feb 11, 2017 12:54 am
Location: New Zealand

Re: FreeCAD as pre-post processor for MBDyn

Post by josegegas »

I have added steering and reverse to the car suspension simulation:

https://www.youtube.com/watch?v=JhQay38VGqI

Pretty happy with how this is going. I am slowly starting to put together relatively complex simulations without the need to manualy edit the input file, which shows the usability and viability of combining FreeCAD with MBDyn :D

You can now download this example form the Gitlab page of my project...
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: FreeCAD as pre-post processor for MBDyn

Post by Kunda1 »

Holy Shmoly! That's Amazing!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
josegegas
Posts: 255
Joined: Sat Feb 11, 2017 12:54 am
Location: New Zealand

Re: FreeCAD as pre-post processor for MBDyn

Post by josegegas »

Kunda1 wrote: Sat Feb 27, 2021 11:43 pm Holy Shmoly! That's Amazing!
Thanks! Yea I´m pretty hapy with how this is going..
josegegas
Posts: 255
Joined: Sat Feb 11, 2017 12:54 am
Location: New Zealand

Re: FreeCAD as pre-post processor for MBDyn

Post by josegegas »

I was wondering, who is keen to try to do some co-simulation with the FEM workbench?
I would like to try something like this:

https://www.youtube.com/watch?v=4KGs2BasHPA

or like this:

https://www.youtube.com/watch?v=FHPuA2VLEHk

My workbench can provide data for the magnitude and direction of the reaction forces acting on the joints for each time step of the MBD simulation. This data, along with a mesh of the part, should go into an algorithm that will perform a bunch of FEA simulations, one for each time step. The results of both, the MBD and the FEA simulations can be used to visualize the results as in the videos above...

Something like this would be a great add to FreeCAD. The hability to predict dynamic forces for FEM simulations is one of the coolest parts of a MBD simulation. So far, and as far as I know, one can only apply static forces to a FEM simulation?

In any case, would be cool to try to combine MBD and FEM for cosimulations.
josegegas
Posts: 255
Joined: Sat Feb 11, 2017 12:54 am
Location: New Zealand

Re: FreeCAD as pre-post processor for MBDyn

Post by josegegas »

Previously I posted about a problem with rounding numbers that are obtained from the CAD and go into the input file for MBDyn. With some numbers of decimal places the simulations worked fine, with others, the initial assemby failed.

Well, the problem was in my code. I was rounding all the variables but one, and this was breaking the initial assemby. The problem has been solved and the "V2 engine" example now runs smootly. I have uploaded the example to the Gitlab of the project, in case you want to try it.

Cheers.
User avatar
OficineRobotica
Posts: 433
Joined: Thu Feb 21, 2019 8:17 am
Contact:

Re: FreeCAD as pre-post processor for MBDyn

Post by OficineRobotica »

josegegas wrote: Tue Mar 02, 2021 12:38 pm
Your work and what can be achieved with your workbench is amazing. Just WOW.

P.S. You can embed videos here on the forum like this:

Code: Select all

[video]https://your_video_link[/video]



phpBB [video]



Best regards and keep up the good work.
Check out my Youtube channel at: https://www.youtube.com/@OficineRobotica
josegegas
Posts: 255
Joined: Sat Feb 11, 2017 12:54 am
Location: New Zealand

Re: FreeCAD as pre-post processor for MBDyn

Post by josegegas »

OficineRobotica wrote: Wed Mar 10, 2021 5:01 am
josegegas wrote: Tue Mar 02, 2021 12:38 pm
Your work and what can be achieved with your workbench is amazing. Just WOW.
Thanks!

I have made a few changes that make it easier to work with "drive hinge" joints. Still not perfect, but now it is possible to put together simulations with a lot of these kind of joints. So far this is the most complicated simulation I have achieved. All together it has 29 bodies and 49 joints...

phpBB [video]
josegegas
Posts: 255
Joined: Sat Feb 11, 2017 12:54 am
Location: New Zealand

Re: FreeCAD as pre-post processor for MBDyn

Post by josegegas »

Here is my first "real-world" application example. I found a quite detailed model of one of those massive KUKA robots on grabcad, and fortunately the author uploaded a .step file, so I was able to import it into FreeCAD.

The example is as follows: Asumming most of the robot´s parts have the average density of steel, and given a certain set of motions of the robot´s joints, calculate: a) the direct kinematics (the position and orientation of the end effector asfunction of time). b) the reaction forces that the joints will have to withstand.

Here is the simulation using my workbench:

phpBB [video]


This is the first time I test this workbench with a "real world" example. The plan now is to try more examples like this, and document them.

I will also start working on the integration of hydraulic and electric nodes, as I test the workbench with some more examples like this one...

The example will be on Gitlab.
barrti
Posts: 12
Joined: Sun Dec 15, 2019 2:21 pm

Re: FreeCAD as pre-post processor for MBDyn

Post by barrti »

Hi
I have Freecad 0.19.24276 as per below on Win 10.
I have been trying unsuccessfully to install the workbench FreeCAD-MBDyn dynamics workbench.
I've followed the readme and copied the unzipped folder into the Mod folder as instructed.


Everytime I open the Dynamics workbench, I get the Workbench Failure "No Module named 'sympy"" as below.

Is this a case of installing sympy?

I have installed sympy on C using the Anaconda package but that did not help. (Anaconda installed Sympy V1.6.2)

Can anyone help? I have read though the 26 pages of this forum post but to no avail.

Thanks for reading.


12:12:18 No module named 'sympy'
12:12:18 Traceback (most recent call last):
File "<string>", line 361, in Initialize
File "C:\Program Files\FreeCAD 0.19\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)
File "C:\Program Files\FreeCAD 0.19\Mod\freecad-mbdyn-dynamics-workbench-master\MBdynGui.py", line 32, in <module>
from dynamics import Dynamics
File "C:\Program Files\FreeCAD 0.19\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)
File "C:\Program Files\FreeCAD 0.19\Mod\freecad-mbdyn-dynamics-workbench-master\dynamics.py", line 39, in <module>
from revolutepin import Revolutepin
File "C:\Program Files\FreeCAD 0.19\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)
File "C:\Program Files\FreeCAD 0.19\Mod\freecad-mbdyn-dynamics-workbench-master\revolutepin.py", line 50, in <module>
from sympy import Point3D, Line3D
File "C:\Program Files\FreeCAD 0.19\bin\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)



OS: Windows 10 Version 2004
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24276 (Git)
Build type: Release
Branch: releases/FreeCAD-0-19
Hash: a88db11e0a908f6e38f92bfc5187b13ebe470438
Python version: 3.8.6+
Qt version: 5.15.1
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/Australia (en_AU)
josegegas
Posts: 255
Joined: Sat Feb 11, 2017 12:54 am
Location: New Zealand

Re: FreeCAD as pre-post processor for MBDyn

Post by josegegas »

Hello.

It seems that the latest version of FreeCAD does not come with SymPy. SymPy is a library my workbench uses for some calculations of orientations, etc:

https://www.sympy.org/en/index.html

All you have to do is install SymPy, but remember that FreeCAD comes with its own Python, so you will have to install SymPy in whatever location FreeCAD´s Python is...
Post Reply