FreeCAD as pre-post processor for MBDyn
Moderator: bernd
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
FreeCAD as pre-post processor for MBDyn
Hi all. For my PhD I've been using MBDyn to do simulations of engines and other mechanisms. It is a free and open source multi body dynamics software. It is very powerful but it lacks pre and post processing graphic interface. I've been using FreeCAD as pre and post processing tool for MBDyn and all works very well. Both programs can be integrated nicely through python scripts. I think they could also be integrated in a new workbench. A few days ago I started programing a new workbench with this purpose and though it may be a good idea to share the results here and see if people are interested. In the video you can see a simulation of a simple pendulum under different initial conditions (mass, initial angular velocity, gravitational acceleration, etc). Then I add another body, a simple cylinder, and give it some initial conditions too. FreeCAD can then be used to visualize the MBDyn results. Wat you see in the video is the two objects moving and the reaction forces in the "hinge", which is how they call the joint in MBDyn. Let me know what do you think and if its worth keep working on this! In the end we could be able to give FreeCAD similar features as MSC Adams or something....
https://www.facebook.com/josegabriel.eg ... 599267675/
In this video I've already added the plot tool, so you can visualize the position, angular position, acceleration, and angular acceleration of each "node" in the simulation. A node can be defined as a point within the body:
https://www.youtube.com/watch?v=V0cVsi3 ... e=youtu.be
https://www.facebook.com/josegabriel.eg ... 599267675/
In this video I've already added the plot tool, so you can visualize the position, angular position, acceleration, and angular acceleration of each "node" in the simulation. A node can be defined as a point within the body:
https://www.youtube.com/watch?v=V0cVsi3 ... e=youtu.be
Last edited by Kunda1 on Sat Jul 04, 2020 2:26 pm, edited 1 time in total.
Reason: fixed typo in forum thread
Reason: fixed typo in forum thread
-
- Posts: 991
- Joined: Wed Mar 27, 2019 10:45 am
Re: FreeCAD as pre-post procesor for MBDyn
That is sick, Sir! Perhaps a call to the FEM crowd, such as Bernd (FEM) or Oliveroxtoby (CFD) to continue this discussion on how best to integrate efforts?
Re: FreeCAD as pre-post procesor for MBDyn
I don't know MBDyn, but it sounds like it would be in the same ballpark as Modelica. Saso has a keen interest in something like this, but so far no real development has taken place; see Modelica.josegegas wrote: ↑Sun Sep 08, 2019 5:21 am I've been using MBDyn to do simulations of engines and other mechanisms. It is a free and open source multi body dynamics software. It is very powerful but it lacks pre and post processing graphic interface. I've been using FreeCAD as pre and post processing tool for MBDyn and all works very well. Both programs can be integrated nicely through python scripts. I think they could also be integrated in a new workbench.
It'd be awesome if you could develop something that is general, that is, able to use different solvers, one of which could be MBDyn and another Modelica. That's basically how the FEM Workbench works.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: FreeCAD as pre-post procesor for MBDyn
It realy would be nice to have an interface to MBDyn.
Implement a protytype and see how comformatable it will be.
Implement a protytype and see how comformatable it will be.
Re: FreeCAD as pre-post procesor for MBDyn
Above demo videos indeed look very nice, in the past there has been a similar demo done also with Bullet Physics but there were some concerns if it is really appropriate for real engineering work... MBDyn license is GPL so it would have to be installed separately, ok, but it seems like default installation packages are only for linux? We have also been already looking at https://projectchrono.org/ and Modelica https://forum.freecadweb.org/viewtopic.php?f=18&t=32556
Last edited by saso on Wed Feb 12, 2020 11:50 am, edited 1 time in total.
Re: FreeCAD as pre-post procesor for MBDyn
I have just started a work bench as a pre and post processor for MBDyn. I was going to use assembly 4 as a base. I thought the use of local coordinate systems would be useful and I would not need a constraint solver because MBDyn would notify if there was a problem. I also thought it would be difficult to translate constraints from assembly 3 or A2+ into MBDyn joints.
One issue with using FreeCAD for multibody dynamics is there is no routine to calculate moment of inertia for arbitrary shapes(part design); that would need to be written.
One issue with using FreeCAD for multibody dynamics is there is no routine to calculate moment of inertia for arbitrary shapes(part design); that would need to be written.
Re: FreeCAD as pre-post procesor for MBDyn
Just an aside, looking at the original clips by OP and how many times they needed to increase/decrease the widget window, that's a useability issue. Looking at the UI it's pretty surprising how much space title bars and tabs take up. But this discussion would be better the UI/UX subforum.
Also, maybe at some point a potential workbench like this would for sure benefit from a node based paradigm: pyflow.
Also, maybe at some point a potential workbench like this would for sure benefit from a node based paradigm: pyflow.
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
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
Re: FreeCAD as pre-post procesor for MBDyn
Sounds great that you had the same idea! Would you mind sharing some details? My approach has been to create customized objects in FreeCAD that contain the properties of each object required by MBDyn. Thus, I create a "Gravity" object in FreeCAD that has the gravitational acceleration and the direction vector. There is also a "Rigid Body" object that has the mass, center of mass, inertia tensor, etc. A "Node" object that has the initial conditions, etc... Then my Python script reads the objects and writes the txt file (.mbd) to be read by MBDyn. I then run the simulation, and read the output files to animate the objects in FreeCAD. What is your approach?
Re: FreeCAD as pre-post procesor for MBDyn
Why would you need assembly 4? I mean, MBDyn already takes care of the mechanism assembly. It will yield an error if the assembly was not consistent. My approach to animate the simulation results is just to use a timer (imported from Qt) to update each part's position and orientation. This is very straightforward since MBDyn writes the simulation results in a simple text file, from where all I do is read the values and move the 3D objects accordingly. MBDyn gives me XYZ positions and Euler angles, exactly what FreeCAD loves haha
Re: FreeCAD as pre-post procesor for MBDyn
I thought exactly the same. There is no need for constraint solver because MBDyn already does this. My idea is to use FreeCAD only as pre and post processor. MBDyn is already a very powerful tool. If we could use FreeCAD to make MBDyn more user friendly, by avoiding the complicated input files, this would be awesome!