# Configuring Grbl on the WriteHand

Below are the settings I entered into Grbl to get the WriteHand up and operational, and the reasons I chose them. All those not mentioned I left at the default state. For an explanation on each, check the Grbl page here.

#### \$0 – Step pulse, microseconds

Looking at the datasheets for the A4988 stepper driver, it appears the step pulse length is rated at 1 microsecond. So I set \$0 = 1. This throws an error, so I reset it to \$0 = 3, which appears to be the minimum length allowable.

#### \$100 and \$101 – [X,Y] steps/mm

For a rough estimate, I calculated the steps per mm. Later I will find out the actual movement and tweak this number. To calculate the steps/mm, I measured the diameter of the timing belt around the stepper pully (~14mm) to find the circumference (~44mm). There are 200 steps  in one full rotation of the stepper motor, however I am using 1/8 micro-stepping, so I multiply this by 8, then I divide this 800 microsteps by 44 to get 36.364 steps/mm. \$100 = 36.364 and \$101 = 36.364.

#### \$110 and \$111 – [X,Y] Max rate, mm/min

To make sure the motors can move quickly, the maximum rates should be raised quite high, say, 200 mm/sec. Converts to 12,000 mm/min. I set mine as follows: \$110 = 12000\$111 = 12000.

#### \$120 and \$121 – [X,Y] Acceleration, mm/sec^2

I arbitrarily chose my initial acceleration to be 500 mm/sec^2. It has been working well, without missing steps when moving. \$120 = 500, \$121 = 500.

#### \$130 and \$131 – [X,Y] Max travel, mm

Using the manual stepping arrows in the Grbl Controller, I could easily find the maximum limits of each axis. My work space is roughly 300 mm x 250 mm. \$130 = 300, \$131 = 250.

Grbl also lets you create starting blocks. Starting blocks are g-code messages sent immediately after homing the machine. First, I set my feed rate (target movement speed) to 6000 and my spindle speed to 10 (a number 0-255 which determines the amount my servo moves to drop the pen). Second, since my machine homes to a less than optimal location for X=0 and Y=0, my machine moves to the negative direction the full length of the machine (300). G91 turns the machine to relative mode, to move -300x from where it was (0,0).

To program the starting block, I add the following:

\$N0 = F6000S10
\$N1 = G91X-300