Another important setting is the travel adjustment. The tool's travel along the axes depends on the screw pitch on your machine, the driver settings, and the values set in the UGS, for example.
After connecting the Arduino Uno control system, you may find that the actual axis travel does not match the values specified in the G-code. This deviation must be measured and adjusted controller.
In a CNC system with an Arduino Uno, CNC Shield V3 and DRV8825 drivers, the linear travel of the tool is determined by three parameters: the number of full steps of the motor per revolution, the selected microstepping mode of the driver, and the lead of the screw (the distance the nut moves in millimetres per one full revolution of the screw). A typical stepper motor has 200 full steps per revolution (1.8° per step), but this value must always be taken from the motor’s datasheet. The total number of effective steps per revolution is obtained by multiplying the motor’s full steps by the microstepping factor set by the jumpers on the CNC Shield; for example, with DRV8825 in 1/32 mode the driver generates 200 × 32 = 6400 microsteps per one turn of the screw. To calculate how many steps per millimetre the axis will have, you divide the total steps per revolution by the screw lead in millimetres:
steps_per_mm = (motor_steps_per_rev × microsteps) / screw_lead_mm
Then, the obtained values must be entered into the UGS settings:
X-axis → $100
Y-axis → $101
Z-axis → $102
If the screw has an 8 mm lead, a 200-step motor and DRV8825 set to 1/32 microstepping, then steps_per_mm = (200 × 32) / 8 = 800; this value is later entered into the GRBL configuration for the corresponding axis. The inverse calculation gives the linear travel per one microstep of the driver: you simply divide the screw lead by the total number of steps per revolution,
travel_per_step_mm = screw_lead_mm / (motor_steps_per_rev × microsteps)
and in the same example travel_per_step_mm = 8 / 6400 = 0.00125 mm per microstep. Using these two formulas, you can precisely relate the electronic settings (step angle and microstepping) to the mechanical movement of the tool for any axis of the machine.