Anyway, since I’m a programmer, I was naturally curious about the G-code used on the CNC machines. So, I’m looking for some general tutorials or know-how. Any ideas?
HAAS Has a really good manual on it and a quick reference card. Also, there is CNC Machining magazine which is really cool. If you have any basic questions on CNC operation or programming, let me know and I’ll try to help.
NC Codes
-Block Number (N)
-Preparatory Codes (G)
-Miscellaneous Codes (M)
-Priamary X Motion (X)
-Priamary Y Motion (Y)
-Priamary Z Motion (Z)
-For Circular interpolations— I=X J=Y and K=Z
-Feed rate (F)
-Spindle speed (S)
-Tool Type (T)
Preparatory Codes:
G90 - Absolute Coordinates
G91 - Relative Coordinates
G00 - Rapid Traverse (non-cutting move)
G01 - Straight Line Interpolation (cutting move
G02 - Circle Interpolation (cw)
G03 - Circle Interpolation (ccw)
G04 - Dwell (wait) Pause between motions on all axes.Time in seconds -
example: G04F2 -pause for 2 sec.
G05 - Pause - waits for user intervention
M Codes - Miscellaneous
M00 - Pause
M01 - Optional stop
M02 - End of Program
M03 - Spindle on
M05 - Spindle off
M06 - Tool Change
M08 / M09 - Accessory # 1 on / off
M10 / M11 - Accessory # 2 on / off
I hope that this has helped a little bit…here’s some sample code…
G-Code is one of my favorite programming languages! I learned it from a manual that came with the CNC machine that I used, but I found the following web site which looks like a good overview:
Good luck! By the way, it is rather uncommon to write G-Code by hand. Lots of CAD programs are available with manufacturing packages as well, and these manufacturing packages can generate G-Code for your CAD drawing automatically. You simply have to tell it which surfaces you want to machine with what tools, how your stock is mounted, specify some parameters (such as feedrates, spindle speeds, and tool properties), and it will generate the G-Code automatically for you. In any case, it is still pretty important to know the main G-Code commands if you are going to operate a CNC machine.
Patrick
And here is some of the G-Code used to machine an omni-wheel. This is G-Code that I generated automatically from I-DEAS:
Can you guess which part of the omniwheel this is for??? Interestingly, CNC machines used to read programs off of a roll of tape (holes were punched out in rows and columns to encode the commands). The above program, if I had pasted the whole thing, would require a roll of tape over one mile long in distance!!