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 New
    Builder

    Joined:
    May 26, 2017
    Messages:
    48
    Likes Received:
    24
    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 Master
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    1,470
    Likes Received:
    746
    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 New
    Builder

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

    DaveH24 New
    Builder

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

    Zach S New
    Builder

    Joined:
    May 26, 2017
    Messages:
    48
    Likes Received:
    24
    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 Master
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    1,470
    Likes Received:
    746
    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 New
    Builder

    Joined:
    May 26, 2017
    Messages:
    48
    Likes Received:
    24
    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 Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,238
    Likes Received:
    1,815
    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 New
    Builder

    Joined:
    May 26, 2017
    Messages:
    48
    Likes Received:
    24

    Attached Files:

  10. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,238
    Likes Received:
    1,815
    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 New
    Builder

    Joined:
    May 26, 2017
    Messages:
    48
    Likes Received:
    24
    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 Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,238
    Likes Received:
    1,815
    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 Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,238
    Likes Received:
    1,815
    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 Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,238
    Likes Received:
    1,815
    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 Master
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    1,470
    Likes Received:
    746
    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 Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    312
    Likes Received:
    137
    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

    Builder

    Joined:
    Jul 17, 2016
    Messages:
    67
    Likes Received:
    23
    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
     
  22. DBud

    DBud New
    Builder

    Joined:
    May 19, 2017
    Messages:
    3
    Likes Received:
    0
    Hi everyone, so I have an issue with grbl giving me alarm 8 whenever I try to home it. It also tells me to check my limit switches. I have tested them before and they work properly as far as I can tell. Anyone have any idea why I can't home my machine?
     
  23. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,238
    Likes Received:
    1,815
    put a pulldown resistor on the PWM pin (between the pin and GND)

    during boot the Arduino pins go into a 'tristate' mode where the state is undefined.
    your laser driver must be defaulting to ON in this state, which means it has a a pullup resistor.
    you need to use a pulldown resistor that has a lower value so that it overrides to off, yet not so low as to overload the pin when in operation.
    I would try 10 x 1k resistors in series and remove one until it works, then replace that mess with one resistor of that value.
    for example, if it comes on with 6 resistors but stays off with 5, then you need a 5k resistor.
     
  24. Paul Pridday

    Builder

    Joined:
    Jul 17, 2016
    Messages:
    67
    Likes Received:
    23
    Thanks David. Will give that a try

    Paul
     
  25. GooglePlexInfinity

    Builder

    Joined:
    Aug 5, 2017
    Messages:
    1
    Likes Received:
    0
    Hello guys I am new to all this, and unfortunately the z axis of my GRBL 3D printer isnt working. When I test the z-axis it only moves down (If it is at the top) and never up. I have never printed anything, so I am wondering if this is normal behavior. I am using sparkfun's easydriver stepper motor controllers from Amazon, and am running version 3.5.1 with version 0.8c on my arduino uno. I have tried everything from checking my wiring several times, and swapping wires. All other axis seem to work fine, and the driver boards seem to be fine, and illuminated with an LED. I am following tinkernut's CD drive 3D printer tutorial from YouTube, and attached is a video
     
  26. Julius

    Julius Well-Known
    Builder

    Joined:
    Nov 13, 2015
    Messages:
    193
    Likes Received:
    61
    In a week, I'll be making my electronics box and setting up the new machine!
    1)Does anyone know where to wire the PWM and Spin Ena pins on a HuanYang VFD? What is the voltage on the PWM anyways? 5V?

    1. I'd like 2 types of coolant on my relay, one is a vacuum (simply switches a power bar from NO to closed) and the other will be a compressor line for milling metals. This may be easier to just do manually, honestly. just asking.

    2. Can I have the other relay control the stepper motors PSU? It'd be cool to have the whole box basically shut itself off via the arduino. Any pin option for that? If not, I'll just use a on/off toggle.
    4)How does the feed hold pin work? I'd like to add my E-stop button, but without just losing power to the drives and my work position. The switch has one NO and one NC circuit, so if there was some way I can have it Feed hold when I engage the switch, then reset when I pop the switch out? Is that possible or will it just constantly reset itself as long as the circuit is complete.

    Thanks!

    Here is my current wiring set up: Imgur: The most awesome images on the Internet


    Please comment here so its all in one spot
    Pins options + Spindle Wiring · Issue #244 · gnea/grbl · GitHub
     
  27. boelle

    boelle New
    Builder

    Joined:
    Sep 4, 2015
    Messages:
    5
    Likes Received:
    1
    hi

    i'm trying to help a friend with some custom electronics for an OX.... we got GRBL loaded on it but it enters alarm lock mode

    we know the electronics are ok as it has just come off a big 3d printer

    are there a way to get a kind of status that says what causes the alarm? ie GRBL thinks that a button is pressed while its not connected etc
     
  28. boelle

    boelle New
    Builder

    Joined:
    Sep 4, 2015
    Messages:
    5
    Likes Received:
    1
    #628 boelle, Aug 10, 2017
    Last edited: Aug 10, 2017
  29. Anthony Bolgar

    Anthony Bolgar Journeyman
    Builder

    Joined:
    Jan 14, 2016
    Messages:
    354
    Likes Received:
    198
    Mine always starts locked, just send a $X to unlock it.
     
  30. boelle

    boelle New
    Builder

    Joined:
    Sep 4, 2015
    Messages:
    5
    Likes Received:
    1
    i know you can do that

    i want to confirm what cases the alarm
     
    Anthony Bolgar 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