A set of postprocessing scripts and macro to accelerate the gyroid infill print speed with Klipper

Overview

Fast Infill for Klipper

⚠️ Use at your own risk ⚠️

This is a set of postprocessing scripts for Cura and SuperSlicer to accelerate the gyroid infill printing speed leveraging Klipper's Square Corner Velocity (SQV) feature.

It modifies the value of the SQV only for the infill keeping everything else default. Since the gyroid infill is made of curves, it prints slower by default because this is what the Square Corner Velocity feature does. Increasing this value too high for perimeters will remove details from your print.

This is why, being able to apply a different SQV value for the infill specifically will massively accelerate your prints when you use the gyroid infill while keeping the crisps details on everything else!

Eg:

  • Superslicer was planning a print to last 25h (65% of the print was gyroid infill)

  • it only took 14h using this postprocessing script. It would have taken more than 25h without.

  • This is the result of printing the gyroid infill at 300mm/s with 5k accel with this postprocessing script with a standard SQV of 5 and 20 for infill only (Thanks to @FlorentBroise for the video):

    fast_infill2.mp4

How to use

Klipper setup

This is mandatory, whatever the slicer you use:

  1. Add the save_variable section to your printer.cfg if you don't already have it. For eg.:
    [save_variables]
    filename: ~/klipper_config/saved_variables.cfg
  2. Copy the content of fast_infill.cfg into your printer.cfg
  3. If you use a standard screen (not KlipperScreen), you can also add the content of menu_fast_infill.cfg. This will add 2 entries in your Tune menu to be able to set some values without going to the fluidd/mainsail interface
  4. Once you have added the configuration to your klipper configuration, restart Klipper
  5. When the machine is back online, run the command SET_INFILL_SQV SQV= . This will define the SQV value you want to use during the infill. I suggest a value of 20 if your printer is capable of going very fast (eg. Voron, RatRig VCore-3, ...).

You can update the SQV value for infill while it's printing by using the same command above. It will be applied during the next infill run. If you don't want to modify the infill SQV, just set the value to the same value as your default SQV.

Cura

  1. Copy the fastGyroidInfill.py file from the repository's cura folder into your cura configuration folder -> scripts

    • For Windows, place this file in the folder %APPDATA%\cura\ \scripts
    • For Linux, place this file in the folder ~/.local/share/cura/ /scripts
    • For MacOS, place this file in the folder ~/Library/Application Support/Cura/ /scripts
  2. Add the postprocessing script to Cura

    1. Extensions menu -> Post processing -> Modify GCode
    2. Add the Faster Gyroid Infill with Klipper post processing script
  3. Slice your file as usual

SuperSlicer

  1. Copy the fastGyroidInfill.py file from the repository's superslicer folder in a folder on your computer where superslicer runs. Put it in a folder without any space.
  2. Install Python (if you are using Windows, don't install python from the Microsoft Store, it won't work)
  3. Reference the post processing script into your superslicer configuration. Eg. for Windows: superslicer_config
  4. Run your slicing as usual and export or upload the file to your printer. If everything works as ecpected, you'll see a black terminal window poping up (that is the script running).

How to validates that it works well

If you open the gcode file after postprocessing, you should find references to _USE_INFILL_SQV and _USE_NORMAL_SQV.

