Welcome to Our Community

Some features disabled for guests. Register Today.

Backlash Compensation on CNC machine

Discussion in 'CNC Mills/Routers' started by JTjepkema, Jan 14, 2021.

  1. JTjepkema

    JTjepkema New
    Builder

    Joined:
    Jan 14, 2021
    Messages:
    2
    Likes Received:
    0
    Currently I'm trying to improve the accuracy of the probing of my cnc machine running on the grbl firmware. In order to do this I want to implement backlash compensation using software since I'm streaming the Gcode to the controller by using Pyserial. However, I'm pretty sure that grbl does not offer backlash compensation with built-in features.

    My solution to this was to try to detect when the machine changes directions for a certain axis and then let the machine move by the backlash distance first and only then resuming with the next command. During the backlash compensation move I would like the machine coordinate system not to change since this is what the probing commands use as a reference. However, I have not figured out how to do this yet.

    Any suggestions would be very welcome.
     
  2. Rob Taylor

    Rob Taylor Master
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    1,470
    Likes Received:
    746
    To do this with 8-bit grbl, you'd have to write a post-processor (even a stand-alone command line one) to parse the code and at every direction change insert a line of code to take up the lash and another line (G10 L20 P1 or whatever) to reset the work coordinates to what they're supposed to be. Not even bCNC has a backlash comp method built in, and no one's gonna bother at this point with an official 32-bit grbl coming out before too much longer (it's already in the xPRO V5). They'll wait and see what that brings first.

    Realistically it's a choice between grblHAL or LinuxCNC if you need to move to backlash comp in the short term. grblHAL requires 32-bit hardware like a Teensy 4.1, and if you look at the git you can find backlash comp references. LinuxCNC of course requires a Linux-capable machine with a parallel port at a minimum, usually a full PC, but then your sender and controller is in a single device. That can cost some money to optimize performance though.
     
  3. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    13,751
    Likes Received:
    4,070
    Christian James likes this.
  4. Rob Taylor

    Rob Taylor Master
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    1,470
    Likes Received:
    746
    Hahaha that was gonna be my third paragraph but then I completely forgot about it. Even with comp, getting physical lash as low as possible is important.

    If it's lead screw, that's easy. If it's ball screw, that's trickier, but not impossible.
     
  5. JTjepkema

    JTjepkema New
    Builder

    Joined:
    Jan 14, 2021
    Messages:
    2
    Likes Received:
    0
    Thanks for all the replies!

    While I agree that fixing the mechanics would be best, I would like to see if a software based solution could work as well. I did some further research and I believe that it is only possible to get the probing coordinates in the machine coordinate system. Since these are fixed, changing the coordinate system turns out not to be an option. Since I do not have a linux based machine, I have tried some other solutions using Grbl first.

    The best solution that I found was to just post-process the sampled points such that the backlash is accounted for. While this is a bit complicated, it seems to be working out reasonable well so far. I will do some further testing to see if it is an good solution.
     
  6. Christian James

    Christian James Journeyman
    Builder

    Joined:
    Jun 8, 2018
    Messages:
    434
    Likes Received:
    210
    I really can't see how it would make sense to tolerate a "floppy" machine, relying on software to correct the slop. Just get the machine right, then you should be good.
     
    Peter Van Der Walt likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice