Welcome! Log In Create A New Profile

Advanced

Software Backlash Compensation

Posted by georgeflug 
Software Backlash Compensation
January 22, 2013 10:55PM
On my reprap I have been unable to mechanically eliminate backlash. I tried compensating for backlash using the lash plugin in skeinforge but my results did not come out right. After looking at the generated gcode, I discovered the lash plugin does not use the best method for compensating for backlash. Whenever there is a direction reversal, the lash plugin looks at the next destination point and then adds a backlash amount (for example, 0.2mm) to the coordinates of that point. This results in the printer correctly reaching the destination despite backlash. However, I discovered the printer does not start at the correct point using this method.

Not being familiar with programming python or skeinforge plugins, I wrote a separate piece of software that modifies the gcode file by altering both the start and end points whenever there is a direction reversal. I call this the "no lash" compensation tool. You can see the actual results I achieved in the picture below. I am able to print a nearly perfect circle despite having 0.24 and 0.30 mm of backlash on my axes.


I also drew up a quick image that illustrates the differences in the two backlash compensation algorithms.


So with that, I have attached my software and code. It was written in C# using .NET 4.0.

Does anyone have any suggestions or criticisms for this tool?
Is it possible to completely eliminate backlash without software?
Is software a worthy tool to compensate for hardware backlash, or should everyone focus their efforts on eliminating the problem at the source?

Thanks!
Attachments:
open | download - NoLash.zip (54.3 KB)
Re: Software Backlash Compensation
January 23, 2013 06:42AM
Quote

Is it possible to completely eliminate backlash without software?

Yes.

Quote

Is software a worthy tool to compensate for hardware backlash

No. At least not at speeds above zero. Software requires a pause at each direction change, as backlash compensation can't be infinite quick.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Software Backlash Compensation
January 26, 2013 08:28PM
Thanks for the feedback, Traumflug. I was not able to eliminate backlash in my setup but I will continue to work on it!

