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. BArnold

    BArnold New
    Builder

    Joined:
    Feb 25, 2015
    Messages:
    3
    Likes Received:
    0
    I recently implemented a Z-zero plate on my SO2 CNC. I'm using the Macro page in UGS to hold the commands. My first macro is G20 G38.2 Z-0.5 F2; G92 Z0.5. For simplicity, I'd like to add another command to raise Z another .25" while leaving the reference point at 0.5", the thickness of my plate. So far, whatever I do causes an error, unless I unplug the Z-zero plate. Ideally, I'd like to add to the one macro; i.e., G20 G38.2 Z-.5 F2; G92 Z0.5; ______ Z0.75. Is this possible?
     
  2. John Meikrantz

    John Meikrantz Well-Known
    Builder

    Joined:
    Nov 2, 2014
    Messages:
    169
    Likes Received:
    56
    Do a G91 (relative distance mode) and then G0 z0.25. That will retract an additional .25". Finish off with a G90 to put back in absolute mode.
     
  3. BArnold

    BArnold New
    Builder

    Joined:
    Feb 25, 2015
    Messages:
    3
    Likes Received:
    0
    John, thank you for your help. Using the commands you mentioned works like I want. My macro now reads G20 G38.2 Z-.5 F2; G92 Z.5; G91; G0 Z0.25; G90. That's so much easier than hand-cranking to a piece of paper!

    Thanks again!
     
  4. John Meikrantz

    John Meikrantz Well-Known
    Builder

    Joined:
    Nov 2, 2014
    Messages:
    169
    Likes Received:
    56
    You should also take a look at bCNC and cnc.js. They both have built in probing support and are pretty feature rich.
    I run both on Raspberry Pi 2 with no performance issues.
     
  5. BArnold

    BArnold New
    Builder

    Joined:
    Feb 25, 2015
    Messages:
    3
    Likes Received:
    0
    I've seen posts about bCNC on other forums. I'll take a look at both. UGS has been working fine for me so far but I've heard of some people having issues with it.
     
  6. Julius

    Julius Well-Known
    Builder

    Joined:
    Nov 13, 2015
    Messages:
    193
    Likes Received:
    61
    Hey Sonny, will there be anything for manual tool changes? Like, run a part of the code, go to home, and pause. User changes the bit, re-does a Z set with a plate or manually, then it resumes the operation?
     
  7. John Meikrantz

    John Meikrantz Well-Known
    Builder

    Joined:
    Nov 2, 2014
    Messages:
    169
    Likes Received:
    56
    Check out bCNC - has manual tool change function, and auto probe. vlachoudis/bCNC · GitHub
     
  8. Sonny Jeon

    Sonny Jeon Well-Known
    Staff Member Moderator Builder

    Joined:
    Aug 6, 2015
    Messages:
    165
    Likes Received:
    66
    bCNC is the only GUI with manual tool change that I know of at the moment. Grbl provides all of the tools to support tool changes, but doesn't incorporate the process into itself. There lots of reasons for this, but I won't get into explaining why it's this way. Other than saying that machines are all different and there are a number of unique ways of doing a tool change. It's better to give GUIs the interface to do this, than to have Grbl manage every scenario. At some point though, I do need to write up a recommended methodology for GUI writers on how to properly do this. This should help get GUIs supporting it quicker.
     
    Mark Carew and David the swarfer like this.
  9. Julius

    Julius Well-Known
    Builder

    Joined:
    Nov 13, 2015
    Messages:
    193
    Likes Received:
    61
    Ok cool. Very nice to see it IS a part of it though, since my friend is complaining how it isn't and he basically has 3 different g code files, one for each tool and has to run them back to back in UGS.
     
  10. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,462
    Likes Received:
    1,915
    I added tool change support to SketchUcam a couple of releases ago. This adds a tool change (standard T1 M6 type or a custom macro you write) to the start of every file. You can then use the Gcode joiner function to join the files together to run as one.

    Both methods allows you to add a tool offset, so if you know how long your tools are you need only measure them once and can simple supply the tool offset when changing tools. This does require that initial Z zero be set with the correct 'baseline' tool, or a standard spacer that is longer than all your tools.

    Example macro: you need to set the G59 0,0,0 co-ordinate system to where you want to change tools.
    Code:
    M5
    G49      ; turn offset off
    G59     ; go to coordinate system G59, where you have already set 0,0,0 to be your tool change position
    G0 X0 Y0 Z0  ; go there
    M0      ; pause
    G43.1 Z%s     ; set offset, notice the %s, the offset number will be inserted there
    G54      ; back to regular co-ordinates
    
    Note that using a macro like this cannot make use of a tool height sensor since we don't have a way to get the length back from GRBL. But bCNC can do that.
     
    Mark Carew likes this.
  11. osyrus11

    osyrus11 New
    Builder

    Joined:
    Apr 14, 2015
    Messages:
    2
    Likes Received:
    1
    Having a heck of a time trying to get my machine properly homing.
    Is there somewhere on these forums where we can get a list of typical grbl values for the ox cnc? (to play nice with the nema stepper motors and the pulley and belt that openbuilds uses for these guys?)
     
  12. Steve Fox

    Steve Fox Well-Known
    Builder

    Joined:
    Feb 22, 2015
    Messages:
    129
    Likes Received:
    21
    Here's the settings from my Ox.
    It's about 24" x 38".
     

    Attached Files:

  13. Sonny Jeon

    Sonny Jeon Well-Known
    Staff Member Moderator Builder

    Joined:
    Aug 6, 2015
    Messages:
    165
    Likes Received:
    66
    The first thing to do is make sure your machine coordinate system is correct. X+ moves in X+ and Y+ moves in Y+. Alter the direction invert settings if they aren't. Then use the homing direction invert setting only to tell Grbl which direction your limit switch is. If you are having problems related to failed homing, it's most likely noise in your limit switch lines, falsely triggering the pin. In this case, add shielding, move your cables away from noise sources, and wire in a low-pass filter with a small capacitor across the limit switch pin and ground.
     
    osyrus11 likes this.
  14. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,462
    Likes Received:
    1,915
    and remember those X+ etc directions are TOOL MOVEMENT (-:
     
  15. Julius

    Julius Well-Known
    Builder

    Joined:
    Nov 13, 2015
    Messages:
    193
    Likes Received:
    61
    Hey Sonny

    Is it possible to do a homing cycle or something to find 0,0 of only X/Y and set Z manually, either by paper or a probe? My Z has 6" of travel but only 2" to the bed so I'd rather not have it crash every time I need to use my machine lol. I'll be using limit switches if that matters at all. My friend suggested running Pin 12 straight to ground to short it out for the homing cycle because Im setting it after the fact. Can I just copy the Z probe macro but use it for x/y with the limit switches or is there no circuit to complete?

    Cheers!
     
  16. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,462
    Likes Received:
    1,915
    it is normal to home Z in the UP direction, so it never goes near the part or table during the homing cycle, it goes UP.
    so put that limit switch at the top of the travel and let it home there.
     
    woofguy likes this.
  17. billg

    billg New
    Builder

    Joined:
    Jan 18, 2016
    Messages:
    2
    Likes Received:
    0
    I have installed everything but my mk2/4 does not connect. Wen i connect the usb and wait nothing shows up in the grbl panel com box, when I rescan still nothing.Can you help? I am a newbie. Thanks
     
  18. John Meikrantz

    John Meikrantz Well-Known
    Builder

    Joined:
    Nov 2, 2014
    Messages:
    169
    Likes Received:
    56
    Planet CNC mk2/4 does not run grbl, so you can't use grbl-panel. You will need to use the Planet CNC USB controller.
     
  19. billg

    billg New
    Builder

    Joined:
    Jan 18, 2016
    Messages:
    2
    Likes Received:
    0
    Thank you
     
  20. Sonny Jeon

    Sonny Jeon Well-Known
    Staff Member Moderator Builder

    Joined:
    Aug 6, 2015
    Messages:
    165
    Likes Received:
    66
    Yes! (Sort of) :) You can have Grbl only home two axes for 2-axis machines. In your case, just the x and y axes. To do this, you'll need to alter the homing cycle defines in config.h. There are comments to tell you how to do it. It'll leave the z-axis undefined as the current value. Meaning it won't change it.

    As far as the 'sort of', Grbl doesn't allow the user to specify a machine coordinate. It's only done by the homing cycle. This is intentional to prevent users from messing with the machine coordinate system, because it can also mess up work coordinates badly. Since you are using a 3-axis machine and homing only 2-axes, this kinda breaks the intent of how the machine coordinates are supposed to work. To get around this, you could try remembering to zero the z-axis manually with work coordinates, but this would get tedious and is a high risk for a crash at some point.

    I would recommend to setup your machine to home all three axes. This will be easiest and best thing to do.
     
  21. JakePratt42

    Builder

    Joined:
    Feb 3, 2016
    Messages:
    5
    Likes Received:
    0
    Hi Sonny,

    I'm having a strange problem with getting my Y-Axis working properly using GRBL. The Y-Direction pin is always high, so the Y-Axis only moves in one direction, despite trying to move it both directions. I metered the arduino and the stepper drover board. With the arduino connected I always see 5v on the direction input of the stepper controller, and it drops to zero when disconnected, while the arduino pin is always at 5v. I have tried inverting the Y-Axis direction but the problem still persists.

    Any help would be greatly appreciated.

    Jake P.
     
  22. Steve Fox

    Steve Fox Well-Known
    Builder

    Joined:
    Feb 22, 2015
    Messages:
    129
    Likes Received:
    21
    Do you have another board that you could hook up to see if it does the same thing?
    Sounds like a bad output.
     
  23. JakePratt42

    Builder

    Joined:
    Feb 3, 2016
    Messages:
    5
    Likes Received:
    0
    I have another board, but the serial connection is not very reliable on it. the one I'm currently using is brand new. I will try flashing my backup board tonight, and checking the state of the Y-Direction pin.
     
  24. Steve Fox

    Steve Fox Well-Known
    Builder

    Joined:
    Feb 22, 2015
    Messages:
    129
    Likes Received:
    21
    If you have any experience with Arduinos and you want to find out if it is the board, you can hook an LED and a current limiting resistor between the pin and ground and write a short program through the Arduino interface to turn it off and on.

    If you have programmed an Arduino before, it takes a couple of minutes to do.
    If you don't have the experience, it probably isn't worth the trouble to learn.
     
  25. JakePratt42

    Builder

    Joined:
    Feb 3, 2016
    Messages:
    5
    Likes Received:
    0
    I tested my board with the basic blink example supplied in the arduino ide. I modified it to use pin 6. With my DMM attached I could see the pin going back forth from high to low.

    Afterwards I flashed GRBL back onto the board and the Y-Axis is still only moving in one direction.

    One odd thing to note: The first attempt to move the Y-Axis it began moving in the opposite direction first, for about 1/2 second before it reversed itself and was stuck moving in only one direction.
     
  26. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,462
    Likes Received:
    1,915
    if the Arduino is working fine, then the problem is on the stepper driver board....
     
  27. Steve Fox

    Steve Fox Well-Known
    Builder

    Joined:
    Feb 22, 2015
    Messages:
    129
    Likes Received:
    21
    Good work.
    I agree with David.
    Next thing to try would be to change the X and Y driver boards to see if the other one does the same thing.


    One question that doesn't have anything to do with your current issue.
    Did you flash the Arduino board with the Arduino interface or did you load one of the compiled versions?
    I'm guessing that you used the Arduino interface, which is a good thing. It gives you more options.
     
  28. JakePratt42

    Builder

    Joined:
    Feb 3, 2016
    Messages:
    5
    Likes Received:
    0
    From my previous tests, when i disconnected the y direction pin from the driver board, the corresponding pin on the driver board went low. this leads me to think that the problem is elsewhere. Tonight I'll do some more troubleshooting focused on the driver board itself. Ill try controlling the direction pin manually with some extra bits of wire on my breadboard. But even with the arduino y direction pin dissconnected from the driver board I was still seeing arduino pin stick in a high state.

    In regards to what David said, physically the arduino seems to be working fine, but when I load GRBL on it, that one pin seems to get stuck in a high state.
    If toggling the direction pin manually works as expected, I'll then try to swap the driver boards and see what happens.

    Thanks for all the advice and feedback.

    Jake P.
     
  29. Steve Fox

    Steve Fox Well-Known
    Builder

    Joined:
    Feb 22, 2015
    Messages:
    129
    Likes Received:
    21
    I haven't done any Arduino programming in six months or so, but I believe there is a setting to enable a pull-up resistor on each pin.
    I can't remember if the GRBL software has that enabled or not. I do know there are a lot of variables in several files in the GRBL library.

    I would look it up, but I installed Windows 10 and for some reason, it won't let me choose the program I use to view the .h files.
     
  30. Sonny Jeon

    Sonny Jeon Well-Known
    Staff Member Moderator Builder

    Joined:
    Aug 6, 2015
    Messages:
    165
    Likes Received:
    66
    Sorry about the late reply. Your problem is indeed unusual. Can you describe your wiring scheme, commands you are sending to Grbl, and your Grbl settings? This occasionally helps diagnose if it's a problem with Grbl or something external.
     

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