What's new
What's new

curious about cnc

mpryne

Plastic
Joined
Mar 2, 2009
Location
Blanchester, Ohio
First i do no cnc currently. I am merely wanting to maybe get my feet wet and try to understand g-code. I know that is a little vague but i was unable to find g-code for dummies or something similar as a toe teaser. Any suggestions for glutton for punishment?

Thanx in advance!
 
the best way to learn g code, assuming you have not operated before, you need to run a cnc machine to become familiar with the way it functions. then look at the g code and watch what it does, after that, then you are ready to start g code
 
G-code is just like any other program language, you have program commands that are made up of addresses and values and rules (Syntax) by which you use them.
In the command G01 X1.0 Y0.0- The G, X and Y are addresses, the 01, 1.0 and 0.0 are the values.
In the G-code language the following are typically valid addresses:
A = Address of the rotational axis relative to X axis
B = Address of the rotational axis relative to Y axis
C = Address of the rotational axis relative to Z axis
D = Tool compensation address
E = Parameter value for canned cycles
F = Feedrate address
G = Preparatory function address
H = Tool compensation address
I = Circular interpolation center address for the X axis component
J = Circular interpolation center address for the Y axis component
K = Circular interpolation center address for the Z axis component
L = Parameter value for canned cycles
M = Auxiliary function address
N = Block Address
P = Parameter value for canned cycles
Q = Parameter value for canned cycles
R = Radius value address
S = Spindle speed address
T = Tool address
U = Secondary address for the X axis (typically incremental, but not always)
V = Secondary address for the Y axis (typically incremental, but not always)
W = Secondary address for the Z axis (typically incremental, but not always)
X = Axis address
Y = Axis address
Z = Axis address

CNC machine positioning is based upon the cartesian coordinate system.
Consider this as 3 flat planes 90° from each other that intersect at a common point. This common point is called the origin, (datum, zero point. or 0,0,0)
From this common point, consider a line that extends straight in both directions along each plane. Because this line goes in both directions, it goes both positive and negative.
For a handy, simplified reference, hold out your left hand in front of you....
Point your thumb up, your index finger straight out from you and your bird finger to your right. Curl your last two fingers to your palm.This is the left hand rule.
The thumb is representative of the Z+ axis direction
The index finger is representative of the Y+ axis direction
The bird finger is representative of the X+ Axis direction
The curled fingers are representative of the origin.

G-codes are called preparatory functions because they prepare (command) the control to actually do something relative to the coordinate system.
G-codes are divided into groups, more on that later

M-codes are auxiliary functions but they are always related to something external to movement about the coordinate system. (Turn spindle on, turn coolant on.. move about in the programs, changing control modes, etc, but nothing directly causal to machine movement about the coordinate system)
....time for work...
 
You can buy books and learn what Tony just ran thru, get familar with the whole language, that is what I did. Machine manuels work too as can your library, on line stuff is available as well.

then get a machine, see it in action and understand what it all means.

You may try some plotting software, I have seen some free downloads and trial versions that proofs out programs, simulates moves and errors showing what works and what dont' work...but a machine is best.
 
A lot of people recommend Peter Smid's book on CNC, but I think it's too detailed to just dive in and get the big picture. I really like Mike Lynch's "Computer Numerical Control for Machining" book. A little dated, but it gives you the specifics of G-code and also the big picture of why and what you're doing. It explains some different machine tools as well.
 
I'll second Mike Lynch's books. They're the ones I had in tech school, and they do a very good job teaching the basics, and how everything works. You should be able to get them off his website, I think his company is CNC Concepts. I also have Peter Smid's books, and they are very good as well, but I think starting from scratch Lynch's are a better. Good luck!
 
If you want to run it without crashing a machine, this is a pretty good free simulator.
http://www.cncsimulator.com/
Minder.


There's nothing that makes experience stick like having your own cnc to play around with. That is if you want to really learn gcodes and what they do. And most of the time, there has to be something that you really want to make, to give the incentive to learn.

Most of us need the real danger of running real machinery to sharpen us up and keep us sharp because a shoulder shrug or 'Sorry' when things go wrong is woefully inadequate. You need to feel the pain of programmed failure in your heart :D
 








 
Back
Top