At speeds above zero, backlash compensation will cause a speed loss for each direction change. However, it does not take much time to move a small amount. On my setup, I run a feedrate of 45 mm/s with backlash compensation at 0.30 mm. That's 0.0067 seconds per direction change (plus any overhead such as microprocessor time, which I will assume is ideal at 0 seconds). To lose 10 minutes during a print, you would need 1500 direction changes which would require a large print or a print with many small infills. Those who need efficient productivity out of their machine may find this time loss unacceptable, others won't notice it.
Re: Software Backlash Compensation
February 03, 2013 05:33PM
This looks like a really great tool, but I ran into an error, which I copied and recorded here (http://pastebin.com/8qB7AP3N) for you to take a look at. If you could fix that or tell me how to work around that I would love it! Thanks.
Re: Software Backlash Compensation
February 03, 2013 06:04PM
Okay I actually found the first problem when my friend looked at the code. Your code needed the file to have an appendix of '_export.' So I did that and ran the program again and instead got this error (http://pastebin.com/cZnmyVqE). My friend didn't know how to fix this one so some help would be appreciated. Thanks.
Re: Software Backlash Compensation
February 05, 2013 10:43PM
Thanks for giving the tool a test run. The error you saw said "Input string not in correct format." I'm curious what the input string looked like; can you send me the gcode file you were working with? Just to be clear, this tool edits the file exported from skeinforge so make sure you select a gcode file, not an stl model or any other file.
Re: Software Backlash Compensation
February 05, 2013 11:05PM
No problem. I'm using slic3r, not skeinforge, but it is a gcode file so I had hoped it might work.

I used woodsmokes backlash guide (http://www.woodsmokeworkshop.com/wordpress/?p=359) and I was going to try running the calibration print through your software and see if it could give me some better results because slic3r currently doesn't have anything to compensate for backlash.

I attached the gcode file I was trying to use as well.
Attachments:
open | download - Lashmaze_export.gcode (119.2 KB)
Re: Software Backlash Compensation
February 05, 2013 11:34PM
This file should work for you. slic3r added comments to the gcode using the semicolon character that the code was not expecting. I have modified the code to ignore the comments. I also fixed the error where the code expected the filename to end with "_export".

I noticed that woodsmoke's Lash Maze print consists only of vertical and horizontal lines. Both the skeinforge backlash compensation and the NoLash backlash compensation should work equally well for this print. When you move away from strictly vertical and horizontal lines, you should see improvement when using the NoLash tool over the skeinforge module.

I have not used slic3r and did not know that it lacked backlash compensation so I'm glad that my tool can also fill that gap!

Edited 1 time(s). Last edit at 02/05/2013 11:36PM by georgeflug.
Attachments:
open | download - NoLash.zip (55.6 KB)
Re: Software Backlash Compensation
February 06, 2013 12:10AM
Great! Thank you! I downloaded your new program and it successfully processed my gcode. I will hopefully try a print tomorrow and see how it goes.
Re: Software Backlash Compensation
February 07, 2013 08:12PM
Unfortunately, my printer is having some issues with its hot end, so I am not going to be able to print something using the program until I get it resolved. I ordered some new parts so hopefully I can have it back up sometime next week and give you some feedback on how well the software is working for me.
Re: Software Backlash Compensation
April 21, 2013 10:51AM
georgeflug Wrote:
-------------------------------------------------------
> Is it possible to completely eliminate backlash
> without software?
> Thanks!

You don't need to completely eliminate backlash. You just need to reduce it enough so that it is not significant. If you can get it down to about 0.15mm or 0.005 inches, that is probably good enough for machines of this type.

I think you could get an adjustable split nut and reduce it enough.
Re: Software Backlash Compensation
July 08, 2013 09:14PM
The backlash option is the only reason i am toying with Skeinforge right now. If your tool works well i will use it 100% and keep using Slic3r for now. I to am not able to get less than about .010" of lash in my machines. Ive built two machines and bought one and they all have about the same amount of lash.
Re: Software Backlash Compensation
July 08, 2013 09:24PM
I tried it and i get an error that it is not a valid win32 aplication. Any chance you can make it compatible with winXP 32?

And IMO software is a valid way to eliminate backlash. Heck i run a shop with about 20 CNC machines and every one of them use software to account for backlash. If its good enough for a $100,000 CNC machine its good enough for me.
Re: Software Backlash Compensation
July 08, 2013 09:49PM
GITRDUN Wrote:
-------------------------------------------------------
> The backlash option is the only reason i am toying
> with Skeinforge right now. If your tool works well
> i will use it 100% and keep using Slic3r for now.
> I to am not able to get less than about .010" of
> lash in my machines. Ive built two machines and
> bought one and they all have about the same amount
> of lash.


Repitier firmware has backlash compensation and you can use any slicer you want.


FFF Settings Calculator Gcode post processors Geometric Object Deposition Tool Blog
Tantillus.org Mini Printable Lathe How NOT to install a Pololu driver
Re: Software Backlash Compensation
July 10, 2013 11:09PM
The software should work in Win32 but you have to have the .Net framework installed. I think I made it under the 4.0 framework which can be downloaded here:
[www.microsoft.com]

If you already tried that then let me know and I can find a 32-bit box and see what happens on my end. Might take a couple days though. smiling smiley Also feel free to PM a gcode file over to me and I can quickly process it so that you can see if it gives you the results you want.

Like Sublime said firmware backlash compensation should also work great and Repetier is the only one I know that does it.
Re: Software Backlash Compensation
July 14, 2013 02:08AM
Hi,

I ported this code to Java so it can more easily run on Linux / MacOS etc. It also runs without a GUI so it can be plugged into slic3r as a postprocessing script for automatic execution when you slice. I have attached an executable Jarfile (which also contains the src etc), and the code is also in github at: [github.com] (see there for the README)
Attachments:
open | download - NoLash.jar (6.9 KB)
Re: Software Backlash Compensation
November 30, 2017 08:59AM
Hi all,

All the versions of software mentioned in this post only does linear movement, G0, G1 etc.
However, arc movements, G2 & G3 has not been coded.


I have create a web based GCode modifier that will allow for software backlash compensation.

All GRBL movements commands has been catered for (Including Arc G2 & G3) {in the X-Y plane only - not yet on Z} - since Z is mostly on one direction only, I do not see the point in doing it on Z.... gravity playing a factor as well.

My test so far has been successful with brilliant results (eliminiating backlash)

I have a few small bugs to work out, but if anyone is interested - please let me know - I need some sample G-Code to test ....
Re: Software Backlash Compensation
January 11, 2018 02:01PM
Hello,
I am very much interested to test out your webpage Gcode modifier smiling smiley
The software posted above seems to be giving me error message so I wasn't able to test with that sad smiley
Re: Software Backlash Compensation
July 02, 2018 01:03AM
Hi,

i have to do a little bit of digging in this old topic.
I have 3D printer with backlash (and i can't fix it mechanicaly).
Script above works quite nice, but generater another problem. Because it's another move added to gcode, printhead stops for a second in place, where backlash is compensated.
In this place small blob is appearing. Would it be possible, to add retraction before backlash compensation?
Or are there better scripts to compensate backlash?
I have duet WiFi in my printer.
Sorry, only registered users may post in this forum.

Click here to login