Introduction: How to Make Mini CNC 2D Plotter Using Scrap DVD Drive, L293d Motor Shield & Arduino

this a mini CNC 2D plotter made from old DVD drive and L293D motor shield very cheap but intresting

let see how to make in

Step 1: Video

Step 2: Material Need for This Project

1) 2 X SCRAP DVD DRIVE

2) 1 X ARDUINO

3) 1 X L293D MOTOR SHIELD

4) 1 X SERVO MOTOR (TOWER PRO 9G)

5) JUMPER WIRES

6) SOME HARDWARE NUT BOTS ETC

7) DOUBLE SIDE 3M TAPE

You can buy this material from below links of Amazon

Simple Lab's L293D Motor Shield for Arduino

Arduino Uno R3 ATmega328P ATMEGA16U2 Compatible with USB Cable

REES52 Tower Pro SG90 9g Servo Motor For Arduino ARM Raspberry AND Other MCU

Librairy For Adafruit Shield Driver Motors

extract the file and past them to

arduino/libraries

Step 3: Assembling the Machine

Open the scrap DVD Drive and rremove internal moving tray..

This tray having stepper mechanism on it this will act as our X-axis & Y-axis.

Go through the attached pictures for understanding how to assemble your machine.

make hole on empty DVD drive case mount our X-axis and Y-axis on respective DVD case with the help of

nut bolts.

Now place them perpendicular

Step 4: Wiring Details

watch the picture carefully and wire components accordingly

Step 5: CNC Code for Arduino

upload the code to arduino using arduino IDE

Step 6: G Code

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

please follow the video on you tube how to create G-code file

some ready made G-code files

Step 7: Processing IDE Program (GCTRL)

Upload the gctrl file to processing IDE

and click on PLAY button in processing window.

first press 'p' to select you com port

if you want you can set jog speed by pressing 1,2, or 3 button from keyboard

press 'g' to load G-code file

your machine is ready to plot as soon as you hit enter by selecting g code file

now you have done your plotter is ready

thanks for your attention

Step 8: How to Connect Stepper Motor With L293D Shield

Comments

author
m.mohanlalJ (author)2017-03-15

mr.innovative,pls ans my comments posted 2days before,.Again my project of mini is stuck .no further going.pls let me know how to align pen in centre and rectify error message M18 (drives off)

At first it plott on may be 2or3 line correctly then printing every thing in one corner.and at last when it stopped and give message M 18 (drives off)pls give solution.l am tottaly newbie in software

author
m.mohanlalJ (author)2017-03-14

sir,when I run g code in processing p 3 at the end of run the plotting is all jumble up,and message shows : M18 ( drives off )

Command not recognise : M18

Pls give the solution to correct the error.

author
Wisem3 (author)2017-03-13

Hello, sir i am getting m18 drives off error in processing ide. Then it all stops and the drawing so formed its any good,

author
AnkitS226 (author)2017-03-05

i have downloaded the af library but still there is error in <afmotor.h>

please help me out in removing this

author
8_bitGuy (author)2017-01-31

I am using 2 DVD stepper motors, but still, the output is not what I expected it to be.. but the motors which I am using have different pin-out for wires..? does that means they do have different steps/rev..?

The output for STAR is in the picture.

The Gcode for star and elliptical are

config i am using in the code are-

steps/rev = 20; steps/mm(x&y)=360; x=(0:40) y=(0:40)

Help me out !!

Heliptical Path Output.jpgMotor1.jpgMotor2.jpgStar Output.jpghelip.gcodestar.gcode
author
cdubs61 (author)2016-12-18

Hi! So I have successfully uploaded the CNC Code and have processed the GTRL interface using Processor; however, when I attempt the jog the axes using the arrows keys of my PC, nothing moves. I hear a high-pitched hum (hums when I move up and right keys, but stops when I press the down and left keys) and I can feel the stepper motors trying to work, but the leadscrews won't budge! Also, when I try to move the x and y sleds by hand while this is happening, the leadscrews resist my hand. It's like the motors are preventing movement rather than creating it.... What do I do??? (stepper motors did work when I tested them)

author
NnaemekaN2 (author)cdubs612017-01-13

yea i have exactly same problem with mine. and when i test with the one revolution code it works perfectly but when i tried streaming a g code nothing moves, and i made my own motor shield on a bread board using l293d and am not sure whereto connect the input pins on the ardiuno board please i need help on this.

