ArcWelderPlugin
A plugin for OctoPrint used to convert G0/G1 commands to G2/G3 commands. Reduce the size of your gcode files, and reduce number of gcodes per second sent to your printer.
Install / Use
/learn @FormerLurker/ArcWelderPluginREADME
Arc Welder: Anti-Stutter
Converts G0/G1 commands to G2/G3 commands. This can greatly compress some GCode files and can reduce the number of GCodes sent to your printer when streaming GCode from OctoPrint. This can reduce stuttering as long as your firmware correctly implements G2/G3 (arc) commands and is configured properly.
Installation
Prerequisites
Python Development Package for Linux
Python is already installed if you are running Octoprint, but if you are running on Linux, the python-dev package is required. If you are running OctoPi and Python 2.7, this will already be installed. At the time this was written, the dev package of Python 3 is not included in OctoPi.
Before installing the dev package, run this command from a terminal to update your system:
sudo apt-get update -y
Next, install the Python 3 dev package with this command:
sudo apt-get install -y python3-dev
Installing from the Plugin Manager
Typically, you will want to install Arc Welder from the plugin repository. This will ensure that you are using the latest release build.
- If you are running Python 3, first look at the prerequisites section above to make sure you have all of the necessary files.
- Open OctoPrint and click on the settings icon (wrench/spanner).
- Click on the plugin manager in the left menu.
- Within the plugin manager, click Get More....
- Enter Arc Welder in the search box, and click the Install button next to the plugin. If you do not see the plugin listed in the search results, please see the next section to install from a specific URL.
- After installation is complete (it will take a lot longer than most other plugins since Arc Welder must compile a custom python extension written in c++), reboot your pi when prompted.
Installing a Specific Version of Arc Welder
You can install a specific version of Arc Welder from a URL within the plugin manager, but you will need to find the right URL to do so. This should only be done in special cases and is not recommended for general use.
Installation from a URL
- Navigate to the releases on Github.
- Select the release you are interested in (the most recent release is at the top), and click on the version number. Note that Pre-Releases will be tagged, so avoid those if you are only interested in stable versions.
- Read the release notes carefully. It may contain important information!
- Scroll to the bottom of the release page and ensure the Assets are expanded.
- Right-click on the Source code (zip) and copy the link into your clipboard.
- Open OctoPrint and click on the settings icon (wrench/spanner).
- Click on the plugin manager in the left menu.
- Within the plugin manager, click Get More... .
- Paste the installation URL you copied into the ... from URL text box and click the Install button to the right of the text box.
- After installation is complete (it will take longer than average since Arc Welder must compile a c++ package). Reboot your pi.
Using Arc-Welder
By default, Arc-Welder will automatically convert any newly added GCode files and will create a new file containing the converted GCode. Using the default settings, this new file will end with .aw.gcode. If your GCode file was called print.gcode, the converted file will be print.aw.gcode.
You can also convert existing files from the file manager by clicking a new icon (compress icon - two arrows pointing towards each other) that will now be available within the file manager. Note: You cannot convert files that have already been converted by Arc Welder!
Once a file has been converted, the Arc Welder tab will show detailed statistics about the conversion, including before/after file sizes, compression information, before and after segment length statistics, and more. You can view these statistics at any time by selecting a welded file or by clicking the statistics icon in the file manager.
Settings and Setup
Arc Welder is pre-configured and will work with no settings changes for most people. However, there are a few settings you may want to investigate (see the Use Octoprint Settings and G90/G91 Influence Extruder extruder settings in particular). You can navigate to the settings either by navigating to the Arc Welder tab and clicking on the Edit Settings button or by opening the OctoPrint settings and finding the Arc Welder plugin in the left side menu.
Pre-Processor Settings
These settings control the main aspects of the plugin and how your GCode file will be compressed.
- Arc Welder Enabled - Check or uncheck to enable or disable the plugin. This prevents Arc Welder from converting any files and adding buttons to the file browser. It will not remove the plugin from the tabs or settings pages. If you want to truly disable Arc Welder, please do so in the plugin manager.
- Resolution in MM - This setting controls how much play Arc Welder has in converting GCode points into arcs. If the arc deviates from the original points by + or - 1/2 of the resolution, the points will not be converted. The default setting is 0.05 which means the arcs may not deviate by more than +- 0.025mm (that's a really tiny deviation). Increasing the resolution will result in more arcs being converted but will make the tool paths less accurate. Decreasing the resolution will result in fewer arcs but more accurate tool paths. I don't recommend going above 0.1MM. Higher values than that may result in print failure.
- Maximum Arc Radius - This is a safety feature to prevent unusually large arcs from being generated. Internally, Arc Welder uses a constant to prevent an arc with a very large radius from being generated where the path is essentially (but not exactly) a straight line. If it is not perfectly straight and if my constant isn't conservative enough, an extremely large arc could be created that may have the wrong direction of rotation. The default value works fine for all of the gCode I've tested (it is about 1/7th of the radius of the worst errant arc I've encountered). If you discover that you need to adjust this setting because of errant arcs, please create an issue and let me know! The default setting is 1000000 mm or 1KM.
- File Processing Type - There are three options here:
- Automatic Processing Only - Newly uploaded files will be compressed automatically.
- Manual Processing Only - Convert files by clicking on the compress button in the file manager. Files that are already compressed will have the compress button disabled.
- Automatic and Manual Processing - Newly uploaded files will automatically be converted and you will be able to compress files by clicking the compress button in the file manager.
The default setting is Automatic and Manual Processing.
Output File Settings
Here you can control how Arc Welder will handle the output file. It can either overwrite the source GCode file completely, or you can create a new file with a different name.
- Overwrite Source File - When selected, Arc Welder will overwrite the original file with the compressed version. Default Value: disabled.
- Target File Prefix - When Overwrite Source File is disabled, Arc Welder will produce a new file with this prefix. For example, if you use AW_ as your prefix and your source file is called print.gcode the output file would be called AW_print.gcode. Default: NO PREFIX
- Target File Postfix - When Overwrite Source File is disabled, Arc Welder will produce a new file with this postfix before the file extension. For example, if you use .aw for your postfix and your source file is called print.gcode, the resulting file would be called print.aw.gcode. Default: .aw
Note: You can combine prefixes and postfixes if you like.
Source File Options
- Source File Deletion - Arc Welder can delete the source file in most situations. It will never delete the source file if it is currently printing or if the source file is overwritten by the welded GCode. The options are:
- Disabled - The source file will never be deleted.
- Always Delete Source File - The source file will always be deleted if possible.
- Delete After Automatic Processing - Files that are automatically processed (see the File Preprocessing Type setting) will be automatically deleted when possible.
- Delete After Manual Processing - Files that are manually processed (see the File Preprocessing Type setting) will be automatically deleted when possible.
Printer Settings
Arc Welder needs to know one property of your printer's firmware to guarantee accurate results in all slicers and with all start/end GCode: G90/G91 influences extruder.
- Use Octoprint Settings - Octoprint has a setting for G90/G91 influences extruder in the Features tab. Enabling Use Octoprint Printer Settings will cause Arc Welder to use OctoPrint's setting. Default: Enabled
- G90/G91 Influence Extruder - If Use Octoprint Feature Settings is unchecked, Arc Welder will use this setting to determine if the G90/G91 command influences your extruder's axis mode. In general, Marlin 2.0 and forks should have this box checked. Many forks of Marlin 1.x should have this unchecked, like the Prusa MK2 and MK3. I will try to add a list of printers and the proper value for this setting at some point, as well as a GCode test script you can use to determine what setting to use. Keep in mind that most slicers produce code that will work fine no matter what setting you choose here. Default: Disabled
Notification Settings
These settings allow you to control the notification toasts and progress display.
- **Show Pre-Processing Star
