CNC Plotter

by lingib in Workshop > CNC

23013 Views, 250 Favorites, 0 Comments

CNC Plotter

Cover1.jpg
sample_plot.jpg
CNC Plotter

This Instructable explains how to build a CNC plotter, using two NEMA17 stepping motors, a timing belt, a few idler pulleys, an Arduino UNO R3 microcontroller, and some printed PLA parts.

The paper size is A4 ... longer pipes are required for A3

Resolution is 80 steps per millimeter.

Unlike some plotters, in which the arm moves back and forth, the footprint for this plotter is constant.

A mounting base is not required as the plotter is freestanding. Screw-holes, however, have been provided should you wish to add a base.

The design is such that a laser print-head (future project) can be substituted for the pen-lift shown in photo 1. The current design is used for creating watercolor outlines.

The detachable pen-lift is described in my instructable https://www.instructables.com/CNC-Pen-Lift-1/

The plotter runs a modified version of “GRBL- Servo” and works with “UGS” (Universal G-Code Sender).

The timing-belt path is unusual in that the belt passes through the inside of the 12/10 diameter metal arms. This accounts for its simplistic look. The belt is tensioned by moving the end-brackets outwards.

Construction details, including all STL files, are provided … … all you need is a screw-driver, a pair of side-cutters, and a hacksaw.

Excluding the CNC-Pen-Lift, the estimated cost of this plotter is less than $100

Images

  • Photo 1 shows the assembled plotter
  • Photo 2 shows a sample plot
  • The video shows the plotter in action

Supplies

 The following parts were purchased from https://www.aliexpress.com/

  • 1 only Arduino UNO R3 with USB cable
  • 2 only Big Easy Driver motor controllers
  • 2 only 12 volt 30 ohm 17HS3430 NEMA17 stepper motors
  • 2 only NEMA17 stepper brackets
  • 1 only 3m length GT2 6mm timing belt
  • 2 only GT2-20 6mm timing pulleys with 5mm bore
  • 3 only GT2 6mm toothless idler pulleys with 4mm bore
  • 4 only GT2-20 6mm toothed idler pulleys with 4mm bore
  • 6 only LM12UU linear bearings

The following parts were obtained locally:

  • 2 only 1m lengths 12/10mm (O.D./I.D.) metal tube [1]
  • 8 only M3 x 5mm bolts
  • 4 only M3 x 10mm bolts
  • 4 only M3 x 20mm bolts
  • 4 only M3 x 35mm bolts
  • 4 only M3 nuts
  • 15 only M4 x 30mm bolts
  • 15 only M4 nuts
  • 2 only cable ties

In addition to the above parts your will need to make the pen-lift described in my instructable https://www.instructables.com/CNC-Pen-Lift-1/

You will also need to print the PLA parts described further on

Excluding the CNC-Pen-Lift, the estimated cost of this plotter is less than $100

Notes

[1]

I used 12mm O.D. aluminium tube

Aluminium tube was all that was available at the time … (stainless steel would be better)

Circuit

GRBL-SERVO_wiring.jpg

The wiring diagram for this plotter is shown in photo 1.

IMPORTANT - the Big Easy Driver modules expect the wires from each motor coil to be adjacent. Check that the motor wires don't alternate ... if so swap the two center wires.

Adjusting the motor current(s)

  • Attach a 12 volt 30 ohm NEMA17 stepping motor to a Big Easy Driver module and apply 12 volts DC to the motor assembly. [1]
  • Now adjust the small potentiometer on the Big Easy Driver module for a current reading of 0.4 amps
  • Repeat this process for the remaining motor and Big Easy Driver module.
  • Disconnect the power.

Substitute motors

The plotter also works with 6 volt 8 ohm stepping motors in which case a 6 volt power supply should be used and the motor currents set to 0.6 amps (600mA).

Notes

[1]

