Welcome to Our Community

Some features disabled for guests. Register Today.

GRBL Error 33: The motion command has an invalid target

Discussion in 'CNC Mills/Routers' started by Kerry Thurber, Feb 10, 2021.

  1. Kerry Thurber

    Builder

    Joined:
    Dec 23, 2020
    Messages:
    16
    Likes Received:
    5
    So I finally got my machine on line and ready to cut. I made a baseboard job and set it going. Immediately I get the error in the title

    GRBL Error: The motion command has an invalid target. G2, G3 and G38.2 generates this error, if the arc is impossible to generate or if the probe target is the current position.

    Here is the code up to the failure point:

    (Tooling at row 1, column 1.)
    (Advance to inside left edge)
    G0 X1.71 Y9.50
    (Lower the spindle)
    G1 Z-1.85 F100
    (Draw circle at [9.5,9.5] iteration 1, depth 1.85 accounting for tool width)
    G2 X17.30 Y9.50 I7.80 F400
    G2 X1.71 Y9.50 I-7.80 F400

    The error throws on the first G2 line. It performs on the simulator fine, and it sometimes! performs on the board. IOW, the probe target is not the current position and it is not impossible to generate. What am I missing? Do I need a GRBL update?
     
  2. sharmstr

    sharmstr OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 23, 2018
    Messages:
    2,030
    Likes Received:
    1,428
    No. You need a post processor that wont generate arc errors. What are you using?
     
    Peter Van Der Walt likes this.
  3. Kerry Thurber

    Builder

    Joined:
    Dec 23, 2020
    Messages:
    16
    Likes Received:
    5
    I made a C# app to code it. What should I be using? What do you use?
     
  4. sharmstr

    sharmstr OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 23, 2018
    Messages:
    2,030
    Likes Received:
    1,428
    For the spoilboard I use the wizard in OpenBuilds Control.

    For CAM I use either Fusion 360 or Vectric. Both have post processor that are compatible with grbl: docs:software:cam [OpenBuilds Documentation] The Fusion post has specific code that prevents the arc errors.

    If you google grbl arc errors you'll get a idea of what causes them and how to fix them.
     
  5. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    13,749
    Likes Received:
    4,070
    Your app isnt generating valid arcs. Either too much rounding, not enough decimals, or the math is just way off.
     
  6. Kerry Thurber

    Builder

    Joined:
    Dec 23, 2020
    Messages:
    16
    Likes Received:
    5
    Good answer. I did use rounding. How accurate does it need to be? I've rewritten to three decimal places, which is a micron. I'll try later today.
     
    Peter Van Der Walt likes this.
  7. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    13,749
    Likes Received:
    4,070
    base1379 likes this.
  8. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,237
    Likes Received:
    1,815
    G2 and G3 must have X Y I and J words, always, it is moaning about not having a J word.
    also make sure you are using incremental mode for the I and J words since that is what GRBL uses.
     
    sharmstr and Peter Van Der Walt like this.
  9. Kerry Thurber

    Builder

    Joined:
    Dec 23, 2020
    Messages:
    16
    Likes Received:
    5
    J is always 0, and it seems to work without a J word. I think the problem is that I lack decimal places.
     
  10. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,237
    Likes Received:
    1,815
    How accurate is needs to be depends on the radius of the arc. More accurate for small arcs. This is because GRBL checks for errors by comparing the 2 radii it calculates to be within a few percent of each other.
     
  11. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,237
    Likes Received:
    1,815
    'seems to work' is not the same as 'always works' (-: I advise putting in the J word now so that in a years time when you modify the code you will be reminded that it is needed. Self documenting code is the best code, because we programmers don't write documentation! <-:
     
    Kerry Thurber 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