Dear All,

could you please help me troubleshooting a problem?

Inputs:
Boards: arduino uno, arduino mega, GRBL firmware installed on them
Motor driver: DM542
Steppers: NEMA23, NEMA17
Sender sw: GRBL candle
Test Gcode: a simple gcode that creates a d=3mm hole with 3.2 mm depth by 0.1mm steps, and with G1 commands only. (No G2/G3) The test takes about 1.5 mins. I run it without any load, and with the motor only.

Result:
The motor on Z axis doesn't go back to the starting position. I marked the shaft with a pen, and recognise ~20 degrees differency. I tested it with 3 NEMA23 and 1 NEMA17, the results are the same. At this point we could think the problem is the motor driver, BUT if I run the commands from the Gcode file that contains only the Z movement, it's perfectly accurate! If it contains the X-Y movements as well, it fails! I tried to run the test with only one driver and one motor only, but I experienced the same problem. The longer the project, the bigger the inaccuracy. I tested it on 2 types of boards, and the results are the same as well.

What the hell is going on? Have you experienced something similar? Any idea?
Thanks for your help!