I’m using a CPS-3205 adjustable power supply which has on-board metering. Any 12 volt power supply/battery capable of 2amps will work equally well … just insert a current meter in series when adjusting the current.

STL Files

plotter_gantry_mount_LM12UU.JPG
plotter_end_plate.JPG
plotter_LM12UU_slide.JPG
plotter_arm_end.JPG
plotter_servo_bracket.JPG

 The following PLA parts are required:

  • Photo 1 … gantry (1 only)
  • Photo 2 … end plate (2 required)
  • Photo 3 … slide (1 only)
  • Photo 4 … arm end (1 only)
  • Photo 5 … pen-lift bracket (2 required)

The STL files for the above parts are attached to this step.

Assembly instructions follow ...

Gantry

plotter_gantry_mount_LM12UU.JPG
IMG_2810.JPG

 Press four LM12UU linear bearings, two from each end, into the holes provided. If necessary add a drop of super-glue before fully pressing home.

Insert two GT2 toothless idler pulleys into the slot closest to the gantry support tubes. Secure them in place with M4 x 30mm nuts and bolts … finger tight only. Ensure the idlers spin freely.

Insert two GT2-20 toothed idler pulleys into the slot furthest from the gantry support tubes. Secure them in place with M4 x 30mm nuts and bolts … finger tight only. Ensure the idlers spin freely.

Insert two 12mm O.D. pipes into the LM12UU linear bearings . Bed the pipes in by running them back and forth. Lubricate the bearings with light oil if necessary.

End Plates

plotter_end_plate.JPG
IMG_2811.JPG

Insert the 12mm O.D. pipes into each end plate. Lock them in place with a M3 bolt using the threaded holes provided.

Attach a NEMA17 mounting bracket to each plate using M4 x 30mm nuts and bolts.

Attach a NEMA17 motor to each NEMA17 mounting bracket using four M3 x 5mm bolts

Attach a GT2-20 timing pulley to each motor shaft

Adjust the pulley/motor height such that the timing pulley is centered in the timing-belt window.

Slide & Pen-lift Brackets

plotter_LM12UU_slide.JPG
plotter_servo_bracket.JPG
IMG_2801.JPG

 Insert two LM12UU linear bearings into the slide. Lock the bearings in place with a drop of super-glue if necessary.

Insert two 12mm O.D. pipes into the linear bearings. Run the bearings up and down the pipes to bed them in. Lubricate the bearings with light oil if necessary.

Attach the two pen-lift brackets to the slide using two M3 x 35mm nuts and bolts.

Attach the pen-lift described in my instructable https://www.instructables.com/CNC-Pen-Lift-1/ to the pen-lift brackets using two M4 x 10mm nuts and bolts.

Insert a GT2 toothed idler pulley into the slot provided and secure in place with an M4 x 30mm nut and bolt … finger tight only. Ensure that the pulley spins freely.

Insert the two 12mm O.D. pipes into the gantry holes. Inserting two M3 bolts into the threaded holes provided and lock the pipes in place.

Arm End

plotter_arm_end.JPG
IMG_2816.JPG

 Insert two GT2-20 toothed idler pulleys into the end slot. Secure the pulleys in place with two M4 x 30mm nuts and bolts … finger tight only.

Insert the 12mm O.D. pipes into the large holes in the arm-end. Secure the pipes by inserting two M3 x 10mm bolts into the threaded holes provided.

The remaining two holes are for securing the end of the timing belt with two M3 x 35mm nuts and bolts.

Timing Belt

Timing belt path.jpg

The timing-belt path is shown in photo 1. [1]

The belt to passes up and down the pen-arm a total of four times. Two of these runs pass through the inside of the 12mm diameter support tubes.

The timing-belt is tensioned by moving the end-plates outwards.

The pen moves up/down when the motors rotate in opposite directions.

The pen moves left/right when the motors rotate in the same direction.

When using GRBL the software must be configured for CoreXY.

Notes

[1]

