CT63, all mechanical systems are subject to some amount of backlash. We obviously do as much as possible to reduce it via physical means, but getting the last 0.05mm can be tricky.
While we all wait for a solution from CNCdrive, I have something that might help. I have written some code in Lua that takes in a gcode file as input, then outputs that file with appropriate compensation moves added.
I've tested it extensively, including on a live machine, and it seems to work nice. Use at your own risk ofc :>
Code is here:
https://pastebin.com/y5ryM1rw
To run the code you'll need to install Lua for Windows:
https://github.com/rjpcomputing/luaforwindows/releases
Using a text editor, create a file called compensate.lua and paste this code inside.
Measure your machine's backlash in X, then set "backlash" on line 4 of the code.
Put your input.tap file in the same folder.
Open a command prompt (windows key + R, then type cmd)
Navigate to the folder with the files. Then run the compensation procedure by typing:
lua compensate.lua > output.tap
When you run the resulting file, to ensure correctness, start the program with your spindle at or very close to the origin, and the most recent move in X was to the right, ie positive. This is so that the backlash starts in a known place.
The code supports G0, G1, G2 and G3.
G2 and G3 can be specified either with the "R" parameter, or the "I" and "J" parameters.
Any other commands will simply be copied to the output without modification.
It doesn't currently support multiple work offsets, rotating or translating the work offset, any of the canned cycles etc.
I used the following suite of automated tests during development to ensure correct output:
https://pastebin.com/LHqXD21s
I also prepared a gcode file with all different possible configurations of arcs to ensure they all work correctly:
Any questions please ask. I hope this helps someone. :>