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.
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.
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)
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.
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
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.
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???
@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.
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-)?
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.
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.
@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
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?
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?
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.
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.
@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.
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.
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
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.
"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?
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.
@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.
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!
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: 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. 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.