Comments
Nice. I’d really like a graphical interface for Grbl! In stream.rb I can guarantee that the buffer will not overflow, but it is never a problem in reality. I send a number of lines at once (e.g. 10) and then continue to send new lines every time I see an ‘ok’. It works, but in principle it is terrible. I wish I could find a way to use hardware handshaking. |
I did not tinker to much this weekend…. I will try the 10 and then do one line per ok some time in the future. I previously let python send non stop to Grbl and I think I may have been overloading it somewhere maybe. Not completely sure. The gcode file Vectric Cut 2D generates for me is not generating G02/G03 arc gcode and generates lots of little G01 lines. I need to figure if I can get it to do G02 and G03. I have not pushed/tested/made additions to the comm limits of Grbl yet but I was thinking a little bit about the usb software/hardware handshaking…getting carried away it would be cool if the Arduino had a dual core processors with shared memory of some sort. Get one processor to handle comms and the other to do the stepping. Other thoughts, if there was a use some I/O could be done thru a printer port. If you are interested in a copy of the python I am hacking together let me know. I am more then willing to share. It is not completely fine tuned yet but it keeps getting better. |
In cut 2d there is two separate output profiles for G-code with or without arcs, but personally I use the one without. The atmega 168/328 has very limited RAM so I have been very frugal with the serial input buffer. Without some sort of handshaking the buffer will be overrun in seconds. The real solution is to buffer to an SD-card and I plan to do this at some point. Edward has been doing something along these lines using two arduinos: I would like to follow your development. Why not host your code here at github? |
I started a github repository. Looks like I need to download some additional software before I can put code in repository. Do I need to put any sort of GNU open free sort of clauses in with the code? I am new at this. |
No you don’t need to explicitly state the licence – but with a free github account you are not allowed to make private repositories which means anyone will be able to download your code. You need to install git in order to use github. |
Sounds good, I installed git and put a screen shot of the interface in a repository under my account. I plan to put code there soon also with gnu license. |
Update:
|
Here is Arduino handshake code I mention in previous comment. PC Python program sends gcode line to arduino with “?” at end of line. If arduino can send back proper count of chars to PC Python program things are good. PC/Python then sends “*” telling Arduino to “gc_execute” run the line. If bad count is sent back PC/Python sends back “#” character to cancel line and start over. void sp_process()
} |
Hi Simen, |
I don’t understand exactly what the problem is, so please educate me! Grbl ends each line with a CRLF, why isn’t that sufficient? A long long time ago I wrote I simple testing interface for grbl in Air. It can be found here: I can’t remember having trouble with handshaking. But I am sympathetic to the cause, I just have to make sure this is a real problem. |
ok, I got it (sort of) figured out. I am not too experienced with sockets so the real problem is probably on my end
so, right now I am schecking for 10 13 or 13 10 and then sending the resulting string to the display and all is well! I don’t know if there is a standard method for this, it seems quite a workaround.. |
btw, the code for the air app is here: |
I am doing a different python interface then your ruby interface. Should I be doing some handshaking with code on the Arduino. How many lines can I send at a time? Should I wait for code on the Arduino to write back “ok” before I send a next line. I am going to play with it some but if you can give me a head start that would be great. Should code on arduino store up a bunch of gcode lines before starting execution.
(My python interface is a little further along. I made it so that it can draw G02 arc gcode in python/opengl. Not the heart of the system but nice shiny surface stuff.)