G01 Code Examples

G01 Code

G01 is a CNC code and used to linear interpolation (usually for cutting) for CNC machines. The G01 usage is same for CNC lathe and CNC Milling machines. Cutting motion is done in a linear plane with the G01 code.

G01 Code Examples for CNC Lathe

Example - 1

In this example, we used G01 code for outer diameter turning.

O0002 ;
N10 G50 S2000 T0100 ;
G96 S180 M03 ;
G00 X70.5 Z5.0 T0101 M08 ;
G01 Z-100.0 F0.25 ;
G00 U2.0 Z0.5 ;
G01 X-1.6 F0.23 ;
G00 X65.0 W1.0 ;
G01 Z-54.5 F0.25 ;
G00 U2.0 Z1.0 ;
X60.0 ;
G01 Z-54.5 ;
G00 U2.0 Z1.0 ;
X55.0 ;
G01 Z-30.0 ;
X60.0 Z-54.5 ;
G00 U2.0 Z1.0 ;
X50.5 ;
G01 Z-30.0 ;
X60.3 Z-54.7 ;
X72.0 ;
G00 X150.0 Z200.0 T0100 ;
M01 ;
N20 G50 S2300 T0300 ;
G96 S200 M03 ;
G00 X55.0 Z5.0 T0303 M08 ;
Z0 ;
G01 X-1.6 F0.2 ;
G00 X46.0 Z3.0 ;
G42 Z1.0 ;
G01 X50.0 Z-1.0 F0.15 ;
Z-30.0 ;
X60.0 Z-55.0 ;
X68.0 ;
X70.0 W-1.0 ;
Z-100.0 ;
G40 U2.0 W1.0 ;
G00 X150.0 Z200.0 M09 T0300 ;
M30 ;

Example - 2

In this example, we used G01 code for outer diameter turning. We will not use any cycle in this program example.

O0000 ;
N10 (ø30 Drilling) ;
G50 T0200 ;
G97 S250 M03 ;
G00 X0 Z5.0 T0202 M08 ;
G01 Z-5.0 F0.07 ;
W1.0 ;
Z-40.0 F0.25 ;
G00 Z5.0 ;
Z-39.0 ;
G01 Z-60.0 ;
G00 Z10.0 ;
X200.0 Z200.0 T0200 ;
M01 ;
N20 (Outer Diameter Cutting) ;
G50 S1500 T0100 ;
G96 S180 M03 ;
G00 X94.0 Z5.0 T0101 M08 ;
G01 Z-14.8 F0.27 ;
G00 U2.0 Z0.5 ;
G01 X28.0 F0.23 ;
G00 X87.0 W1.0 ;
G01 Z-14.8 F0.27 ;
G00 U2.0 Z1.0 ;
X80.5 ;
G01 Z-14.1 ;
G02 X81.9 Z-14.8 R0.7 ;
G00 X100.5 W1.0 ;
G01 Z-29.8 ;
G00 U2.0 Z-1.0 ;
G01 X60.5 F0.23 ;
G00 X82.0 W1.0 ;
Z-2.4 ;
G01 X60.5 ;
X72.9 ;
G03 X80.5 Z-6.2 R3.8 ;
G00 U2.0 Z5.0 ;
X200.0 Z200.0 T0100 ;
M01 ;
N30 (Rough boring) ;
G50 S1500 T0400 ;
G96 S180 M03 ;
G00 X34.5 Z3.0 T0404 M08 ;
G01 Z-41.8 F0.27 ;
G00 U-0.5 Z1.0 ;
X39.5 ;
G01 Z-15.0 ;
X34.5 Z-24.3 ;
G00 Z10.0 ;
X200.0 Z200.0 T0400 ;
M01 ;
N40 (Outer Diameter Finish) ;
G50 S1800 T0500 ;
G96 S200 M03 ;
G00 X63.0 Z5.0 T0505 M08 ;
Z0 ;
G01 X38.0 F0.2 ;
G00 X60.0 Z3.0 ;
G42 Z1.0 ;
G01 Z-2.5 F0.2 ;
X74.0 ;
G03 X80.0 Z-5.5 R3.0 ;
G01 Z-13.5 ;**
G02 X83.0 Z-15.0 R1.5 ;
G01 X100.0 ;
Z-30.0 ;
X103.0 ;
G40 G00 U2.0 W1.0 ;
G00 Z10.0 ;
X200.0 Z200.0 T0500 ;
M01 ;
N50 (Finish for boring) ;
G50 S1800 T0600 ;
G96 S200 M03 ;
G00 X40.0 Z5.0 T0606 M08 ;
G41 Z1.0 ;
G01 Z-15.0 F0.2 ;
X35.0 Z-24.33 ;
Z-42.0 ;
X29.0 ;
G40 G00 Z10.0 ;
X200.0 Z200.0 T0600 M09 ;
M30 ;

