CNC Programming For CNC Machinists

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

CNC Programming for CNC Machinists

by Helman Jr.

CNC Programming is not that difficult to learn and master, specially cnc programming for cnc lathe
machines. Because cnc lathe machines have only two axis to work with X-axis and Z-axis.

CNC Programming for CNC Machinists

X-axis of cnc lathe machine controls the diameter of the component.

Z-axis of cnc lathe machine controls the length of the component.

To learn cnc programming you better start from the easy to program drawings.

Here are some basic cnc programming examples

o CNC Programming for Beginners a Simple CNC Programming Example


o Lathe CNC Programming Example
o CNC Milling Machine Programming Example for Beginners

To start cnc programming for a cnc lathe machine the process is under.

You first have to call the proper cutting tool for the machining. This step is cnc machine dependent but on
fanuc cnc control you will use following cnc programming command,

T5 or T0505

Now load workshift value, the following cnc programming commands are used to load the workshift,
G10 , G54
Rotate the main spindle of cnc lathe machine. The cnc programming command to rotate the main spindle is
under,

G97 S1000

The above cnc programming command will not make the spindle to rotate this will actually only tell the
cnc machine that I want to rotate the main spindle at 1000RPM (Revolution Per Minute),

but to actually rotate to spindle you have to give another cnc programming command or M-Code or M-
Function to tell cnc machine to rotate the spindle in CW (Clockwise rotation) or CCW (Counter-Clockwise
rotation).
M03 (Rotate spindle in CW ditection)
M04 (Rotate spindle in CCW direction)
M05 (Stop the spindle)

To turn the cnc machine Coolant ON, so our tool insert and component can’t get hot you need to turn on
the coolant, the cnc programming commands or M functions are as under

M08 (Coolant ON)


M09 (Coolant OFF)

Now the time to actually move the tool, there are multiple cnc programming commands (G-codes) to travel
the tool.

To travel the tool at a fast feed or in cnc words we say it Rapid Traverse the tool we will use following cnc
programming command or G-code,

G00 X... Z...

The X and Z values with G00 are the destination coordinates for the tool.

To travel the tool at a control feed or to Linear Traverse the tool, we will use following cnc programming
command or G-Code,

G01 X... Z... F...

The X and Z values with G01 are destination coordinated in X and Z axis. The F value is the tool feed,
This might be G95 (Feed Per Revolution).

To machine Arc or Circular Interpolation on component, the following cnc programming commands or G-
codes are used,

G02 X... Z... R...


G03 X... Z... R...

G02 cnc programming g-code is used to program a Clock-wise Arc, and G03 G-code is used to program a
Counter-Clockwise Arc. The X and Z values are destination coordinates and R is the Arc Radius.

This way you will complete all the cnc program.

To make an end to the cnc program you will use following cnc programming command or M-code,

M30

M30 End the cnc program and brings the cursor to the program start.

CNC G Codes
CNC G Code in a broader way are instructions to the cnc machine tools.
CNC G-code are instructions to cnc machine tools like
which way to go whether
to travel in a straight line (G01)
or in a curve (G02, G03)
or in taper (G01)
and with what feed (G94, G95).
Whether to travel at full feed (G00)
or with a controlled feed (G94, G95).
and if there is a stay how long will the stay be a cnc programmer calls this stay Dwell Time. (G04)
The G codes also provide some very crucial data at program start and at run time like
Tool-Offsetting data (G10)
and CNC Workpiece-Zero-Point or CNC Workshift Setting, (G10, G54, G55)
as without this data running a cnc machine is just a dream.
So after reading the above paragraph you might have understood the power of the G codes.
They provide crucial and sensitive data at run time and instruct the cnc machine tools to run on
the given path with a controlled feed but keeping that crucial data in mind all the time.
If I fully translate the above paragraph in cnc G code then I will say that the cnc machine will read
machine zero offset with G54 and Tool-Offset with G10 and run on a path which is carved with
G00 G01 G02 G03 and run with a control feed the feed is controlled with G94 G95 G96.
Important G Codes
G00

The G00 G code of cnc machine tell the cnc machine to bring the tool to a given point given with
G00 at the full feed, the feed of the G00 is given in the cnc machine parameters and normally
never changed, but can be changed if really needed.
G01

The G01 G-code of cnc machine tell the cnc machine to bring the tool with a controlled feed,
unlike G00 whose feed is buried in cnc machine parameters the feed of the G01 code is given in
the same program block or in the prior blocks. To control the feed another G code is used which
is G95.
Fanuc G71 for Boring Opertaion
This programming example also illustrate how G71 turning cycle can be used for internal
machining (boring operation). So if you want to remove extra stock from inside of a component,
you can use Fanuc G71 turning cycle for internal stock removal as well.
Fanuc Programming Example

Fanuc Canned Cycle Example


G28 U0 W0
G50 S1500
N1 T0101 M8 (OD FACING)
G96 S180 M3
G0 X255.0 Z5.0
G72 W2.0 R0.5
G72 P100 Q200 F0.25
N100 G0 Z0 G41
G1 X-2.0 F0.18
N200 G0 Z5.0
G40
X255.0
G28 U0 W0
N2 T0404 M8 (ID ROUGH)
G96 S180 M3
G0 X50.0 Z5.0
G71 U2.0 R0.5
G71 P500 Q600 U-0.5 W0.1 F0.25
N500 G0 X202.0 G41
G1 Z0 F0.12
X200.0
Z-10.0
X100.0
Z-30.0
X60.0
Z-45.0
N600 X50.0
G40
G0 Z5.0
G28 U0 W0
N3 T0505 M8 (ID FINISH)
G96 S220 M3
G0 X50.0 Z5.0
G70 P500 Q600
G0 X50.0 Z5.0
G28 U0 W0
M5 M9
M30

CNC Programming for Beginners a Simple CNC


Programming Example
CNC programming is not a difficult task as many think, For beginners it will be useful if they divide the
drawing in some smaller parts and start programming them. Actually CNC programming take some time to
master, but in short it is just a path for our tool to machine. Here is another simple CNC Lathe program.

CNC Lathe Program Example with Code

Simple CNC Programming Example

N1 T0101 ; Tool no 1 with offset no 1 FANUC Control


N2 G97 S500 M03 ; Spindle rotation clockwise with 500 RPM
N3 G42 G00 X0 Z0 ; P0 tool nose radius compensation active
N4 G01 X25 G95 F0.3 ;
N5 G01 Z-7.5 ; P1
N6 G01 X40 Z-15 ; P2
N7 G01 Z-25 ; P3
N8 G01 X60 Z-35 ; P4
N9 G40 G00 X200 Z100 ; Tool nose radius compensation cancel
More ...

You might also like