Welcome! Log In Create A New Profile

Advanced

Marlin- how to define SCARA to permit controlled arc moves (G2 & G3)

Posted by blabbersnitch 
Marlin- how to define SCARA to permit controlled arc moves (G2 & G3)
June 17, 2015 03:46AM
Hi all.
I have a Prusa i3 with Marlin.
I want it to recognise G2 and G3 g-codes. The Reprap wiki says this:
"The Marlin Firmware can toggle support for these Gcodes. To enable support, make sure to define SCARA at compile time, or else the Gcodes will be ignored"

I hope this isn't too dumb a question, but does anyone know how to do this? I have looked through the Marlin files for somewhere to set SCARA but can't find it (though I see references to a SCARA setting in there).

Thanks,
Eric
Re: Marlin- how to define SCARA to permit controlled arc moves (G2 & G3)
June 17, 2015 01:38PM
A SCARA printer is a type of printer with arms so it is different than an i3 . Google SCARA
Are you sure your printer does not allready support G2/G3, when I issue a G2/G3 comand printer does the arc and I have made no special changes to Marlin.
The problem is I know of no slicer program that will generate G2/G3 commands as STL files have no arcs only triangles.
Re: Marlin- how to define SCARA to permit controlled arc moves (G2 & G3)
June 17, 2015 11:07PM
Thank you for your reply.

I went and tried the G-codes on my Marlin printer and you are right, they were all recognised and the printer moved in a circular pattern when told to.

The g-codes I am experimenting with are not from a slicer, but from the 'Gcodetools' extension that comes as a part of Inkscape. I think it is aimed at CNC applications but with a little modification (some 'find and replace's) it can become readable by Marlin.
The idea is to have my Prusa i3 become dual purpose: 3d printing and 2d laser engraving. Inkscape lets me convert 2d graphics to g-code.
Re: Marlin- how to define SCARA to permit controlled arc moves (G2 & G3)
June 18, 2015 12:05AM
Quote
blabbersnitch
Thank you for your reply.

I went and tried the G-codes on my Marlin printer and you are right, they were all recognised and the printer moved in a circular pattern when told to.

The g-codes I am experimenting with are not from a slicer, but from the 'Gcodetools' extension that comes as a part of Inkscape. I think it is aimed at CNC applications but with a little modification (some 'find and replace's) it can become readable by Marlin.
The idea is to have my Prusa i3 become dual purpose: 3d printing and 2d laser engraving. Inkscape lets me convert 2d graphics to g-code.
Interesting, keep us posted!
Re: Marlin- how to define SCARA to permit controlled arc moves (G2 & G3)
June 18, 2015 12:49AM
There is a former forum member named ttsalo that modified Marlin to use SCARA G codes. Perhaps check out how he did it on his Github.


[scara3dprinter.wordpress.com]
Re: Marlin- how to define SCARA to permit controlled arc moves (G2 & G3)
June 18, 2015 09:47PM
Thanks Evil Monkey. I had a look at ttsalo on Github. What I think he has done (and I could be wrong) is modified Marlin so when it is given straight lines, Marlin can convert them to arcs. What I want to do is give Marlin arcs, and have it recognise them. I will go back and have a better look, it looks like there might be some interesting stuff there. Thanks.

