Welcome to Our Community

Unlock hidden features. Sign Up for Free Today!

GRBL Controller Issues

Discussion in 'Controller Boards' started by Muse, Apr 18, 2016.

Tags:
  1. Muse

    Muse New
    Builder

    Joined:
    Apr 18, 2016
    Messages:
    1
    Likes Received:
    0
    Im running GRBL 0.9i on a scratch built machine

    Im having a couple of problems because im using standard measurement as opposed to metric and the machine setup readout stays in metric.

    Instead of writing a long novel im just going to bullet point my major problems.

    -I have $N0=G20F7.8 but the machine forgets to set itself to standard when I boot up and that screws up my homing process. it's dropping G20 for some reason.

    -The machine homes to the switches from where I start it but resets its zero once it hits them so it doesnt return to where I want it after it homes. It just reads "Alarm Lock" after it reports that it is OK

    - My workable area is 1054 in all axes but it keeps giving me a "soft limit" reached error.

    Any and all assistance is GREATLY appreciated as, at this point, I am clawing in the dark here. Thank you all.

    ~M
     
  2. Steve Fox

    Steve Fox Veteran
    Builder

    Joined:
    Feb 22, 2015
    Messages:
    122
    Likes Received:
    16
    I've never been able to get soft limits to work on my machine, so I turned it off ($20=0).
    I have home pull-off set to 5mm ($27=5.000). I was having problems with no pull-off.
    I also found out that once I hit one of the limit switches, the machine reverts to metric and I have to reset it to metric, move one of the axes and set it back to inches.
     
  3. Rob Taylor

    Rob Taylor Veteran
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    139
    Likes Received:
    28
    Eww, imperial. Why'd ya wanna do that?! :p I only started looking at grbl a few days ago, but...

    $N0=G20 should work. Have you also tried setting $13=1? There may also be other imperial elements that probably ALL have to be changed to work together. I had a program randomly change G21 to G20 during its run, I'm still not entirely sure why. I was trying to test sub-mm motions and kept being very confused when it kept moving 5-12mm at a time!

    Possibly sounds like a debounce problem? Try changing $26. From the sounds of its description, $27 might be an issue in play as well.

    Do you have a real time DRO readout in your interface? Check what it's claiming as the work position when your machine starts complaining about soft limits. I'm not sure exactly how it could suddenly think it's past the limit, it seems like a prioritisation error, maybe: if you set safe distances from different points (eg. soft limits vs homing pull-off), one may say the machine's safe, the other may say it's out of bounds.

    Plus, there's a big difference between 1054" and 1054mm! Looks like grbl itself only accepts system settings in SI units, too, so make sure everything's converted appropriately (0.5" is a good $27, but 0.5mm might still engage switches!).

    I'm having a slightly hard time parsing the wording of the grbl GitHub wiki here, so I may have misunderstood something. I imagine @Sonny Jeon could be more specific.
     
  4. Sonny Jeon

    Sonny Jeon Veteran
    Staff Member Moderator Builder

    Joined:
    Aug 6, 2015
    Messages:
    110
    Likes Received:
    36
    Everything in Grbl's settings are in mm, steps, min, and sec. The units are given in the '$$' print out, next to the descriptions.

    The $N0=G20F7.8 should work after homing. Grbl will execute the startup lines immediately after homing completes.

    There was a problem with soft limits in a brief window of Grbl v0.9 versions, where the soft limit would pause the machine and not tell you. A '~' resume command would exit the pause and start the soft limit. That has since been fixed.

    Most problems with soft limits and homing are related to how Grbl sets its origin. When homing is complete, GRbl sets the machine space in all negative coordinates. Or the origin in back right corner of the machine (3d printers put it in the front left instead for different reasons!) This origin position is the standard operation of production CNC machines. Users often try to move to somewhere in positive space and get a soft limit error. Or their work coordinate (G54-G59) offsets are non-zero and not related to the homed position correctly.

    To set the machine in positive space or correct the offsets, you have to alter the G54 (-G59) work coordinate system(s). It's very simple to do. Just look at the G10L2 and G10L20 commands in the LinuxCNC gcode descriptions.

    Lastly, soft limits operate by looking at the MACHINE coordinates, not work coordinates. If they have a motion that moves the machine into positive machine space or (-) axis travel, it'll throw a soft limit alarm. Always look at the machine coordinates relative to your work coordinates. It will make more sense if you do.
     
  5. Rob Taylor

    Rob Taylor Veteran
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    139
    Likes Received:
    28
    This makes a lot of sense. Not having a complete machine and not yet testing limit switches, I haven't run into this yet, but I'll certainly try to bear this in mind. I've seen a lot of coordinate confusion on my travels, I'm hoping to avoid that myself, since I have to press it into commercial service in short order.

    Interesting. Haven't run into these yet at all (other than noticing the G54 etc. buttons in the bCNC GUI). Found the top level of the LinuxCNC guide, though: LinuxCNC "G-Code" Quick Reference

    Ah, good catch! I meant machine, not work. Not much use in using user-set parameters for absolute positioning!
     
  6. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder

    Joined:
    Aug 6, 2013
    Messages:
    521
    Likes Received:
    250
    from the GRBL-panel wiki
    so you do want to do a
    $13=1
    to tell GRBL to default to inches. GRBL-panel will then display inches.

    Even so, Gcode can still be in inches or in mm, never assume the state of the machine is what you want, always put G20 or G21 in the header of the Gcode to make it absolutely clear what is going on.

    for the limit settings, you should read
    Configuring Grbl v0.9 · grbl/grbl Wiki · GitHub
    seems to me you either use soft limits OR you use hard limits.
     
  7. Rob Taylor

    Rob Taylor Veteran
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    139
    Likes Received:
    28
    Seems like there should be a Wiki page specifically on configuring a machine for permanent use in imperial measurements.

    Absolutely, I ran into this during testing. I'm assuming that despite working top-to-bottom in metric, one of my G-code or DXF conversions threw an imperial measurement in there for some reason. Pays to do a find-and-replace to check that you don't have any weird codes in there that you don't want. Unfortunately, machines just do what they're told!

    You may be right. "Hard limit work basically the same as soft limits, but use physical switches instead." I assumed, like everyone else, that the soft limits were there to avoid the hard limits being triggered and everything shutting down. But that implies that they're a replacement. I dunno, like I said before, it's a little difficult to parse the exact meanings of some parts of that Wiki. Shame, because it's otherwise one of the cleanest and most informative Wikis of any FOSS package I've ever come across!
     
  8. Sonny Jeon

    Sonny Jeon Veteran
    Staff Member Moderator Builder

    Joined:
    Aug 6, 2015
    Messages:
    110
    Likes Received:
    36
    Rob: You're unfortunately right that Grbl's Wiki could use more work, and I haven't had the time (or motivation) to update it in a while. However, it is a Wiki and users are encouraged to help, if possible. Could you possibly help in telling me what you'd like to add to the Wiki to help other users avoid the same problems you had? We could work together on this.
     
  9. Rob Taylor

    Rob Taylor Veteran
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    139
    Likes Received:
    28
    Haha, I totally get that. Once I'm actually building my machine (couple weeks, maybe?) and I'm looking harder at the limits and coordinate spaces stuff, I'll definitely get in touch and make some edit suggestions.

    I realised that grbl is more or less the "flash to an arduino and you're done" mass-market software that I was attempting to wend my way toward conceptualising and writing here: Open Software A-Z CAM | OpenBuilds - so instead of doing that, I'd rather just contribute a bit here and there to the grbl project.
     
  10. Steve Fox

    Steve Fox Veteran
    Builder

    Joined:
    Feb 22, 2015
    Messages:
    122
    Likes Received:
    16
    Sonny,

    I'm having a hard time wrapping my head around these concepts. They just seem backwards to me from a coordinate system concept. If I place an object at the origin, that means the size of the object is -4" x -5" for example as opposed to 4" x 5".

    I have my machine set up so the origin is in the lower left corner. This could also be considered as the upper right corner, with me standing off of the upper edge of the machine. I have the coordinate system set up so that X and Y are both positive from the origin. I had to reverse the homing to get the X and Y to home towards the origin.

    It seems to me that this orientation makes more sense if the table moves instead of the tool, like on a milling machine. While the table moves in negative directions, the tool moves in positive directions.

    That being said, I have some questions.

    If I decide to keep the origin in the lower left corner, what other settings do I need to change? For instance, I know that I've never been able to get the soft limits to work.

    Would it be possible/beneficial to add a switch in the software that would reverse the entire coordinate system with one bit instead of having the need to make changes to many variables in nonconsecutive locations?

    Is there a benefit for me to change the origin so that it is an all negative coordinate system?

    Is the default to place the material in the upper left corner (lower left in my case) and route so that it comes out upside down? Or, am I supposed to figure out what the maximum X and Y dimensions are and use that as the origin and place the material there? I don't know of anyone who has the origin set in the upper right corner and stands at the bottom of the machine.

    I understand that GRBL is set up with the origin in the upper left corner because all commercial CNC machines are set up that way. I just can't figure out how to make it work with the machine I have in such a way that it makes sense to me.

    Thanks for your help,
    Steve Fox
     
  11. Sonny Jeon

    Sonny Jeon Veteran
    Staff Member Moderator Builder

    Joined:
    Aug 6, 2015
    Messages:
    110
    Likes Received:
    36

    A lot of questions. I'll try to answer most of them and make this clearer. If you search on the web, I've probably answered this question a few dozen times. It all comes down to a user needing to understand and start utilizing work coordinate systems, which are extremely useful and the main reason to have homing at all. Work coordinate systems allow you to pre-set locations all around your machine and repeatably come back to them within the error of your limit switches.

    How machine coordinates are situated should not effect you at all. Whether they are positive or all negative or a mix. As long as they are consistent, that's all that really matters. This is because Grbl and all CNC machines move in their work coordinate systems. Not machine coordinates.

    There are 6 work coordinate systems in Grbl (G54,G55,G56,G57,G58, and G59). They can all be set independently of each other to set a unique origin anywhere in the machine. For example, you can place a work coordinate origin in the front-left-top corner of the machine by doing this. Home the machine. Move the tool to the left-front-top corner. Set the work coordinate system here to [0,0,0] with the G10L20P0X0Y0Z0 command. It'll set the current work coordinate system to 0,0,0 and all motions from this point will be in positive space.

    A piece of stock is still all positive lengths. Not negative. Grbl's default origin just placed in the standard right-rear-top part of the machine.

    Again, the reason for this is mostly from historical reasons. The origin has always been placed in the right-rear-top corner of a milling machine. True it does make more sense if it's a CNC with moving table and the table would home to right in front of you. But most production CNC mills have moving tables, rather than a gantry.

    And doubly again, you can have Grbl set the origin wherever the homing cycle completes by uncommenting HOMING_FORCE_SET_ORIGIN in config.h, re-compile, and flash.
     
  12. Steve Fox

    Steve Fox Veteran
    Builder

    Joined:
    Feb 22, 2015
    Messages:
    122
    Likes Received:
    16
    I thought the main reason for homing was so the software could determine where the hardware is.

    I saved your answer concerning work coordinate systems last week and I haven't had time to spend on it. I have some free time next week and plan on working on it then.

    I guess that GRBL was so easy to set up and get working, it wasn't necessary for me to go any further.

    And that's the rub. It's not true that a part is all positive lengths when making the right rear corner the origin. I use Aspire and if I set the origin to the right rear corner, all the dimensions are negative. That makes it doubly difficult to make computations because when going from left to right or bottom to top, for instance, the coordinates gets smaller, not larger. I know a part can't have a negative length, but try to tell that to Aspire.

    Very frustration and to me seems much more complicated than necessary,
    Steve Fox
     
  13. Rob Taylor

    Rob Taylor Veteran
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    139
    Likes Received:
    28
    In that case, allow grbl to home in the back right as it wants to and set machine position there, but set your G54 coordinates with jog+G10L20P1 (or, say, G10L2P1X-450Y-450 or whatever) to have 0,0,0 at the front left?

    Far as I can tell, grbl doesn't care where the machine vs work coordinates are at, as long as everything falls within your soft or hard limits. Aspire, I assume, doesn't care if your machine coordinates are offset as long as your work coordinates are telling it that it's in positive space. (Also, I assume it actually wouldn't care if you tried to cut a negative dimension, it's purely mathematical). So just use grbl to lie to Aspire?
     
  14. Sonny Jeon

    Sonny Jeon Veteran
    Staff Member Moderator Builder

    Joined:
    Aug 6, 2015
    Messages:
    110
    Likes Received:
    36
    Steve. Please understand that machine coordinates don't do much of anything in reality. It's completely arbitrary once you learn how to use work coordinates, which is how you're supposed to be using your machine with homing enabled. Also, please understand that CAM programs don't care about machine coordinates either. They almost always set a G54 work coordinate system at the start of a program and never use machine coordinates directly unless explicitly told to do so.

    So Aspire should work fine with Grbl once you get work coordinate systems figured out. There are ton of resources online explaining work coordinate systems and how they operate. Please take the time to do this and everything will make much more sense.

    I know that having machine coordinates in negative space is confusing as to why, but it's the way it is. So complaining about it won't change this. Believe me I've been trying to explain this to people for 5 years, since I first installed homing and work coordinate systems into Grbl. This is historical in nature, and Grbl follows the standard that have been set in place for decades. Again, if you find this behavior still too annoying to deal with, you can always uncomment HOMING_FORCE_SET_ORIGIN in Grbl's config.h source code, re-compile it, and flash.
     
  15. Rob Taylor

    Rob Taylor Veteran
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    139
    Likes Received:
    28
    BTW, this is what I get when I input "G10L2P1X-450Y-450". Nothing moves, nothing changes, just the work coordinates flick from saying I'm at 0,0,0 (eg. from homing) to what you see below.

    G10L2P1X-450Y-450.JPG

    If I hit "Move to Origin", the machine moves into negative territory. (Or would, if I'd built it yet- for now, the steppers move correctly :p)
     
  16. Steve Fox

    Steve Fox Veteran
    Builder

    Joined:
    Feb 22, 2015
    Messages:
    122
    Likes Received:
    16
    I never complained, I was just trying to learn.
    Sorry to have bothered you.
     

Share This Page

  • About Us

    The OpenBuilds Team is dedicated helping you to Dream it - Build it - Share it! Collaborate on our forums and be sure to visit the Part Store for all your Building needs!
  • Like us on Facebook

  • Support Open Source FairShare Program!

    OpenBuilds FairShare Give Back Program provide resources to Open Source projects, developers and schools around the world. Invest in your future by helping others develop theirs!

    Donate to FairShare!