CNC Programming

The definition of CNC programming is a series of set codes and instructions that form a program. This in is used to control a computer, that in turn is used to control a tool of sorts designed to create an end product that may be used for commercial or industrial applications. These tools are used in the manufacturing of unique or mass-produced pieces, gear cutting, or milling & turning. CNC itself stands Computer Numerical Control and was developed on the 1970's after progressing from the NC programming founding it had in the 1950's. It has widely influenced the many different applications of the manufacturing industries processes'. The core advantages of this form of programming is improved automation rather than human interaction, reliable, consistent and high degrees of accuracy.

iso programming

An example of ISO programming

The heart of this programming is the programmer, ultimately, although the whole manufacturing process requires little to no human presence, the program has to be written. What materials are to be used, physical production, the feed time of the material to be fed into the machine, what fabrications are to be performed on it. The programmer has to understand what is required by the end user, understand what are the limitations of the materials being used, what the limitations of the machine being used are. All this is taken into consideration by the programmer, to then be constructed into a series of numbered and sequential instructions for the machine to generate the end piece.

Programming Language

G - code is widely recognised as the industry standard for programming CNC machines, it is the basis for the creation of most instructions. It has the ability to control the machines most basic operations from cutting a straight line through to creating a perfect arc, adjusting tool cutting depth and diameter off sets to interpreting numbers as a form of measurement. Just a few selections of G - codes to show what they are capable of;

G00 : Rapid Linear Interpolation

G02 : Clockwise Circular Interpolation

G04 : Dwell

G05 : High Speed Machining Mode

G17 : X-Y Plane Selection

G37 : Special Fixed Cycle (Grid)

G45 : Tool Offset Increase

G101 : User Macro 1 (substitution) =

G202 : User Macro (negative condition branch)

A selection of M - codes which are used miscellaneous functions;

M00 : Compulsory Stop

M02 : End of Program

M04 : Spindle On (counter clockwise rotation)

M05 : Spindle Stop

M13 : Spindle on (clockwise rotation) and Coolant On (flood)

M30 End of Program, with return to program top

M48 : Feed Rate Override Allowed

M52 : Unload Last Tool From Spindle

M99 : Subprogram End

These are the most common codes used, but programming language as a whole is referred to as G - Code, for ease across the industry and the practice has sustained. It is noted that all letters of the alphabet are used in G - code, some are used for milling, others are strictly used in turning, but most are used in both disciplines. We will give a very brief overview here as to the rest of the letters association with G - code as you can find more in-depth resources readily available in general on line;

A :  Absolute or incremental position of A axis (rotational axis around X axis)

B : Absolute or incremental position of B axis (rotational axis around Y axis)

C : Absolute or incremental position of C axis (rotational axis around Z axis)

D : Defines diameter or radial offset used for cutter compensation

E : Precision feedrate for threading on lathes

F : Defines Feed Rate

G : Address for preparatory commands

H : Defines tool length offset; Incremental axis corresponding to C axis

I : Defines arc centre in X axis for G02 or G03 arc commands. Also used as a parameter within some fixed cycles

J : Defines arc centre in Y axis for G02 or G03 arc commands. Also used as a parameter within some fixed cycles

K : Defines arc centre in Z axis for G02 or G03 arc commands. Also used as a parameter within some fixed cycles, equal to L address

L : Fixed cycle loop count

M : Miscellaneous Function

N : Line (block) number in program

O : Program Name

P : Serves as parameter address for various G and M codes

Q : Peck increment in canned cycles

R : Defines size of arc radius, or defines retract height in milling canned cycles

S : Defines speed, either spindle speed or surface speed depending on mode

T : Tool Selection

U : Incremental axis corresponding to X axis (typically only lathe group A controls)

V : Incremental axis corresponding to Y axis

W : Incremental axis corresponding to Z axis (typically only lathe group A controls)

X : Absolute or incremental position of X axis

Y : Absolute or incremental position of Y axis

Z : Absolute or incremental position of Z axis

CNC Machining

tools for manufacturing processes

This is the final step in the CNC manufacturing process, this can be anything from milling, turning to lathing. Using the programming installed on the computer, these pieces are manufactured to very precise tolerances which can be repeated numerous times and to high end accuracies. There are various types of machines that are used in the CNC manufacture process, these can be a router through to a plasma cutter to a milling machine, and with the progression of 3D printers being on the forefront of numerous industries offering numerous opportunities to design whatever you can imagine, it seems to be an exciting time to be a CNC machine operator or a programmer.