Welcome! Log In Create A New Profile

Advanced

Generating Gcode for a pen plotter on a Mac...? (issues)

Posted by Ohmarinus 
Generating Gcode for a pen plotter on a Mac...? (issues)
June 13, 2019 04:48PM
Hi all, I am currently building a CoreXY pen plotter and have gotten acceptable results, check this video:
[www.youtube.com]

Anyway, I am currently using Gcodetools within Inkscape but I'm running into some severe problems. Somehow I am able to generate gcode for only a really small amount of designs that I made. The rest of the files all give errors like:

Traceback (most recent call last):
  File "gcodetools.py", line 6753, in 
    gcodetools.affect()					
  File "/Applications/Inkscape 0.91 .app/Contents/Resources/share/inkscape/extensions/inkex.py", line 268, in affect
    self.effect()
  File "gcodetools.py", line 6677, in effect
    self.path_to_gcode()		
  File "gcodetools.py", line 4590, in path_to_gcode
    [ self.parse_curve([subpath], layer) for subpath in csp  ]
  File "gcodetools.py", line 3734, in parse_curve
    c += biarc(sp1,sp2,0,0) if w==None else biarc(sp1,sp2,-f(w[k][i-1]),-f(w[k]))
  File "gcodetools.py", line 2305, in biarc
    r = TS.mag()/v.mag()*2
ZeroDivisionError: float division by zero

The paths are all checking out correctly and I have managed to create a mediocre gcode file with another gcode generator so the file should be good.

Worst part is that I can export all individual lines that are in the file, but when I try to export all the lines together I get this error.

The Gcodetools forum has been dead/inactive for years and I tried to export my file with 3 different inkscape versions and all give the same errors on most of my files.

This is why I am looking for a working Gcode generator that works on a Mac. I'm done with Inkscape. And I've built such a wonderful machine (that still needs tweaking and upgrades). It deserves some well generated code.

The file that doesn't want to generate is this one:
lotus.svg

The file that does want to generate is this one:
geometrische_tekening_350x350_v2.svg

Are there errors in my Lotus drawing? And would anyone know how I can fix it? Unless I can make the Lotus drawing work in this system I have to start looking into better ways to generate gcode. I hope someone knows the solution for me.


Edit;
I have just hacked this plugin GcodePlot;
[inkscape.org]
to support servo moves with M280 (both pen up and down) and add M400's in between the servo moves. Seems to work really well on all my files, but it doesn't to a nice job on curves sadly. Gcodetools generates much nicer curves. So I'm still lost sad smiley

Edited 3 time(s). Last edit at 06/13/2019 05:23PM by Ohmarinus.


http://www.marinusdebeer.nl/
Re: Generating Gcode for a pen plotter on a Mac...? (issues)
June 13, 2019 06:10PM
There are errors in lotus.svg at the two inner sharp points on the right hand side. You may be able to correct them by mirroring the left side.

Edited 1 time(s). Last edit at 06/13/2019 06:10PM by etfrench.
Re: Generating Gcode for a pen plotter on a Mac...? (issues)
June 14, 2019 02:52AM
Quote
etfrench
There are errors in lotus.svg at the two inner sharp points on the right hand side. You may be able to correct them by mirroring the left side.

Thanks a lot for your insight! Is there a way that I can find this out myself so that I can find and fix these errors in the future? smiling smiley

Thanks for the tip, I'll try it and see if that helps. Next time I'll draw my artworks in Rhino in line art and export it to DXF because I previously worked in Illustrator but it seems Illustrator has a tendency to generate a lot of errors. It may look nice but behind the curtain..

Update:
Okay, so I removed the right side and duplicated the left side with a mirror in Rhino and reconnected all the lines correctly. But I am still getting the same error in Gcodetools.. So doing a mirror didn't help.. I think I really should try to get Gcodetools working because eventually I want to use a tool changer for different colored parts.

Edited 2 time(s). Last edit at 06/14/2019 04:11AM by Ohmarinus.


http://www.marinusdebeer.nl/
Re: Generating Gcode for a pen plotter on a Mac...? (issues)
June 14, 2019 07:30AM
I have rebuilt the edges completely of my design but it doesn't look like the thing I made anymore. It does seem to generate a weird huge cross in Inkscape but when I check the Gcode the blue and green line paths don't appear in bCNC.

It would be awesome if someone could point me in the direction of repairing an SVG file with errors in it since when I open my file in Rhino3D it doesn't show me there are any errors in the line art?

I have 'hacked' the gcodetools plugin so that it always already has the correct settings in the 'default' tool setup, so I don't have to put in the M280 and M400 commands manually. Including a header and footer for homing and moving the toolhead out of the way after a print.

The reason why I hacked the plugin is because I want to add tool changing for multicolor use from inkscape. I have heard that Fusion360 also has a gcode-capable generator. I might try that out once I update my OS to Mojave or something. I'm now still on Yosemite and have been very busy with work and was afraid to update because I don't want to lose all my current work.

Preview in InkScape:


Preview of Gcode in bCNC:



Update:
Here a timelapse with the hacked-up version of gcodeplot:
[www.youtube.com]

As you can see the machine is working pretty good already. It's now mostly down to getting the string-tensioning up to the amount so that the machine has less backlash and I need to get the Z-carriage tight enough so that the pen can't wiggle anymore. It wiggles slightly, even though it doesn't really show. Up close you can see it. I'm thinking of picking up a tiny linear rail somewhere if my next attempt of making a good sturdy and light z-axis fails.

Edited 1 time(s). Last edit at 06/14/2019 04:20PM by Ohmarinus.


http://www.marinusdebeer.nl/
Re: Generating Gcode for a pen plotter on a Mac...? (issues)
June 14, 2019 05:40PM
Actually, there are quite a few other errors in the .svg. Most of the tips are malformed. I'd recommend not doing this in Inkscape. Fusion 360 is still able to generate gcode for all of the valid geometry. [knowledge.autodesk.com]
Re: Generating Gcode for a pen plotter on a Mac...? (issues)
June 15, 2019 03:24AM
Quote
etfrench
Actually, there are quite a few other errors in the .svg. Most of the tips are malformed. I'd recommend not doing this in Inkscape. Fusion 360 is still able to generate gcode for all of the valid geometry. [knowledge.autodesk.com]

Wow, that looks like it does a better job than any of those inkscape plugins will ever do.. Guess I'll have to upgrade my OS then. It's a difficult decision, because I won't be able to use a lot of other software anymore. Thanks for the screencast.


http://www.marinusdebeer.nl/
Sorry, only registered users may post in this forum.

Click here to login