The picture shows a variable pitch thread with constant tooth width. The initial pitch of this thread is 5mm, and the pitch increases by 1mm every time the spindle rotates. Tool width 3mm
Format: G34 X(U) Z(W) F K (incremental value of the pitch for one revolution of the spindle);
The format of some systems is G34 X(U) Z(W) F R (incremental value of the pitch for one rotation of the spindle);

G99;
T0101;
M3S150; (Because the pitch gradually increases, use low speed)
#1=2; (set the tooth height on one side)
#2=0.15; (feed amount per knife)
G0 X53 Z4; (positioning)
N1 G0 X[46+#1*2] Z[4+#1*TAN[15]]; (Quickly locate to the starting point, and the depth of one side tooth is 2mm, and the oblique type can be used
G34 Z-40 F4 K1;
G0 X53;
Z4;
#1=#1-#2;
IF [#1 LE 1.5] THEN#2=0.1;
IF [#1 LE 1] THEN#2=0.06;
IF [#1 LE 0.2]THEN#2=0.03;
IF [#1 GT 0] GOTO1;
G0 X46;
G34 Z-40 F4 K1;
G0 X100;
Z100;
M30




