GRBL Lead-Screw Configuration

Calculating The Pitch Of A Lead-screw


1.  Measure 1 inch on a set of calipers.

2. Place the caliper left prong over the crests of the thread (the middle).

3. Count threads from left to right counting the first crest as half as the caliper is in the middle of a thread. So above we have 1/2, 1 , 1 , 1 and a 1/2 so we have 4. 4 revolutions per inch.

4. Divide the inches by the number of threads to get the pitch which in this case would be 1 inch / 4 revolutions equals a pitch of 0.25

Setting The Steps Per Millimetre

The revolutions per inch are converted to millimetres and the following data and formula is used to get the steps per mm.

R * M * (1/T) = Micro-steps per mm


(M) Motor step for a full revolution

Check your motor data sheet for this. For me it is 200 steps per full revolution of the motor.

(R) Driver micro-stepping resolution

This is set by the jumper on the CNC controller board. Mine is set to 16 micro steps per one step of the motor

(T) Screw revolutions per mm.

Explained as above mine is 2mm travel per 1 revolution of the lead-screw.

Using my specs as an example:

16 micro-step resolutions * 200 steps per revolution of the motor * (1 / 2 mm travel per revolution of the lead-screw) = 266.66 micro steps per mm.

Enter the axis value micro-steps per mm value accordingly by issuing the command i.e. for the X axis $100 = xxx where xxx is the value so mine would be;


So that’s the mathematical way of doing it. But say we don’t have any data sheets for the motor or the CNC board that tells us details such as motor step revolutions and micro-step resolution? Well you would have to do this manually in a trail and error kind of way. This is easy but a bit time consuming and I would do this in the following way;

1. Lay a ruler (or preferably a set square) across the waste-board in parallel with the x-axis, clamp this down so it can’t move.

2. Attach a pencil or pointer, something with a pointed tip into the router.

3. Move the router so the pointer points to zero on the ruler (or a division of 10)

4. Use the ‘jog’ feature in you software to job the x-axis by 10mm. This could also be done by issuing the G-Code command G91 G0 X10 or G91 G0 X-10

5. Check how far this has travelled across the ruler.

6. Increase or decrease the X value micro-steps per mm value accordingly by issuing the command $100 = xxx where xxx is the decimal value for the travel.

The following table show the commands for setting microsteps per mm.

Axis Command Description
X $100=250.000 X steps/mm
Y $101=250.000 Y steps/mm
Z $102=250.000 Z steps/mm

I also want to set up the max rate of travel for the axis’s.  This will allow the controller to back off slighty if a move exceeds this amount. This is done by changing the max rate of mm travel per minute per axis using the $110, $111, $112 commands along with a value for the X,Y and Z axis respectively.

The following table show the commands for setting Max rate per mm/min.

Axis Command Description
X $110=250.000 X Max rate, mm/min
Y $111=250.000 Y Max rate, mm/min
Z $112=250.000 Z Max rate, mm/min

After this there The value is defined by driving one of the axis the full or near to the full length of travel of the machine, if the axis travels the length and doesn’t stall then the value is increased by something like 10%. The process is completed until a stall occurs. How can you identify a stall? Well the motor stops turning and it sounds like a cross between someone shooting a spaceinvaider out of the sky and a cat being run over. It doesn’t damage the motor but I would refrain from doing it too many times just in case. When a stall occurs the speed is reduced a little and repeat until we can travel at top speed without stalling. This value will be different for each of the axis. For example my y-axis on my machine will stall at a lower speed to that of my x-axis as the y-axis drive the gantry which consist of both the x-axis, z-axis and the router. The x-axis on the other hand only has to drive the z-axis and router so there is less work to do.

NOTE: For safety it’s best to ease off from the top value around 10 – 20% to take into account wear and material friction.

There is another setting that goes hand in hand with the above, and that is the axis acceleration mm/sec^2. This determines how uick we can accelerate the lower the slower, higher will results in tighter quicker moves and reaches the desired feed rates much quicker. Again this is set using the sme method as above and backing off 10-20%.

The following tables show the configuration commands described in this post

Axis Command Description
X $120=10.000 X Acceleration, mm/sec^2
Y $121=10.000 Y Acceleration, mm/sec^2
Z $122=10.000 Z Acceleration, mm/sec^2

Be the first to comment

Leave a Reply

Your email address will not be published.