Example - 3

In this example, we used G01 command for outer diameter turning. We will not use any cycle in this program example, G02 will be used.

CNC Lathe G01 and G02 Code Axis Movement for Beginners

N5 G00 X20.Z2 ;
N10 G01 Z-30. F0.2 ;
N15 X43.094 Z-50. ;
N20 G02 X51.754 Z-52.5 I4.33 K2.5 ;
N25 G01 X70. ;
N30 Z-100. ;

Example - 4

In this example, we used G01 command for outer diameter turning.

CNC Lathe G01 Example Outside Diameter Turning for Beginners

N20 S1500 ;
N25 G00 X25.2 Z2. ;
N30 G01 Z-49.9. F0.3 ;
N35 G00 X27.5 Z-48. ;
N40 Z2. ;
N50 G96 S125 ;
N55 G50 S1800 ;
N60 G01 X0 Z0 F0.15 ;
N65 X25. ;
N70 Z-50 ;
N75 X55. ;
N80. Z-7.5 ;
N85 X90 ;
N90. Z-90 ;
N95 G00 X92.Z5 ;
N100 G97. ;
N105 G95 ;

Example - 5

In this example, we used G01 code for outer diameter and taper turning.

Absolute Programming

N05 G54;
N10 T0101;
N15 G00 X150. Z100.;
N20 S1800 M03;
N22 G95;
N25 G00 X65. Z2.;
N30 G01 Z0. F0.3;
N35 G01 X80. Z–20.;
N40 G01 Z–120.;
N45 G01 X102.;
N50 M05;
N55 G00 X150. Z100.;
N60 M30;

Incremental Programming

N05 G54;
N10 T0101;
N15 G00 X150. Z100.;
N20 S1800 M03;
N22 G95;
N25 G00 U–85. W–98.;
N30 G01 W–2. F0.3;
N35 G01 U15.W–20.;
N40 G01 W–100.;
N45 G01 U22.;
N50 M05;
N55 G00 U49. W220.;
N60 M30;

Example - 6

In this example, we used G01 command for outer diameter turning with corner.

O0001;
N10 G50 S1500;
G96 S160 M03;
G00 X100.5 Z5.0 T0101 M08;
G01 Z-95.0 F0.25;
G00 U2.0 Z0.5;
G01 X-1.6 F0.2;
G00 X95.0 W1.0;
G01 Z-37.3 F0.25;
X100.0 Z-45.5;
G00 Z1.0;
X90.0;
G01 Z-29.8;
X95.0 Z-37.3;
G00 Z1.0;
X85.0;
G01 Z-22.3;
X90.0 Z-29.8;
G00 Z1.0;
X80.5;
G01 Z-15.55;
X85.0 Z-22.3;
G00 X200.0 Z200.0 M09;
M01;
N20 G50 S2000;
G96 S200 M03;
G00 X85.0 Z5.0 T0303 M08;
Z0;
G01 X-1.6 F0.2;
G00 X80.0 Z3.0;
G42 Z1.0;
G01 Z-15.0 F0.18;
X100.0 Z-45.0;
Z-95.0;
G40 U2.0 W1.0;
G00 X200.0 Z200.0 M09;
M30;

Example - 7

In this example, we used G01 command for facing in CNC Lathe machines.

N10 G54;
N15 T0101;
N20 G00 Z120. Z120.;
N25 S1800 M03;
N30 G00 X105. Z-4.;
N35 G01 X0. F0.2;
N40 G00 Z0.;
N45 G00 X105.;
N50 G00 Z-8.;
N55 G01 X0. F0.2;
N60 G00 Z0.;
N65 M05;
N70 G00 X120. Z120.;
N75 M30;

