Willmac16 / OctoPrint-GcodeLeveling

An OctoPrint plugin for leveling of Z values in Gcode using measured positions
https://plugins.octoprint.org/plugins/gcodeleveling/
GNU Affero General Public License v3.0
5 stars 0 forks source link

ARCs #8

Closed Roukie686868 closed 3 years ago

Roukie686868 commented 3 years ago

I'm playing with the plugin but don't get the results I was hoping for. I took a piece of warped wood and plotted out the curve.

image

Then I tried to make a 1 mm deep cut 8mm width over a length of about 250mm.

image

In the upload file see Z being corrected but my Y does weird things. see what I get

image

both views are seen from above. attached the before and after gcode files

Test.txt Test_NO-GCL.txt

My 2 cents. It looks like G2 and/or G3 ARC commands are not properly being used.

Willmac16 commented 3 years ago

You are correct in assuming that the G2/G3 commands are not being handled correctly (at all). Since the arc commands only work in one plane at a time, the plugin would need to convert the arc into small linear segments instead of the firmware (file sizes will increase but that is the cost of all gcode side modifications).

I will try to implement this (and possibly Bezier support) soon.

Roukie686868 commented 3 years ago

Looking forward to the update. For now I just went the old fashioned way and planed the surface flat. Let me know when you have an update and I will give it a go.

Willmac16 commented 3 years ago

@Roukie686868 I have a version I believe works in the devel branch. You can install it in the plugin manager with the url https://github.com/willmac16/OctoPrint-GcodeLeveling/archive/devel.zip.

I figured out that I could keep the moves in G2/G3 form and just subdivide arcs into smaller ones that move linearly in the z direction.

I only coded/tested in the XY workplane, so I would avoid using other workplanes for now. If you do have a use for other workplanes, I could try to figure something out, but it seems significantly more complicated.

Roukie686868 commented 3 years ago

I wanted to test the new version but keep getting the following error; image

I did see this before on the previous version but after trying a few times it did the job, now all I get is the *_NO-GCL.gcode file. Is there something I do wrong of is this an error.

Maybe another small thing to improve is the entry from. I create all the fields I need upfront and then go to the first one and TAB my way thru. Every time I hit a new field I first need to delete the ZERO. It would be more efficient when the Zero is highlighted after a TAB and so disappears as soon as I start to type a new number.

Willmac16 commented 3 years ago

Could you send your octoprint.log file (either through the logging tab of settings or through ssh).

Currently the plugin logs errors to the backend, but I should add some user facing errors in the future.

Roukie686868 commented 3 years ago

Could you send your octoprint.log file (either through the logging tab of settings or through ssh).

Currently the plugin logs errors to the backend, but I should add some user facing errors in the future. I did reboot the Raspberry and then loaded the file again to get a cleaner Log file. I saw an error about an integer and a float. I went back in and change the settings file so none of the data points has a comma. did not help.

octoprint (2).log

Willmac16 commented 3 years ago

I suspect this is a python 2 vs 3 thing since I only tested on python 3 instances which didn't have this issue. I made a change that I believe will fix it, but if not I can fire up a python 2 instance.

Roukie686868 commented 3 years ago

I suspect this is a python 2 vs 3 thing since I only tested on python 3 instances which didn't have this issue. I made a change that I believe will fix it, but if not I can fire up a python 2 instance. Greetings from Illinois, I have Python 2.7 installed. That is how OctoPrint/Pi came. Not sure if I will run into problems trying to upgrade this to version 3. image

I did load your 0.3.0 link from the previous reply (assuming that that got adjusted) and this time the file upload does work and I get the new file. The first results looked good with a tilt of 5mm over 160mm length. To see more detail I went for 50mm over 160mm. There some issues pop up. image

Look to the top right. The outer Arc seems okay but the 2 inner ones are parallel to the XY plane.

Willmac16 commented 3 years ago

Could you try decreasing the arc segment length setting.

I might try to figure out a method that would ensure the height deviation was always less than a configureable maximum value, but that would be much more computationally costly.

Roukie686868 commented 3 years ago

I might be able to do this by hand but my code is generate by fusion 360. In the models I create there are many many arcs so not really doable to adjust.

Willmac16 commented 3 years ago

@Roukie686868 I added a setting for this plugin in the octoprint settings window.

Willmac16 commented 3 years ago

image The Length of Arc Segments one

Roukie686868 commented 3 years ago

image

The Length of Arc Segments one

Will try this out tomorrow. Missed that new field. Thanks for the many follow ups.

Roukie686868 commented 3 years ago

Great. I brought the ARC segment length down to 1 and I get perfect results. image many thanks. I would say this topic can be closed.