Skip to content

WatchingWatches/FEM-GradientInfill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FEM-GradientInfill

This is a postprocessing script, which adapts the line width of infill based on the simulated stresses. The core idea came from @CNCKitchen who developed the GradientInfill script, which adapts the infill line width based on the distance to the nearest wall. I previously adapted his script and made it compatible with the most popular slicers here. He proved, that this method can significantly increase the specific strength of FDM printed parts. In his video about it he introduced the idea of using FEM simulations to further increase the specific strength.

collage_grad

Usecase

This script won't maximize the strength of the part. It aims to maximize the strength for one load case, while using a minimum amount of filament (specific strength). These are example usecases/benefits:

  • maximize specific strength ➡️ lower mass & price
  • adapt the stiffness (of TPE parts)

This is the overall idea. If it can be sucessfully used, depends on the simulation and used parameters. The method looks promissing, but needs validation by real world testing/optimizing the parameters. For TPE parts an interesting investigation would be the influence of the compression bahaviour.

The adaption doesn't make your part withstand the loadcase!

It only uses the simulation to determine, where material is needed.

How to use the software

For the Initial setup install the requirements for the python environment. Every adaption project needs it's own folder in files/ (there are two example projects uploaded). Three files are required:

  1. The simulation result exportet as .vtu
  2. The gcode as .gcode (bambulabs .gcode.3mf is not supported currently)
  3. The .3mf file saved by the slicer, which was used to generate the gcode (remember to save it!)

The .3mf is required to transform the gcode coordinates to the simulation result, to read the stress at the location. The adapted gcode will be saved in a new folder inside of the folder of the project. Only these three files are allowed in project folder. Otherwise you'll get an error message.

Start the GUI

Run the script main.py and the following GUI will open: image

  1. Select the project folder
  2. Select the wanted stresstype of the simulation (if more than one is saved in the file)
  3. The maximum and minimum stresses will be added to the plot. Adjust the parameters
  4. Press the blue "Run FEM Gradient Infill" button to start the adaption
  5. Wait until the button turns green and the adaption is finished. The adapted gcode will be saved in a new folder inside of the folder of the project

Parameters

The main purpose of the GUI is selecting a project and adjusting the parameters for the project. A plot with an linear interpolation of the (Min stress, Min flow) & (Max stress, Max flow) will be generated. Stress values beyond the threshold will get the according flow factor.

The used maximum flow values came out with clean extrusions with a .6 nozzle. I recommend to use the nozzle size for the infill line width to make shared results more comparable.

Segment length is the maximum length of an segment of an infill line. If the length of the infill line is double this length, the original line will be seperated into segments of this length. The purpose of this is getting a desired resolution of gradient linewidth. This value can significantly effect the runtime and gcode size, so a coarser value is preferred.

Since the flow of the infill is most likely increased by a lot, the script automatically reads the maximum flow of the filament (of T0) and adjusts the feedrate to meet the flowlimit.

Limitations

  • Only one object inside the .3mf file is allowed
  • Disable Arc fitting
  • The gcode and vtu coordinates need the same unit (usually mm)
  • The flow limit of multimaterial printers might be wrong (T0 is used)

Currently simulations of Fusion360 and FreeCAD are tested with the gcode of Orca, Prusa and Bambu slicer. Cura slicer is untested and probably won't work. Unfortunately the vtu files don't store the unit of the simulation result. So be careful, when using different simulation software.

You will most likely run into unclean extrusions at the edges. In the original GradientInfill I found a method to limit these artefacts, but it's currently not implemented.

Examples

In the files folder there is one example for simulations of fusion360 and freeCAD. The left and right prints use the files of the fusion360 folder. The left large print is made of TPU. The stiffness of the material changes significantly. The print in the middle uses the files in the freeCAD folder.

When recreating the loadcase by applying the force manually the part is significantly stronger in the right orientation. This is an first qualitative validation for the method. example_prints

About

Adapts the line width of FDM 3D printed infill based on FEM simulations

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors