GRBL: inaccurate on X axis by ~4 mm on 400 mm This is GRBL-related. I have a laser-engraver type machine, Chinese, ~550 mm X axis, aluminium extrusions, 2mm-pitch T belt, Nema 17H3430 motors, one mechanical homing switch for X, Arduino-based.

The X-axis accuracy is not up to par. When I make a mark on the X axis and jog to that mark (after homing), depending on the day, the position varies within ~4 mm or so. Sometimes I have to use G00 X-418, others G00 X-422.

I checked the belt tension, it seems OK, not too tight, not too loose. Is there something else I should check?

Another idea I have: put a homing switch on the other end of the X-axis, then home both ends of the X-axis, measuring the difference in machine position, then modify the steps/mm value for each session to force the command that puts me on the mark to be constant (e.g. G00 X-420). Any other ideas? Thanks.
This seems to be either a case of either belt slop or missed steps or it is a case of the accuracy of the limit switch. 

If the limit switch moves even a little into either direction, you have to account twice that as the maximum error. So the 4 mm error could come from 2 mm into either direction from the 0-position.

However, there is a silver lining: Laser engraving, just like CNC, usually first dials in the 0 regarding the workpiece instead of the 0 of the machine. As long as the machine's movement is ok, you should be fine even without tightening the mounting of the X-endstop. I suggest to run the following test to find out what kind of error actually hounds you though:


Mount a waste piece
Go to a position on the workpiece
Run the laser for a split second
X10
Run the laser for a split second
Repeat 4&amp;5 till you have 10 points
Measure the real distances between the dots engraved


If the distances are always the same but short, you have the wrong steps/mm set and need to adjust them accordingly. If the distances are inconsistent, you have either lost steps or a sloppy belt. To fight lost steps, carefully up the signal to the motor a little. If the results don't change from that, tighten the belt a little - it should sing like a guitar string.