Search

[CNC Programming Examples] U W CNC Lathe CNC Program Examples

U W CNC Lathe CNC Program Examples

Fanuc G71 Turning Cycle

G71 turning cycle is used for rough-material removal from a cnc lathe component. G71 turning cycle makes large diameter cutting easy. Cutting can be done in simple straight line or a complex contour can also be machined very easily.
Through G71 turning cycle parameters cnc machinists can control
  • Depth of cut.
  • Retract height.
  • Finishing allowance in x-axis and z-axis.
  • Cycle cutting-feed, spindle speed.

Programming

G71 U... R...
G71 P... Q... U... W... F... S...

Parameters

First block
Parameter Description
U Depth of cut.
R Retract height.
Second block
Parameter Description
P Contour start block number.
Q Contour end block number.
U Finishing allowance in x-axis.
W Finishing allowance in z-axis.
F Feedrate during G71 cycle.
S Spindle speed during G71 cycle.

G71 Turning Cycle Overview

  • G71 turning cycle cuts the whole contour repeatedly which is given in P Q blocks.
  • Depth of every cut can be controlled by first-block U value.
  • Second-block U W are the finishing allowances which can be given if you want to make a finish cut with G70 finishing cycle.
  • F is cutting feed and S is spindle speed (given in second-block) which are used during G71 turning cycle.
Note – The F and S given inside P Q block will not be used during G71 turning cycle, they are used with G70 finishing cycle if later called.

G71 Turning Cycle Working

N60 G71 U10 R10 
N70 G71 P80 Q90 U3 W0 F0.25
N80 G00 X60
N90 G01 Z-75
When G71 turning cycle is run the whole operation will be done in following sequence,
First-cut
1 – Tool will move in x-axis U (depth of cut) deep with programmed feed from starting-point.
2 – Tool will travel with feed in z-axis (destination point in z-axis is given in P Q blocks )
3 – Tool rapidly retracts R amount in both x-axis and z-axis (at 45 degrees).
4 – Tool rapidly travel in z-axis to start-point
Later-cuts
5 – Tool rapidly moves to last cut depth.
6 – Tool moves with feed in x-axis U deep (first-block U depth of cut).
7 – Tool with feed moves in z-axis (destination point given in P Q blocks).
8 – Tool rapidly retracts in x-axis and z-axis R amount (45 degrees).
9 – Tool rapidly moves to start-point only in z-axis.
This whole sequence of operation keep on going, until the destination point in x-axis is met.
If finishing allowance is given tool will not make the exact diameter and length given in P Q blocks but will leave that much allowance, This finishing allowance can be later machined by calling G70 finishing cycle.


Fanuc G71 Turning Cycle

Fanuc G71 Example

Here is a cnc part-program which shows how G71 turning cycle can be used, this is the program for the drawing given above
N50 G00 X106 Z5 M3 S800
N60 G71 U10 R10 
N70 G71 P80 Q90 U3 W0 F0.25
N80 G00 X60
N90 G01 Z-75
In this program G71 turning cycle will keep repeating the contour given inside P Q blocks shown below
N80 G00 X60
N90 G01 Z-75
These two cnc program blocks tell us that we want to remove material till X60 deep and in Z-75 in length.
The depth of cut is given in first-block U10 retract amount is also given R10.
Finishing allowance in x-axis is U3 but there is no finishing allowance given in z-axis W0.

G70 Finishing Cycle

If you programmed G71 turning cycle with finishing allowances then that finish allowances can be removed with G70 finishing cycle.
G70 finishing cycle repeats the whole contour the G71 way, but in just one-cut removing the finishing allowances.

Why Use G70 Finishing Cycle

As material can be removed with G71 turning cycle, but if you want a different cutting-feed and spindle speed for the last cut, then it is recommended that you use G70 finishing cycle.
G70 finishing cycle use F and S values which are given inside P Q programmed blocks. (G71 use F S values which are given inside G71 second block.)

Fanuc G70 Example

N50 G00 X106 Z5 M3 S800
N60 G71 U10 R10 
N70 G71 P80 Q90 U3 W0 F0.25
N80 G00 X60
N90 G01 Z-75 F0.15
N100 G00 X200 Z100
N110 G92 S1200
N120 T3 G96 S150 M03
N130 G00 X106 Z5
N140 G70 P80 Q90
N150 G00 X200 Z100
N160 M30

G70 G71 Example


G71 Rough Turning Cycle Example

O0004
G00 X200 Z10 M3 S800
G71 U2 R1 F200
G71 P80 Q120 U0.5 W0.2
N80 G00 X40 S1200
G01 Z-30 F100
X60 W-30
W-20
N120 X100 W-10
G70 P80 Q120
M30


***********************************

[CNC Programming Examples] Fanuc G76 Thread Cycle for Dummies

Fanuc G76 Thread Cycle for Dummies



Fanuc G76 Thread Cycle for Dummies
Fanuc G76 Thread Cycle for Dummies explains Fanuc G76 threading cycle briefly. Fanuc G76 gives cnc machinist full control over thread turning.
Fanuc G76 threading cycle has multiple parameters but the same way Fanuc G76 gives full flexibility in thread cutting.
This article is actually to help cnc machinists to easily navigate through multiple articles explaining Fanuc G76 threading cycle.
Below are quick links,
  • Fanuc G76 Threading Cycle
  • G76 Threading Cycle One Line Format for Fanuc 10/11/15T
  • Tapered Threading with Fanuc G76 threading cycle
  • Multi-Start Threading with Fanuc G76 threading cycle
  • Controlling Thread Infeed with Fanuc G76 threading cycle
  • How to Fully Control G76 Threading Cycle Number of Pass and Depth of Cut
For explanation of all the variations of Fanuc G76 see below
Contents
  • CNC Fanuc G76 Threading Cycle
  • One Line Format for Fanuc 10/11/15T
  • Tapered Threading
  • Multi Start Threads
  • Controlling Threading Infeed Angle
  • Controlling Number of Pass and Depth of Cut

CNC Fanuc G76 Threading Cycle

CNC Fanuc G76 Threading Cycle this article briefly explains all the parameters of Fanuc G76 threading cycle, like the following cnc programming code for fanuc g76 threading cycle
N5 G76 P010060 Q100 R0.05
N6 G76 X30 Z-20 P1024 Q200 F2

One Line Format for Fanuc 10/11/15T

G76 Threading Cycle One Line Format for Fanuc 10/11/15T, Fanuc control models 10/11/15 use a single-block format for G76 threading cycle.
G76 X.. Z.. I.. K.. D.. A.. F.. P..

Tapered Threading

Tapered Threading with Fanuc G76 Threading Cycle this post explained how a cnc machinist can cut Tapered Threadswith Fanuc G76 threading cycle.


Tapered Threading with Fanuc G76 Threading Cycle
The following cnc programming code is explained in the above post.
N5 G00 X50 Z5
N6 G76 P010060 Q100 R0.05
N7 G76 X43 Z-45 P1024 Q200 R-14.5 F2

Multi Start Threads

Multi Start Threads with Fanuc G76 Threading Cycle this article fully describes how to cut Multi-Start threads on cnc machine with Fanuc G76 threading cycle.

Controlling Threading Infeed Angle

Controlling Threading Infeed Angle with Fanuc G76 Threading Cycle this article explains how a cnc machinist can control Thread Infeed Angle with Fanuc G76 threading cycle.

Controlling Number of Pass and Depth of Cut

How to Fully Control G76 Threading Cycle Number of Pass and Depth of Cut Explained this articles tells how a cnc machinist can control
  • Depth of cut for First pass
  • Depth of cut for normal passes
  • Depth of cut for Last pass
  • Control number of Spring passes

***********************************

[CNC Programming Examples] Tapered Threading with Fanuc G76 Threading Cycle

Tapered Threading with Fanuc G76 Threading Cycle


Taper threading is not a usual practice in cnc machine workshops, but sometimes customer want a component with taper threading, So here is the solution. Taper threading on a cnc lathe machine with Fanuc control is just easy with Fanuc G76 threading cycle. Fanuc CNC control threading cycle G76 gives us lot of flexibility. CNC Programming tapered threading with Fanuc threading cycle G76 is not that difficult, just one parameter have to add.

Normal Threading with Fanuc G76 Threading Cycle CNC Program

N5 G76 P010060 Q100 R0.05
N6 G76 X30 Z-20 P1024 Q200 F2
One G76 parameter which have to be added for tapered threading is R in G76 second block.

Tapered Threading with Fanuc G76 Threading Cycle CNC Program


Tapered Threading with Fanuc G76 Threading Cycle
N5 G00 X50 Z5
N6 G76 P010060 Q100 R0.05
N7 G76 X43 Z-45 P1024 Q200 R-14.5 F2
Other parameter of Fanuc threading cycle G76 are explained here.
The R parameter in second block of G76 is the tapered value. Note that R is given as Radius value.

How to calculate R parameter for Tapered Threading on Fanuc with G76 Threading Cycle.

R = (Start Diameter – End Diameter) / 2

***********************************

[CNC Programming Examples] Fanuc G21 Measuring in Millimeter with CNC Lathe Programming Example

Fanuc G21 Measuring in Millimeter with CNC Lathe Programming Example

Fanuc G21 Measuring in Millimeter or Programming in Millimeter. CNC gives us the flexibility to program in metric system or in inches system.
Fanuc G21 G-code changes cnc to metric system.
So here is another cnc programming example, for beginner level cnc programmers. This cnc programming example usesFanuc G21 G-code.

Fanuc G21 Programming Example
N1 T0505
N2 G92 S1500 M03
N3 G21 G96 S150
N4 G00 X0 Z5
N5 G42 G01 Z0 G95 F0.3
N6 G01 X23.293
N7 G01 X40 Z-30
N8 G01 X58.146 Z-42
N9 G01 X70
N10 G40 G00 X100 Z100 G97 S500

***********************************

[CNC Programming Examples] Fanuc G20 Measuring in Inches with CNC Program Example

Fanuc G20 Measuring in Inches with CNC Program Example


Fanuc G20 Measuring in Inches or Programming in inches. As cnc machines gives us ease to program and machine any type of component.
The same way the cnc machine controls also give us the utmost flexibility that we can program not only in metric systembut also in inches system.
On Fanuc cnc control G20 and G21 are used to change between the  inches and metric system.
This cnc programming example demonstrate the usage of Fanuc G20 G code.


Fanuc G20 Program Example

Fanuc G20 CNC Program Example

N1 T0101
N2 G97 S800 M03
N3 G96 S150 G20
N4 G00 X0 Z1
N5 G01 Z0 G95 F0.3
N6 G01 X2 R0.25
N7 G01 Z-1
N8 G02 X5 Z-2.5 I1.5 K0
N9 G01 X6
N10 G00 X10 Z10
N11 M30

***********************************

[CNC Programming Examples] CNC Arc Programming Exercise

CNC Arc Programming Exercise


CNC arc programming exercise, shows how to cnc program an arc with I and K. CNC G-code G03 is used to program this arc.

CNC Arc Programming Exercise
N10 GOO X0 Z0
N20 G01 X12 F0.3
N30 G01 X40 Z-25
N40 G03 X70 Z-75 I-3.335 K-29.25
N50 G01 Z-95
N60 G00 X200 Z200

***********************************

[CNC Programming Examples] CNC Programming for Beginners a Simple CNC Programming Example

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

***********************************

[CNC Programming Examples] CNC Programming for Beginners a CNC Programming Example

CNC Programming for Beginners a CNC Programming Example


Here is a cnc programming example for beginners, this cnc programming example is a starting step for cnc learningor CNC Programming for Beginners . Here you will find plenty of free cnc programming examples with component drawings. This cnc programming example explains the cnc boring with cnc boring bar tool.


CNC Programming for Beginners a CNC Programming Example

CNC Program Example

N1 T01 G20
N2 G00 X3.5 Z0.5
N3 G01 G96 S120 Z0 F.5
N4 G02 X2 Z-.75 R0.75 F0.15
N5 G01 Z-5 F0.2
N6 G01 X1.85
N7 G00 Z20
N8 M30

***********************************

[CNC Programming Examples] Fanuc CNC Program Example

Fanuc CNC Program Example

Here is a cnc program example for Fanuc cnc control. This is a very simple and easy cnc program example also shows
  • Use of G02 Arc/Radius in Fanuc cnc program
  • Use of Chamfer in Fanuc cnc program
  • Use of G42/G40 Tool Nose Compensation
  • Use of G92 Maximum Spindle Speed
  • Use of G96 Constant Cutting Speed

Fanuc CNC Program Example

Fanuc CNC Program Code

N10 T2
N20 G92 S1200 M42
N30 G96 S150 M04
N40 G00 X-1 Z5 M08
N50 G01 Z0 G42 F0.2
N60 G01 X24 C2
N70 G01 Z-28
N80 G01 X32 Z-50
N90 G01 Z-56
N100 G02 X40 Z-60 R4
N110 G01 Z-75
N120 G01 X60 G40
N130 G00 X150 Z100
N140 M30

***********************************

[CNC Programming Examples] G-Code G95 Feed Per Revolution

G-Code G95 Feed Per Revolution

Feed Per Revolution (G95)


G95 Feed Per Revolution
G95 (Feed Per Revolution) is a modal G-code that instructs the control to interpret feed commands as mm per revolution (mm/rev) or inches per revolution of the spindle.
G01 F0.02
the above cnc program code would cause the axis to advance 0.02mm for every revolution of the spindle.
When G95 is active the feed values will be programmed as follows: F0.05, F0.15, F0.3, F0.5 and so forth.
N11 ……
N12 G95 ; Program with G95 (F= mm/rev.)
N13 G1 Z-20 F0.2
N14 ……

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

Lathe CNC Programming Example

This is a very simple lathe cnc programming example. This lathe cnc programming example is for beginners level cnc programmers or for novice cnc programmers. Just simple cnc contour programming. The G code which are used in this programming example are from Fanuc cnc control.


Lathe CNC Programming Example




CNC Program in Fanuc G Code

N10 G90 S500 M03
N20 G00 X25 Z5
N30 G01 G95 Z0 F1
N40 G01 Z-7.5 F0.2
N50 G01 X60 Z-35
N60 G01 Z-50
N70 G00 X62
N80 G00 X80 Z20
N90 M30
 

Feed Per Revolution (G95)

G95 Feed Per Revolution
G95 (Feed Per Revolution) is a modal G-code that instructs the control to interpret feed commands as mm per revolution (mm/rev) or inches per revolution of the spindle.
G01 F0.02
the above cnc program code would cause the axis to advance 0.02mm for every revolution of the spindle.
When G95 is active the feed values will be programmed as follows: F0.05, F0.15, F0.3, F0.5 and so forth.
N11 ……
N12 G95 ; Program with G95 (F= mm/rev.)
N13 G1 Z-20 F0.2
N14 ……

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

Lathe CNC Programming Example

This is a very simple lathe cnc programming example. This lathe cnc programming example is for beginners level cnc programmers or for novice cnc programmers. Just simple cnc contour programming. The G code which are used in this programming example are from Fanuc cnc control.


Lathe CNC Programming Example

CNC Program in Fanuc G Code

N10 G90 S500 M03
N20 G00 X25 Z5
N30 G01 G95 Z0 F1
N40 G01 Z-7.5 F0.2
N50 G01 X60 Z-35
N60 G01 Z-50
N70 G00 X62
N80 G00 X80 Z20
N90 M30
 



***********************************

[CNC Programming Examples] Fanuc Macro Programming

Fanuc Macro Programming

Fanuc Lathe Custom Macro for Peck Drilling

Fanuc Peck Drilling Macro

Move the tool beforehand along the X- and Z-axes to the position where a drilling cycle starts. Specify Z or W for the depth of a hole, K for the depth of a cut, and F for the cutting feedrate to drill the hole.
Following Custom Macro works on Fanuc cnc controls like FANUC Series 30i/31i/32i-MODEL A

Programming

G65 P9100 Z K F
OR
G65 P9100 W K F
Parameter Description
Z Hole depth (absolute programming)
W Hole depth (incremental programming)
K Cutting amount per cycle
F Cutting feedrate


Custom Macro

Main Program

G50 X100.0 Z200.0 ;
G00 X0 Z102.0 S1000 M03 ;
G65 P9100 Z50.0 K20.0 F0.3 ;
G00 X100.0 Z200.0 M05 ;
M30

Macro program

