Creating Makelangelo GCode
Shop › Forum › Makelangelo Polargraph Art Robot › Creating Makelangelo GCode
Tagged: commandline, gcode
- This topic has 4 replies, 2 voices, and was last updated 8 years, 6 months ago by Dan.
-
AuthorPosts
-
2016-06-10 at 11:35 #9938AnonymousInactive
Hey everyone!
Are there any linux, command-line tools out there that will create gcode from a svg or dxf that is compatible with the Arduino Makelangelo firmware?
I’ve tried pycam, which gets pretty close and svg2gcode, which isn’t very close.
Moreover, what is the difference between all these gcode formats? For just 2d, it seems like every tool I use is outputting different codes. I’ve added some sample code from the different generators I’ve tried.
Thank you so much for any guidance and advice!
makelangelo java program sample:
M101 T42.55 B-42.55 L-42.55 R42.55 I1 J1;
D1 L3.0 R3.0;
G00 G90;
M06 T0;
G00 Z50.0 F120.0;
G04 P50;
G00 F3500.0;
G00 X-7.3623366 Y-204.67612;
G00 Z90.0 F120.0;
G04 P50;
G00 F3500.0;
G00 X-8.458519 Y-204.60669;
G00 X-9.5425205 Y-204.53113;
G00 X-10.614848 Y-204.44939;pycam sample:
G0 Z25.00000
M3 (start spindle)
G04 P3 (wait for 3 seconds)
X313.50000 Y798.36282
G1 Z0.00000
X295.90635 Y796.21523
X279.65388 Y793.60781
X264.51352 Y790.50325
X250.26843 Y786.85948
X246.06979 Y785.67121svg2gcode sample:
G90
(tooldiameter=4)
G0 X53.5 Y252
G1 X61 Y252 Z0
G0 X378.9 Y2522016-06-10 at 12:26 #9939DanKeymasterEach program is customized to a slightly different application.
Makelangelo has a few opening lines that tell the machine it’s settings (M101, D01). The settings used to be stored in the machine itself, and were later removed for reasons…. that I don’t remember at this moment. BTW, if you’re using our 20-tooth pulleys then update your pulley size settings because it should be D1 L1.27323 R1.27323
Pycam has many lines with no G command at the start. They are using a feature I only just learned about, which is to use the last-seen g command. Pycam is also expecting a rotating cutting tool (M3).
Makelangelo silently ignores commands it does not recognize. Most of Pycam would fail on Makelangelo.
A few people have requested a command-line only interface. It’s a big project to refactor things into a Model-View-Controller code design pattern, after which I can replace the View with a command line only View. Once it works it would be pretty trivial to run a Makelangelo off a Pi Zero or an ESP8266, which would be nice.
2016-06-10 at 13:06 #9947AnonymousInactiveThanks so much for responding, Dan!
That all makes sense and that’s exactly what I’m doing! I’ve got a Pi Zero hooked up to my drawbot.
I’ve written a NodeJS based GCode sender that lets me have a web based interface to send gcode files to store, visualize and print them.
https://github.com/falldeaf/triangulumprint
As a last step though, I’d like to be able to create GCode on the server from images and other sources. I found a few different web-based ways to create dxf files that would be neat to build into the interface (maybe with a plugin interface) that would need converted to Makelangelo compatible gcode.
- http://microsoft.github.io/maker.js/about/
- http://gnuplot.respawned.com/
- http://potrace.sourceforge.net/
I think for now I’ll write a script that refactors the pycam gcode to be compatible with Makelangelo, but please add me to the list of folks that would live to see a commandline version of your DXF->GCODE java app. I want my server to stay compatible with your Arduino firmware and using an official commandline app would be the best route, in my opinion.
Thanks again for reading and taking the time to respond to my previous post.
2016-06-10 at 13:12 #9948AnonymousInactiveSorry one more question if you don’t mind!
In the meantime, do you think it would make sense for me to use just the code that creates GCode from dxf from your application? And try to create a less capable but simple DXF->GCode(makelangelo compatible) java based commandline application?
https://github.com/MarginallyClever/Makelangelo/blob/f33f843677755c634d299f96fecec231b80c399a/java/src/main/java/com/marginallyclever/loaders/LoadDXF.javaJust skimming through the code though, it looks like it may be turning DXF into bitmaps, then using a converter to create gcode, or am I reading that wrong?
Or do you think this would be a waste of time as it would be hard to excise just this functionality, and that parsing and altering pycam gcode files would be easier?
Thank you again for your time!
2016-06-10 at 13:21 #9949DanKeymasterIt’s reading in DXF files and tracing the lines in the files directly into gcode lines. If the order of the lines seems a little wonky, it’s because the DXF file stores lines first by type (line, spline) and then by starting point ascending y axis. eg, the first line has a start at the bottom of the picture and the second line is the one that starts closests to the bottom. DXF files don’t care about continuity (one line starts where another ends) or bounding region (start point might be higher up the image than where the line travels). I’ve long wanted some kind of optimizer to find and remove these silly issues. spatial reconstruction is not a trivial task and the time it takes grows exponentially larger.
-
AuthorPosts
- You must be logged in to reply to this topic.