Comments
  • Unable to overwrite previously exported Gcode of the same name with SuperSlicer

    Unable to overwrite previously exported Gcode of the same name with SuperSlicer

    Unable to export Gcode file if I have already exported a previously sliced file of the same name. I believe this is due to the .sqv.bak file that is saved along with the Gcode file. If I delete the previous .sqv.bak I am then able to export with the post processing script.

    Post-processing script C:\Python310\python.exe C:\Users\acste\Documents\FastGyroidInfill.py on file C:\Users\acste\Desktop\3D printing\GCode\Eevee_Switch_Stand.gcode failed. Error code: 1

    Running script in CMD

    Traceback (most recent call last): File "C:\Users\acste\Documents\FastGyroidInfill.py", line 16, in os.rename(sourceFile, destFile+".sqv.bak") WindowsError: [Error 183] Cannot create a file when that file already exists

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "C:\Users\acste\Documents\FastGyroidInfill.py", line 17, in except FileExistsError: NameError: name 'FileExistsError' is not defined

    opened by Stefkeys 4
  • Unable to save variable.

    Unable to save variable.

    Hello, I have added everything from the description to the configuration file and when I want to set the value for SQV Infill I have the same message as in the attached screenshot. I used SET_INFILL_SQV SQV=<15> and also SET_INFILL_SQV SQV=15

    Screenshot_20211210-074906_Chrome

    opened by MaryGave 0
  • Can't use the Cura script on Cura for Linux (Appimage version)

    Can't use the Cura script on Cura for Linux (Appimage version)

    Hi! I tried copying the fastGyroidInfill.py file to the folders: $HOME/.config/cura/5.2/scripts/fastGyroidInfill.py $HOME.local/share/cura/5.2/scripts/fastGyroidInfill.py No way to find it on PostProccessing menu with both places. Just a few lines in cura.log:

    2022-12-16 22:04:59,915 - DEBUG - [MainThread] PostProcessingPlugin.PostProcessingPlugin.loadScripts [206]: Begin loading of script: UsePreviousProbeMeasurements
    2022-12-16 22:04:59,917 - ERROR - [MainThread] PostProcessingPlugin.PostProcessingPlugin.loadScripts [221]: Exception: Exception occurred while loading post processing plugin: module 'PostProcessingPlugin.PostProcessingPlugin.fastGyroidInfill' has no attribute 'fastGyroidInfill'
    2022-12-16 22:04:59,918 - ERROR - [MainThread] PostProcessingPlugin.PostProcessingPlugin.loadScripts [221]: Traceback (most recent call last):
    2022-12-16 22:04:59,918 - ERROR - [MainThread] PostProcessingPlugin.PostProcessingPlugin.loadScripts [221]:   File "/tmp/.mount_UltimaIF7CeR/share/cura/plugins/PostProcessingPlugin/PostProcessingPlugin.py", line 204, in loadScripts
    2022-12-16 22:04:59,918 - ERROR - [MainThread] PostProcessingPlugin.PostProcessingPlugin.loadScripts [221]:     loaded_class = getattr(loaded_script, script_name)
    2022-12-16 22:04:59,919 - ERROR - [MainThread] PostProcessingPlugin.PostProcessingPlugin.loadScripts [221]: AttributeError: module 'PostProcessingPlugin.PostProcessingPlugin.fastGyroidInfill' has no attribute 'fastGyroidInfill'
    

    NOTE (FYI): both folders works for the plugin and let the same lines in log file.

    opened by ColdBeer72 0
  • exporting in cura 5.1 doesn´t generate extra gcode

    exporting in cura 5.1 doesn´t generate extra gcode

    hi, Slicing in cura 5.1 is not working in my environement, also using cura 5.0 too, doesnt work, using prusaslicer, also 2.5 alpha is flawless.

    once you slice, gcode is not adding all SQV code needed

    Thanks

    opened by okabum 0
  • SuperSlicer error

    SuperSlicer error

    Post-processing script C:\Users\FranciscoFernandes\AppData\Local\Programs\Python\Python310\python.exe C:\Users\FranciscoFernandes\Desktop\SuperSlicer_2.4.58.2_win64_220401\FastGyroidInfill.py on file C:\Users\FRANCI~1\AppData\Local\Temp.15524.gcode.pp failed. Error code: 1 what is the solution?

    opened by tigercraft4 2
  • Update FastGyroidInfill.py

    Update FastGyroidInfill.py

    #4 possible fix for the issue I have open "Dupplicating an item in cura, for each layers, the first infill is slower than the others" : https://github.com/RomRider/klipper-FastGyroidInfill/issues/4

    opened by themaskedbear 0
  • Dupplicating an item in cura, for each layers, the first infill is slower than the others

    Dupplicating an item in cura, for each layers, the first infill is slower than the others

    Hi, First, thank you for your work !

    I'm encountering an issue. In cura, I have inserted a stl and I have duplicated it. I inserted another stl and I multiplied it by 3.

    When printing, I have noticed that the first infill was slower than the others

    In the generated gcode I have seen that for each layer, the first _USE_INFILL_SQV is followed by _USE_NORMAL_SQV 2 lines lower.

    Bellow an extract of the gcode file for the Layer 4 (can be read like that LineNumberInTheGCodeFile TheLineContent) 22849-G0 X133.38 Y93.288 22850-G0 X111.797 Y13.815 22851-;TIME_ELAPSED:1491.242617 22852:;LAYER:4 22853-;TYPE:FILL 22854:_USE_INFILL_SQV 22855:;MESH:Spool_holder_body.stl 22856:_USE_NORMAL_SQV 22857-G1 F1500 E3396.51827 22858-G1 F10800 X111.879 Y13.755 E3396.52165 22859-G1 X112.28 Y13.569 E3396.53635

    26741-G1 X132.468 Y13.1 E3488.21096 26742-G0 F9000 X132.437 Y13.5 26743-G1 F1500 E3481.71096 26744:;MESH:Spool_holder_body.stl(1) 26745-G0 F9000 X133.38 Y15.08 26746-G0 X136.12 Y15.08 26747-G0 X136.26 Y15.08 26748-;TYPE:FILL 26749:_USE_INFILL_SQV 26750-G1 F1500 E3488.21096 26751-G1 F10800 X136.34 Y15.016 E3488.21437 26752-G1 X136.741 Y14.5 E3488.23611

    30575-G0 F9000 X136.759 Y13.242 30576-G0 X136.603 Y12.762 30577-;TYPE:WALL-OUTER 30578:_USE_NORMAL_SQV 30579-G1 F4500 X137.002 Y12.7 E3547.86313 30580-G1 X156.998 Y12.7 E3548.5282 30581-G1 X157.399 Y12.763 E3548.5417

    30629-G1 X136.729 Y13.147 E3579.83717 30630-G0 F9000 X136.851 Y13.534 30631-G1 F1500 E3573.33717 30632:;MESH:6004_Spool_holder_bearing_center_rod.stl(3) 30633-G0 F9000 X157.88 Y113.638 30634-G0 X159.165 Y113.638 30635-G0 X164.337 Y113.606 30636-G0 X165.236 Y114.566 30637-G0 X168.16 Y113.638 30638-;TYPE:FILL 30639:_USE_INFILL_SQV 30640-G1 F1500 E3579.83717 30641-G1 F10800 X168.019 Y113.819 E3579.8448 30642-G1 X167.618 Y114.267 E3579.8648

    30722-G0 F9000 X167.108 Y113.835 30723-G0 X166.963 Y113.357 30724-;TYPE:WALL-OUTER 30725:_USE_NORMAL_SQV 30726-G1 F4500 X167.456 Y113.217 E3580.80788 30727-G1 X167.973 Y113.101 E3580.8255 30728-G1 X168.494 Y113.014 E3580.84307

    31089-G1 X167.562 Y115.263 E3587.81074 31090-G0 F9000 X167.444 Y114.881 31091-G1 F1500 E3581.31074 31092:;MESH:6004_Spool_holder_bearing_center_rod.stl(2) 31093-G0 F9000 X164.943 Y116.639 31094-G0 X163.894 Y117.697 31095-G0 X163.068 Y118.938

    31104-G0 X165.929 Y135.265 31105-G0 X165.244 Y135.801 31106-;TYPE:FILL 31107:_USE_INFILL_SQV 31108-G1 F1500 E3587.81074 31109-G1 F10800 X165.613 Y136.275 E3587.83072 31110-G1 X166.014 Y136.723 E3587.85071

    31185-G0 F9000 X167.353 Y134.817 31186-G0 X167.227 Y134.333 31187-;TYPE:WALL-OUTER 31188:_USE_NORMAL_SQV 31189-G1 F4500 X167.749 Y134.2 E3588.72099 31190-G1 X168.268 Y134.101 E3588.73856 31191-G1 X168.798 Y134.029 E3588.75635

    31556-G1 X167.7 Y136.277 E3595.72302 31557-G0 F9000 X167.588 Y135.894 31558-G1 F1500 E3589.22302 31559:;MESH:6004_Spool_holder_bearing_center_rod.stl 31560-G0 F9000 X165.06 Y137.609 31561-G0 X163.993 Y138.65 31562-G0 X163.148 Y139.877

    31571-G0 X169.05 Y155.533 31572-G0 X168.779 Y155.706 31573-;TYPE:FILL 31574:_USE_INFILL_SQV 31575-G1 F1500 E3595.72302 31576-G1 F10800 X168.42 Y156.168 E3595.74248 31577-G1 X168.019 Y156.489 E3595.75956

    31656-G0 F9000 X167.565 Y155.874 31657-G0 X167.44 Y155.377 31658-;TYPE:WALL-OUTER 31659:_USE_NORMAL_SQV 31660-G1 F4500 X167.957 Y155.261 E3596.67458 31661-G1 X168.478 Y155.174 E3596.69215 31662-G1 X169.005 Y155.116 E3596.70978

    32024-G1 X168.265 Y157.239 E3603.67687 32025-G0 F9000 X168.185 Y156.848 32026-G1 F1500 E3597.17687 32027:;MESH:6004_Spool_holder_bearing_center_rod.stl(1) 32028-G0 F9000 X169.05 Y155.533 32029-G0 X168.961 Y154.252 32030-G0 X165.899 Y153.267

    32048-G0 X169.801 Y110.548 32049-G0 X169.143 Y110.381 32050-;TYPE:FILL 32051:_USE_INFILL_SQV 32052-G1 F1500 E3603.67687 32053-G1 F10800 X169.222 Y110.292 E3603.68083 32054-G1 X169.623 Y109.995 E3603.69743

    32135-G0 X166.364 Y92.941 32136-G0 X166.184 Y92.475 32137-;TYPE:WALL-OUTER 32138:_USE_NORMAL_SQV 32139-G1 F4500 X166.694 Y92.284 E3604.47483 32140-G1 X167.191 Y92.13 E3604.49214 32141-G1 X167.713 Y91.997 E3604.51005

    32521-G0 X133.38 Y93.291 32522-G0 X111.803 Y13.78 32523-;TIME_ELAPSED:1595.761266 32524:;LAYER:5 32525-;TYPE:FILL 32526:_USE_INFILL_SQV 32527:;MESH:Spool_holder_body.stl 32528:_USE_NORMAL_SQV 32529-G1 F1500 E3611.47661 32530-G1 F10800 X111.879 Y13.737 E3611.47952 32531-G1 X112.28 Y13.611 E3611.4935

    AV_6004_Spool_holder_bearing_center_rod.gcode.zip

    opened by themaskedbear 1