Example - 8

In this example, we used G01 command for outer diameter turning in CNC Lathe machines.

Absolute Programming

N10 G54;
N15 T0101;
N20 G00 X60. Z60.;
N30 G95;
N40 S1200 M03;
N50 G00 X36. Z5.;
N60 G01 Z–80. F0.7;
N70 G01 X43. F0.7;
N80 G00 X60. Z60.;
N90 M30;

Incremental Programming

N05 G54;
N10 T0101;
N20 G00 X60. Z60.;
N30 G95;
N40 S1200 M03;
N50 G00 U–24. W–55.;
Z–55;
N60 G01 W–85. F0.7 5;
N70 G01 U7. F0.7;
N80 G00 U17. W140.;
N90 M30;

Example - 9

In this example, we used G01 command for grooving in CNC Lathe machines.

O0001;
N10 G50 S500;
N20 G00 T0202;
N30 G96 S80 M03;
N40 G00 X70. Z0. M08;
N50 G00 Z-45. ;
N60 G01 X50. F0.1;
N70 G00 X80. M09;
N80 G00 Z50. ;
N90 M30;

Example - 10

In this example, we used G01 command for face grooving in CNC Lathe machines.

O0001;
N10 G50 S500;
N20 G00 T0303;
N30 G96 S100 M03;
N40 G00 X15. Z5.;
N50 G00 Z1. M08;
N60 G01 Z-5. F0.1;
N70 G00 Z14. M09 ;
N80 G00 X84.;
N90 M30;

Example - 11

In this example, we used G01 code for face drilling in CNC Lathe machines.

T04 = 8mm drill
T06 = 16mm drill

O0001;
N10 G54;
N20 T0404;
N30 G00 X85. Z85. ;
N40 S1000 M03;
N50 G00 X0. Z3.;
N60 G01 Z-28. F0.4;
N70 G00 X3.;
N80 G00 X85. Z85. ;
N90 T0606;
N100 S800 M03;
N110 G00 X0. Z3.;
N120 G01 Z-28. F0.5;
N130 G00 Z3.;
N140 G00 X85. Z85. ;
N140 M30;

Example - 12

In this example, we used G01 code for boring in CNC Lathe machines.

O0002;
N10 G54;
N20 T0707;
N30 G00 X90. Z90.;
N40 S1000 M03;
N50 G00 X39. Z5.;
N60 G01 Z-62 F0.4;
N70 G01 X23. F0.4;
N80 G00 Z1.;
N90 G00 X43.;
N100 G01 Z-62. F0.4;
N110 G01 X23. F0.4;
N120 G00 Z1.;
N130 G00 X45.;
N140 G01 Z-62. F0.4;
N150 G01 X23. F0.4;
N160 G00 Z1.;
N170 G00 X90. Z90.;
N180 M30;

Example - 13

In this example, we used G01 code for outer diameter turning in CNC Lathe machines.

N5 G00 X0.Z2. ;
N10 G01 Z0. F0.25
N15 X24. ;
N20 X30.Z-3. ;
N25 Z-22. ;
N30 G02 X36. Z-25. R3 ;
N35 G01 X50. ;**
N40 G03 X61.592 Z-29.447 R6. ;
N45 G01 X70. Z-45. ;
N50 Z-55. ;
N60 G02 X80. Z-60. R5 ;
N65 G01 X94. ;**
N70 G03 X100. Z-63. R3 ;

G01 Code Examples for CNC Milling

Example - 1

In this example, we used G01 code for linear motion in CNC milling machines.

Tool Diameter : 5mm
Depth : 5mm

O0001;
N15 G54 ;
N20 G90;
N90 T02 M6;
N92 G94 F500;
N95 S2000 ;
N100 M03;
N105 G43 G0 Z100 H2;
N110 G00 X21 Y64;
N115 G00 Z5;
N120 G01 Z–5;
N130 G01 Y34;
N135 G00 Z5;
N140 G00 X62 Y30;
N145 G01 Z–5;
N150 X93 Y58;
N155 G00 Z5;
N160 X90 Y95;
N165 G01 Z–5;
N170 X30;
N175 G00 Z200;
N195 M05 M09;
N205 M30;