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.
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
Typically, you will want to install Arc Welder from the plugin repository. This will ensure that you are using the latest release build.
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.
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.
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.
These settings control the main aspects of the plugin and how your GCode file will be compressed.
The default setting is Automatic and Manual Processing.
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.
Note: You can combine prefixes and postfixes if you like.
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.
These settings allow you to control the notification toasts and progress display.
Unfortunately, Arc Welder currently does not use the logging settings from the OctoPrint Logging module. This is because Arc Welder uses module-level logging and needs to log from inside of a c++ extension module that I created to do the actual processing in a reasonable amount of time. I already had some code to do this from my other project, Octolapse, so I reused it here. In the future I may improve this, but for now if you want to log anything besides exceptions, you will need to adjust the Arc Welder settings to do so. You will still find the resulting log files in the OctoPrint logging module, though you can also download from the Arc Welder settings page.
plugin_arc_welder.log
file. Useful for creating a clean log file for debugging/Github issues.arc_welder.__init__
module logger set to DEBUG or VERBOSE. For issues with the GCode file itself, use the arc_welder.gcode_conversion
module set to DEBUG or VERBOSE. Warning: logging the gcode_conversion module in DEBUG or VERBOSE will likely increase processing time by 10-20x and will produce a huge log file. Only log if it is absolutely necessary.Your printer's firmware must be capable of printing G2/G3 commands to use the GCode produced by Arc Welder. Additionally, arc support must be enabled and properly configured. Firmware support varies, and many older versions produce arcs less accurately and more slowly than expected.
Marlin has supported arc commands for a long time. However, starting with version 2.0.6 arc support has been greatly enhanced. I recommend you upgrade to at least this version before using Arc Welder because your experience will be much better. Arc support must be enabled in your Configuration_adv.h file.
For recent versions of Marlin (2.0.6 and above), you can send an M115
to see if your firmware has ARC_SUPPORT enabled. For earlier versions you can send an empty G2
or G3
command. If your printer responds with unknown command
, arc support is not enabled.
If your printer is running a fork of Marlin, but arc support is not enabled or is buggy, I recommend creating an issue within the fork's repository.
"A plugin that can convert curves into arcs will be massively welcome and should make a great improvement in performance and print results."
Scott Lahteine
- Creator of Marlin Firmware
Prusa's fork of Marlin does support G2/G3 commands, however the default settings can produce sharp corners for very small arcs. I've only noticed this in a few of my test prints, so it is not a particularly common issue. You should be able to see it on the roof of a Benchy if you look closely. Reducing the MM_PER_ARC_SEGMENT setting slightly can correct this but can also introduce stuttering. Reducing the value massively (say to 0.1mm) will introduce a LOT of stutter and is NOT recommended. Please note that adjusting this setting currently requires a manual firmware recompile.
I have been toying with the firmware and have submitted a pull request to enhance the capabilities, but it hasn't made it into the firmware yet and may require further modifications. I am planning to add some enhancements from Marlin 2.0.6 as well. I also added some new GCodes for adjusting arc interpolating and for retrieving the firmware settings for arc generation. You can view the pull request here. Feel free to give this pull request a thumbs up, but realize that it needs some work and that the good folks at Prusa Research have a lot on their plates.
Also, some very old versions of Prusa's firmware (I'm not sure exactly how old) do not support bed leveling adjustments during arc movements. Please make sure you are using a recent version of the firmware so that interpolated movements are properly leveled.
Klipper seems to handle G2/G3 commands with ease, as long as the GCode_arcs config section is enabled. G2/G3 support was added on September 13, 2019, so make sure you update Klipper if you are using an older version.
Though G2/G3 support is not universal, nor are all implementations equal, it is relatively easy to test. You can do so in the OctoPrint terminal by sending the the following commands, one at a time:
G90
G28 X Y
G0 X0 Y0
G2 X40 I20
If your printer supports arc commands, it should move across a small arc from the origin. Please feel free to let me know if your firmware supports arc movements, and I may add it to the list.
Warning: The above GCode has not been tested on all printers. Please use it with caution and report any issues here.
Most firmware will convert G2/G3 commands to many small segments through a process called interpolation. The length of these segments varies by implementation. In most cases the interpolated segments are much closer together than the linear segments you will find within your GCode file, but it's impossible to know for sure without examining the firmware in detail.
All firmware that I am aware of will inscribe these interpolated segments within the arc. These segments will be entirely within the arc, only touching it at the endpoints. This will reduce the average radius slightly. In most cases, this effect is minimal and has no practical impact. However, in some odd cases, like a snap fitting that is extremely sensitive to changes in diameter, the effect may be noticeable. The smaller the interpolated segments (all firmware controlled), the less of an effect there is. In general, it will be a much smaller effect than normal variations in filament diameter. I hope to find a solution to this problem.
G2/G3 support is not perfect at the moment, but I suspect things will start to improve as they become more common. If you are willing and have the skills to improve G2/G3 support in any way, please do!
If you are interested in testing release candidates (which I really appreciate), you can easily do so via the built-in Software Update plugin.
Starting with Octoprint 1.5.0, release channels can be selected on a per-plugin basis. I have not seen this feature in action, but I believe Arc Welder is properly configured to use it once it becomes available. I will will add instructions as soon as the feature becomes available as a release candidate.
Arc Welder is a pretty new concept, so it is likely there are some undiscovered issues. However, there are a few known problems that are described below.
1. The resulting GCode stutters even when printing directly from SD
If you experience stuttering when printing from OctoPrint, first try printing the Arc Welder GCode directly from your SD card. If you STILL experience stuttering, this is probably a firmware issue of some kind (though maybe not).
For people using Marlin 1.x and forks of Marlin 1.X (Including Prusa firmware for MK2/MK3), you may need to alter your configuration_adv.h file. Check MM_PER_ARC_SEGMENT
and slowly increase the value until the stuttering goes away. A value of 1 (1MM) generally works well from a performance perspective but may result in some flat curves if they are very small.
For people using Marlin 2.0, please upgrade to version 2.0.6 or above. Several critical enhancements were added that will improve arc accuracy and speed.
2. My printer does not support G2/G3.
If you are running Marlin or a fork, make sure Arc Support is enabled by looking at configuration_adv.h. Then make sure the following line exists and is not commented out:
#define ARC_SUPPORT // Disable this feature to save ~3226 bytes
Verify that you have enough memory to enable this feature if it is disabled. You may have to disable some other feature to free up some memory.
3. I cannot install the plugin.
If you are running Python 3, confirm that you have the dev package installed. Please see the installation instructions above for details.
If you are still having problems, please (create an issue)[https://github.com/FormerLurker/ArcWelderPlugin/issues/new] and be sure to include the plugin_pluginmanager_console.log file, which you can find by opening the Octoprint Settings (wrench/spanner icon), clicking on the Logging menu, then finding and downloading the proper log file. Please upload the log file to (gist.github.com)[https://gist.github.com] and place a link within the issue. Also include the OctoPrint version, the version of python you are running, and the OS version. If you are using OctoPi, please include that version as well.
4. I see no improvement in my prints.
If you did not have any problems running the original GCode, Arc Welder isn't likely to improve your quality at all. If you had stuttering before AND after using GCode produced by Arc Welder AND you have tested the new GCode by printing directly from SD, see issue 1 above. You may need to create a support ticket.
5. My print failed when using Arc Welder, but the original GCode printed fine.
I recommend running the GCode through an analyzer that supports arcs (Simplify3D does, and nc viewer is a good online tool, though it has some problems) to see if there are any obvious issues with the GCode.
If the code looks good, please try printing Arc Welder GCode again to see if it fails in the same spot. If it does, please report the issue! See the Reporting Issues section below for info.
If you have a problem using Arc Welder, please first check the open and closed issues. If you find an existing issue that is close to your own, please read through it and see if there are any suggested fixes. If your issue is unique, consider creating a new issue. However, please don't use the Github issues as general technical support. They are for reporting potential bugs in the software. When in doubt, go ahead and create an issue here. I do want to help no matter what your problem is, but I spend so much time time dealing with issues and I'd rather be improving the software if at all possible. Bug reports improve software, tech support does not. Thanks in advance!
View the Arc Welder license.