Introduction: Mini CNC Machine Arduino Based & Adafruit Driver Motor L293D V1 & 2*Mini Stepper CD/DVD Player #1
In this project I will show you how to easily build your own low-cost Arduino Mini CNC Plotter!
For X and Y axis we will use stepper motors and rails from two dvd/cd roms! Printing area will be max 4x4cm.
Step 1: The Video in Youtube :
Step 2: Parts
For this project you will need:
- Part list for beginners:
- Arduino uno ( or Mega ) Breadboard
- Shield driver motor L293D adafruit v1
- Mini Servo motor 9g
- 2x DVD/CD Drives
Librairy For Adafruit Shield Driver Motors v1 :
Step 3: X Y Axe
In first image above you will see the Y axis of our CNC machine. Attach it on your surface, in this part you will need some screws and nuts.
In second image you will see the X and Y axis. The X axis is attached to two plastic parts that I took from remaining 'garbage' stuff. I cut it to fit the construction. This is an easy procedure. Just make sure to put the Y axis straight to CNC base and the X axis vertically in this (90 degrees)
Step 4: The Z Axis
That's the most difficult part of our construction.
You will need something to attach it on X axis, a flat surface. On that surface you will attach the servo motor (Z axis) and the pen base. Pen (or pencil) must be able to move up and down with the help of servo motor. Watch the above image to understand what you need to do to duild Z axis. Tip! Use your imagination ;)
Step 5: the Circuit
Step 6: Uploading the CNC Code
Here is the main CNC code embedded using codebender!
In this part you will see your pen goes up. If don't, change penUp and penDown variables that controlling the servo motor. Press the "Run on Arduino" button and program your board from your browser!
Attachments
Step 7: Make Your Own Gcode Files
To make gcode files that are compatible with this cnc machine you have to use the Inkscape.
Inkscape is professional quality vector graphics software which runs on Windows, Mac OS X and Linux. It is used by design professionals and hobbyists worldwide, for creating a wide variety of graphics such as illustrations, icons, logos, diagrams, 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. Download and install Inkscape from : https://inkscape.org/en/download/windows/
(Important: download 0.48.5 version)
Now you need to install an Add-on that enables the export images to gcode files. This add on can be found here with installation notes.
https://github.com/martymcguire/inkscape-unicorn
Setup Inkscape for first use
Open the Inkscape, go to File menu and click "Document Properties". See the 1st image above and make the changes, make sure to change first to "cm". Now close this window. We will use the area within 4 to 8 cm. See the 2nd image above. How to print texts Put text, change font to Times New Roman and size to 22. Now click on cursor icon and center the text like the 3rd image above. Select Path from menu and "Object to Path". How to print images This is more difficult than texts. Images must have a transparent background. Drag and drop the arduino logo image (download it from files) in Inkscape. Click ok to the next window. Now you have to re-size the image to fit our printing area, see the 4th image above. Click Path from menu and "Trace Bitmap". Make changes as the 5th image above. Click ok and close the window. Now, move the gray scale image, and delete the color one behind it. Move the grey image to the correct place again and click from Path menu "Object to path". The 6th image above show how to delete image outline. Export as gcode Final, go to file menu, click save as and select .gcode. Click ok on next window. That's it! Ready to go! Use the gctrl.pde app to print the gcode file on your new Arduino CNC Plotter! I will make a video on next days about this procedure because it's little complicated. It took me a lot of time to understand how it's working...
Step 8: The GCTRL Program
Now we are ready to print our first image! To do this we will use the gctrl . This program sends 'gcode' images to the cnc plotter.
What is gcode? Gcode is a file with X,Y and Z coordinates. Header of this file is set to: M300 S30.00 (Servo down) G1 X10.00 Y10.00 F2500.00 G1 X20.00 Y10.00 F2500.00 M300 S50.00 (Servo up)
Click the "play" icon/button to start the program.
Download gctrl for Windows :
https://www.instructables.com/files/orig/F69/K945/I...
Click First time to " p " to select Port number for Arduino
and click to " g " to select Gcode file ...
64 Comments
Question 5 years ago on Step 8
Servo not responding.....Servo pin setting is rechecked......individual servo test is ok....
Answer 10 months ago
It hapenned with me too. Servo terminals in adafruit driver board where not enabled. I just connected Ground and 5v in hole points near the jumper(they have 5v and gnd writen on it) and data (PWM) to pin 10. It worked|
Question 3 years ago
I get a red line for the Servo.h lib in the file, and also, GCRTL for Windows doesn't work on windows 10 apparently. It launches, but doesn't take any input from my keyboard. Has anyone else seen this? Can anyone help solve it?
Question 3 years ago on Introduction
I have some problem the motors of DVD writer should not working
4 years ago on Step 5
The wire connection diagram is very confusing. You are showing the orange color wire connected to the negative terminal on the motor shield. Also you are showing the stepper motor connections in cross manner. This is creating confusion. Please prepare a clear drawing.
4 years ago
As I have read 95% of the comments are negative. It means, the programe needs to be looked in to. Mine is also not working.
4 years ago on Step 7
ASDFAD
Question 4 years ago
Hi everyone !
I made a cnc plotter machine but the servo motor does not work.
Also i can not to draw a circle with high resulation.
Please help me.
4 years ago
Salve ho creato il suo progetto e funziona perfettamente. Ma ora ne ho creato uno più grande ma stampa sempre 4x4 come faccio ad aumentare? Grazie
Question 5 years ago
at which value of voltage and external supply current for a shield motor l293
Question 5 years ago
This did not work for me, tried to test x and y axis from gctrl, wont budge, nothing moves. all libraries were installed and code uploaded to the Uno. Thought it might be the motor shield, went and wrote a test stepper motor sketch,shield and the Uno work fine... Pity, looks like a nice little project...
Question 5 years ago on Introduction
Hi, i made CNC as you wrote, but I'm not able to find the right configuration of stepper motor. With two motors, and 8 wire, there wre a lot of wiring possibilities!!! how can i found the right configuration ??
many many thanks, and very good job!! bye, Simone (italy)
5 years ago
I have a problem .... i made the whole setup . But when i upload the gcode .. the neitherX.Y.norZ .... axes...... it just doesn't move... yhere is no movement in the motors.
..
Plzzz solve my problrm..
5 years ago
Hi, my cnc only draw a line, the Y motor go to the limit and cant draw, all is in the same Y line. And i cant set a correct my work area all time only print another line and another..etc Tnx for Help i like this proyect but not is my day :(
6 years ago
Hello guys, now i'm making cnc, i've followed all the steps that already exist, but the output of the resulting image is very messy and i am confused the fact is where is the error?
Please help
6 years ago
Hi, very, very good project, I see that many people have been successful.
I have uploaded Test_X_Axis_CNC_Plotter and Y, and my engines have good movement.
I have a problem with gctrl.pde and gctrl.exe, but I do not know why. My engines have no movement with gctrl. Select the serial port (OK), use the arrows and no movement, load a gcode image with (G) and no movement. I do not know where the problem is.
You help me? Thank you
My beta-CNC without Arduino, only router with OpenWRT and L293 driver. Does not interpret GCODE yet:
https://www.youtube.com/watch?v=16uzCy-xsO0
6 years ago
How do I fill out the drawing? I can only make outlines.
6 years ago
hello, my problem i:
Arduino:1.6.11 (Windows 10), Tarjeta:"Arduino/Genuino Uno"
C:\Users\Kriivo\AppData\Local\Temp\ccdbL8gd.ltrans0.ltrans.o: In function `loop':
ccdbL8gd.ltrans0.o:(.text+0xcb4): undefined reference to `AF_Stepper::onestep(unsigned char, unsigned char)'
ccdbL8gd.ltrans0.o:(.text+0xce2): undefined reference to `AF_Stepper::onestep(unsigned char, unsigned char)'
ccdbL8gd.ltrans0.o:(.text+0xd28): undefined reference to `AF_Stepper::onestep(unsigned char, unsigned char)'
ccdbL8gd.ltrans0.o:(.text+0xd56): undefined reference to `AF_Stepper::onestep(unsigned char, unsigned char)'
C:\Users\Kriivo\AppData\Local\Temp\ccdbL8gd.ltrans0.ltrans.o: In function `global constructors keyed to 65535_0_FKZY7W9IN4TTHPJ.ino.cpp.o.1877':
ccdbL8gd.ltrans0.o:(.text.startup+0xc4): undefined reference to `AF_Stepper::AF_Stepper(unsigned int, unsigned char)'
ccdbL8gd.ltrans0.o:(.text.startup+0xd2): undefined reference to `AF_Stepper::AF_Stepper(unsigned int, unsigned char)'
C:\Users\Kriivo\AppData\Local\Temp\ccdbL8gd.ltrans0.ltrans.o: In function `main':
ccdbL8gd.ltrans0.o:(.text.startup+0x2f6): undefined reference to `AF_Stepper::setSpeed(unsigned int)'
ccdbL8gd.ltrans0.o:(.text.startup+0x302): undefined reference to `AF_Stepper::setSpeed(unsigned int)'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compilación en tarjeta Arduino/Genuino Uno.
Este reporte podría tener más información con
"Mostrar salida detallada durante la compilación"
opción habilitada en Archivo -> Preferencias.
6 years ago
hello sir my cnc not drow properly it can drow only a square it's urjent plz sir
6 years ago
my cnc not drow properly it can drow only square