G-code academy

G01 - Linear interpolation

Code G01 is designed to perform tool movement in a straight line at a given speed. The main difference between the G01 code and the G00 is that with linear interpolation, the tool moves at a given speed. Movement speed is indicated by the F command.
Conventionally, a frame for linear interpolation is written as follows:

G01 Xn.n Yn.n Zn.n F n.n
G01 Xn.n Yn.n Zn.n An.n Bn.n Cn.n Fn.n

Consider the following simple program:

X0Y0 - zero position
G00X0Y0Z-5 - lowering the cutter along the z axis by -5mm
G01X30Y50F50 - moving the tool to a point (30; 50) with a working feed speed of 50 mm / min
G00X30Y50Z10 - raising the cutter along the z axis by 10mm

Rapid positioning
Let's complicate the program a bit. Let's write a program cutting a polygon.

G00Z10 ;raise the cutter to a safe position from the workpiece
G00X0Y0 ;zero position
G01X0Y0Z-5F50 ;lowering the cutter along the axis on z by -5 with a working feed speed of 50 mm / min
G01X30Y50F50 ; moving the tool to a point (30; 50) with a working feed speed of 50 mm / min
G01X30Y100 ;moving the tool to a point (30; 100)
G01X0Y150 ;moving the tool to a point (0; 150)
G00X0Y150Z10 ;raising the cutter along the axis by z by 10
G00X0Y0 ;move to zero position

Rapid positioning
The speed value can be set once. You can also shorten your code. Short code will look like this:

G00Z10
G00X0Y0
G01Z-5F50
G01X30Y50
G01Y100
G01X0Y150
G00Z10
G00X0Y0

Let's try to write a program for a more complex figure:

G00F300 ;for G00 commands we set the speed to 300
G01F300 ;for G01 commands we set the speed to 300
M03S24000 ;turn on the spindle at a speed of 24000 rpm
G00Z3 ;raise the cutter to a safe position
G00X25.325Y47.45 ;moving the tool to a point (25.325; 47.45)
Z-0.03 ;axis milling cutter axis z -0.03
X31.275Y29.275 ;move tool to point
X50.675Y29.325 ;moving the tool to a point
X34.95Y18.125 ;move the tool to a point
X41Y0 ;move tool to point
X25.325Y11.25 ;move tool to point
X9.625Y0 ;move tool to point
X15.675Y18.125 ;move tool to point
X-0.05Y29.325 ;move the tool to a point
X19.35Y29.275 ;moving the tool to a point
X25.325Y47.45 ;move the tool to a point
G00Z3 ;raising the cutter along the axis by z by 3
M05 ;spindle shutdown
G00X0Y0 ;move to zero position

Rapid positioning