Home > Other >Special Application Circuits > How to Build a Low-Cost Arduino MiniCNC Plotter

How to Build a Low-Cost Arduino MiniCNC Plotter

Source: InternetPublisher:红水杯 Keywords: CNC Arduino Updated: 2024/08/06

In this project I will show you how to easily build your own low-cost Arduino Mini CNC Plotter!

For the X and Y axis we will use stepper motors and guides from two DVD/CDROMs! The printing area is maximum 4x4cm.

Because it works with serial communication, you can also use a Bluetooth module (like the HC-06) to print your stuff wirelessly over your computer Bluetooth connection!

Step 1: What You Need

For this project you will need:

Parts List for Beginners:

Arduino University

Breadboard

2xL293DIC motor driver

Micro servo motor

2 DVD/CD drives

Parts list for the 'pro':

ATmega328p (with Arduino bootloader)*

28-pin DIPIC socket

16MHz crystal

2x22pF and 1x100nF capacitors

10K resistor

USB to Serial Adapter**

2 L293DIC

Micro servo motor

2 DVD/CD drives

Prototype PCB circuit board Stripboard

4x2pins screw terminal connector (or 2x4pins screw terminal connector)

You will also need an Arduino UNO board to program the ATmega328 micro-owner

A USB to serial adapter will allow the circuit to communicate with a computer via a USB cable, just like an Arduino Uno does.

Why use screw terminal connectors? Because you don't want to be soldering and desoldering the stepper motor's cables until you find the right combination for the job.

Tools (for "Pro" parts list only):

screwdriver

iron

welding

Cutting tool (e.g. Dremel) (for cutting plastic parts optional)

glue

Step 2: Disassemble the DVD/CD Drive

The first step to start building this cnc machine is to take apart the two DVD/CD drives and then remove the stepper motors. Use a screwdriver to open them and remove them from the rails.

The next step was to choose our base for this CNC machine. I used a surface from leftover DVD "junk" material.

Finally, we need to find something to attach one of the stepper rails vertically to our structure. (You'll understand what I mean in our next step) Watch the picture above.

Step 3: X and Y Axis

In the first picture above you will see the Y axis of our CNC machine. Attach it to your surface, you will need some screws and nuts for this part.

In the second picture you will see the X and Y axis. The X axis is attached to two plastic parts that I took out of leftover "junk" material. I cut it to fit the structure.

This is a simple process. Just make sure you place the Y-axis vertically on the CNC base and the X-axis vertically (90 degrees).

Step 4: Z-Axis

This was the most difficult part of our build.

You will need something to hold it on the X axis, a flat surface. On that surface you will attach the servo motor (Z axis) and the pen holder. The pen (or pencil) must be able to move up and down with the help of the servo motor.

Look at the image above to understand what you need to do to adjust the Z axis.

Step 5: Paper Base

Now you have to attach a wood (or plastic) surface on the Y axis (5x5cm will be fine).

This is where you will place the paper to print your text or image!

Remember that the printing area is 4x4cm.

Step 6: The Circuit

Now that we have the retractors ready, it's time to build the circuit and test the stepper motors (both the X and Y axis).

See the picture above with the breadboard circuit schematic.

Wiring stepper motors is a game of patience. In the next step you will find a "test" code for the x and y axis. If your steppers do not work properly you will have to find the correct working combination by changing the cables between them and the L293DIC.

On my cnc the X axis motor connections are: L293 A: Pins 1 and 3 & B: 2 and 4 but on the Y axis motor connections are A: 1 and 2 & B: 3 and 4.

Step 7: Testing X and Y Axis Movement

Here is the X and Y axis test code embedded using codebender!

For the X axis:

For the Y axis:

If you see any movement here, then the stepper motor is wired correctly!

If not, try changing the cable

Step 8: Upload the CNC Code

Here is the main CNC code embedded using codebender!

In this part you will see your pen rise. If not, change the penUp and penDown variables that control the servo motors.

Press the 'Run on Arduino' button and program your board from your browser!

Step 9: GCTRL Program

Now we are ready to print our first image! To do this we will use the gctrl.pde handler. This program sends the "gcode" image to the cnc plotter.

What is GCODE?

Gcode is a file with X, Y and Z coordinates. The title of this file is set as:

M300S30.00 (servo down) G1X10.00Y10.00F2500.00

G1X20.00Y10.00F2500.00

M300S50.00 (servo upward)

Click the Play icon/button to start the program.

Update! You can use gctrl.exe, look for the file in the "gctrlexeforwindows.zip" file.

~See the picture above~

Now press 'p' and select your Arduino's serial port.

Press "g" and select the "drawing.gcode" file

(If problems occur, press "x" to stop the plotter)

Step 10: Make Your Own Gcode File!

Show all items

To make gcode files compatible with this cnc machine you have to use Inkscape.

Inkscape is professional-quality vector graphics software that runs on Windows, MacOSX, and Linux. Design professionals and enthusiasts around the world use it to create a wide variety of graphics, such as illustrations, icons, logos, charts, maps, and web graphics. Inkscape uses the W3C open standard SVG (Scalable Vector Graphics) as its native format and is free and open source software.

Setting up Inkscape for first use

Open Inkscape, go to the File menu, and click "Document Properties". Refer to the first picture above and make your changes, making sure to change to "cm" first. Now close this window.

We will be using an area between 4 and 8 cm. See the second picture above.

How to print text

Place the text, change the font to Times New Roman and the size to 22. Now click on the cursor icon and center the text as shown in the 3rd image above. Select Path and Object to Path from the menu.

How to print an image

This is harder than the text. The image must have a transparent background. Drag and drop the arduino logo image (downloaded from File) into Inkscape. Click OK to go to the next window. Now you have to resize the image to fit our print area, see the 4th image above. Click on Paths and "Trace Bitmap" in the menu.

Make the changes as shown in the 5th image above. Click OK and close the window. Now, move the grayscale image and delete the color behind it. Move the gray image to the correct position again and click "Object to Path" from the Path menu. The 6th image above shows how to delete the image outline.

Export to gcode

Finally, go to the File menu, click Save As and select .gcode. Click OK on the next window. That's it! You're ready to go! Use the gctrl.pde application to print your gcode file on your new ArduinoCNC plotter!

I will be making a video about this procedure in the next few days as it is a bit complicated. It took me a lot of time to understand how it works. . . . . .

Step 11: Well Done!

You have successfully completed this design and now have your very own CNC plotter on your desk!

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号