Credit for this timing belt configuration belongs to Tim https://www.instructables.com/member/Palingenesis/ .

Installing GRBL

config.h_edit.JPG
GRBLupload.JPG

In order to plot an image we need to install a g-code (graphics-code) interpreter called GRBL. [1]

The following steps install a coreXY version of GRBL onto your Arduino UNO R3.

Method

  • Download the file “Grbl_Pen_Servo-master.zip” from https://github.com/bdring/Grbl_Pen_Servo [2]
  • Expand the zip file.
  • Locate and copy the “grbl” folder to your C:\...\Arduino\libraries” folder.
  • Activate the CoreXY mode by editing code line 189 in the library file “config.h” to read #define COREXY as shown in photo1. Use a text editor such as Notepad++ … not a word processor. [3]
  • Open your Arduino IDE (Integrated Development Environment)
  • Left-click “File | Open” and navigate to the C:\...\Arduino\libraries\grbl\examples\grblUpload” folder.
  • Left-click “grblUpload.ino” then left-click “Open”. You should see the screen shown in photo 2.
  • Finally, compile and upload the code to your Arduino.
  • That’s it … GRBL is now installed on your Arduino.

We are still not quite finished … in the next step we will tell GRBL all about our plotter.

Notes

[1]

GRBL doesn’t stand for anything … rather the name was inspired by a computer mouse.

https://github.com/gnea/grbl/wiki/Frequently-Asked-Questions

[2]

Unless modified, GRBL assumes that you will be using separate motors for each of the XYZ axes. In this version we replace the Z-axis motor with a servo.

The “spindle_control.c” in this library has been modified by in such a way that the pen (servo) is raised whenever the “Z” value is greater than zero, and lowered whenever the “Z” height is zero or negative.

[3]

Unless modified, GRBL assumes that your XY motors are independent … i.e the X-axis motor controls movement along the X-axis and the Y-axis motor controls movement along the Y-axis.

CoreXY is different in that both motors always rotate. Movement along the Y-axis requires the motors to rotate in opposite directions … movement along the X-axis requires both motors to rotate in the same direction.

Configuring GRBL

GRBL_CoreXY_Start.JPG
GRBL$$.JPG
GRBLconfigured.JPG

Before we can start plotting we must overwrite GRBL’s default configuration file with our plotter settings … this is a once-only process.

Photo 1 appears whenever you open your Arduino Serial Monitor at 115200 baud.

Your GRBL settings may be viewed at any time by typing $$ into the text box at the top of your Serial Monitor screen then clicking “Send”. Photo 2 shows the default settings in GRBL version 1.1f.

To edit any setting, just retype the screen line using a different value … for example:

  • Type $110=6000 into the Serial Monitor text box and click “Send”.
  • To see the change type $$ and click “Send”

Repeat this process until all of your settings are the same as those shown in photo 3 [1]

Finally type “G10 L2 P0 Z-2” (without the quotes) and press send. The line G10 L2 P0 Z-2 prevents the pen marking your paper at power-on.

Your plotter is now fully configured and is 100% compatible with Inkscape g-code [2]

Note

[1]

The GRBL settings are fully documented in https://github.com/gnea/grbl/wiki/Grbl-v1.1-Configuration

Screen lines $110, $111, $112 set the maximum plotter speed in millimeters per minute.

Screen lines $120, $121, $122 set the plotter acceleration in millimeters per second per second.

Screen lines $130 and $131 set the A4 paper dimensions for this plotter.

[2]

“Inkscape” may be downloaded from https://inkscape.org/. The software is Free and Open Source, and licenced under GPL.

When using “Inkscape”, I set the F(feed value) in the Inkscape’s “Default Tool” menu to a value higher than the $110, $111, and $112 values in GRBL on the basis that the lowest speed wins ... this approach appears to work.

Plotting an Image

UGS_square_ngs_run.JPG
inkscape preferences.JPG

