Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Firmware Compensation for Older Arc Interpolation #18

Closed
FormerLurker opened this issue Nov 23, 2020 · 0 comments
Closed

Add Firmware Compensation for Older Arc Interpolation #18

FormerLurker opened this issue Nov 23, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@FormerLurker
Copy link
Owner

Some firmware, especially those based on an older version of Marlin, have only the MM_PER_ARC_SEGMENT setting to control arc interpolation. The default value is 1mm, which can result in noticeably flat edges on smaller arcs. This can be somewhat compensated for within the arc generation routine at the cost of less compression.

Add two new command line parameters to the console app:

--mm-per-arc-segment (-s) - The value of the MM_PER_ARC_SEGMENT define within the compiled firmware
--min-arc-segments (-a) - This will simulate the MIN_ARC_SEGMENTS firmware parameter

The general idea is that when an arc is created we will check how may segments would be interpolated along a circle of the same radius using the MM_PER_ARC_SEGMENT value. If it is less than MIN_ARC_SEGMENTS, then we will check the length of the current arc and see if that length divided by the circumference of a circle with the same radius would produce MIN_ARC_SEGMENTS arcs. If it does, the arc will be created. If not, the G2/G3 will be left alone.

The effect of this will be that in some cases no arcs will be generated at all for some circles. In other cases, instead of having an individual arc, it will be split up into multiple arcs. This obviously isn't a perfect solution, but it does provide many of the benefits Arc Welder was designed for, while allowing for more accurate prints, even without the fancy new arc interpolation firmware settings. This will be especially useful when a user can't recompile their firmware for various reasons.

Here is an example of two rows of circles, one separated and the other joined. Both rows start with a radius of 0.1mm and end at 4.7mm. This is the gcode produced by Prusa Slicer as visualized by NCViewer:

image

Here is gcode produced from the standard Arc Welder algorithm:

image

You can see that arcs are generated even for the smallest circles. These would not look very good on firmware with MM_PER_ARC_SEGMENT = 1, since many of these circles are less than 1MM in radius! Here is what happened when I turned firmware compensation on:

image

Here I used a value of 12 for Min Arc Segments and 1mm for MM Per Arc Segment You can see that as the circles get smaller and smaller, fewer and fewer arcs are generated. At a radius of about 3.6mm, full arc generation is seen. At 0.1mm, no arcs are generated at all.

Here is a close up of the original gcode with a high number of segments:

image

And here is the same figure using Arc Welder and the new firmware compensation settings I mentioned above:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant