CNC Programming Examples - G40 G41 G42

CNC Mill Subprogram Example Joining Multiple Arcs G02 G03 G41


CNC milling program to describe how two or more radii can be joint together in a cnc mill program.


* Best ebooks for CNC programming:

+ CNC Programming Basics 
+ G-Code and M-Code 
+ CNC programming 
+ G-Code Reference
+ CNC Machine Tutorial 
+ CNC M-Code Tutoria

CNC Mill Subprogram Example

CNC Part Program

N10 T1 H1 M6 G43 M3
        N20 F150 S250
        N30 G0 X-21 Y50 Z0.5
        N40 G0 Z0
        N50 M98 P040050
        N60 G49
        N70 G0 Z50
        N80 M30

Subprogram

O0050
        N10 F160 S400
        N20 G0 Z-2.5 G91
        N30 G1 G90 X5 Y50 G41      (P1)
        N40 G2 X22 Y85.23 I45 J0   (P2)
        N50 G3 X78 Y85.23 R45      (P3)
        N60 G2 X78 Y14.77 R45      (P4) 
        N70 G3 X22 Y14.77 R45      (P5)
        N80 G2 X5 Y50 R45          (P1)
        N90 G0 G40 X-21
        N100 M99

G M S T Codes Explanation

Code Description
G00 Rapid traverse
G01 Linear interpolation
G02 Circular interpolation CW
G03 Circular interpolation CCW
G40 Cutter compensation cancel
G41 Tool nose radius compensation left
G43 Tool length compensation + direction
G49 Tool length compensation cancel
G90 Absolute command
G91 Increment command
M03 Spindle start forward CW
M06 Tool change
M30 End of program (Reset)
M98 Subprogram call
M99 End of subprogram
T Tool
S Speed
F Feed

CNC Mill Program G91 G41 G43

CNC milling program examples shows the use of G91 G41 G43 G-codes.
Contents

CNC Mill Program G91 G41 G43


CNC Part Program

N05 G54
            N10 M6 T1 G43 H1 M3
            N15 S500 F120
            N20 G0 X-22 Y-22
            N25 Z-3
            N30 G1 X3 Y6 G41 H2   (P1)
            N35 G91 X0 Y24        (P2)
            N40 X12 Y9            (P3)
            N45 X36               (P4)
            N50 Y-24              (P5)
            N55 X-21              (P6) 
            N60 G90 X3 Y6         (P1)
            N65 G0 X-21 G40

G M S T Codes Explanation

Code Description
G00 Rapid traverse
G01 Linear interpolation
G40 Cutter compensation cancel
G41 Tool nose radius compensation left
G43 Tool length compensation + direction
G54 Workpiece coordinate system 1 selection
G90 Absolute command
G91 Incremental command
M06 Tool change
T Tool
S Speed
F Feed

G41 G40 Cutter Radius Compensation Example CNC Mill Program

Cutter Radius Compensation Example program shows how G41, G40 can be used in a cnc mill program.
Cutter Compensation code used in this program are,
  • G41 Cutter Radius Compensation Left
  • G40 Cutter Radius Compensation Cancel

Cutter Radius Compensation Example


G41 G40 Cutter Radius Compensation Example
N5 G00 G54 G64 G90 G17 X20 Y-20 Z50
                N10 S450 M03 F250 D01 (12.5 MM DIA)
                N15 C0
                N20 Z5
                N25 G01 Z0
                N30 Z-5
                N35 G41 X0 Y0
                N40 X-48
                N45 X-68 Y72
                N50 X-28
                N55 Y44
                N60 X12 Y32
                N65 X0 Y0
                N70 G40 X20 Y-20
                N75 G00 Z50
                N80 Y100
                N85 M30
Finished Part
After machining process completion, component will look like

Cutter Radius Compensation Example Finished Part
Explanation of CNC G-Code
G00 : Rapid traverse.
G54 : Zero Offset no. 1.
G64 : Continuous-path mode.
G90 : Absolute dimensioning system.
G17 : X-Y plan selection.
G41 : Cutter radius compensation activation (left hand side movement)
G40 : Cutter radius compensation de-active
S : Spindle speed
F : Axis motion feed
M : Cutter rotation (3=clockwise, 4=anti-clockwise)
D : Tool offset no

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

Siemens Sinumerik Milling Programming Example

A very simple cnc milling program example which will show cnc machinists the use of Siemens Sinumerik milling programming concepts.
This program is written for 4-axis cnc mill, where C is used for rotary table.
But a simple cnc mill can also run this program just remove program block N15
Contents
  • Sinumerik Milling Program
    • Finished Part
    • Explanation of G-Code

Sinumerik Milling Program


Sinumerik Mill Programming Example
N5 G00 G54 G64 G90 G17 X-20 Y-20 Z50
                    N10 S450 M03 F250 D01 (12.5 MM DIA)
                    N15 C0
                    N20 Z5
                    N25 G01 Z0
                    N30 Z-5
                    N35 G42 X0 Y0
                    N40 X30
                    N45 Y30
                    N50 X0
                    N55 Y0
                    N60 G40 X-20 Y-20
                    N65 G00 Z50
                    N70 Y100
                    N75 M30

Finished Part

After the machining is complete, this finished part will look like this


Finished Part

Explanation of G-Code

G00 – Rapid traverse.
G54 – Zero Offset no 1.
G64 – Continuous-path mode.
G90 – Absolute dimensioning system.
G17 – X-Y plan selection.
G42 – Cutter radius compensation activation
G40 – Cutter radius compensation cancel
M03 – Cutter rotation clockwise
S – Spindle speed
F – Axis motion feed
D – Tool no

CNC Lathe Programming Exercise Fanuc G71 Turning Cycle, G74 Peck Drilling Cycle

CNC programming exercise for cnc lathe machinists who work on Fanuc cnc control (or similar cnc control).
This cnc programming exercise use
Fanuc G71 Turning Cycle
Fanuc G74 Peck Drilling Cycle

CNC Lathe Programming Exercise


CNC Lathe Programming Exercise Fanuc G71, G74 Cycles
N10 G40 G00
                        N20 G99
                        N60 T0101
                        N70 G50 S3500
                        N80 G96 S0240 M4
                        N90 G00 X72. Z0.1
                        N100 G01 X-1.6 F0.12 M7
                        N110 G00 X150. Z150.
                        N120 M5
                        N130 M9
                        N140 T0303
                        N150 G97 S2500 M3
                        N160 G00 X0. Z3.
                        N170 G01 Z-6. F0.1 M7
                        N180 G00 Z2.
                        N190 G00 X150. Z150.
                        N210 T0707 M7
                        N220 G97 S0884 M3
                        N230 G00 Z3.
                        N240 G00 X0.
                        N250 G74 R1.0
                        N260 G74 X0.0 Z-68.326 Q18000 F0.22
                        N380 G00 X200.
                        N400 G00 Z100.
                        N500 T0404 M7
                        N510 G50 S3500
                        N520 G96 S0240 M4
                        N530 G00 Z1.
                        N540 G00 X70.
                        N550 G71 U4. R1
                        N560 G71 P570 Q650 U0.6 W0.2 F0.35
                        N570 G42 G00 X24.
                        N580 G01 Z0.
                        N590 G01 X28. Z-2.
                        N600 G01 Z-72.
                        N610 G02 X32. Z-74. I2. K0.
                        N620 G01 X62.
                        N630 G01 X68. Z-77.
                        N640 G01 Z-90.
                        N650 G40
                        N660 G00 X150.
                        N680 G00 Z70.
                        N690 T0202 M7
                        N700 G50 S4500
                        N710 G96 S0380 M4
                        N720 G00 X16. Z3.
                        N730 G42 G01 Z0. F0.1
                        N740 G01 X24.
                        N750 G01 X28. Z-2.
                        N760 G01 Z-72.
                        N770 G02 X32. Z-74. I2. K0.
                        N780 G01 X62.
                        N790 G01 X68. Z-77.
                        N800 G01 Z-90.
                        N810 G40
                        N820 G00 X150. Z150.
                        N830 M5
                        N840 M9
                        N850 M30

Used Tools & Operations

  • T0101 Turning Tool – Rough Facing
  • T0303 Center Drill – Center Drilling
  • T0707 Twist Drill – Drilling
  • T0404 Turning Tool – Rough Turning
  • T0202 Turning Tool – Finish Contour Cutting

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

Fanuc G73 Pattern Repeating Cycle CNC Program Example Code

CNC programming example for Fanuc G73 pattern repeating cycle.
Fanuc G73 Pattern Repeating Cycle has already been described here
CNC Fanuc G73 Pattern Repeating Cycle
You might like other Fanuc G73 pattern repeating cycle examples
CNC Fanuc G73 Pattern Repeating Cycle CNC Program Example
Fanuc G73 Pattern Repeating Canned Cycle Basic CNC Sample Program


Fanuc G73 Pattern Repeating Cycle Programming Example

This cnc program example also shows how cnc machinists can use ‘W’ instead of ‘Z’ for z-axis movements.
Fanuc G73 Pattern Repeating Cycle Program Example
N010 G00 X260.0 Z80.0
                            N011 G00 X220.0 Z40.0
                            N012 G73 U14.0 W14.0 R3
                            N013 G73 P014 Q020 U4.0 W2.0 F0.3 S0180
                            N014 G00 G42 X80.0 Z2.0
                            N015 G01 W-20.0 F0.15 S0600
                            N016 X120.0 W-10.0
                            N017 W-20.0 S0400
                            N018 G02 X160.0 W-20.0 R20.0
                            N019 G01 X180.0 W-10.0 S0280
                            N020 G40
                            N021 G70 P014 Q020
                            N022 G00 X260.0 Z80.0
                            N023 M30

--------------------***--------------------
Reference books
--------------------***--------------------
--------------------***--------------------

[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 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 - Ramping Milling

CNC Mill Subprogram Example Joining Multiple Arcs G02 G03 G41

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

CNC milling program to describe how two or more radii can be joint together in a cnc mill program.
Contents

CNC Mill Subprogram Example


CNC Part Program

N10 T1 H1 M6 G43 M3
        N20 F150 S250
        N30 G0 X-21 Y50 Z0.5
        N40 G0 Z0
        N50 M98 P040050
        N60 G49
        N70 G0 Z50
        N80 M30

Subprogram

O0050
        N10 F160 S400
        N20 G0 Z-2.5 G91
        N30 G1 G90 X5 Y50 G41      (P1)
        N40 G2 X22 Y85.23 I45 J0   (P2)
        N50 G3 X78 Y85.23 R45      (P3)
        N60 G2 X78 Y14.77 R45      (P4) 
        N70 G3 X22 Y14.77 R45      (P5)
        N80 G2 X5 Y50 R45          (P1)
        N90 G0 G40 X-21
        N100 M99

G M S T Codes Explanation

Code Description
G00 Rapid traverse
G01 Linear interpolation
G02 Circular interpolation CW
G03 Circular interpolation CCW
G40 Cutter compensation cancel
G41 Tool nose radius compensation left
G43 Tool length compensation + direction
G49 Tool length compensation cancel
G90 Absolute command
G91 Increment command
M03 Spindle start forward CW
M06 Tool change
M30 End of program (Reset)
M98 Subprogram call
M99 End of subprogram
T Tool
S Speed
F Feed

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

Slot Milling a Sample CNC Program Example

A very simple cnc milling program example which shows how a simple slot can be machined.
Another such program example which mills a pocket the same way but in a taper is here CNC Milling Machine Programming Example for Beginners.

Slot Milling Program Example


Slot Milling Sample CNC Program
N10 G00 G90 X70 Y25 Z1 S800 M3
            N20 Z-5
            N30 G01 X20 F150
            N40 G00 Z100
            N50 X-25 Y50
            N60 M30
N10 Spindle on clockwise rotation at 800 rev/min, tool rapid traverse to P01.
N20 Infeed in Z.
N30 Tool traverse P01 to P02, feedrate 150 mm/min.
N40/N50 Rapid traverse retraction.
N60 End of program.



CNC Milling Machine Programming Example for Beginners

CNC Mill Program Example

A very simple cnc milling machine programming tutorial for beginner level cnc machinists.
An easy to understand cnc mill programming code. This is a cnc g code example without the use of any cnc canned cycle.
Related cnc mill program examples
  • CNC G02 Circular Interpolation Clockwise CNC Milling Sample Program
  • CNC Milling Circular Interpolation G02 G03 G-Code Program Example
Beginner level cnc program examples for CNC Lathe
  • Fanuc CNC Program Example
  • CNC Programming for Beginners a Simple CNC Programming Example
  • CNC Programming for Beginners a CNC Programming Example

CNC Milling Machine Programming Example for Beginners
N05 G0 G90 X40 Y48 Z2 S500 M3
                N10 G1 Z-12 F100
                N15 X20 Y18 Z-10
                N20 G0 Z100
                N25 X-20 Y80
                N30 M2
N05 The tool traverses in rapid traverse on P1, three axes concurrently, spindle speed = 500 rpm, clockwise
N10 Infeed on Z-12, feed 100 mm/min
N15 Tool travels on a straight line in space on P2
N20 Retraction in rapid traverse
N30 End of program