Use 3D Printer As a Plotter/cutter

97K17384

Intro: Use 3D Printer As a Plotter/cutter

I got an XYZ DaVinci 1.0a, hacked to have Repetier 0.92mod firmware, and wanted to use it as a plotter / cutter as well as a 3D printer. Some use cases:

  • plotting with fabric markers on T-shirts; the main point is to make coloring-sheet T-shirts our 4-year-old can color with fabric markers
  • drawing traces on circuit boards for etching
  • cutting gum paste for cake decorating
  • cutting paper or vinyl with a drag-knife.

It was important to me that the printer mod be easily and quickly installable and uninstallable, so one can quickly switch between plotting, cutting and 3D printing.

The software side of this is a Python script / Inkscape plugin that I wrote to convert SVG / HPGL path files into gcode that the printer can print.

Materials:

  • M3 screws and nuts
  • ABS filament
  • pen or marker (for plotter)
  • pins, plywood, screws and bungee cord (for extended print platform)
  • cutter holder and blades (I used this one) (for cutter)
  • Cricut adhesive mat (for cutter)

My total cost was under $20, not counting the printer.

STEP 1: Attachment Clip and Springy Tool Holder

For versatility and easy of printing, I went with a two-part approach:

  • attachment clip for the print head
  • springy tool holder for pen or cutter.

The attachment clip provides a mounting surface, with screw holes or gluable mounting holes, that clips onto the print head. The tool holder then screws or glues to it.

The attachment clip needs to be customized for your particular print head. Mine is for the XYZ DaVinci 1.0a. You may be able to use my OpenSCAD file to to customize for other printers. Experience shows that you'll have to measure, print, modify, print again.

I've used three tool holders. All of them need to be printed in ABS, and get their springiness from built-in ABS springs. The springiness is essential to compensate for imperfections in the surface (though you also may get some bonus springiness from your bed's leveling springs--but that may screw up your leveling).

  1. Two-piece very springy pen holder that I remixed from one that EGoe made for the ShapeOko.
  2. Low-profile pen holder that I designed from scratch.
  3. Roland-style blade mount holder that I also designed from scratch. The bird-shaped spring here is just designed to press on the blade mount's upper pin. You may need to change the dimensions slightly to fit your blade mount.

As long as the mounting screw/glue holes on your attachment clip has the same placement as on mine, you should be able to just print my tool holders without change. I used ABS juice (ABS dissolved in acetone) to attach the two piece holder to the attachment clip. The bond is surprisingly strong. The rest uses M3 screws and nuts.

The dimensions my pen holders are designed to hold up to a 15mm fabric marker, but you can use Thingiverse's Customizer to change the size. All of them are designed to use M3 screws and nuts to hold the tool in place. There are screw nut holes that are printed by the file. On my printer, these tend to come out very snug and I had to run a drill bit (sometimes just handheld) through the screw holes, and then use a screw to force a nut into the hole. The nice thing about that is that the nuts then tend to stay in the hole.

The two-piece pen holder is really cool looking, but takes up a lot of space, which limits your print area. Hence I designed my low-profile holder instead.

STEP 2: Extended Print Platform

On my printer, because the tool is off to one side of the print bed, a large chunk of the print bed can't be used for drawing and cutting. However, there is also a chunk of space that could be used if the print bed were large. In my scrap collection, I had the remains of a plywood jigsaw puzzle, and I glued on some extra pieces of wood that made it into an extended print platform, which ties on with bungee cord. A bonus of this is that I can use thumbtacks to attach work to the wood. This is ugly and hackish, but worked.

I wouldn't use this for cutting, as it's going to be hard to make the plywood as level as a glass bed would be, and leveling is much more crucial for cutting.

STEP 3: Calibrating

Level your printer bed. If you're going to be cutting, level it very carefully.

Attach your clip and tool holder, and insert the tool you will use. The calibration will be different for different combinations, and the Z-calibration will need to be done each time you level, as the heights will change slightly.

Make sure you can home your printer without the clip, holder or tool bumping into the bed. If not, you will need to do some careful hardware/software working around.

Now, use your printer panel or software (I used Repetier Host) in manual mode to move the printhead around.

