
Fanuc CNC Mill Programming.
Learn Fanuc CNC mill programming from
these examples.
Learn Fanuc CNC programming complete from
the Fanuc programming
DVDs:
Fanuc CNC Programming DVDs.
Home: http://home.columbus.rr.com/hputz

If you have any questions or problems, call
me at 614-888-8466 or
send an email.
Fanuc CNC Mill Programming:
A typical Fanuc milling program with calculations for speeds and feeds:
This example would work on Fanuc controls since the 6M in about 1981.
Mild Steel, 4" square, lets drill 2 holes with a High Speed Drill, each .5"
diam. and .5" deep.
O2001(Program Number)
N1G90G80G40
(G90 sets up Absolute, G80 and G40 clear out info)
N2T1M6
(Tool change to T1, M6 activates changer, or on kneemill, waits for manual tool change.)
N3G54G0X1.0Y1.0S800M3
(G54 is co-ordinate system, G0 is rapid to X1.0 and Y1.0, S800= about 100SFM for Mild
Steel cut with .5" diam. HS drill)
N4G43H1Z1.0M8
(G43 is tool length comp, H1 identifies location in offset page where tool length is
registered, Z1.0 is location to which we rapid, turn coolant on)
N4G81G99X1.0Y1.0R.1Z-.5F8.0
(Use Canned Cycle G81, rapid to R-value, drill to Z-.5 at F8.0, return to R in rapid)
N5X3.0Y3.0
(Repeat cycle at new location)
N6G80M9
(Cancel Cycle, coolant off)
N7G91G28Z0
(Simplified return to Z-zero in G91, incremental)
N8G28X0Y0
(Home in X-Y)
N9M30
(End, rewinds memory)
Note: G28 is one of the very few codes that has to be repeated, almost all others carry
forward and do not have to be repeated.
Mill-Drill feed is always in Inches per minute.
To figure feed: RPM times Feed per Rev.= F value.
The simplified method for figuring RPM:
SFM times 4 divided by diam. of cutter.

Cutter Comp Example:
Originally E-Mailed to CNC Newsgroup.
Hi Brian: Here it is, a 2" square part with radius.
Zero is at lower left corner.
O1000
N1 G90 G80 G40
N2 T1 M6
N3 G54 G0 X-1.0 Y-1.0 S2500 M3 (Rapid to off the left corner of part.)
N4 G43 H1 Z-.5 M8(Set tool length.)
N5 G41 D31 X0 Y-.5 (Set comp in offset #31, approaching from left.)
N6 G1 Y1.75 F25.0 (Cut part.)
N7 G2 X.25 Y2.0 R.25
N8 G1 X1.75
N9 G2 X2.0 Y1.75 R.25
N10 G1 Y0
N11 X-.5
N12 G0 G40 X-1.0 Y-1.0 (Cancel comp going back to original point.)
N13 G91 G28 Z0
N14 M30
This will work in any Fanuc since 1980 or so. This is the simple tool
changer, you may have to separate the T1 and the M6.
Also, the D value could be programmed as a H on some machines.
Time Estimating for the above:
Tool change time depends on the machine and
the time for setup depends on your own skill.
The basic method for figuring the time for cutting is to figure RPM, then the
rate of feed per minute.
Take the total distance cut in G1 and divide that by the rate of feed.
In this case, the part is 2 " square, so the total cutting distance is
8" plus the .5" before the part and .5" past it.
Total of 9" divided by the feedrate of 25.0 IPM is about 30 seconds. Add a few
seconds for rapid and you have a reasonable time estimate.

Fanuc Sub example:
We want to C/Drill, Drill and Tap a series of holes,
all are located at odd dimensions, we will drill 1 hole and put all hole locations into a
sub for recall.
Advantage: You only have to program locations once and recall Sub.
More important: You can not make a mistake in hole locations,
check out the C/Drill positions and you can be sure the drill, tap, will be exactly in the
same location.
Note: Especially useful when dimensions are converted from Metric
and every Inch dimension is a really odd number.
Example:
O100
N1 G90 G80 G40
T1 M6
G54 G0 X1.0 Y1.0 S1000 M3
G43 H1 Z1.0 M8
G81 G99 R.1 Z-.25 F5.0 (C/Drill 1st. hole.)
M98 P1000 (Jump to Sub O1000 for other locations.)
G91 G28 Z0 M9
M30
Sub: O1000
X2.093
X3.1229
X4.0327
Y1.1175
X.3214
G80 M9
M99 (Return to Main Program)
Drill 1st. hole, then recall Sub, same for chamfering, tapping, etc.
Counterbore Sub Program:
Its in Incremental, so we can repeat it anywhere on the part.
This was originally developed for a bus company to manufacture floor boards with
a lot of different size holes. The method is to place the tool right above the
hole location and then call the Sub like this:
M98 P1000(This was a 1" counterbore, we made
up Subs for all hole sizes and called them according to hole size)
G91 G1 Z-.5 F12.0(Feed to depth)
G41 D31 X-.5 F10.0(Set Comp, tool radius in offset #31)
G3 I.5(Complete Circle)
G1 G40 X.5 F20.0(Take out Comp)
G0 Z.5
M99(Return to Main Program)
Next line in Main program should be new hole position, the Re-call sub, etc.

The applicable videos to learn the detailed method of programming:
"Prep" to learn about feeds-speeds and basics.
"Math" to figure shapes.
"Lathe" or "Mill" to learn programming.
"Shortcuts-Canned Cycles" for ease of programming and Sub Programming..
"Cutter Comp" for lathes and mills.
Check out all DVDs: http://home.columbus.rr.com/hputz.
Look for more later.
Call or E-Mail for any questions.

CNC Milling related links:
The best source for Speeds, Feeds info:
www.cutdata.com
CNC Download and Graph:
www.cncwarrior.com
Do a lot of programming for very little money:
www.bobcadcam.com
CNC Networking & Factory Automation:
www.shopfloorautomations.com
CNC Editor & Graphing Software, easy to use and affordable:
www.mnsi.net/~eaglesd/
Fanuc service and training:
www.GEFANUC.com
CNC programming too complicated? Try the Centroid control:
www.centroidcnc.com
Affordable and good, CNC mills with Centroid:
www.atrump.com
First class tools for milling, drilling:
www.coromant.sandvik.com
CNC milling facts and knowledge:
www.nfrpartners.com/cncfaq.htm
CNC Educational Services:
http://cnc.hypermart.net

Valuable CNC Resources: Machining related
magazines.
Its amazing how much you can learn by reading machinetool
related magazines, subscribe to these, they are usually free, put them in your favorite
relaxing place and learn---.
American Machinist: The Original.
www.americanmachinist.com
Modern Machine Shop.
www.mmsonline.com
Manufacturing Engineering.
www.sme.org/manufacturingengineering
Cutting Tool Engineering.
www.ctemag.com
CNC...West, concentrating on the west coast.
www.cnc-west.com
Moldmaking Facts & Knowledge
www.moldmakingtechnology.com

Learning about manual machining:
www.metalwebnews.com

For info, write:
hputz@columbus.rr.com .
614-888-8466
Home