Welcome to Our Community

Some features disabled for guests. Register Today.

Ask Grbl CNC questions here.

Discussion in 'Control Software' started by Sonny Jeon, Aug 12, 2015.

  1. Rob Taylor

    Rob Taylor Master
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    1,470
    Likes Received:
    748
    Because of the way grbl's streaming buffer works, you're probably gonna need to involve the GUI as well, I think, because it's the one doing the decision-making on whether to push the next line out or not depending on its estimate of the state of the buffer.

    You can listen for when the G38.2 is sent, but knowing when it's going to be executed requires listening for a specific return "ok", but those returns aren't labelled in any way, so you have to know whether it's a couple of long lines in the buffer ahead of it or a bunch of short lines!

    Since this is a step that doesn't require a lot of high-speed operation, it may be possible to command some kind of buffer flush without losing track of the program, such that the only command in the buffer becomes the G38.8, or you could send an initial empty or do-nothing (G91 G0 X0 Y0) line that generates an "ok" response for you to trigger your other system ahead of the G38.2 being executed. If that's possible, that's the way I would do it, but I haven't seen anything that accomplishes it thus far.

    The other thing here is that grbl has two buffers, the serial receive buffer and the planner buffer where it's actually executing from. I'm assuming that the GUI effectively only sees one buffer, and when grbl moves a line from the receive buffer to the planner buffer is irrelevant, only the "ok" received upon execution. Though since the receive buffer has a 128 char limit and the planner buffer has a 16-line limit, that seems like they could conflict at some point, and I'm not 100% sure how it's managed so that they don't. It's very hard to see exactly what's going to get executed when, because even if you know you've filled the buffer, you still don't know when those lines are precisely going to get executed down the ladder.

    Maybe the optimum- read, least-complex- method is simply to send a dedicated flag line to grbl, that does nothing but is simultaneously large, useless and unique to look for in the serial stream. A 126-char line, say, that does absolutely nothing (somehow, or maybe just something pointless and non-destructive like arcs) that always gets prepended to your G38.2 lines by a post-processor or find-and-replace. That way, you know for a fact that the only thing following it is the G38.2. Again, though, you don't know when the planning buffer is actually going to shift it into executable position.

    Hmmm. This is a tricky one... Important to figure out though, in terms of usefully extending grbl's capabilities within a larger system. I wish line numbers were used for send and receive. Lotta lost characters, though, in that small buffer, for 5- or 6-digit programs.

    For now, you may just have to have the spring hard-mounted to a side-wall somewhere so you can G53 over to it and operate that way. I'd rather figure out a sister-system solution though!

    EDIT:

    Two possible interesting things from config that could be worth looking into:

     
    #1021 Rob Taylor, Feb 19, 2020
    Last edited: Feb 19, 2020
  2. Steve77777

    Builder

    Joined:
    Feb 7, 2020
    Messages:
    5
    Likes Received:
    1
    hi

    Hi i have a mini cnc milling router, with grbl 0.9, just bought a new keystone board, it says machine connected but wont move when i send commands, just says connected but not idle, i'm new as you may tell, can you help please.
     
    PaulN likes this.
  3. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,921
    Likes Received:
    4,291
    Grbl 0.9 is quite old! Last version was in 2015, so most hosts applications these days will not work with it.

    Grbl 1.1 has been out for over 3 years now (Dec 2016) (and even that has been surpassed by newer versions too with 1.1h out since Aug last year) see gnea/grbl and gnea/grbl
     
  4. Steve77777

    Builder

    Joined:
    Feb 7, 2020
    Messages:
    5
    Likes Received:
    1
    Thanks can I download it for free please, and how
     
  5. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,921
    Likes Received:
    4,291
    Refer to:

     
  6. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    315
    Likes Received:
    138
    @dazeddnc In general, probing is a very constrained operation, I don't see it happening in anything beyond a very specialized program. Are you trying to do some sort of tool change? In which case, you might want to look at the several projects using GRBL for ATC. Google finds a bunch.
     
  7. Steve77777

    Builder

    Joined:
    Feb 7, 2020
    Messages:
    5
    Likes Received:
    1
    Thanks for reply, opened up page, could not see any download options though, is there a way of downloading 1.1,
    Thanks
     
  8. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,921
    Likes Received:
    4,291
    Refer to the wiki it has detailed instructions (do read it all of it, its worth the read and worth the time - its all there!
    follow wiki.PNG
     
  9. Steve77777

    Builder

    Joined:
    Feb 7, 2020
    Messages:
    5
    Likes Received:
    1
    Ok thanks I will look now
     
  10. Steve77777

    Builder

    Joined:
    Feb 7, 2020
    Messages:
    5
    Likes Received:
    1
    Machine used to go into idle but now just says connected
     
  11. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,921
    Likes Received:
    4,291
    Are you still on Grbl 0.9? If yes, update first. Read the wiki, it really has all the instructions

    Or consider an off the shelf solution like docs.openbuilds.com/blackbox if you need an "easier" and more modern solution
     
  12. dazeddnc

    dazeddnc New
    Builder

    Joined:
    Feb 18, 2020
    Messages:
    2
    Likes Received:
    0
    Rob: Thanks for a detailed explanation about the situation. Yeah, some kind of line-tracking-echo would be great for extensibility. But....I get it. There's only so many bits and CPU cycles available. Every added feature comes at a cost...and people seem to get by fine without it most times.

    Phil: I have not ventured down this path. I'll have to poke around and see if that fits the bill.

    I want to set up my CNC so that a non-technical person can clamp the work piece, click a couple of buttons, and more or less walk away.
    I don't want to leave open the potential to forget running a probe cycle to find Z=0 after a power cycle, etc.

    In a nutshell, rather than drawing things in CAD, I have software that will use some awareness of machine capability and direct input of label dimensions/text to engrave a sheet of custom labels.
    Before starting a cut, it is set up to run a homing cycle and then Z-probe. It may be necessary to change tools, but it shouldn't happen a lot and it certainly can't be fully automated.
    This is mostly about making things simple for a newbie to setup a job and go. Leave as little to chance as possible.

    Edit:
    So, I don't think an ATC is really what I'm after. And the idea of responding to G38.2 is pretty much shot.
    We'll never be cutting anything that needs coolant though.
    I'm assuming M7 and M9 would stay in synchronization with other motion commands.
    I should be able to tie the coolant pin to my pro mini. Then I just have to issue M7 before G38.2 and M9 after.
     
    #1032 dazeddnc, Feb 19, 2020
    Last edited: Feb 19, 2020
  13. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    315
    Likes Received:
    138
    Yes, that's a good pragmatic solution. Newer GRBL variants have the ability to flip all sorts of external pins, you wouldn't need to steal coolant pins.
     
  14. Rob Taylor

    Rob Taylor Master
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    1,470
    Likes Received:
    748
    Hahaha, it's funny because adapting a coolant/ancillary pin is usually my go-to solution for things like this and for whatever reason this time I didn't even think about it. Good call!
     
  15. AlejandroZ

    Builder

    Joined:
    Feb 22, 2020
    Messages:
    8
    Likes Received:
    0
    Hello all,

    I just built my first CNC machine. It's a 2-axes foam cutter inspired by Stefan on CNC kitchen (youtube channel) own's CNC foam cutting machine.

    It only has X and Y axes (it runs along the X axis, and moves up and down the nicrom wire along the Y axis. To get an idea of this, the machine looks similar to the Foamlinx SC5542:
    [​IMG]


    But I have a problem with the homing sequence. I need the Y axis to clear the workspace before attempting to home the X limit switch and then home the Y axis.
    How can I accomplish this? This is only mentioned on the GRBL help pages when the machine is a 3-axes one, and even in that case, I couldn't find any custom settings for that (like by how much to raise the Z axis).

    edit: I might have found a workaround this, by increasing the homing pull-off distance, altough it would be nice to be able to set it for individual axes.
    Thanks in advance
     
    #1035 AlejandroZ, Feb 22, 2020
    Last edited: Feb 22, 2020
  16. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    315
    Likes Received:
    138
    Kind of a hack but you could use Z instead of Y because GRBL homes Z first. Not sure what the GCode gen implications are. Probably a way in the code to make Y behave like Z in the homing sequence.
     
  17. Rob Taylor

    Rob Taylor Master
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    1,470
    Likes Received:
    748
    Operational axes and homing order are configurable via config.h. Might have to poke into it though because I can't find the page where it's mentioned now.
     
  18. AlejandroZ

    Builder

    Joined:
    Feb 22, 2020
    Messages:
    8
    Likes Received:
    0
    But I can't home "Z" first. The X axis switch needs to be reached first in order to be able to physically reach the other axis switch.
     
  19. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    315
    Likes Received:
    138
    OK, looking at the machine I see that so you really can't use a standard homing sequence at all. I thought your problem was that you had loaded foam in the machine and didn't want to drag the wire through it. So really, you need X to behave like Z in the homing sequence.

    One thought, why bother with homing? A lot of people run ok with never doing it. In fact, a lot of people run without limit switches at all.
     
  20. Alex Chambers

    Alex Chambers Master
    Moderator Builder

    Joined:
    Nov 1, 2018
    Messages:
    2,773
    Likes Received:
    1,358
    It can be done - you need to think in three dimensions. When you generate your g-code in cam one of the codes defines which of the three planes you are working in (X/Y, X/Z or Y/Z). Tell us where your homing switches are (pic of machine would help as well) and we can give more advice.
    Alex.
     
  21. AlejandroZ

    Builder

    Joined:
    Feb 22, 2020
    Messages:
    8
    Likes Received:
    0
    Here's the machine. There are some design glitches and parts missing due to not being able/being lazy to move/resize/mirror certain components on Fusion360 haha.

    2020-02-22 20_22_19-Window.png 2020-02-22 20_23_55-Window.png

    As I said earlier, the machine is inspired on this one (check at minute 19:28):
     
    #1041 AlejandroZ, Feb 22, 2020
    Last edited: Feb 22, 2020
  22. Rob Taylor

    Rob Taylor Master
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    1,470
    Likes Received:
    748
    I'm not entirely sure A) why this needs a homing system at all and not just regular limits, and B) why the y-axis has to go up first since it shouldn't be getting homed with workpieces in it anyway?
     
  23. AlejandroZ

    Builder

    Joined:
    Feb 22, 2020
    Messages:
    8
    Likes Received:
    0
    Limit switch pull-off distance was set by default at 1mm. If I homed, then moved the X a few centimeters and then homed the machine again, the part that contacts with the Y-axis limit switch would crash into the Y-axis switch when the machine starts to home the X axis.

    By increasing the pull-off to 3mm, I managed to circumvent this, although I'm losing 2mm on each axis, but I don't really mind.
     
  24. Alex Chambers

    Alex Chambers Master
    Moderator Builder

    Joined:
    Nov 1, 2018
    Messages:
    2,773
    Likes Received:
    1,358
    Can you re-position the Y axis homing switch to home at the top instead of the bottom?
    Alex.
     
  25. AlejandroZ

    Builder

    Joined:
    Feb 22, 2020
    Messages:
    8
    Likes Received:
    0
    That could work, but I would have another hanging cable that would need to be pretty long as the switch would travel all the way to the X-axis length. And I would need to redesign more things.

    I'll stick with the workaround I found for now.

    Thanks a lot, everyone!
     
  26. RegPye

    RegPye New
    Builder

    Joined:
    Jul 1, 2014
    Messages:
    15
    Likes Received:
    7
    I am not sure if this s the correct place to ask this question, but here goes.
    I have a question on using the latest GRBL 1.1h.
    I want to make a pause in the gcode so that I can adjust the amperage of my plasma cutter for the next operation.
    I have tried putting M01 in the code, but nothing happens, it just continues on the the next operation is if it were not there.
    As a work around I added M01 M60 to cause an error and stop the program run, then I made my adjustment and pressed the continue button and all went as planned.
    What I would really like to do is find out what is the correct way to do it.
    I am using UGCS platform to send the gcode to my machine.
    Hope someone can help with this, thanks.
     
  27. Rob Taylor

    Rob Taylor Master
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    1,470
    Likes Received:
    748
    M0 for non-optional "optional stop", not M1. If you send M1 it's checking for an optional stop switch to also be set, and I'm not sure off-hand if grbl actually has that capacity or not.
     
    Alex Chambers likes this.
  28. Alex Chambers

    Alex Chambers Master
    Moderator Builder

    Joined:
    Nov 1, 2018
    Messages:
    2,773
    Likes Received:
    1,358
    M01 is optional stop. Not sure how grbl or OB control responds to it but you probably need M0.
    Alex.

    Edit; I'll have to type faster! LOL.
     
  29. RegPye

    RegPye New
    Builder

    Joined:
    Jul 1, 2014
    Messages:
    15
    Likes Received:
    7
    Thanks Rob & Alex, I will give it a try and see what happens.
     
  30. RegPye

    RegPye New
    Builder

    Joined:
    Jul 1, 2014
    Messages:
    15
    Likes Received:
    7
    OK, tested that M0 and it works fine on my machine. Thanks guys.
     
    Rob Taylor and Alex Chambers like 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