Widespreaddeadhead, happy to keep you posted. It will probably be a slow moving project though (I have a few things on the go).
This is where I am at now: mostly just thinking and a little bit of planning and tinkering.
I have wanted to engrave wood for a while now, and was inspired by Groover's Instructable on the Pocket Laser Engraver:
[www.instructables.com]
Getting lasers here in Australia is difficult so the DVD burner laser is a good option.
My thinking has been:
Better get some laser goggles: Done.
It would be nice to have a larger work area than Groovers pocket engraver: I could same X-Y design as my Prusa i3.
It would be nice to use the same electronics as my Prusa too (Arduino Mega and Ramps). But the grbl software for the Arduino that is often used for CNC and laser cutters has some compatibility issues with Arduino Mega (it's fine with Arduino Uno). That seems to have been resolved by LETARTARE (Github).
Instead of using grbl, could I use Marlin? (Marlin has SD support, I'm not sure grbl does... and I would like to be able to engrave without having my laptop connected the whole time)?
Inkscape seems to be the popular graphics program (it's free) for working with these diy laser engravers. It has an extension 'gcodetools' that will output a gcode from a 2D drawing. The gcode uses the G2 and G3 arc moves, and that was the reason for my initial post. But it looks like Marlin recognises them so I might be able to use Marlin after all. And if I can use Marlin, then I can possibly just use my printer; make it dual purpose.

So I can take a gcode file from Inkscape, make some changes (instead of using the default code for 'laser on' or 'spindle on', I can substitute 'fan on' or something Marlin recognises, and drive my laser from the appropriate Ramps output). I have to manage the z-axis motion in these files, but that seems easy enough.

So, while I wait for my laser casing to arrive (I pulled a burning laser out of an old DVD burner last night), I will tinker a bit with Inkscape and the gcodetools extension to see what method is best to use (there are quite a few options available in the gcodetools). I have found a few quirks with how it works but so far have been able to sort them out.
I haven't used Groover's Inkscape exension as I think it is based on gcodetools anyway. But I have found a neat extension by 305 engineering:
[github.com]
That seems to work on bitmaps. So gcodetools might be the way to go for vector graphics and 305 engineering's extension might be better for bitmaps.

Still exploring... no show stoppers yet.
Also thinking how to protect against the potential for eye damage. I might put a box around the whole thing and have a webcam, or something like that to view progress.( Also some protection against the laser coming on when powered up, etc.)
I also might try to redesign the extruder to fit the laser (I want to fit a print fan anyway).

Eric
Re: Marlin- how to define SCARA to permit controlled arc moves (G2 & G3)
June 19, 2015 02:24AM
Sounds interesting,
I had a bamboo saxofone once and it had a beautiful hand engraved drawing on it.
[www.google.de]

Would be a niche business to build a laser-engraver for tube-shaped wooden objects $$$
Could be a simple addon to the bed with a borrowed x-stepper, that rotates the flute/bamboo
-Olaf

Edited 1 time(s). Last edit at 06/19/2015 02:28AM by o_lampe.
Re: Marlin- how to define SCARA to permit controlled arc moves (G2 & G3)
June 19, 2015 03:02AM
Question about inkscape:
Would it be possible to 3D-print something like this?
[www.google.de]

[www.google.de]

THX
Olaf

Edited 1 time(s). Last edit at 06/19/2015 03:04AM by o_lampe.
Re: Marlin- how to define SCARA to permit controlled arc moves (G2 & G3)
June 19, 2015 08:41AM
Good grief!! Don't worry about starting with something simple! I just wanted to engrave a few simple shapes and some text.

I think for something like the images you linked to, I would use the '305 engineering' extension that treats the images as bitmaps. You can set the pixels per mm. Especially since some parts have a solid fill.
I imported a 'simpler' image into Inkscape to try the included gcodetools which uses a vector approach.
First i selected 'trace bitmap', then deleted the imported image and kept the trace. Then I selected 'object to path', and then in the extensions->gcodetools menu options I selected 'path to gcode'. The outputed file is gcode (with the G2 and G3 controlled arc codes). A few substitutions in the gcode would be all that would be required for Marlin to control a laser (I think... I will report back when I can verify).
I will attach a picture of the original image and of the paths the gcodetools generated. Each line in the original is treated as two edges with fill. The tracing extracts the edges of the line and these are converted to paths. It's promising (but like I said, I would probably choose to treat the whole thing as a bitmap rather than tracing out vectors).
I took the same approach with a solid spiderman logo (my son loves Spiderman) and the Gcode paths I got look pretty good.

By the way, I like the idea of using a stepper to rotate a cylindrical object, just unplug the cable to the Y-stepper (or X-stepper) and plug it into the rotating stepper... but one step at a time.

Edited 1 time(s). Last edit at 06/19/2015 08:43AM by blabbersnitch.
Attachments:
open | download - zentangle.jpg (45.1 KB)
open | download - zentangle_paths.jpg (75.3 KB)
open | download - spiderman_logo.jpg (47.2 KB)
Re: Marlin- how to define SCARA to permit controlled arc moves (G2 & G3)
June 19, 2015 10:40AM
How important is laser-object distance with a DVD-laser?
I´m afraid this is the crucial point in engraving bamboo or other naturally shaped surfaces.



-Olaf
Sorry, only registered users may post in this forum.

Click here to login