O9100;
#1=0; (Clear the data for the depth of the current hole.)
#2=0; (Clear the data for the depth of the preceding hole.)
IF [#23 NE #0] GOTO 1; (If incremental programming, specifies the jump to N1.)
IF [#26 EQ #0] GOTO 8; (If neither Z nor W is specified, an error occurs.)
#23=#5002-#26;         (Calculates the depth of a hole.)
N1 #1=#1+#6;           (Calculates the depth of the current hole.)
IF [#1 LE #23] GOTO 2; (Determines whether the hole to be cut is too deep?)
#1=#23;                (Clamps at the depth of the current hole.)
N2 G00 W-#2;           (Moves the tool to the depth of the preceding hole at the cutting feedrate.)
G01 W- [#1-#2] F#9;    (Drills the hole.)
G00 W#1;               (Moves the tool to the drilling start point.)
IF [#1 GE #23] GOTO 9; (Checks whether drilling is completed.)
#2=#1;                 (Stores the depth of the current hole.)
N9 M99
N8 #3000=1;            (NOT Z OR U COMMAND Issues an alarm.)


Make your own G81 Drilling Cycle through Fanuc Macro and G66 Modal Call

This is a complete Fanuc Macro which works same as Fanuc G81 Drilling Cycle.

G66 Modal Call

Once Fanuc G66 is issued to specify a modal call a macro is called after a block specifying movement along axes is executed. This continues until G67 is issued to cancel a modal call.

Macro Call Parameters

G65 P9110 X x Y y Z z R r F f L l ;
X: X coordinate of the hole (absolute only) . . . (#24)
Y: Y coordinate of the hole (absolute only) . . . (#25)
Z: Coordinates of position Z (absolute only). . . (#26)
R: Coordinates of position R (absolute only). . . (#18)
F : Cutting feedrate . . . . . . . . . . . . . . . . . . . .. . . (#9)
L: Repetition count

Program Example

O0001;
G28 G91 X0 Y0 Z0;
G92 X0 Y0 Z50.0;
G00 G90 X100.0 Y50.0;
G66 P9110 Z–20.0 R5.0 F500;
G90 X20.0 Y20.0;
X50.0;
Y50.0;
X70.0 Y80.0;
G67;
M30;

Drilling Macro

O9110;
#1=#4001;   (Stores G00/G01)
#3=#4003;   (Stores G90/G91)
#4=#4109;   (Stores the cutting feedrate)
#5=#5003;   (Stores Z coordinate at the start of drilling)
G00 G90 Z#18;   (Positioning at position R)
G01 Z#26 F#9;   (Cutting feed to position Z)
IF[#4010 EQ 98]GOTO 1;  (Return to position I)
G00 Z#18;   (Positioning at position R)
GOTO 2;
N1 G00 Z#5;   (Positioning at position I)
N2 G#1 G#3 F#4;  (Restores modal information)
M99;

Fanuc Bolt Hole Circle Custom Macro (BHC)

 

Drawing/Image



CNC Program

/*Parameters
G65 P9100 Xx Yy Zz Rr Ff Ii Aa Bb Hh
X: X coordinate of the center of the circle (#24)
Y: Y coordinate of the center of the circle (#25)
Z: Hole depth (#26)
R: Coordinates of an approach point (#18)
F: Cutting feedrate (#9)
I: Radius of the circle (#4)
A: Drilling start angle (#1)
B: Incremental angle (Clockwise when negative value) (#2)
H: Number of holes (#11)
*/

O9100
#3=#4003
G81 Z#26 R#18 F#9 K0
IF[#3 EQ 90]GOTO 1
#24=#5001+#24
#25=#5002+#25
N1 WHILE[#11 GT 0]DO 1
#5=#24+#4*COS[#1]
#6=#25+#4*SIN[#1]
G90 X#5 Y#6
#1=#1+#2
#11=#11-1
END 1
G#3 G80
M99

/*Fanuc Bolt Hole Macro Example
Example macro call to drill 5 holes at intervals of 45 degrees
after a start angle of 0 degrees
on the circumference of a circle with radius 4”.
The absolute center of the circle is (10”, 5”).*/
O0002
G90 G92 X0 Y0 Z4.0
G65 P9100 X10.0 Y5.0 R1.0 Z-2.0 F20 I4.0 A0 B45.0 H5
M30






G65 Macro for Internal Elipse

 

Drawing/Image


CNC Program

T1 M6
G0 G90 G40 G21 G17 G94 G80
G54 X0 Y0 S? M3
G43 Z5 H?
G1 Z-? F?
#20 = 2 ; Incremental degree calculation
#21 = 0 ; Start Angle
#22 = 30 ; Y Axis Radius
#23 = 50 ; X Axis Radius
G41 X#23 D? ; Compensation motion to right side of internal pocket
N10 #21 = [#21 + #20] ; Angular Count
#24 = SIN[#21] ; Incremental Y axis calculation
#25 = COS[#21] ; Incremental X axis calculation
#24 = [#24*#22] ; Absolute Y calculation
#25 = [#25*#23] ; Absolute X calculation
X#25 Y#24 ; Movement in X & Y axis
IF [#21 LT 360] GOTO 10 ; Restart if less than 360 degree motion
IF [#21 GT 360] GOTO 20 ; If final angle becomes greater than 360 degrees recalculate
IF [#21 EQ 360] GOTO 30 ; Finish if total angle is equal to 360 degree
N20 #21 = 360
GOTO 10
N30 G40 X0
G0 G90 Z100 M30

G65 Macro for an Increasing Radius

Drawing/Image


CNC Program

;A = #1 (Start Angle 0 degrees)
;B = #2 (Start Radius)
;C = #3 (Increment angle for accuracy calculations.)
;I = #4 (Finish Angle)
;J = #5 (Finish radius)
;K = #6 (Milling feed)

O2222
T5 M6
G0 G90 G40 G21 G17 G94 G80
G54 X35 Y0 S500 M3
G43 Z100 H?
Z5
G1 Z-0.5 F200
G65 P8999 A0 B35 C0.01 I70 J37 K500
G0 G90 Z100 M30

O8999
#7 = #4 / #3 ;1) Total no. of moves 70 / 0.01
#8 = [[#5 - #2] / #7] ;2) Increase in radius 37-35/7000
N1 #2 = #2 + #8 ;3) Next Radius i.e. 35+inc. radius.
#1 = #1 + #3 ;4) Increase in angle
#9 = #2 * COS [ #1 ] ;5) New X axis position
#10 = #2 * SIN [ #1 ] ;6) New Y axis position
G1 X#9 Y#10 F#6 ;7) Feed move to new positions
;8) If new angle is less than finish angle go to line N1.
IF [#1 LT #4] GOTO 1
G0 Z10
M99

G65 Macro for Internal Helical

CNC Program

T? M6 (THREADMILL)
G0 G90 G40 G21 G17 G94 G80
G54 X? Y? S? M3 (Move to bore centre)
G43 Z? H?
;
G65 P1002 A? B? D?
(A = THREAD DIAMETER)
(B = PITCH)
(D = RADIUS OFFSET NUMBER)
M30

O1002
#11=[[#1*0.8]/2]
#12=[[#1/2]-#11]
;
G91 Y#12
G41 X#11 D#7
G3 X-#11 Y#11 R#11 Z#2/4
J-[#1/2] Z#2
X-#11 Y-#11 R#11 Z#2/4
G1 G40 X#11
G0 G90 Z100
M99

G65 Macro for a Counterbore

 

CNC Program

T? M6 (ENDMILL)
G0 G90 G40 G21 G17 G94 G80
G54 X? Y? S? M3 (Move to bore centre)
G43 Z? H?
;
G65 P1001 A? D?
(A = C/BORE DIAMETER)
(D = RADIUS OFFSET NUMBER)
M30

O1001
#11=[[#1*0.8]/2]
#12=[[#1/2]-#11]
G91 Y#12
G41 X#11 D#7
G3 X-#11 Y#11 R#11
J-[#1/2]
X-#11 Y-#11 R#11
G1 G40 X#11
G0 G90 Z100
M99
 
 
 
 


***********************************

CNC Programming Examples - CNC Milling Machine

CNC Mill Example Program G01 G02 G03 G90 G91


* Best ebooks for CNC programming: 
CNC Programming Basics 
G-Code and M-Code 
CNC programming 
G-Code Reference 
CNC Machine Tutorial 

A cnc mill program for cnc machinists programmers, who have started to learning basic cnc programming techniques.
Contents


CNC Mill Example Program




CNC Program

        N40 G90 G00 X0 Y0
        N50 G01 X-10 Y-20 R8         (P1)
        N60 G01 X-50 R10             (P2)
        N70 Y10                      (P3)
        N80 X-19.97 Y25.01           (P4)
        N90 G03 X7.97 Y38.99 R18     (P5)
        N100 G01 X30 Y50             (P6) 
        N110 G91 X10.1 Y-10.1        (P7)
        N120 G90 G02 X59.9 Y20.1 R14 (P8)
        N130 G01 X70 Y10             (P9)
        N140 Y-20 R10                (P10)
        N150 X50                     (P11)
        N160 G03 X30 R10             (P12)
        N170 G01 X10 R8              (P13)
        N180 X0 Y0

G M S T Codes Explanation

Code Description
G00 Rapid traverse
G01 Linear interpolation
G02 Circular interpolation CW
G03 Circular interpolation CCW
G90 Absolute command
G91 Increment command

-------------------------------------------------------------------

CNC Mill Programming Example

CNC mill program example for cnc machinists.


CNC Mill Programming Example

CNC Program

            G0 X-60 Y0
            G1 X-70                  (P1)
            G2 X-25.02 Y25.97 R30    (P2)
            G1 X2.46 Y10.13          (P3)
            G3 X8.5 Y10.92 R5        (P4)
            G1 X18.79 Y21.21         (P5)
            G2 X25.13 Y-26.05 I21.21 J-21.21 (P6)
            G1 X-5 Y-8.66            (P7)
            G3 X-12.14 Y-11.13 R5    (P8)
            G2 X-70 Y0 R30           (P1)
            G1 X-60

G M S T Codes Explanation

Code Description
G00 Rapid traverse
G01 Linear interpolation
G02 Circular interpolation CW
G03 Circular interpolation CCW




I Will Make A Manufacturable 3d Model And A Cnc Program For It 
I Will Do Cnc Program For Molding, Laser Cutting Fusion 360 Cam 
I Will Cnc Programming On Mastercam 
I Will Make G Code Or Cnc Program For Your Design 
I Will Create CNC Programs For You

G02 G03 Example CNC Mill

G02 G03 Circular interpolation CNC mill example program.

G02 G03 Example CNC Mill

CNC Part Program

                G0 X30 Y-30             (P1)
                G1 Y22.67               (P2)
                G3 X24.07 Y26.18 R4     (P3)
                G2 X-18.27 Y23.46 R50   (P4)
                G3 X-23.46 Y18.27 R4    (P5)
                G2 X-23.46 Y-18.27 R50  (P6)
                G3 X-18.27 Y-23.46 R4   (P7)
                G2 X24.07 Y-26.18 R50   (P8)
                G3 X30 Y-24.67 R4       (P9)
                G1 X33

G M S T Codes Explanation

Code Description
G0 Rapid traverse
G1 Linear interpolation
G2 Circular interpolation CW
G3 Circular interpolation CCW
M30 End of program (Reset)

--------------------------------------------------------------------------------------------


Multiple Arc CNC Mill Program G2 G3 I J

CNC milling machine program which combines/joins multiple arcs.

Multiple Arc CNC Mill Program G2 G3 I J

CNC Part Program

                    N10 M6 T1 G43 H1 M3
                    N15 S500 F120
                    N20 G0 X0 Y0              (P1)
                    N25 G1 Y20                (P2)
                    N30 G3 X-15 Y35 I-15 J0   (P3)
                    N35 G2 X-45 Y35 I-15 J0   (P4)
                    N40 G3 X-60 Y20 I0 J-15   (P5)
                    N45 G1 Y0                 (P6)   
                    N50 G1 X0                 (P1) 
                    N55 M30

G M S T Codes Explanation

Code Description
G0 Rapid traverse
G1 Linear interpolation
G2 Circular interpolation CW
G3 Circular interpolation CCW
G43 Tool length compensation + direction
M3 Spindle start forward CW
M6 Tool change
M30 End of program (Reset)
T Tool
S Speed
F Feed

---------------------------------------------------------------------

Haas Corner Rounding and Chamfering Example G01 C R


Haas Corner Rounding and Chamfering

Haas CNC program example to show how Chamfer and Corner Radius can be programmed.

Haas Chamfering

To program Chamfer
N10 G01 X20 Y30 ,C3

Haas Corner Rounding

To program Radius
N10 G01 X20 Y30 ,R3

Haas Corner Rounding and Chamfering Example


Haas CNC Program

                        O1234 (Corner Rounding and Chamfering Example);
                        T1 M6;
                        G00 G90 G54 X0. Y0. S3000 M3; (P1)
                        G43 H01 Z0.1 M08;
                        G01 Z-0.5 F20.;
                        Y40. ,R10.;            (P2)    
                        X50. ,C5.;             (P3) 
                        Y0.;                   (P4)
                        G00 Z0.1 M09;
                        G53 G49 Z0.;
                        G53 Y0.;
                        M30;

Haas G M S T Codes

Code Description
G00 Rapid Motion
G01 Linear Interpolation Motion
G43 Tool Length Compensation +
G49 G43/G44 Cancel
G53 Non-Modal Machine Coordinate Selection
G54 Select Work Coordinate System l
G90 Incremental Programming
M3 Spindle On, Clockwise (S)
M6 Tool Change (T)
M08 Coolant On
M09 Coolant Off
M30 Program End and Reset
S Spindle speed
T Tool


>> Ebooks for CNC Programming