You are on page 1of 10

Fanuc Programming

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.

Fanuc G76 Threading Cycle Explanation


N5 G76 P010060 Q100 R0.05
N6 G76 X30 Z-20 P1024 Q200 F2

First block of the G76 Threading cycle

G76 : G code for threading cycle.

P : P actually consists of multiple values which control the thread behavior,

 01 : Number of spring cuts.


 00 : Thread run out at 45 degree
 60 : Flank angle or Infeed angle

Q : Depth of normal cut ( these values are given in hundreds, so the depth of cut will be 0.1 ).
R : Depth of Last or Finish cut

Second block of the G76 Threading cycle

G76 : G code of the threading cycle.


X : The end value in x-axis.
Z : The end value in z-axis.
P : Thread depth ( as radius value ).
Q : Depth of first cut.
F : Thread Pitch
R : Thread Taper
N20 G97 S800 M03
N30 G00 X30 Z5 T0303
N40 G76 P021060 QI00 R100
N50 G76 X18.2 Z-20 P900 Q200 FI.5
N60 G00 X50 Z-20
N70 G76 P021060 Ql00 R100
N80 G76 X38.2 Z-52 P900 Q200 FI .5
N90 G00 X200 Z200
N100 M30

Fanuc control models 10/11/15 use a single-block format for G76 threading cycle.

Other Fanuc control models (0/16/18/20/21) use the double-block format for G76 threading
cycle.

The single-block format is older then the two-block format.

In G76 threading cycle single-block format, the cycle uses the following data:

G76 X.. Z.. I.. K.. D.. A.. F.. P..

X : specifies the final thread diameter.

Z : is the position of the thread end.

I : specifies the amount of taper.

K : is the single thread depth.

D : is the depth of the first pass.

A : is the thread angle.

F : is the thread lead.

P : is the infeed method.

Fanuc cnc controls has no direct threading cycle for cutting multi-start threads on cnc. But you
can cut multi-start threads on a cnc with fanuc control by using Fanuc G76 Threading Cycle.
Multi Start Threads with Fanuc G76 Threading Cycle

There are multiple techniques for cutting multi-start threads on cnc with Fanuc G76 threading
cycle. Here is one of them.
This cnc programming example uses cnc subprogram call to cut multi-start threads on Fanuc cnc.

CNC Main program


N50 G00 X48 Z5
N60 M98 P0034713

CNC Sub Program


N10 G76 P020000 Q100 R0.05
N20 G76 X42 Z-15 P974 Q200 F4.5
N30 G00 W1.5
N40 M99

The above cnc main program calls the 4713 sub-program three times.

For Fanuc G76 Threading Cycle complete help see CNC Fanuc G76 Threading Cycle

Fanuc control models 10/11/15 use a single-block format for G76 threading cycle.

Other Fanuc control models (0/16/18/20/21) use the double-block format for G76 threading
cycle ( G76 Two line format ).

The single-block format is older then the two-block format.

In G76 threading cycle single-block format, the cycle uses the following data:

G76 X.. Z.. I.. K.. D.. A.. F.. P..

X : specifies the final thread diameter.


Z : is the position of the thread end.

I : specifies the amount of taper.

K : is the single thread depth.

D : is the depth of the first pass.

A : is the thread angle.

F : is the thread lead.

P : is the infeed method.

G32

G32 is used for thread cutting, but with G32 we can just make a single threading cut. This all
mean that you yourself have to do all the work of threading tool positioning.

For brief introduction of G32, G33 read CNC Fanuc G33 G32 Threading G Code.

Thread Cutting Possibilities with G32

 Longitudinal thread.
 Transverse thread.
 Tapered thread.
 Single and Multiple Start threads with a constant pitch.
 Variable pitch and taper angles by Chaining thread cutting blocks.

For taper threading with G32 first take the tool to the start position.

Then make the thread cut with G32 and give the values of destination point in X, Z axis along
with thread pitch F.

