Home Sign Up!
Browse Community Submit
All Art Craft Food Games Green Home Kids Life Music Offbeat Outdoors Pets Photo Ride Science Tech
CNC G-Code Interpreter using Processing
by otaviousp on September 16, 2009
Table of Contents
CNC G-Code Interpreter using Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Intro: CNC G-Code Interpreter using Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Step 1: The Processing code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Step 2: Generating the G file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Step 3: Lets check the results. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
http://www.instructables.com/id/CNC-G-Code-Interpreter-using-Processing/
Intro: CNC G-Code Interpreter using Processing
Hi guys, for years I'm trying to make my own CNC router so I can make PCB easier.
What I'm trying to make is a G code interpreter who can sends signals to an arduino board. So the arduino board can control a simple CNC router to draw a circuit over a
PCB.
I hope this project inspirer some peoples to support, improve, and make this things gonna real.
Any suggestions, comments, bug, improvement, please send to me.
Image Notes
1. Eagle routing
2. My route, very similar, don't you think, xD
Step 1: The Processing code.
The code is real simple. I generate an G file in Eagle Layout editor. Read this file in processing. And I move, or Draw, the lines.
On the next step I will shoe how to generate the G file, and use my code to draw the PCB on screen.
The file named as 12.txt is a G file to use as example.
The file named as "motor shield" is a example already routed on the eagle. You just need to generate the G-file.
The file named as "teste" is simple example already routed on the eagle. You just need to generate the G-file too.
File Downloads
motor shield.brd (25 KB)
[NOTE: When saving, if you see .tmp as the file ext, rename it to 'motor shield.brd']
12.txt (3 KB)
[NOTE: When saving, if you see .tmp as the file ext, rename it to '12.txt']
motor shield.sch (135 KB)
[NOTE: When saving, if you see .tmp as the file ext, rename it to 'motor shield.sch']
teste.sch (3 KB)
[NOTE: When saving, if you see .tmp as the file ext, rename it to 'teste.sch']
teste.brd (4 KB)
[NOTE: When saving, if you see .tmp as the file ext, rename it to 'teste.brd']
cnc.pde (1 KB)
[NOTE: When saving, if you see .tmp as the file ext, rename it to 'cnc.pde']
http://www.instructables.com/id/CNC-G-Code-Interpreter-using-Processing/
Step 2: Generating the G file.
Open any project that you already made, or just download the example above.
Open the *.brd file.
Click on the CAM Processor icon, the one that looks like a movie film.
On the layer windows deselected all, and select only the Top OR Bottom layer. Make sure you deselected all other layer or my program will won't recognize the code.
Make sure that on the Style tab this check-box are checked. Mirror, Upside Down, pos. Coord.
Click on file button and save the file inside of your sketch folder. Something like this: C:/Users/Otavio /Documents/Processing/cnc/data/12.txt
Change my name for yours.
Then click on the "process job " button.
A warning message will appear, ignore it. Just click on OK.
Nice, if you do everything right. the file will be create, and locate inside the data folder of your sketch.
If you open the file you will see some codes like this one:
G01*
X000000Y000000D02*
D10*
X005919Y003615D02*
X005842Y003802D01*
X003086Y006558D01*
Ok, now on Run your sketch and see the results. It looks amazing, don't?
Image Notes
1. Scroll down to deselected everthing.
2. Change this line with you own.
3. Select GERBERAUTO here.
4. Check like this one.
5. Click here to generate the G-file.
Step 3: Lets check the results.
On the images below you can see and compare both circuits.
I know that the pads aren't draw, but I intend to leave this part to the arduino board handle.
The part that send messages to arduino is not done yet.
Any suggestions are welcome.
Please guys, if you like it, rate it.
http://www.instructables.com/id/CNC-G-Code-Interpreter-using-Processing/
Image Notes Image Notes
1. Another simple demonstration. 1. Eagle routing
2. The result. 2. My route, very similar, don't you think, xD
Related Instructables
Use an Arduino Controlling an
CNC Stomp Pad How to Make a with an N64 RGB Led with
Project | CNC Three Axis CNC Arduino and
Programming | Machine controller by How to use a Nexus One
quasse CNC Mill with Processing by
G-Code (Cheaply and Dock by kittka
Programming | Easily) by Google smitec08
CNC Plasma oomlout SketchUp by
Cutting by BovineDiozzi
ivanirons
Comments
12 comments Add Comment
oshondrom says: Nov 17, 2010. 8:34 AM REPLY
can you send me those files at
[email protected] i love your project!
ivansg says: Oct 29, 2010. 7:12 PM REPLY
Cool project!
Bom ver que é do brasil!
Quando terminar minha CNC, irei testar...
Abraço
Grumpy Mike says: Jul 14, 2010. 3:45 AM REPLY
The CNC.pde code is no such thing it is just the standard Arduino example of follow a pot with a stepping motor code.
otaviousp says: Jul 14, 2010. 7:40 AM REPLY
Actually my code is based on the Arduino example but with a graphic interface.
marcos1971 says: Mar 28, 2010. 8:33 PM REPLY
Ola parabéns pelo teu trabalho, mas download dos arquivos não funciona, se puderes por favor enviar para meu email.
[email protected] abraço e obrigado
lordzeppo says: Nov 29, 2009. 8:46 AM REPLY
file download ain't working
can you send me those files at
[email protected] please
thanks
http://www.instructables.com/id/CNC-G-Code-Interpreter-using-Processing/
otaviousp says: Nov 29, 2009. 9:20 AM REPLY
just try to rename the file you download.
anyway, I will send it t tou,
cya
jeff-o says: Sep 17, 2009. 1:17 PM REPLY
So, is the goal to draw the circuit using an etch-resist pen on the board, or to run a mill that carves out everything BUT the traces? Just wondering. Someday
I'll have a CNC machine of my own, too...
otaviousp says: Sep 17, 2009. 1:35 PM REPLY
Im think using a PEN the same pen you use to draw the circuit on hand. The milling process is a little different, we have to drill on the edge of the trace.
But, it can possible to do with a code modification.
jeff-o says: Sep 17, 2009. 2:12 PM REPLY
Ah, ok. I'd definitely push for the cnc mill solution in that case...
sammyBoy says: Sep 17, 2009. 10:54 AM REPLY
I've also been toying with CNC for a while and I was thinking of using my *duino as a control board. I'm going to have a play with your code over the week-
end. Looks good, nice instructable.
otaviousp says: Sep 17, 2009. 11:28 AM REPLY
nice, please let me know what you think about the code, and if it is possible to use it.
http://www.instructables.com/id/CNC-G-Code-Interpreter-using-Processing/