Welcome to Our Community

Some features disabled for guests. Register Today.

Grbl question

Discussion in 'Control Software' started by wvu_kuiken, Oct 12, 2017.

  1. wvu_kuiken

    Builder

    Joined:
    Mar 18, 2017
    Messages:
    4
    Likes Received:
    0
    I'm wiring an enclosed control box and would like an indicator when i plug my usb in to my arduino and connect to the grbl firmware. I'd like to run a 24v led powered off of a relay from the arduino. Is there a code that I can use in the Grbl config that sets a pin high (send 5v to the relay) once connected to the grbl through grbl panel? I'm now seeing that you can set start up commands through $n in grbl. Is this a route that I can take? If so, can anyone help with the syntax I would use if I'd like to use pin 1 or pin 11 since I won't be using PWM control on the spindle?

    Thanks.
     
  2. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    315
    Likes Received:
    138
    Why 24V? With a dropping resistor, you could just run the led off the arduino 5V or one of the output pins.

    Or you could run a 5V relay off the Arduino 5V to switch 24V to the led. Though, that pulls a lot more power. Add in a reversed diode to prevent kickback if you do it that way.

    I understand you want the led to indicate the grbl connection but won't you have ample indication via your PC? I'd just use the Arduino power approach.

    Anyway, there are 3 possible outputs - spindle, mist, flood. you could configure any of those for that purpose. There are M commands for them though spindle has some specific issues iirc. Mist or flood is simpler - M7 - mist and M8 - flood. Mist needs to be config'd in config.h and rebuilt. Pretty easy to do though.
     
  3. Xamer

    Xamer New
    Builder

    Joined:
    Apr 4, 2020
    Messages:
    11
    Likes Received:
    0
    Hey there need help.
    I am using grbl which is connected to arduino uno, I am trying yo connect my stepper motor to the x axis of grbl and pass values through serial monitor of IDE, but my motor is not responding to the values which I pass to it. Kindly help me with the connection of my stepper motor with grbl or please send me a link which will guide me with the connection.
    (I am using old DVD motor)
     
  4. Alex Chambers

    Alex Chambers Master
    Moderator Builder

    Joined:
    Nov 1, 2018
    Messages:
    2,785
    Likes Received:
    1,366
    Are you connecting your stepper motor directly to the Arduino? - that won't work. If you are using a stepper driver which one, and do you know the specification of the motor you are using? - voltage and current requirements as a starting point.
    Alex.
     
  5. Xamer

    Xamer New
    Builder

    Joined:
    Apr 4, 2020
    Messages:
    11
    Likes Received:
    0
    I have already mentioned, I have connected my stepper motor to grbl board and I am using KTC CMS Labs A4988 stepper motor.
    Currently I dont know the specification of my motor, but its normal DVD driver motor
     
  6. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    315
    Likes Received:
    138
    Are you connecting your stepper motor directly to the Arduino Uno? What is this GRBL board you are talking about? Post a picture. Part of our confusion comes because GRBL runs on the Arduino Uno.
     
    Alex Chambers likes this.
  7. Giarc

    Giarc OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Jan 24, 2015
    Messages:
    3,017
    Likes Received:
    1,682
    I am confused. I the first post you said:
    In the second post you said:
    So are you using GRBL on the arduino to control the stepper motors, or are you using a GBL shield on an arduino and some an arduino program you made - or downloaded - to try to control your motors through the serial monitor???
     
  8. Xamer

    Xamer New
    Builder

    Joined:
    Apr 4, 2020
    Messages:
    11
    Likes Received:
    0
    @Giarc,
    Yes I am using GRBL CNC shield on arduino uno and trying to control my motors through serial monitor.
    I try to use 'G0X10Y0Z0' code on through serial monitor but its not working.
     
  9. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    315
    Likes Received:
    138
    dude, post a picture that shows how it's wired up. post the brand of shield (and a picture).

    do you have power for steppers? have you wired the 4 wires of the stepper motors to the stepper controller outputs (A+,A-, B+, B-)?
     
  10. Giarc

    Giarc OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Jan 24, 2015
    Messages:
    3,017
    Likes Received:
    1,682
    What program (ie sketch) is loaded on the arduino? If it is GRBL why not just use a GRBL sender rather than a serial monitor? I don't know if a serial monitor can even do that unless there is a sketch loaded on the arduino that knows what those commands mean when coming from the serial monitor. What I can guarantee you is that if you have GRBL loaded on your arduino with a cnc grbl shield and functioning drivers, and if you use one of these GRBL interfaces, or OpenBuilds Control and you type those commands you listed into the command line it will do what you want it to do. Well, it will move the motor. Whether or not it goes the right direction and distance depends on if it is hooked up right and calibrated. The GRBL wiki will tell you everything you need to know.
     
    Peter Van Der Walt likes this.
  11. Giarc

    Giarc OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Jan 24, 2015
    Messages:
    3,017
    Likes Received:
    1,682
    Also, if you decide to use one of those listed GRBL interfaces, choose bCNC, Universal G code sender, or GRBL Panel. Those are well known on this forum so you will probably be able to get answers to any other questions.
     
  12. Xamer

    Xamer New
    Builder

    Joined:
    Apr 4, 2020
    Messages:
    11
    Likes Received:
    0
    @phil from seattle

    -> do you have power for steppers? have you wired the 4 wires of the stepper motors to the stepper controller outputs (A+,A-, B+, B-)?

    How to find whether its getting required power?
    How to find (A+,A-,B+,B-) of motor?

    Attaching the images of setup
     

    Attached Files:

  13. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    315
    Likes Received:
    138
    OK, that helps. You don't show the power supply but let's assume that's ok.

    GRBL expects a complete system. If your wiring is correct it may be in some sort of fault state because you basically have nothing hooked up. Are you using a GCode sender like UGS, Candle, GRBL Panel... on your PC? That should show you what's going on.

    Also, those step sticks don't like to be inserted backwards - kills the step stick. Don't go by the orientation of the writing on the step stick as some companies have it upside down. I can't tell from the picture which orientation is correct.

    A+, A-, B+, B- are connectors next to each of the step stick sockets. Even though your wiring job is a bit wonky, it looks like they are connected correctly.

    Also, how did you get GRBL on your arduino?
     
  14. Xamer

    Xamer New
    Builder

    Joined:
    Apr 4, 2020
    Messages:
    11
    Likes Received:
    0
    Also, how did you get GRBL on your arduino?

    I am not getting your question.

    Also can you help me in the wiring of my motor with my board.
    cos I am having doubt with the wiring as I don't have knowledge about it.

    As mentioned above, does Gcode sender help me with proper analysis?
     
  15. Alex Chambers

    Alex Chambers Master
    Moderator Builder

    Joined:
    Nov 1, 2018
    Messages:
    2,785
    Likes Received:
    1,366
    How did you identify which wires were connected to the stepper motor coils @Xamer ? This thread might help with the wiring;

    Stepper motors won't turn

    Alex.
     
  16. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    315
    Likes Received:
    138
    OK, GRBL is a piece of software that runs on an Arduino. The Arduino becomes a CNC motion controllers when it has GRBL installed. You have to install GRBL on the Arduino. To interface the Arduino/GRBL board to the CNC machine you use a GRBL breakout board and stepper motor drivers.

    Follow this guide to building a GRBL CNC machine. Pay close attention to installing GRBL on an Arduino.
     
    Alex Chambers likes this.
  17. Xamer

    Xamer New
    Builder

    Joined:
    Apr 4, 2020
    Messages:
    11
    Likes Received:
    0
    @phil from seattle,
    I have install GRBL on arduino uno, also use UGS and try to send some command to the board but getting error.
    I am attaching the image of it.
     

    Attached Files:

  18. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    315
    Likes Received:
    138
    I have not seen that error before but am not familiar with UGS. Maybe some one else has an idea what it means. Maybe a bad install of GRBL - it takes almost no time to "boot" up. I would go back, rebuild and reinstall GRBL.
     
  19. Xamer

    Xamer New
    Builder

    Joined:
    Apr 4, 2020
    Messages:
    11
    Likes Received:
    0
    While uploading GRBL on arduino uno I am getting below message
    "Low memory available, stability problems may occur."
    But uploading also done on board. Do you have nay idea regarding this?
    attaching the image
     

    Attached Files:

  20. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    315
    Likes Received:
    138
    That message, "low memory...", is due to GRBL being at the limit of what the Atmel chip can handle. You could drop some features (like door, mist or flood,...) that you don't need. config.h is fairly explanatory though without a SW background, it may be a bit overwhelming. You could leave it that way, probably no ill effects.
     
  21. Xamer

    Xamer New
    Builder

    Joined:
    Apr 4, 2020
    Messages:
    11
    Likes Received:
    0
    "low memory...", is due to GRBL being at the limit of what the Atmel chip can handle.
    But does this affect other execution on board or due to which the uploading is not done properly?
     
  22. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    15,055
    Likes Received:
    4,313
    Standard error, as grbl has been pushing the limits of the Atmega for a while... If you havent added features in config.h (like corexy, etc) that use more memory than the standard build, you can ignore it.
     
  23. Xamer

    Xamer New
    Builder

    Joined:
    Apr 4, 2020
    Messages:
    11
    Likes Received:
    0
    @Peter Van Der Walt ,

    As suggested from you, I have checked config file and found that "corexy" is already commented.
    Can you suggest any other feature which I can ignore for my CNC project.
     
  24. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    15,055
    Likes Received:
    4,313
    Stock default config still has the "warning" but works fine. Like I said, unless you enabled any of the extra features, relax and don't worry!
     
  25. Xamer

    Xamer New
    Builder

    Joined:
    Apr 4, 2020
    Messages:
    11
    Likes Received:
    0
    Can any one help me in this??
    Just wanted to test, whether my servo is working or not?
     
  26. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    315
    Likes Received:
    138
    Have you resolved your earlier problem with grbl not booting?

    Also, do you mean servos or steppers?
     
  27. Xamer

    Xamer New
    Builder

    Joined:
    Apr 4, 2020
    Messages:
    11
    Likes Received:
    0
    My grbl got uploaded successfully.
    And yes I mean stepper moters.
     
  28. Rob Taylor

    Rob Taylor Master
    Builder

    Joined:
    Dec 15, 2013
    Messages:
    1,470
    Likes Received:
    749
    Minimum motor test conditions
    • Connect the X STP pin to your driver's STP+ terminal.
    • Connect the X DIR pin to your driver's DIR+ terminal.
    • Can probably leave ENA disconnected for now.
    • Connect your driver's STP- and DIR- terminals to your Arduino's GND.
    • Make sure your four stepper wires go to the correct A+A- B+B- driver terminals:
    1. If you have a multimeter, check the wires resistance/continuity: each pair should measure about 0.3 Ohms or so. One pair is a single letter's + and - wires.
    2. If you don't have a multimeter (why?!) twist the wires together two at a time. When you find a pair, the motor should become impossible or extremely difficult to turn by hand.
    • Connect 12V or 24V DC power to your driver's DC terminals.
    • Plug your Arduino into your computer over USB
    • Open your G-code sender.
    • Don't change any grbl machine configuration settings!
    • Just type in "G91 G1 X200 F1000" and hit send on the serial entry box.
    If the motor stutters, reverse the polarity of one of your wire pairs- either A+A- or B+B-, not both. Resend the G-code. Your motor should now turn.

    That's it. Once grbl is already loaded on the board, the wiring is a quite straightforward checklist:

    • Driver power
    • Driver signal
    • Motor power
    • Arduino signal
    Stock grbl doesn't have homing enabled or anything, the motor direction doesn't matter, you can just fire it up.
     

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