The Z value in the G32 thread cutting has the same meaning as the Z value in the G76 cycle or
the G92 threading cycle. It represents the end position.

There are multiple possibilities of taper threading on cnc lathe machines.

Taperd threading with G76 threading cycle.

Taper Threading with G92 Threading Cycle.

CNC Programming Example G92 Taper Threading Cycle.


Taper Threading with G32

Taper Threading with G32

N10 G50 S800 T0100


N20 G97 S800 M03
N30 G00 X90.0 Z5.0
N40 X22.026
N50 G32 X49.562 Z-71.5 F3.0
N60 G00 X90.0
N70 Z5.0
N80 X21.052
N90 G32 X48.588 Z-71.5
N100 G00 X90.0
N110 Z5.0
N120 X150.0 Z150.0
N130 M30

Here are just two passes of taper threading in this cnc programming example, but you can repeat
the

G92 threading cycle is used for threading on a cnc lathe machine. The added benefit of G92
thread cycle is that G92 G-code gives cnc machinist full control over the depth of every cut
while threading.

For full description of G92 threading cycle read CNC Fanuc G92 Threading Cycle.
G92 thread cycle can be used for taper threading as well, for a full description of taper threading
with G92 threading cycle read Taper Threading with G92 Threading Cycle.

The below is a cnc programming example which show you how taper threads can be machined
with G92 thread cycle.

Taper Threading with G92 Threading Cycle

CNC Programming Example G92 Taper Threading Cycle

N10 T1
N20 G97 S1000 M03
N30 GOO X70 Z5 M08
N40 G92 X49.4 Z—32 R—6.166 F1.5
N50 X49
N60 X48.7
N70 X48.5
N80 X48.3
N90 X48.2
N100 G00 X100 Z100
N110 M30

Here is another cnc programming example, this cnc programming example shows the use of
G71 Canned Cycle and G70 for Fanuc CNC Control.

Although I already have posted about the G71 Turning Canned Cycle(Rough Turning Cycle), but
that blog post just illustrates the use of G71 and G71 parameters.
This cnc programming example shows a complete contour cutting with G71 and finish cut on
contour with G70.

G70 finishing cycle for fanuc cnc control can also be used with G72 Facing cycle for fanuc
control. Usage of G70 Finishing cycle with G72 Facing cycle is same as shows here in the
following example.

CNC Programming Example with Fanuc G71 Rough Turning Cycle and G70

N10 G00 G90 X142 Z171


N20 G71 U4 R1
N30 G71 P40 Q110 U4 W2 F0.3
N40 G00 X40
N50 G01 Z140 F0.2
N60 G01 X60 Z110
N70 G01 Z90
N80 G01 X100 Z80
N90 G01 Z60
N110 G01 X140 Z40
N120 G70 P40 Q110
N130 G00 X200 Z220
N140 M30

When doing any operation on a lathe, all parameters are critical and should not be overlooked.
There are industry standards and recommendations for SFM, feedrates, insert geometry,
workholding, etc., that should be followed.

A common problem in boring applications is that the boring bar is extended further than
recommended, or the diameter to length ratio is exceeded for that particular bar.
Boring Bar Diameter to Length Ratio Recommendations for CNC Machinists

Boring bars are made of different materials, and they all have different diameter to length ratios.
Where one boring bar will work, another may not.

In boring applications, the diameter to length ratio is the biggest contributor to vibration

The most common materials for boring bars and their diameter to length ratios are:

Boring Bar Materials Diameter to Length Ratio or D to L Ratio

Steel 4:1
Heavy Metal 4:1 to 6:1
Steel Devibrator 6:1
Tungsten Carbide 6:1
Carbide Devibrator 8:1
Standard Tunable 6:1 to 10:1
Special Carbide Devibrator over 10:1
Special Tunable 10:1 to …

When choosing a boring bar, look at the diameter and length of the hole to be bored. Then
choose the proper boring bar based on the diameter to length ratio that will work best for the
application.

You might also like