All g-code files, regardless of file-extension, can be read with a text-editor such as Notepad++. Common file extensions include *.gcode, *.nc, *.ngc, and even *.txt

Step1

Before we can plot we need something to draw

  • Download the attached file “square.txt”. [1]


The contents of this file comprise the following g-code commands:


%
(Header)
(Generated by gcodetools from Inkscape.)
(Using default header. To add your own header create file "header" in the output dir.)
M3
(Header end.)
G21 (All units in mm)

(Start cutting path id: rect82)
(Change tool to Cone cutter)

G00 Z5.000000
G00 X50.000000 Y100.000000

G01 Z0.000000 F100.0(Penetrate)
G01 X100.000000 Y100.000000 Z0.000000 F6000.000000
G01 X100.000000 Y50.000000 Z0.000000
G01 X50.000000 Y50.000000 Z0.000000
G01 X50.000000 Y100.000000 Z0.000000
G00 Z5.000000

(End cutting path id: rect82)


(Footer)
M5
G00 X0.0000 Y0.0000
M2
(Using default footer. To add your own footer create file "footer" in the output dir.)
(end)
%


Step 2


We now need some way to send this file to our plotter.

A suitable program is UGS (Universal Gcode Sender) from https://winder.github.io/ugs_website/download/

Step 3

Set the pen’s “Home” position. [2]

  • position your paper under the plotter
  • run UGS and "open" a connection to your arduino.
  • "check" the box labelled "Enable Keyboard Movement"
  • set the "XY step size" to 10 mm
  • set the "Feed rate" to 1000 mm/minute
  • click the +X, -X, +Y, -Y buttons to move the pen.
  • when the pen is over the lower-left corner of your paper click the "Reset Zero" button
  • uncheck the "Enable Keyboard Movement" box
  • The plotter will now return to this position.

Step 4

We are now ready to plot.

  • launch “Universal Gcode Sender”
  • position the pen over the lower-left corner of your paper (see step 3 above)
  • enter the COM port attached to your plotter
  • set the communication speed to 115200 bauds
  • click “Open”
  • now “Browse” for our g-code file “square.txt.”
  • click “Open”
  • click “Visualize” and a screen will (eventually) appear.
  • click “Send “ ... the yellow virtual pen, and your plotter, should both start moving (photo 1)

Notes

[1]

“Step 9” of my instructable https://www.instructables.com/CNC-Robot-Plotter/ explains how to create a g-code image-outline using Inkscape.

[2]

The default (0,0) XY machine coordinate for GRBL is set to the lower-left corner of the plotter.

Unfortunately the default (0,0) XY coordinate in the latest versions of Inkscape is set to the top-left corner of your page .

To set the default (0,0) XY coordinate to the lower-left corner of your page:

  • open Inkscape.
  • click “Edit | Preferences | Interface” (photo 2)
  • deselect “Origin at upper left with y-axis pointing down (restart required)”
  • exit Inkscape
  • restart Inkscape.

Summary

This Instructable explains how to build an A4 CNC plotter, using two NEMA17 stepping motors, a timing belt, a few idler pulleys, an Arduino UNO R3 microcontroller, and some printed PLA parts.

Construction details, including all STL files, are provided … all you need is a screw-driver, a pair of side-cutters , and a hacksaw.

The plotter resolution is 80 steps per millimeter.

Only a single timing belt is required.

The plotter runs a servo version of GRBL and is compatible with UGS (Universal Gcode Sender) and Inkscape.

Unlike some plotters, in which the arm moves back and forth, the footprint for this plotter is constant.

A mounting base is not required as the plotter is freestanding. Screw-holes, however, have been provided should you wish to add a base.

The detachable pen-lift is described in my instructable https://www.instructables.com/CNC-Pen-Lift-1/

Excluding the CNC-Pen-Lift, the estimated cost of this plotter is less than $100

  Click here   to view my other instructables.