First, move the printhead away from the bed for safety. Then locate the minimum and maximum XY coordinates of the available print area (make sure printer can move freely over it without bumping into any clips that you will use to hold the work in place). On my printer with the two-piece holder, the coordinates are minX=10, minY=8, maxX=192 and maxY=150, all in millimeters.

Now comes the crucial point. This is so crucial, I recommend doing it before every print. Find the Z coordinate that the tool will be in while drawing and cutting. To do this, attach whatever you want to draw on (paper, fabric, etc.) on the bed, or attach the cutting mat. Then very slowly lower the tool until it is at the desired height. To prevent marking the object when drawing, you can put a piece of aluminum foil between the pen/marker and the object.

For drawing, you want the pen to exert some pressure on the drawing surface. You'll need to experiment to get the right amount of pressure. For cutting, you want the very tip of the blade to slightly penetrate the cutting mat.

Make a note of the Z coordinate.

Then check how many millimeters you need to lift the tool for movement. Typically two or three millimeters of lift will do. The less you lift, the faster the print will be.

Finally, if you're cutting, measure the "tool offset". This is the distance from the swiveling knife pivot to the far edge of the knife. Typically, this will just be the width of the knife.

You will now have this data, all in millimeters:

  • minimum and maximum X and Y coordinates
  • work Z coordinate
  • distance to lift tool
  • tool offset (if cutting)

STEP 4: Preparing Gcode With Inkscape

There is a pretty good chance you can use the bundled gcodetools extension to drive your printer as a plotter, but I ended up writing my own python script and extension.

1. Make sure you have Inkscape installed.

2. Download the latest release of my gcodeplot scripts. Drag the contents of the zip file into your Inkscape's extensions directory. E.g., C:\Program Files\Inkscape\share\extensions in a typical Windows installation (you will get a UAC prompt in Windows, and will need to use an account with admin privileges; if you don't have such an account, do a single-user install of Inkscape).

3. Restart or start Inkscape.

4. Load the SVG file you want to draw or cut into Inskcape. The lower-left corner of the page in Inkscape corresponds to the minimum X and Y coordinates you measured in the previous step. Make sure your images fit into the print area.

5. Convert the drawing to a path: ctrl-A to select everything, then Path | Object to Path.

6. Save to gcode:

  • File | Save As...
  • Select: "3-axis gcode plotter" in the "Save as type" dropdown (if it doesn't show up, gcodeplot hasn't been installed properly)
  • After pressing "Save", you will have a complicated window with many settings.
  • General tab:
    • Tool mode: choose "drawing" or "cutting" to start off
    • Left x-coordinate, lower y-coordinate: the minimum X and Y coordinates from previous step
    • Right x-coordinate, upper y-coordinate: the maximum X and Y coordinates from previous step
    • Work z-coordinate, from previous step
    • Lift z-height: distance to lift tool relative to work for movement, from previous step
    • Parking z-height: a good safe lift distance relative to work, to miss all clips, etc. (20mm default should be fine)
    • Serial port: leave blank
  • Fitting and Extracting tab:
    • I recommend the defaults
  • Drawing Settings tab (if drawing):
    • Shading threshold: 0 if you don't want to shade colored areas; 1 if you want to shade all colored areas
  • Cutting Settings tab (if cutting):
    • Tool Offset: set as measured in previous step
    • Overcut: probably set to the same value as the Tool Offset
  • Press OK.

STEP 5: Drawing or Cutting

Make sure your work is attached well enough to the print bed. Here are some hints:

  • if you use any clips, make sure that the print head or pen won't crash into them
  • make sure bed is not being heated
  • for drawing on fabric with a fabric marker, make sure the fabric is very strongly attached along the edges and well stretched; otherwise, the marker will pull the fabric
  • for drawing on paper, you can just clip the paper to the bed or tape it with painter's tape; with a ball-point pen, I've had good luck just drawing on a sticky note that was stuck to the bed (it was a bit off on the side not glued down, but it still worked)
  • I'd attach CDs or PCBs (I haven't tried PCBs) with painter's tape
  • for cutting, use a Cricut adhesive mat, cut to the correct size, and clipped to your bed; you can customize the clips that I used