Owner
Jérôme W.
Jérôme W.
A Raspberry Pi Pico powered Macro board, like a Streamdeck but cheaper and simpler.

Env-MCRO A Raspberry Pi Pico powered Macro board, like a Streamdeck but cheaper and simpler. (btw this image is a bit outdated, some of the silkscreen

EnviousData 68 Oct 14, 2022
Monitor an EnvisaLink alarm module running Honeywell firmware, and set a Nest device to Home/Away depending on whether the alarm is Disarmed/Away.

Nestalarm Monitor an EnvisaLink alarm module running Honeywell firmware, and set a Nest device to Home/Away depending on whether the alarm is Disarmed

null 1 Dec 30, 2021
Scripts for measuring and displaying thermal behavior on Voron 3D printers

Thermal Profiling Measuring gantry deflection and frame expansion This script runs a series of defined homing and probing routines designed to charact

Jon Sanders 30 Nov 27, 2022
Testing additional addon devices, and their working scripts

ESP32-addon-devices-potpurri Testing additional addon devices, and their micropython working scripts ?? List of device addons tested so far Ethernet P

f-caro 0 Nov 26, 2022
This application works with serial communication. Use a simple gui to send and receive serial data from arduino and control leds and motor direction

This application works with serial communication. Use a simple gui to send and receive serial data from arduino and control leds and motor direction

ThyagoKZKR 2 Jul 18, 2022
A rubiks cube timer using a distance sensor and a raspberry pi 4, and possibly the pi pico to reduce size and cost.

distance sensor cube timer A rubiks cube timer using a distance sensor and a raspberry pi 4, and possibly the pi pico to reduce size and cost. How to

null 3 Feb 21, 2022
Hook and simulate global keyboard events on Windows and Linux.

keyboard Take full control of your keyboard with this small Python library. Hook global events, register hotkeys, simulate key presses and much more.

BoppreH 3.2k Dec 30, 2022
A module for cross-platform control of the mouse and keyboard in python that is simple to install and use.

PyUserInput PyUserInput is a group project so we've moved the project over to a group organization: https://github.com/PyUserInput/PyUserInput . That

Paul Barton 1k Dec 27, 2022
This repository contains all the code and files needed to simulate the notspot quadrupedal robot using Gazebo and ROS.

Notspot robot simulation - Python version This repository contains all the files and code needed to simulate the notspot quadrupedal robot using Gazeb

null 50 Sep 26, 2022
This allows you to record keyboard and mouse input, and play it back using pynput.

Record and Play with Python! This allows you to record keyboard and mouse input, and play it back (with looping) using pynput. It allows for automatio

George Jensen 45 Jan 2, 2023
Example code and projects for FeatherS2 and FeatherS2 Neo

FeatherS2 & FeatherS2 Neo This repo is a collection of code, firmware, and files

Unexpected Maker 5 Jan 1, 2023
This is the remake of the program PYOBD. It works on Python3 and all new libraries. It was tested on Linux, Windows, and it should work on MAC too.

This is the remake of the program PYOBD. It works on Python3 and all new libraries. It was tested on Linux, Windows, and it should work on MAC too. You just need an ELM327 USB or bluetooth device and a PC(laptop preferably).

null 127 Jan 6, 2023
This repository hosts the code for Stanford Pupper and Stanford Woofer, Raspberry Pi-based quadruped robots that can trot, walk, and jump.

This repository hosts the code for Stanford Pupper and Stanford Woofer, Raspberry Pi-based quadruped robots that can trot, walk, and jump.

Stanford Student Robotics 1.2k Dec 25, 2022
I made this so I can control my Tapo L510 light bulb and Govee H6159 light strip using the PyP100 module and the Govee public API

TAPO-And-Govee-Controller I made this so I can control my Tapo L510 light bulb and Govee H6159 light strip using the PyP100 module and the Govee publi

James Westhead 0 Nov 23, 2021
It is a program that displays the current temperature of the GPU and CPU in real time and stores the temperature history.

HWLogger It is a program that displays the current temperature of the GPU and CPU in real time and stores the temperature history. Sample Usage Run HW

Xeros 0 Apr 5, 2022
An IoT Trivia app that shows you how to take a JSON web API such as the opentdb.com API and stream and display it on a FeatherS2 in an OLED display.

CircuitPython IoT Trivia ESP32-S2 OLED Version An IoT Trivia app that shows you how to take a JSON web API such as the opentdb.com API and stream and

Kevin Thomas 1 Nov 27, 2021
Small Robot, with LIDAR and DepthCamera. Using ROS for Maping and Navigation

?? RoboCop ?? Small Robot, with LIDAR and DepthCamera. Using ROS for Maping and Navigation Made by Clemente Donoso, ?? Chile ???? RoboCop Lateral Fron

Clemente Donoso Krauss 2 Jan 4, 2022
A ch341dll Wrap is for using in Python 32bits windows to access I2C SPI and MDIO (by GPIO), and Demo with display PC sreen on OLED by i2c or SPI .

ch341dll_wrap_typcal_app A ch341dll Wrap is for using in Python 32bits windows to access I2C SPI and MDIO (by GPIO). In addition, I provided 3 Demo. I

null 13 Jan 2, 2023
Mycodo is open source software for the Raspberry Pi that couples inputs and outputs in interesting ways to sense and manipulate the environment.

Mycodo Environmental Regulation System Latest version: 8.12.9 Mycodo is open source software for the Raspberry Pi that couples inputs and outputs in i

Kyle Gabriel 2.3k Dec 29, 2022