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. Zach S

    Zach S Journeyman
    Builder

    Joined:
    May 26, 2017
    Messages:
    37
    Likes Received:
    7
    I'm pretty new to to software aspect of things, and just finished with my build. I'm having a difficult time setting up my universal gcode with grbl (v0.9).
    I'm using the Cnc pro v3. I made a test cut set to .25 inches but it only cut .0249 inches. I need some assistance setting up my parameters.
    Thanks
    Zach
     
  2. Rob Taylor

    Rob Taylor Veteran
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    153
    Likes Received:
    38
    Exactly an order of magnitude off (0.25 vs 0.025) suggests it could be a simple distance-per-step mis-key? Say, "02" instead of "0.2" or something.
     
  3. Zach S

    Zach S Journeyman
    Builder

    Joined:
    May 26, 2017
    Messages:
    37
    Likes Received:
    7
    Thanks for the reply Rob.
    How would I go about adjusting that?
     
  4. DaveH24

    DaveH24 Well-Known
    Builder

    Joined:
    Feb 19, 2017
    Messages:
    17
    Likes Received:
    1
  5. Zach S

    Zach S Journeyman
    Builder

    Joined:
    May 26, 2017
    Messages:
    37
    Likes Received:
    7
    Thanks Dave. Those are the current setting's I have Except with Grbl V0.9. I have the open builds nema23 stepper motors, 3GT belt, 20 tooth pulley, and the 250mm 8mimm lead screw for the Z, Also I'm using the Cnc Xpro V3 stepper driver. I've bought all my electronics from the openbuild parts store. I appreciate the help
     
  6. Rob Taylor

    Rob Taylor Veteran
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    153
    Likes Received:
    38
    Ah. That would be the problem, then. You really need to go through every one of those values and make sure it's correct for your machine. Grbl wants you to input steps/mm (ie. how many steps does it take to travel 1mm?) This needs calculating, as the Github documentation suggests.

    The NEMA 23 motors are 1.8 degree step angle, so 200 steps per revolution. GT3 belt is of course 3mm pitch. With 20mm pulleys, you have 60mm of linear movement per rev, which, divided by 200 steps is 0.3mm/step. 1/0.3 = 3.333333333333 steps/mm (put in as many 3s as it'll accept). That's your $100 and $101 value (and the reason I'll never use GT3 belt, computers don't like odd numbers and recurring decimals- should be GT2.5 or GT4). For the z axis, 2mm pitch 4 start gives a lead of 8mm/rev. That would be 0.04mm/step, which is 25 steps/mm for your $102 value.

    Ensure you fully understand every value in that config page, what it does, how that relates to your actual hardware, and what it should be set to for your machine before trying any cuts. At best, you'll just scrap some wood. At worst, you could trash your belt, motors, controller electronics, spindle, toolbits, etc.
     
  7. Zach S

    Zach S Journeyman
    Builder

    Joined:
    May 26, 2017
    Messages:
    37
    Likes Received:
    7
    IMG_6066.JPG These are the current setting's I have Rob. I appreciate all your help you have no idea.
     
  8. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder

    Joined:
    Aug 6, 2013
    Messages:
    700
    Likes Received:
    326
    use this GRBL settings calculator
    to get the step/mm numbers you need.

    use this
    HOWTO Calibrate your CNC Machine for MACH3 or GRBL
    to fine tune the values
     
  9. Zach S

    Zach S Journeyman
    Builder

    Joined:
    May 26, 2017
    Messages:
    37
    Likes Received:
    7

    Attached Files:

  10. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder

    Joined:
    Aug 6, 2013
    Messages:
    700
    Likes Received:
    326
    first, turn off all homing and limits and get the calibration correct, THEN set up homing.

    I cannot find where you have told us what microstepping setting you are using. that has an effect on 'smoothness', but so does that actual speed it is travelling at (they are STEPPER motors, they STEP :) )
    Note that all settings in GRBL are in millimeters.

    assuming your video shows a homing cycle, you can adjust those speeds
    Set up the Homing Cycle · gnea/grbl Wiki · GitHub

    your homing fail is most likely your $27 setting, it is not pulling off the switch far enough. (what is that actual error message?)
    OR
    it is noise in the limit wires. That is why you get the machine working properly without them.
    Wiring Limit Switches · gnea/grbl Wiki · GitHub
    (This is one of those things where if you don't follow the 'best practices' it will not work)
     
  11. Zach S

    Zach S Journeyman
    Builder

    Joined:
    May 26, 2017
    Messages:
    37
    Likes Received:
    7
    David,
    Thanks for all the help, I managed to get up and running yesterday ended up changing the post processor and everything was good after that.
    Thanks again!
     
    David the swarfer likes this.
  12. dennisv

    dennisv New
    Builder

    Joined:
    Jul 11, 2017
    Messages:
    2
    Likes Received:
    0
    Hi everyone,

    I'm pretty new to g code, and I'm running into an issue with controlling a Nema 23 stepper motor. What I'm trying to do is pretty simple, just turn 90 degrees and then back again in a loop. Setting up the accelerations and velocities seemed to work fine, but when I tried to create a loop I ran into a problem.

    I can't seem to define variables. When I use

    #100 = 1 or something of the sort

    I get the error: Command Letter missing.

    When I try

    $#100=1

    It's an invalid statement. I tried reuploading the grbl source code, look at different manuals, but they all seem to have #100 = something working just fine. What am I missing here?
     
  13. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder

    Joined:
    Aug 6, 2013
    Messages:
    700
    Likes Received:
    326
    GRBL does not understand variables.
    It supports only what it says it does in the Wiki (-:
    Home · gnea/grbl Wiki · GitHub

    While the specifics of how it interprets Gcodes follow the LinuxCNC documentation, it does not do everything LinuxCNC can do.

    I assume you want that motor to turn 90 degrees back and forth 'forever'?
    You can do that with a little Python.....
    Code:
    #!/usr/bin/env python
    """\
    Simple g-code oscilating  script for grbl, Python2.7
    modified from the stream script by the swarfer
    ---------------------
    The MIT License (MIT)
    
    Copyright (c) 2012 Sungeun K. Jeon
    
    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:
    
    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.
    
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    THE SOFTWARE.
    ---------------------
    """
    
    import serial
    import time
    
    # Open grbl serial port
    s = serial.Serial('COM11',115200)
    
    # Wake up grbl
    s.write('\r\n'.encode())
    time.sleep(2)   # Wait for grbl to initialize
    s.flushInput()  # Flush startup text in serial input
    
    s.write('G21G91F1000\n'.encode())   # set relative mode
    print(s.readline())
    
    dist = 90.0   #set this to the distance to move
    
    # Stream g-code to grbl
    for i in range(0,12):        #change 12 to how many times you want it to run
       cmd = 'G1 X{:f}'.format(dist)
       print(cmd)
       s.write(cmd.encode() + '\n'.encode())         # Send g-code block to grbl
       grbl_out = s.readline()            # Wait for grbl response with carriage return
       print( ' : ' + grbl_out.strip())
       dist = -dist
    
    # Wait here until grbl is finished to close serial port and file.
    raw_input("  Press <Enter> to exit and disable grbl.")
    
    # Close serial port
    s.close()
    
    Run it under Python2.7 in a DOS prompt
    c:\python27\python.exe rotate.py
    it will run back and forth in relative mode until the loop expires, 0 to 12 in the above, but if you change 12 to 100000 it will run a long time. the loop could be changed to run forever. you would have to close the DOS prompt to stop it.
     
    dennisv likes this.
  14. dennisv

    dennisv New
    Builder

    Joined:
    Jul 11, 2017
    Messages:
    2
    Likes Received:
    0
    Thanks David!

    That saves me a bunch of time messing around in grbl. If I can do it in python, or matlab for that matter, that'll save me a bunch of time. I really appreciate the effort!

    Best,

    Dennis
     
  15. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder

    Joined:
    Aug 6, 2013
    Messages:
    700
    Likes Received:
    326
    so long as you can send the correct commands to the correct serialport that the Arduino is attached to, you can send it any Gcode commands you like, for as long as you like, the language used does not matter.
     
  16. JDZ

    JDZ New
    Builder

    Joined:
    Jul 12, 2017
    Messages:
    2
    Likes Received:
    0
    I'm new to grbl and having a problem getting my OX (large) running. I'm running grbl(grbl_v1.1f.20170131 without any changes by me) on a uno clone as recommended and finding that the stepper direction pins for Y and Z axes are not going high to 5V but rather about 2V which is not high enough to trigger reverse direction on the drivers. This is the case even if I disconnect the cables from those pins. They are going low and high (if you can call 2V high) with commands to go forwards and backwards so I'm sure everything is wired up correctly. It is not a hardware fault because I can drive those two pins to 5V if I replace grbl with a simple sketch digital writes those pins. X axis moves completely fine and that direction pin does go to 5V on reverse as expected.

    I actually seems as though the pin mode for those pins is not getting set correctly and they are being written high but configured as inputs. Just a guess based on the behaviour. Any thoughts?
     
  17. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder

    Joined:
    Aug 6, 2013
    Messages:
    700
    Likes Received:
    326
    thinks "get a real Uno"
    clones use the wrong USB->serial chip and do not communicate properly. (just google 'grbl ch340' for details)
     
  18. JDZ

    JDZ New
    Builder

    Joined:
    Jul 12, 2017
    Messages:
    2
    Likes Received:
    0
    Thanks for the reply David, but I don't see how serial comms issues could cause this problem.
    When I upload a basic sketch which writes pin D6 or D7 high I get ~5V. When grbl does it my multimeter says 2.5V. I don't even understand how that is possible? I could not replicate the behaviour by messing with the data direction register so that rules out my initial hunch.
     
  19. Rob Taylor

    Rob Taylor Veteran
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    153
    Likes Received:
    38
    Is grbl writing it permanently high? I would assume, since stepper drivers typically only increment the motor on a rising edge, a step from grbl would have to be an entire "wavelength"- ie. rise and fall. If grbl is continuously stepping the motor, it's essentially just sending a steady square wave of +5v and 0v at whatever duty cycle based on the pulse timing, which is ultimately a PWM voltage to your meter. Really, you need an oscilloscope to see what's going on for this kind of data transmission.
     
  20. phil from seattle

    phil from seattle Well-Known
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    6
    Likes Received:
    1
    I have a question about an unused pin on an Arduino Uno with GRBL 1.1 - A4. From the code, it looks like Mist uses A4 as an output. The wiki diagrams does not show this so was hoping for confirmation from the authority on GRBL.

    I'm making an arduino shield to support this and want to get it right.
     
  21. Paul Pridday

    Paul Pridday Journeyman
    Builder

    Joined:
    Jul 17, 2016
    Messages:
    60
    Likes Received:
    20
    Having a "laser on" issue that I hope someone can help with. Arduino Uno with a CNC shield V3 running GRBL 1.1f. Upon startup all is fine but when GRBL panel connect is "clicked" the laser turns on until it actually connects and goes into locked mode. It only stays on for about a second while the connection takes place but still not a good thing. Any ideas???

    Thanks

    Paul
     

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 provides resources to Open Source projects, developers and schools around the world. Invest in your future by helping others develop theirs!

    Donate to FairShare!