Possibility of a Kinematics workbench

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
drei
Posts: 479
Joined: Sun May 11, 2014 7:47 pm
Location: Mexico
Contact:

Possibility of a Kinematics workbench

Post by drei »

Hello everyone,
I created this thread with the intent of knowing if the community is interested in the creation of a Kinematics Workbench for FreeCAD. Please be aware that this is not a promise to code, just a place for discussion.

From my personal background, I've begun to learn how to use MBDyn for dynamic simulations, but it gets kinda hard when doing complicated objects, specially because the program asks you for the Inertia tensor and other mechanical properties.

I'm planning to learn more about FreeCAD as a whole before even taking the endeavor of creating a workbench, but I believe I have a little work plan if I ever get the time to code it.

My idea is to base my work on what has already been done for FEM and Raytracing, because the kinematics analysis software is not license compatible with FreeCAD (GPL vs LGPL). Though I'm not sure if I should write it exclusively in Python (not very efficient, but can get stuff done faster) or to use C++ as well (more work, but better in the long run)

In short, what the workbench will do is:
  1. Early stage - Alpha / Beta
    • Have an empty template ready for use with MBDyn
    • Python Example of a free-falling object written to mbdyn
    • Ability to take the selected geometry from FreeCAD and write the necessary information to the file (moment of inertia, position, and center of mass)
  2. Early Stage - Beta
    • Possiblity of defining the simulation scenario, (gravity direction, gravity presence, object velocity (linear and angular), etc.)
    • Possibility of running MBDyn from FreeCAD
    • Import results to a Spreadsheet (Plot them perhaps?)
  3. Simulation
    • Add the possiblity of animating objects in FreeCAD based on the information defined from the user and obtained from MBDyn
    • Inclusion of relationships between objects (Joints between elements) (Perhaps this should wait until assembly is ready)
  4. Input and Export files
    • Add option to directly edit the files within FreeCAD
    • Export video from animation (Use ffmpeg as a library?)
  5. FreeCAD as a pre and post processor for MBDyn
    • Constantly add missing features in order to allow users to work with the rest of MBDyn's simulation possibilties
I'd love to hear your opinions and suggestions.

Regards,
Isaac
Need help? Feel free to ask, but please read the guidelines first
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Possibility of a Kinematics workbench

Post by ulrich1a »

Could the bullet physics library be an alternative? It has the zlib license.
Look here for an example in blender: https://www.youtube.com/watch?v=DV3DF2etolM

Ulrich
drei
Posts: 479
Joined: Sun May 11, 2014 7:47 pm
Location: Mexico
Contact:

Re: Possibility of a Kinematics workbench

Post by drei »

Hmm,
I hadn't considered using a library since I don't know the appropriate procedure for creating the imput files. I'll look into it, from what I could glimpse, the workflow would be similar and I'd just have to run a compiler instead of a program.
Need help? Feel free to ask, but please read the guidelines first
m.no
Posts: 10
Joined: Wed Oct 29, 2014 6:51 pm

Re: Possibility of a Kinematics workbench

Post by m.no »

viewtopic.php?f=8&t=10747&p=87693#p87693

As I mentioned in linked topic, I'm thinking that using FC as pre/post is good idea.

Look also at HOTINT, I didn't try it but looks good on screenshots.

About Bullet and ODE: I used them in V-REP. Altough, they are working in real time, they are really limted for engineering purposes. It's easy to create unstable model so to make model stable you have to do some tricks. After that result "looks nice" but values are not usable.

One remark - AFAIK MBDyn some time ago still haven't got any collision detection. Bullet and ODE both have it.

PS. I think proper name for workbench would be "Dynamics" not "Kinematics" :).
galou_breizh
Posts: 436
Joined: Wed Sep 15, 2010 9:38 am

Re: Possibility of a Kinematics workbench

Post by galou_breizh »

Hi,

I think this is a very good idea. MBDyn and Bullet/ODE/etc have indeed different purposes. I tried to use MBDyn once for it's ability to simulate dynamics and elastic deformation of beams (much more light weight than meshing the geometry with FEM elements). I have to admit that it took me a lot of time and didn't give any reasonable results within the time I could spend on the problem at hand. I then stumbled upon BlenderAndMBDyn (https://github.com/gdbaldw/BlenderAndMBDyn), but had no Blender knowledge.

I think BlenderAndMBDyn could be a good base for a FreeCAD plugin.

@drei: congratulations for writing such a clear road map. This could be the start of a student project...
@drei: if you use a library, you don't usually create input files, but directly call the library functions in your code with the appropriate library structures or classes, and get library structures and classes as return values.

Cheers,
Gaël
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Possibility of a Kinematics workbench

Post by microelly2 »

Its a nice idea. My dream is to have an interface to open modelica. Such an interface will not only solve mechanical problems.
drei
Posts: 479
Joined: Sun May 11, 2014 7:47 pm
Location: Mexico
Contact:

Re: Possibility of a Kinematics workbench

Post by drei »

I think I'll drop the MBDyn idea in favor of a library.
Reasons:
  • At the end, the user will need to install another program (disk space issues)
  • MBDyn does not have official support for Windows or Mac. So it will be hard to get this Workbench integrated into master (which would be the ideal situation)
  • MBDyn does not have its source code accessible online (something like git), instead it has a tar file containing a semi-stable release. So there is the risk of ending up using software that is dead / not actively updated.
I'll be making tests throughout the year to get myself used to git, FreeCAD and either ODE or Bullet. I'd love to add Modelica, but it just seems like a really high end goal that I would not be able to reach.

I'm concerned about library dependencies, would it be best to bundle the library inside the 3rd Party folder or whould a CMake file listing the dependency be sufficient?

Also, has anybody used either ODE or Bullet? How does one fare against the other?
Need help? Feel free to ask, but please read the guidelines first
Post Reply