Sending G-code to GRBL

Home Model Engine Machinist Forum

Help Support Home Model Engine Machinist Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

geoff p

Well-Known Member
Joined
Jun 20, 2011
Messages
54
Reaction score
7
Hi,
My set-up is:

  • Arduino, loaded with GRBL,

  • driving two Pololu A4988

  • to my X- and Y-steppers. (I don't have a working Z-axis.)
In Windows, I hand-code G-code in UltraEdit (text editor) from my drawings in Xara.
  • then I send the xxx.NC file to the Arduino via

  • G-code Sender and a USB-connection
which all works "as advertised."

BUT....
I'm having difficulty maintaining the USB connection. It (usually) holds during a run but ALWAYS drops when G-code Sender gets to the end of the file i.e. when it pops-up its jaunty message "Yea, all code sent."

At present this means I must close the sender, pull-out the USB plug ("bing bong") and re-insert it ("bing bong") to re-connect, then re-start the sender. And, of course, my working Zero positions get lost in the process.:wall:

If you use GRBL, how do you send your code?

Geoff
 
Answer my own question :rolleyes: I have just come across Zapmaker's "Grbl Controller 3.4.5", which seems to do the trick.

After a file has run, click the "reset" button, then "open" and "begin" to simply run the same file again. :cool:
Geoff
 
Ok now you got me interested.
Hi, My set-up is: [*] Arduino, loaded with GRBL,
You didn't mention what GRBL is. I flunked mind reading in college so I'm going to guess it is an app for running G-Code on an Arduino.
[*] driving two Pololu A4988 [*] to my X- and Y-steppers. (I don't have a working Z-axis.)
Well you got more than I got!
In Windows, I hand-code G-code in UltraEdit (text editor) from my drawings in Xara. [*] then I send the xxx.NC file to the Arduino via [*] G-code Sender and a USB-connection which all works "as advertised."
This is very interesting. How good of a controller is the Arduino with GRBL? I kinda like that we have so many ways to run G-Code these days.
. BUT.... I'm having difficulty maintaining the USB connection. It (usually) holds during a run but ALWAYS drops when G-code Sender gets to the end of the file i.e. when it pops-up its jaunty message "Yea, all code sent." At present this means I must close the sender, pull-out the USB plug ("bing bong") and re-insert it ("bing bong") to re-connect, then re-start the sender. And, of course, my working Zero positions get lost in the process.:wall: If you use GRBL, how do you send your code? Geoff
Well I don't use GRBL, your post is the first I've heard of it. Honestly this sounds like a bug. However it also sounds like you are powering the Arduino from the USB port, would a separate power supply not be better?
 
My History: whilst I am a slightly-proficient programmer, the intricacies of G-code flummoxed me. I know, 'cos I tried!

GRBL (yes, Wizard 69, that's its name, just like yours is Wizard69) is an open-source "application" (though that's my poor term for it) that installs onto an Arduino (I actually have an Arduino Uno, though they have been supplanted by more powerful-and-faster devices) and resides in the Arduino's flash-RAM.

Functionally, it is simply a G-code Interpreter - that is, it works out from your G1 X0.99 Y1.234 commands, where to send your steppers, and how many steps that will require. It handles G2 and G3 arc-commands rather well IMHO (In My Humble Opinion to save you mind-reading) and also several other G-codes - of which I use only a very few.

Since GRBL is sitting in the Arduino's flash-RAM, the ordinary RAM is available to receive-and-process a serial-stream of code coming from the main (desktop/laptop/etc-top) computer, via a USB port. GRBL's output is Step + Direction commands for the X-, Y-, Z-axes.

The G-code can come from anywhere - when all is said and done, it's only Text! If you don't believe me, drop one of your *.nc, *.tap, *.stc files into Notepad.

GRBL works on the Arduino - what operating system you use at your desktop has NO bearing on it. ALL it wants is a stream of G-codes.

The tricky bit that I was struggling-with was stuffing the *.whatever files into the USB-port, but, as per my second post, that is now solved.

Grbl Controller simply pushes a file onto USB (which is a Serial port) and uses X-on, X-off to control the flow i.e. when the GRBL sends a signal "I'm full" it pauses the transmission until GRBL asks for more data. (With apologies to Zapmaker for making his programme seem simpler than it really is.)

[quote:]Well you got more than I got![/quote]
Actually, I doubt that. What I do have is a manky, Chinese, drilling machine, which has an X-,Y-table-come-vice on it. Those two movements are driven by stepper-motors through motorcycle-engine timing-chains. Heath Robinson said, on one roll in his grave, he was quite amazed that I dare to call it CNC.

Geoff
P.S. My CNC costs have been:-
2 x stepper-motors @ 30 $AU each; (I had to order from Australia)
2 x Pololu drivers from Pololu.com @ 9.95 $US
1 x Arduino Uno @ 1000 baht (30$US)
1 x GRBL @ zero. Download from Github
1 x Grbl Controller @ zero. Download from zapmaker.org
 
Thanks for the detailed explanation, a little more than I needed but that never hurts.

My History: whilst I am a slightly-proficient programmer, the intricacies of G-code flummoxed me. I know, 'cos I tried! GRBL (yes, Wizard 69, that's its name, just like yours is Wizard69) is an open-source "application" (though that's my poor term for it) that installs onto an Arduino (I actually have an Arduino Uno, though they have been supplanted by more powerful-and-faster devices) and resides in the Arduino's flash-RAM. Functionally, it is simply a G-code Interpreter - that is, it works out from your G1 X0.99 Y1.234 commands, where to send your steppers, and how many steps that will require.
This is one interpreter I haven't heard of before. This is a good thing because the proliferation of interpreters means we have many sound options and lots of flexibility.
It handles G2 and G3 arc-commands rather well IMHO (In My Humble Opinion to save you mind-reading) and also several other G-codes - of which I use only a very few. Since GRBL is sitting in the Arduino's flash-RAM, the ordinary RAM is available to receive-and-process a serial-stream of code coming from the main (desktop/laptop/etc-top) computer, via a USB port. GRBL's output is Step + Direction commands for the X-, Y-, Z-axes.
Is this an Open Source solution. I will have to go looking for this app after my forums readings.
The G-code can come from anywhere - when all is said and done, it's only Text! If you don't believe me, drop one of your *.nc, *.tap, *.stc files into Notepad. GRBL works on the Arduino - what operating system you use at your desktop has NO bearing on it. ALL it wants is a stream of G-codes. The tricky bit that I was struggling-with was stuffing the *.whatever files into the USB-port, but, as per my second post, that is now solved. Grbl Controller simply pushes a file onto USB (which is a Serial port) and uses X-on, X-off to control the flow i.e. when the GRBL sends a signal "I'm full" it pauses the transmission until GRBL asks for more data. (With apologies to Zapmaker for making his programme seem simpler than it really ) Actually, I doubt that.
Serial communications can be very frustrating from the stand point of the engineer or programmer trying to get something to work.
What I do have is a manky, Chinese, drilling machine, which has an X-,Y-table-come-vice on it. Those two movements are driven by stepper-motors through motorcycle-engine timing-chains. Heath Robinson said, on one roll in his grave, he was quite amazed that I dare to call it CNC.
Still more that I got at the moment. I just placed a half ton of concrete at the front of the house and rationally there are a number of must do home repairs that I need to get done over the next year or so, so any CNC I end up with will be cobbled together out of whatever I can find.
Geoff P.S. My CNC costs have been:- 2 x stepper-motors @ 30 $AU each; (I had to order from Australia) 2 x Pololu drivers from Pololu.com @ 9.95 $US 1 x Arduino Uno @ 1000 baht (30$US) 1 x GRBL @ zero. Download from Github 1 x Grbl Controller @ zero. Download from zapmaker.org
 
Still more that I got at the moment. I just placed a half ton of concrete at the front of the house and rationally there are a number of must do home repairs that I need to get done over the next year or so, so any CNC I end up with will be cobbled together out of whatever I can find.

A concrete base, you say, Why, in my day ....:D

The "system" I described is mounted (too posh a word for the reality) on a bamboo dining-chair, held in place with a 6" G-clamp.

It does have the advantage of being at a comfortable working-height - I just pull up another chair so I can watch/adjust/mess-about, then swivel back to my computer to adjust the code, and try again.

I wholeheartedly agree with "cobbling it together" - power to your elbow.
 
A concrete base, you say, Why, in my day ....:D
Unfortunately a walk way and landing for the front entrance. I'm still stiff and have a little more to do! Thankfully it is raining all day today so I get out of working outside, plus the rain is keeping the concrete cool.
The "system" I described is mounted (too posh a word for the reality) on a bamboo dining-chair, held in place with a 6" G-clamp. It does have the advantage of being at a comfortable working-height - I just pull up another chair so I can watch/adjust/mess-about, then swivel back to my computer to adjust the code, and try again. I wholeheartedly agree with "cobbling it together" - power to your elbow.

I've been slowly collecting parts for a small machine, so maybe when things slow down this winter I will have enough to cobble something together. This is one reason why I took an interest in your thread, anything that highlights new ways to process G-Code is of interest to me.

Honestly how about a picture or two of that chair?
 
I knew that was coming, so I took some pictures yesterday. Today, Winslop refuses to recognise either my camera or the SD-card and thus the pictures are "currently unavailable" Sorry about that.
Geoff
 
That got me rummaging, and here are two pictures.
The first shows my pseudo-mill, with its chain-drives. Don't ask me about backlash! It isn't all that bad, probably only a few thou, and can mostly be beaten by always approaching critical points from the same direction.

The steppers, if I remember correctly, are rated 200 oz-in but draw only a quarter-amp so their "power" cables are simply telephone leads - the already crimped-on RJ-HowsYerFather ends are very convenient, as can be seen in the second photo.

The solderless breadboard alongside the Arduino is totally redundant - it's a left-over from other projects. The telephone wall-box cost about a quid. The huge advantage of the telephone wires is that I can simply unplug one- or both-motors for manual positioning, plug in again, power up and start sending code. (In one incarnation, I used 3-metre long telephone cables so the Arduino could be near my desktop-computer. I forget why.)
Geoff
BTW The computer that the Arduino etc sit on is just an old scrapper, whose case make a handy resting place for the said Arduino.

overview_of_mill.jpg


arduino_plus_pololus.jpg
 
Last edited:

Latest posts

Back
Top