Load the gcode file into your printer control program and print. I used Repetier Host. Kill the print (know what your printer's reset button sequence is) if anything goes wrong to avoid damage.

STEP 6: More Software Stuff

While saving the gcode with my gcodeplot Inkscape extension, you can fill out a serial port name (e.g., "COM4") and have it simultaneously send the code to your printer. I don't recommend this when starting out as you have no control during sending, and the reliability is likely lower than using something like Repetier Host. But eventually you can try it.

If you have python installed, gcodeplot.py can also be used directly from the commandline, and applied to a path-only SVG file (i.e., an SVG file where objects were converted to paths with Select-All and then Path | Object-to-Path in Inkscape) or an HPGL file. Run python gcodeplot.py (assuming you have python in your path, and you're in the root gcodeplot directory) to list the options. One particularly useful option is adjusting the x/y/z coordinates right inside gcodeplot.py. To do that, include --pause-at-start --send=portname in the commandline, e.g.:

python gcodeplot.py --pause-at-start --send=COM4 mydrawing.svg

The printer will start up, but before any printing starts, you will get a gcodeplot commandline that lets you move the printhead around. Here are some pause-mode commands:

  • xn: here n is a number (e.g., x7, x0 or x-4.3) in millimeters; moves printhead to absolute x coordinate n. You can also replace n by left, center or right, as well as by more complicated formulas like (left+center)/2. In all commands, if you use formulas, there must be no spaces in them. Also, there must be no space between x and the number.
  • yn and zn: same but for y and z axes; the special coordinates bottom and top (for the y axis), and work and safe (for the z axis) will be recognized
  • x+n: increments the x position by n. E.g., x+0.7 moves the printhead by 0.7 mm in the positive direction, and x+-0.7 by 0.7 in the negative direction. (Don't confuse with x-0.7 which moves to absolute coordinate -0.7)
  • y+n and z+n: same but for y and z axes
  • left=x: set the left value (minimum x coordinate) for the drawing to the current x coordinate (you can also do more complicated formulas, like left=x-3 or left=left-0.1; again, no spaces)
  • bottom=y: set the bottom value (minimum x coordinate) for the drawing to the current y coordinate
  • work=z: set the work z-value
  • Gxxx: send any G-command to the printer
  • c: continue printing

After you set the left, bottom and work values, the drawing/cutting will be adjusted to use them.

Finally, you can do multicolor plotting by using a pen control file. Make a text file, e.g., named pens.txt, with contents like this:

1 (0,0) red Red marker
2 (0,0) #00FF00 Green marker
3 (0,0) black Black marker
4 (0,2) yellow Highlighter

The general format is penNumber (offsetX,offsetY) svgColor Description:

  • penNumber: an integer--drawing will be sorted in order of penNumber
  • (offsetX,offsetY): used in case the pen is a different thickness from the pen you used when calibrating; for instance, if your pen tip sticks out 2mm further in the y-direction than the one you used when calibrating, put (0,2). If all the pens are the same size, use (0,0) for them all. (There is no out-of-bounds checking when you use offsets. Be careful.)
  • svgColor: pen color, specified in SVG color format; there are many named colors; you can also use #RRGGBB hex color names, as well as rgb(r,g,b) color names where r,g,b are integers fromI y 0 to 255 or percentages (e.g., rgb(100%,100%,100%)).

If you then include --pens=pens.txt on your gcodeplot.py commandline, gcodeplot.py will match the colors in the drawing to the closest colors in your pens file, and insert a pause command in the gcode for pen changes. The challenge is either making sure that the pens all stick out the same distance (you'll have to do this if you are using a 3rd party program like Repetier Host to send the gcode to the printer) or else re-callibrating the z-coordinate using gcodeplot's pause-mode commands (i.e., move the printhead to the correct work position with zn or z+n commands--with aluminum foil to protect the work--and then do work=z).

I have yet to test the multiple color feature, as I haven't had a use for it.

64 Comments

If you are having issues and at your wits end, try something simple first.
Start with a blank InkScape canvas and draw a circle or square and select it and choose Path pull down menu -> Object to Path, then try the save as 3-axis Gcode Plotter, type a filename in the dialog box and hit save, it will then pull up the GcodePlot settings page, When you click OK at the bottom, it should save your Gcode file to the directory you picked with no errors. If that works, your image is the problem!
I fixed some of my errors for different images and text using "Stroke and Fill" fix or the "Fill Bounded Areas" fix from previous comments. I am using the new version of InkScape (1.3) and the GcodePlot Extension works well, {When I have my image correct}.
Thank you for creating this extension!
Hi, another feature request:
on the drawing settings an option to make multiple "walls" would be nice, so instead of shading, it should draw the shape of the object on the inside untill its filled up.
And on cutting settings add "preffered cutting direction (degrees).
I'd like to pay for these feature, let me know :) Great work.
I get the „no point“ error message too, nonr of the comments seems to work.
Send me your svg file and I'll look at it (arpruss at gmail dot com).
Thanks for your reply, i got it working.
So it seems like it is important that the svg shapes are inside the right-x and upper y-coordinate. Otherwise i get the out of range and no point message.

i have a feature request, is it possible to set the angle in wich each shape cut has to start? Lets say every cut of a shape should have an start point at a 90degree angle. this way the blade doesnt have to align after each cut and you get faster and cleaner cuts with less prone to errors, do you understand?
On dxf2gcode you can set a start point on each shape, but it can't set specific angles as start point automaticly.

All in all it is a great tool, thanks for you time and work.
Cannot save and none of the fixes seem to work. I need to know what version of Inkscape + gcodeplot versions if anyone in the thread is still alive. Just want to know the working combinations for people.
What error message do you get? If you're really stuck, you can always run gcodeplot from a commandline.
For anyone else having issues with "No Points" even with Stroke and Fill.

Select your image and then Path>Trace Bitmap.
getting the dreaded NO POINTS error, can you please just give a step by step how to fix this? people just say goto fill and stroke but i have no clue what to input...

thanks
Your drawing needs to have outlines around the regions, rather than the regions just being filled. Click on a region in Inkscape and shift-click on the black color in the palette to add an outline.
hey thanks, i figured it out, i had click on the image, click on flll and stroke, under fill hit X and under stroke hit flat color.


any idea why the Gcode goes back over the drawing with sqigly lines? it seems to go over parts of the image 2x once nice like a vector others like bitmap , i made the image in AI

I am using a Mac so I don't know if this is the issue.

I am getting an error when I do the Save As.
gcodeplot.py:429: SyntaxWarning: :"is not" with a literal. Did you mean "!="?
if pen is not 1:
Drawing out of range:


Any idea what might be causing this? How to fix?
I fixed the bug that was giving the warning. But the warning doesn't explain why you weren't getting any output. I am guessing this was because you didn't have any lines in your drawing, only filled regions.
I'm struggling with "No points" error when trying to save gcode for cutter followed by info that fille cannot be saved. What's interesting the drawing mode works. I have Inkscape 0.92 with gcodeplot-0.10. Image size is within the range, all shapes with infill (I've tried with traced bitmaps and simple vector objects in Inkscape like circle).
Resolved! The shape can't have any fill - only strokes allowed. So after tracing the bitmap go to Fill and Stroke to remove fill and set black stroke.
Sometimes I have error about the image size. In that case copying image and pasting into the new file looks like the simplest workaround.
You CAN have fill. It's just that by default, fill is not drawn, resulting in nothing happening.
There is a crosshatch option for fill handling, too.
Finally I got rid of the "No points."-error. I wanted to share my solution. First of all I used the 0.92.5 x64 portable app of inkscape and the gcodeplot-0.10. This was my initial problem not knowing if there could be a version problem - it's not by the way! As long you are using the .10 script and not the 1.x inkscape version or newer. To eliminate the no points error do only this additional step: "Use fill boned areas" (the bucket icon on the left tool bar) for all areas.
But don't ask me why this helps... I've almost no experience with SVG and inkscape

In ma case the opposite works for cutter - no fill for all the areas, just black 1pix wide stroke.
Thanks for this nice tutorial, I didn't use your setup. But the inkscape plugin works like a charm. Just what I needed.
More Comments