author
MiguelM214 (author)2016-12-27

thanks for your proyect

i do the machine. prove the axis with your programs and the axis are good

i donwload the file "gctrl.pde" but download a file "FLTW2G9IRXTABCW.pde"

i open arduino program and transfer this file. i dont have error.

now.... where i select the file to print?

i dont understan the step 7 of your proyect. thanks

author
HưngĐ8 (author)2016-12-02

i got this error: ;(

the method showinputdialog(object) in the type joptionpane is not applicable for the arguments ()

author
WannaDuino (author)HưngĐ82016-12-25

i think you did not set your PORT right. 1 choose your arduino board

2 choose your PORT

then test run the code before uploading it. or you mis the ADMotor shield library

WannaDuino!!!

author
HưngĐ8 made it! (author)HưngĐ82016-12-03

i got this error: ;(

the method showinputdialog(object) in the type joptionpane is not applicable for the arguments ()

s.PNG
author
Mr innovative (author)HưngĐ82016-12-04

what is your operation system is it other than windows ?

author
mwee (author)Mr innovative2016-12-22

I'm getting the same error .. Running Windows 10 with Processing 3.2.3

author
HưngĐ8 (author)mwee2016-12-22

That is not OS problem. I solved the problem. That problem's in Code line 31:

String result = (String) JOptionPane.showInputDialog(this,

-> change "this" to "frame", then the code will be ok

author
Siliffe (author)2016-12-19

Hi there,

I have tried to upload the arduino code but i got this error message when verifying the code:

Screen Shot 2016-12-19 at 21.11.22.png
author
cdubs61 (author)Siliffe2016-12-20

In his code it includes the library for the L293D Motor Shield, but you have not downloaded that library onto your own computer. That's why it says "AFMotor.h: No such file or directory #include <AFMotor.h>". If you go to step 2, he has the file for the motor shield library that you download. Once you download it, it should be able to compile. :)

author
ParaschivL made it! (author)2016-12-20

And I have the same problem.

drawings do not come out right.

how to define the origin?

Pressing keys 1, 2, 3 or pg up, pg down, nothing happens, although the board Arduino LED indicates that receives data.

Here are you Hisoka files.

Hisoka.jpg
author
fredo55 (author)2016-12-19

Hi, trying to find what is wrong with my setup, a simple horizontal line of 40 mm is printed as only 4 mm (same thing with a vertical line). Also, checking at the gcode there are M01, M17, and M18 command not recognized and marked as errors. Using CAMbotics everything is fine.

Any suggestion, please?

author
alaah5 (author)2016-09-16

HI I need wiring diagrams of motors . its amazing instructables

author
Mr innovative made it! (author)alaah52016-09-16

please seen the pic for wiring details

schem.png
author
pagaldunia (author)Mr innovative2016-12-16

please tell Mr that, doesn't it needs to be calibrated ??

author
ParaschivL (author)2016-11-30

Hello

when I want to upload gctrl.pde, I receive this error:

********************

Arduino: 1.6.11 (Windows 10), Board: "Arduino/Genuino Uno"

C:\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Arduino\hardware -hardware C:\Users\cparaschiv\AppData\Local\Arduino15\packages -tools C:\Arduino\tools-builder -tools C:\Arduino\hardware\tools\avr -tools C:\Users\cparaschiv\AppData\Local\Arduino15\packages -built-in-libraries C:\Arduino\libraries -libraries C:\Users\cparaschiv\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10611 -build-path C:\Users\CPARAS~1\AppData\Local\Temp\build3a8a9971c0e1ebf5b423349760755e06.tmp -warnings=default -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino6 -prefs=runtime.tools.avr-gcc.path=C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2 -verbose C:\Arduino\gctrl\gctrl.ino

C:\Arduino\arduino-builder -compile -logger=machine -hardware C:\Arduino\hardware -hardware C:\Users\cparaschiv\AppData\Local\Arduino15\packages -tools C:\Arduino\tools-builder -tools C:\Arduino\hardware\tools\avr -tools C:\Users\cparaschiv\AppData\Local\Arduino15\packages -built-in-libraries C:\Arduino\libraries -libraries C:\Users\cparaschiv\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10611 -build-path C:\Users\CPARAS~1\AppData\Local\Temp\build3a8a9971c0e1ebf5b423349760755e06.tmp -warnings=default -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino6 -prefs=runtime.tools.avr-gcc.path=C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2 -verbose C:\Arduino\gctrl\gctrl.ino

Using board 'uno' from platform in folder: C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14

Using core 'arduino' from platform in folder: C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14

Detecting libraries used...

"C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\cores\arduino" "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\variants\standard" "C:\Users\CPARAS~1\AppData\Local\Temp\build3a8a9971c0e1ebf5b423349760755e06.tmp\sketch\gctrl.ino.cpp" -o "nul"

"C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\cores\arduino" "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\variants\standard" "-IC:\Arduino\libraries\Servo\src" "C:\Users\CPARAS~1\AppData\Local\Temp\build3a8a9971c0e1ebf5b423349760755e06.tmp\sketch\gctrl.ino.cpp" -o "nul"

"C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\cores\arduino" "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\variants\standard" "-IC:\Arduino\libraries\Servo\src" "-IC:\Arduino\libraries\Adafruit-Motor-Shield-library-master" "C:\Users\CPARAS~1\AppData\Local\Temp\build3a8a9971c0e1ebf5b423349760755e06.tmp\sketch\gctrl.ino.cpp" -o "nul"

"C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\cores\arduino" "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\variants\standard" "-IC:\Arduino\libraries\Servo\src" "-IC:\Arduino\libraries\Adafruit-Motor-Shield-library-master" "C:\Arduino\libraries\Servo\src\avr\Servo.cpp" -o "nul"

"C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\cores\arduino" "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\variants\standard" "-IC:\Arduino\libraries\Servo\src" "-IC:\Arduino\libraries\Adafruit-Motor-Shield-library-master" "C:\Arduino\libraries\Servo\src\sam\Servo.cpp" -o "nul"

"C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\cores\arduino" "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\variants\standard" "-IC:\Arduino\libraries\Servo\src" "-IC:\Arduino\libraries\Adafruit-Motor-Shield-library-master" "C:\Arduino\libraries\Servo\src\samd\Servo.cpp" -o "nul"

"C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\cores\arduino" "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\variants\standard" "-IC:\Arduino\libraries\Servo\src" "-IC:\Arduino\libraries\Adafruit-Motor-Shield-library-master" "C:\Arduino\libraries\Adafruit-Motor-Shield-library-master\AFMotor.cpp" -o "nul"

"C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\cores\arduino" "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\variants\standard" "-IC:\Arduino\libraries\Servo\src" "-IC:\Arduino\libraries\Adafruit-Motor-Shield-library-master" "C:\Users\CPARAS~1\AppData\Local\Temp\build3a8a9971c0e1ebf5b423349760755e06.tmp\sketch\gctrl.ino.cpp" -o "nul"

Generating function prototypes...

"C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\cores\arduino" "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\variants\standard" "-IC:\Arduino\libraries\Adafruit-Motor-Shield-library-master" "-IC:\Arduino\libraries\Servo\src" "C:\Users\CPARAS~1\AppData\Local\Temp\build3a8a9971c0e1ebf5b423349760755e06.tmp\sketch\gctrl.ino.cpp" -o "C:\Users\CPARAS~1\AppData\Local\Temp\build3a8a9971c0e1ebf5b423349760755e06.tmp\preproc\ctags_target_for_gcc_minus_e.cpp"

"C:\Arduino\tools-builder\ctags\5.8-arduino10/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\CPARAS~1\AppData\Local\Temp\build3a8a9971c0e1ebf5b423349760755e06.tmp\preproc\ctags_target_for_gcc_minus_e.cpp"

Compiling sketch...

"C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\cores\arduino" "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\variants\standard" "-IC:\Arduino\libraries\Adafruit-Motor-Shield-library-master" "-IC:\Arduino\libraries\Servo\src" "C:\Users\CPARAS~1\AppData\Local\Temp\build3a8a9971c0e1ebf5b423349760755e06.tmp\sketch\gctrl.ino.cpp" -o "C:\Users\CPARAS~1\AppData\Local\Temp\build3a8a9971c0e1ebf5b423349760755e06.tmp\sketch\gctrl.ino.cpp.o"

gctrl:107: error: variable or field 'fileSelected' declared void

void fileSelected(File selection) {

^

gctrl:107: error: 'File' was not declared in this scope

gctrl:138: error: variable or field 'serialEvent' declared void

void serialEvent(Serial p)

^

gctrl:138: error: expected ')' before 'p'

void serialEvent(Serial p)

^

gctrl:1: error: 'import' does not name a type

import java.awt.event.KeyEvent;

^

gctrl:2: error: 'import' does not name a type

import javax.swing.JOptionPane;

^

gctrl:3: error: 'import' does not name a type

import processing.serial.*;

^

gctrl:5: error: 'Serial' does not name a type

Serial port = null;

^

gctrl:9: error: 'null' was not declared in this scope

String portname = null;

^

gctrl:16: error: expected unqualified-id before '[' token

String[] gcode;

^

C:\Arduino\gctrl\gctrl.pde: In function 'void openSerialPort()':

gctrl:21: error: 'null' was not declared in this scope

if (portname == null) return;

^

gctrl:22: error: 'port' was not declared in this scope

if (port != null) port.stop();

^

gctrl:22: error: 'null' was not declared in this scope

if (port != null) port.stop();

^

gctrl:24: error: 'port' was not declared in this scope

port = new Serial(this, portname, 9600);

^

gctrl:24: error: expected type-specifier before 'Serial'

port = new Serial(this, portname, 9600);

^

C:\Arduino\gctrl\gctrl.pde: In function 'void selectSerialPort()':

gctrl:31: error: 'JOptionPane' was not declared in this scope

String result = (String) JOptionPane.showInputDialog(this,

^

gctrl:31: error: invalid use of 'this' in non-member function

String result = (String) JOptionPane.showInputDialog(this,

^

gctrl:35: error: 'null' was not declared in this scope

null,

^

gctrl:36: error: 'class HardwareSerial' has no member named 'list'

Serial.list(),

^

C:\Arduino\gctrl\gctrl.pde: In function 'void setup()':

gctrl:45: error: redefinition of 'void setup()'

void setup()

^

C:\Arduino\gctrl\gctrl.ino:83:6: note: 'void setup()' previously defined here

void setup() {

^

gctrl:47: error: 'size' was not declared in this scope

size(500, 250);

^

C:\Arduino\gctrl\gctrl.pde: In function 'void draw()':

gctrl:53: error: 'background' was not declared in this scope

background(0);

^

gctrl:54: error: 'fill' was not declared in this scope

fill(255);

^

gctrl:56: error: 'text' was not declared in this scope

text("INSTRUCTIONS", 12, y); y += dy;

^

gctrl:68: error: 'height' was not declared in this scope

y = height - dy;

^

gctrl:69: error: invalid operands of types 'const char [20]' and 'float' to binary 'operator+'

text("current jog speed: " + speed + " inches per step", 12, y); y -= dy;

^

C:\Arduino\gctrl\gctrl.pde: In function 'void keyPressed()':

gctrl:75: error: 'key' was not declared in this scope

if (key == '1') speed = 0.001;

^

gctrl:76: error: 'key' was not declared in this scope

if (key == '2') speed = 0.01;

^

gctrl:77: error: 'key' was not declared in this scope

if (key == '3') speed = 0.1;

^

gctrl:80: error: 'keyCode' was not declared in this scope

if (keyCode == LEFT) port.write("G91\nG20\nG00 X-" + speed + " Y0.000 Z0.000\n");

^

gctrl:80: error: 'LEFT' was not declared in this scope

if (keyCode == LEFT) port.write("G91\nG20\nG00 X-" + speed + " Y0.000 Z0.000\n");

^

gctrl:80: error: 'port' was not declared in this scope

if (keyCode == LEFT) port.write("G91\nG20\nG00 X-" + speed + " Y0.000 Z0.000\n");

^

gctrl:80: error: invalid operands of types 'const char [15]' and 'float' to binary 'operator+'

if (keyCode == LEFT) port.write("G91\nG20\nG00 X-" + speed + " Y0.000 Z0.000\n");

^

gctrl:81: error: 'keyCode' was not declared in this scope

if (keyCode == RIGHT) port.write("G91\nG20\nG00 X" + speed + " Y0.000 Z0.000\n");

^

gctrl:81: error: 'RIGHT' was not declared in this scope

if (keyCode == RIGHT) port.write("G91\nG20\nG00 X" + speed + " Y0.000 Z0.000\n");

^

gctrl:81: error: 'port' was not declared in this scope

if (keyCode == RIGHT) port.write("G91\nG20\nG00 X" + speed + " Y0.000 Z0.000\n");

^

gctrl:81: error: invalid operands of types 'const char [14]' and 'float' to binary 'operator+'

if (keyCode == RIGHT) port.write("G91\nG20\nG00 X" + speed + " Y0.000 Z0.000\n");

^

gctrl:82: error: 'keyCode' was not declared in this scope

if (keyCode == UP) port.write("G91\nG20\nG00 X0.000 Y" + speed + " Z0.000\n");

^

gctrl:82: error: 'UP' was not declared in this scope

if (keyCode == UP) port.write("G91\nG20\nG00 X0.000 Y" + speed + " Z0.000\n");

^

gctrl:82: error: 'port' was not declared in this scope

if (keyCode == UP) port.write("G91\nG20\nG00 X0.000 Y" + speed + " Z0.000\n");

^

gctrl:82: error: invalid operands of types 'const char [21]' and 'float' to binary 'operator+'

if (keyCode == UP) port.write("G91\nG20\nG00 X0.000 Y" + speed + " Z0.000\n");

^

gctrl:83: error: 'keyCode' was not declared in this scope

if (keyCode == DOWN) port.write("G91\nG20\nG00 X0.000 Y-" + speed + " Z0.000\n");

^

gctrl:83: error: 'DOWN' was not declared in this scope

if (keyCode == DOWN) port.write("G91\nG20\nG00 X0.000 Y-" + speed + " Z0.000\n");

^

gctrl:83: error: 'port' was not declared in this scope

if (keyCode == DOWN) port.write("G91\nG20\nG00 X0.000 Y-" + speed + " Z0.000\n");

^

gctrl:83: error: invalid operands of types 'const char [22]' and 'float' to binary 'operator+'

if (keyCode == DOWN) port.write("G91\nG20\nG00 X0.000 Y-" + speed + " Z0.000\n");

^

gctrl:84: error: 'keyCode' was not declared in this scope

if (keyCode == KeyEvent.VK_PAGE_UP) port.write("G91\nG20\nG00 X0.000 Y0.000 Z" + speed + "\n");

^

gctrl:84: error: 'KeyEvent' was not declared in this scope

if (keyCode == KeyEvent.VK_PAGE_UP) port.write("G91\nG20\nG00 X0.000 Y0.000 Z" + speed + "\n");

^

gctrl:84: error: 'port' was not declared in this scope

if (keyCode == KeyEvent.VK_PAGE_UP) port.write("G91\nG20\nG00 X0.000 Y0.000 Z" + speed + "\n");

^

gctrl:84: error: invalid operands of types 'const char [28]' and 'float' to binary 'operator+'

if (keyCode == KeyEvent.VK_PAGE_UP) port.write("G91\nG20\nG00 X0.000 Y0.000 Z" + speed + "\n");

^

gctrl:85: error: 'keyCode' was not declared in this scope

if (keyCode == KeyEvent.VK_PAGE_DOWN) port.write("G91\nG20\nG00 X0.000 Y0.000 Z-" + speed + "\n");

^

gctrl:85: error: 'KeyEvent' was not declared in this scope

if (keyCode == KeyEvent.VK_PAGE_DOWN) port.write("G91\nG20\nG00 X0.000 Y0.000 Z-" + speed + "\n");

^

gctrl:85: error: 'port' was not declared in this scope

if (keyCode == KeyEvent.VK_PAGE_DOWN) port.write("G91\nG20\nG00 X0.000 Y0.000 Z-" + speed + "\n");

^

gctrl:85: error: invalid operands of types 'const char [29]' and 'float' to binary 'operator+'

if (keyCode == KeyEvent.VK_PAGE_DOWN) port.write("G91\nG20\nG00 X0.000 Y0.000 Z-" + speed + "\n");

^

gctrl:86: error: 'key' was not declared in this scope

if (key == 'h') port.write("G90\nG20\nG00 X0.000 Y0.000 Z0.000\n");

^

gctrl:86: error: 'port' was not declared in this scope

if (key == 'h') port.write("G90\nG20\nG00 X0.000 Y0.000 Z0.000\n");

^

gctrl:87: error: 'key' was not declared in this scope

if (key == 'v') port.write("$0=75\n$1=74\n$2=75\n");

^

gctrl:87: error: 'port' was not declared in this scope

if (key == 'v') port.write("$0=75\n$1=74\n$2=75\n");

^

gctrl:89: error: 'key' was not declared in this scope

if (key == 's') port.write("$3=10\n");

^

gctrl:89: error: 'port' was not declared in this scope

if (key == 's') port.write("$3=10\n");

^

gctrl:90: error: 'key' was not declared in this scope

if (key == 'e') port.write("$16=1\n");

^

gctrl:90: error: 'port' was not declared in this scope

if (key == 'e') port.write("$16=1\n");

^

gctrl:91: error: 'key' was not declared in this scope

if (key == 'd') port.write("$16=0\n");

^

gctrl:91: error: 'port' was not declared in this scope

if (key == 'd') port.write("$16=0\n");

^

gctrl:92: error: 'key' was not declared in this scope

if (key == '0') openSerialPort();

^

gctrl:93: error: 'key' was not declared in this scope

if (key == 'p') selectSerialPort();

^

gctrl:94: error: 'key' was not declared in this scope

if (key == '$') port.write("$$\n");

^

gctrl:94: error: 'port' was not declared in this scope

if (key == '$') port.write("$$\n");

^

gctrl:97: error: 'key' was not declared in this scope

if (!streaming && key == 'g') {

^

gctrl:98: error: 'gcode' was not declared in this scope

gcode = null; i = 0;

^

gctrl:98: error: 'null' was not declared in this scope

gcode = null; i = 0;

^

gctrl:99: error: 'File' was not declared in this scope

File file = null;

^

gctrl:100: error: 'println' was not declared in this scope

println("Loading file...");

^

gctrl:101: error: 'file' was not declared in this scope

selectInput("Select a file to process:", "fileSelected", file);

^

gctrl:101: error: 'selectInput' was not declared in this scope

selectInput("Select a file to process:", "fileSelected", file);

^

gctrl:104: error: 'key' was not declared in this scope

if (key == 'x') streaming = false;

^

C:\Arduino\gctrl\gctrl.pde: At global scope:

gctrl:107: error: variable or field 'fileSelected' declared void

void fileSelected(File selection) {

^

gctrl:107: error: 'File' was not declared in this scope

Multiple libraries were found for "Servo.h"

Used: C:\Arduino\libraries\Servo

Not used: C:\Users\cparaschiv\Documents\Arduino\libraries\Servo2

Using library Servo at version 1.1.2 in folder: C:\Arduino\libraries\Servo

Using library Adafruit-Motor-Shield-library-master at version 1.0.0 in folder: C:\Arduino\libraries\Adafruit-Motor-Shield-library-master

exit status 1

variable or field 'fileSelected' declared void

**********************

Do you know why?

author
Mr innovative (author)ParaschivL2016-11-30

it looks you try to run GCTRL processing code in arduino.

You have to run GCTRL.PDE in processing softwear

author
julioberaldi made it! (author)2016-11-04

Olá amigo, gostaria de Dizer Que o Seu Projeto, apesar de simples, ficou muito bom e Chamou Minha Atenção Entre Tantos Outros postados aqui. Apesar de ter sido feito com produtos simples, a qualidade do desenho apresentado no vídeo, ficou bem legal. Parabéns e muito sucesso em seus projetos e quero dizer que pessoas assim igual a você, fazem a diferença neste mundo de hooje.

Eu também já fiz uma CNC, com características próprias; porém moro em outro país e por questões financeiras não é possível adquirir uma conta premium no momento.

Mas mesmo assim desejo sucesso para você e todos os outros membros do "Instructables" que todos continuem fazendo a vida de todos um pouco melhor...


20161029_190559.jpg20161029_190636.jpg20161102_135216.jpg
author

your CNC is very impressive friend, but i don't understand a single word what you said :)

author

Translated:

Hello friend, I would like to say that your project, although simple, was very good and called my attention among so many others posted here. Although it was made with simple products, the quality of the design presented in the video, was very cool. Congratulations and a lot of success in your projects and I want to say that people like you, make a difference in this world of hooje.

I have also done a CNC, with its own characteristics; But I live in another country and for financial reasons it is not possible to buy a premium account at the moment.

But I still wish success for you and all the other members of the "Instructables" to continue to make everyone's life a little better ...

author

you peoples are so nice, thanks for translate it JetMechanic this type of efforts are highly appreciable.

author
SamyO2 (author)julioberaldi2016-11-30

hi bro can you helpe to make that one or send me document that i could use it

author
uzair makda (author)2016-11-27

does this work on win 10

author

yes

author
ahmedj8 (author)2016-09-19

​i want to write my own code , can you simple with keywords explain ideas of program ?

author
alaah5 (author)2016-09-17

hi gctrl not run with win10

author
Mr innovative (author)alaah52016-09-17

Might be, as i have not tried on win 10 i am working on win 7.

I think some library may missing in your processing, if you share what error message is coming it will help me to help you.....

author
lyh17 (author)2016-09-15

Hi, nice instructables! Is this cnc code designed by you only for this plotter, or is it universal? I am new to all this.

author
Mr innovative (author)lyh172016-09-15

G codes are use in many CNC, main reason of using G codes are its software "InkScape" is open source and easily available to download thats the reason you find G codes in many CNC projects, But in commercial level CNC machine they prefer .NC type files may be they are more accurate and relaible. but at this prototype level Gcodes are best.

author
lyh17 (author)Mr innovative2016-09-16

Thanks! Is it possible to build a plotter with 2 different cd drives (I have two different scrap drives, the motors are probably different)?

author
Mr innovative (author)lyh172016-09-16

Yes you can build a plotter CD Drives are best, motors may different but basically they are Stepper motors with four terminals you can connect them directly to L293D motor shield.

author
RafaelS145 (author)2016-09-14

hello my friend, i have one doubt from L293D motor shield,I put the cables from motor A + A-, B + B- or A + B +, A- B-?

author
Mr innovative (author)RafaelS1452016-09-15

A+ A- , B+ B- is right way to connect stepper with shield

author
andrewty (author)2016-09-12

where are the instructions.

Many pics but no details to manufacture the mechanisms.

Not much about how to control the electronics.

author
Mr innovative (author)andrewty2016-09-12

There is wiring detail in Step 4

There is material details in Step 2,

there is no need to manufacture any of mechanisms, all are ready made available with DVD drives just required some basic skill of understanding how to use parts, just be creative,

very much interested to help you if you stuck in between on any point or step.

author
mbonifax (author)2016-09-12

please tell us wath is

"instructABDO". I did find nothing about

author
Mr innovative (author)mbonifax2016-09-12

"instructABDO" is the person's user name on instructable, from whom i was inspire regarding Gcodes..

author
Wragie (author)2016-09-11

I wonder if this could be adapted to lay down etch resisting ink onto the copper of small pcb's? If it could it would be very handy for laying out boards without using a transfer or other system.

author
GeoR1 (author)Wragie2016-09-11

I used to use an Artline permanent marking pens , many times, to make PCBs, I still have samples made from the 1970s. First clean the PCB with AJAX and a green scouring pad. wipe down the PCB with methylated spirits and let dry. Do not touch the PCB with (oil) fingers.

PCB is now ready for marking with pen. Use a brand new, juicy, pen.

author
Wragie (author)GeoR12016-09-11

I have seen quite a few guys using Sharpy brand or Stadatelar brand black or red felt pens with good results. I haven't tried this myself but for the price of a pair of used drives and a felt pen it would be a cheap experiment to try!

author
Mr innovative (author)Wragie2016-09-11

yes it would be, I would like to bring something like that in future

author
Foxtrot70 (author)Mr innovative2016-09-11

It appears that the micro-tipped marker would be enough for etch resisting, I have used this type pen to touch up a board before etching. If not I think using another pen it can be disassembled, using rubber gloves and some care, remove the absorbent medium wash out the ink and reload it with the etch resisting ink. Replace the cap when not in use to prevent drying thus prolonging its life. Once done it should take right off. This would be excellent for rapid prototyping of PCBs .

author
Mr innovative (author)2016-09-06

here i use 5v dc this is enough, whichever axis's servo is not working test it separatly weather stepper may be faulty this happens to me also,, attache stepper at pin

8, 9, 10, 11 and upload the code '' Stepper_one revolution '' this code is available at.

open arduino IDE--FILE---EXAMPLES---STEPPER--STEPPER_ONEREVOLUTION

upload the code and check if your stepper move its Ok, either you stepper is faulty

author
hgautam1 (author)2016-09-04

Hey could you please tell me how much power, you provided to the motors?? Because I have managed to build up the complete plotter but it's x axis is not working when I used to mount the pen on it... I think it is a power issue.... So would you please tell me?

About This Instructable

61,038views

497favorites

License:

Bio: Electrical engineer by profession
More by Mr innovative:How to Make Color Sorting Machine Arduino BasedHow to Make LDR Darkness Sensor Circuit Simple DIYMicro Servo Based Robotic Arm With Record and Play Function
Add instructable to: