G Code.
An example of G code!
G code is mainly the code used in numerical computing control, used by the machine to interpret the instructions and coordinates it must follow to machine a certain piece. It entails both milling and turning code depending on the type of machine it's intended for.
In the first part you got to see some basic examples of this code. Now I'm gonna show you some more basic concepts before we get hands on on milling.
CONCEPTS.
Block.-Represents a series of ordered commands. This enables you to perform several actions in a single line of code. It has some restrictions though:
Most modern CNC applications will display a warning when you perform an illegal operation, there are 3 types:
In the first part you got to see some basic examples of this code. Now I'm gonna show you some more basic concepts before we get hands on on milling.
CONCEPTS.
Block.-Represents a series of ordered commands. This enables you to perform several actions in a single line of code. It has some restrictions though:
- They must contain one type of tool movement (circular or linear, not both).
- Can only perform a single cutting speed.
- Must use a single tool and leadscrew speed.
- Block numbering must be sequential.
Most modern CNC applications will display a warning when you perform an illegal operation, there are 3 types:
- Notifications. Appear when you perform a given action that could result in an error such as stablishing two movements in a line.
- Warnings. Appear when you code an action that could potentially damage the tool such as trying to cut a path using the G00 code which isn't designed for that action (in modern applications it will indicate where the error lies).
- Fatal error. When you perform an action that could damage the tool-machine such as trying to drill past the table or place the tool at an unreachable location. This will stop the machine until it can be corrected and crash the application to prevent damage to the machine (most of the time...).
Command indicator.
Now to the indicator of a given command. G code has several command lists that perform a given action. I won't publish all as they're way too many and there are a lot of awesome sites on the net with lists of the commands. Take it as a homework assignement! Then again, in the Code Repository may upload a table. The indicators are:
NIt's necessary to indicate the sequence order in a program, which is where a certain block of code stands to the rest.
In more modern machines, the application automatically does the numbering but old models need you to do it manually. |
GPreparatory function, they are mostly related to the cutting paths that the tool-machine can take.
|
FAdvance rate. Used to indicate how fast a given tool will move (and cut). Too slow and the application will be inefficient but move to fast and oh! say goodbye to your leadscrew (and believe me, they're quite expensive...).
|
SUsed to indicate the leadscrew's rotational speed, something very important when seeking a smooth finishing.
|
TIndicates which tool number must be grabbed. They are indicated in the rack and vary from machine to machine.
|
MMiscellaneous functions that perform different things in the machine such as starting the cooler flow, changing tool, etc.
|
X, Y, ZIndicate how the machine must move according to the coordinates axis.
|
U, V, WAuxiliar commands for the coordinate axis.
|
R, I, J, KIndicate radius and center points for a given circle or circular radius.
|
P, Q, RCycle parameters.
|
Now that we have finally tackled the boring bits lets begin with an example!