The original post was for a Variable Pitch thread, starting with a 1/4" pitch (6.34mm) increasing uniformly as the shaft rotated to 3/4" pitch (19.04mm) at 24" (609mm) from the starting point.
My example is how to drive a rotary axis (A) in sync wih the linear (X axis) to produce such a thread. Such a thread is definitely unusual, which actually could be described as a Linear Cam, and not really a machine Thread.
The use of G90 and G91 make this possible in a continuous manner. The G90 code means all dimensions are Absolute, i.e., if the mill is at X0, Y0, Z0, A0 and the first line of code in a routine is G90, followed by G01 X5 F20, the mill table will move from X0.00 to X5.000 Y0.0 Z0.0 A0.0.
If this code is in a routine, and is repeated, such as the loop in my example, the machine will NOT move again, because it is already at X5.000.
The G91 code means all dimensions are treated as an INCREMENTAL move, and every time a loop is read, such as the example, each time a value for X5 is read, it will move again that distance. If the loop containing X5 is read (4)times, the machine table will be at X20.000.
The difference in millimeters to inches is by a factor of 25.4. To change from an inch dimension, divide the INCH dimension by .0394, which is the Inch Decimal equivalent of 1mm. One inch divided by .0394 = 25.4
The .0394 value is rounded to 4 places for simplicity; 1 divided by 25.4 actually = .039370079
I suggest your question about a metric dimensioned screw be a new topic.
If you want to cut a thead using a rotary axis as my example shows, you do not use an increment factor in the loop.
John