109JB's User interface for the Arduino GRBL controller


Page 1 of 3 123 LastLast
Results 1 to 20 of 49

Thread: 109JB's User interface for the Arduino GRBL controller

  1. #1
    Member
    Join Date
    Jan 2005
    Location
    USA
    Posts
    1943
    Downloads
    2
    Uploads
    0

    Default 109JB's User interface for the Arduino GRBL controller

    Not sure if this is the best place to put this, but I couldn't find a better place with all of the subforums here.

    Anway, I have a CNC mill and have been using LinuxCNC for several ears using the parallel port. It has worked well, but I occasionally get real time warnings that are a little concerning to me. It has never caused a problem, but I began searching for a solution that I could implement on a shoestring. I thought about the mesa cards, switching to another motion control software, etc.

    I had been keeping an eye on GRBL which is a motion control firmware that is installed on a little Arduino microcontroller. GRBL is interesting because all of the time sensitive tasks are run on the Arduino, and it is doing nothing else but running GRBL. It is not running an operating system, or background programs, or other tasks. It is solely running GRBL, meaning that the real time tasks of operating the machine should be very stable. I have found this to be true. Since the board design is open source there are many places to buy them cheap. I decided to give it a try. Heck for the $7 it cost me I figured if nothing else it would be an interesting diversion. Well, I got that first board and I was hooked. GRBL is the firmware on the Arduino and it accepts a simple USB serial port stream of text (G-code) to run. The available G-codes are limited but all of the basics are there. you can simply open a serial monitor and start typing g-code, but since the input to GRBL is a stream of text, the user has to have an interface on a computer to use GRBL effectively. There are many interfaces out there, and I tried many of them. In one way or another I found each of them lacking and I decided to roll my own interface. At the time I started, none supported G81-G89 canned cycles and this was a major reason I started my own. I believe that some other have implemented limited canned cycle support, but I wanted the canned cycles to work the same as they do in LinuxCNC, and for that matter the Cincinnati VMC's I ran in my previous career. So that is what I did. I have decided to also release my interface as a free application to others who might like it. I have worked hard to get it where it is. Between GRBL and my interface, there is support for the following:

    Non-modal codes (Group 0) G4, G10 G28, G28.1, G30, G30.1, G53 G92, G92.1
    Motion (Group 1) G0, G1, G2, G3, G33, G38.2, G38.3, G38.4, G38.5, G80, G81, G82, G83, G85, G89
    (G2 and G3 support helical motion too)
    Plane selection (Group 2) G17, G18, G19
    Distance Mode (Group 3) G90, G91
    Arc IJK Distance Mode (Group 4) G91.1
    Feed Rate Mode (Group 5) G93, G94
    Units (Group 6) G20, G21
    CDC (Group 7) G40 - (I'm working on G41/G42 now)
    Tool Length Offset (Group 8) G43.1, G49
    Canned Cycles Return Mode (Group 10) G98, G99
    Coordinate System (Group 12) G54, G55, G56, G57, G58, G59
    Control Mode (Group 13) G61
    Spindle Speed Mode (Group 14) G96, G97
    Lathe Diameter Mode (Group 15) G7, G8

    Stopping (Group 4) M0, M2, M30
    Tool Change (Group 6) M6 Tn
    Spindle (Group 7) M3, M4, M5
    Coolant (Group 8) M7 M8 M9
    Override Switches (Group 9)
    User Defined (Group 10)

    As you can see, the list is pretty complete. Some of the above are not supported natively in GRBL and are handled in the GUI. For example, A canned cycle (G81-G89) is interpreted b the GUI and the individual linear moves that make up the canned cycle are what is sent to GRBL. This is how the cutter compensation I am working on will be handled as well. the heavy lifting will be done by the computer with GRBL focusing on moving where it is supposed to when it is supposed to.

    Here is a look at the main window of my GUI and you can get an idea of what it has. There is unfortunately no graphical backplot, but as I get better at programming I hope to be able to do that some day. I used MS Visual Studio 2005 to write the interface so that I could try to use it on an old Windows 98 laptop. I have confirmed that it does work on that windows 98 machine, but performance is a bit lacking. There are no errant motions, but for large files with lots of little bity moves, the machine can sometimes not stream fast enough and you can get a brief pause between moves. This isn't a problem for anything more modern though.

    109JB's User interface for the Arduino GRBL controller-new-grbl-ui-png

    As i said, the GUI is available for free download at this link

    https://dl.orangedox.com/e8hUY9RuEsEJHYCX6o/109JB's%20GRBL%20Interface%201-0-0-0.zip

    If you are running a parallel port based machine you can try it pretty easily. Here is how I did it on my machine. I didn't want to mess with anything that couldn't be easily reversed until I knew GRBL was going to work, so I built the following adapter that simply plugs into the parallel port breakout board on one end, and the USB port of the computer on the other end. I used an Arduino Nano for its small size and just cut the end off of an old parallel port cable, soldering the wires to the Nano. A small project box finished it off. This has worked so well that I haven't changed a thing and don't think I will, but if you would like to you can completely eliminate the breakout board and wire the Arduino directly to the stepper drivers, switches, etc. It essentially works as a breakout board.

    109JB's User interface for the Arduino GRBL controller-img_0407-jpg

    109JB's User interface for the Arduino GRBL controller-img_0408-jpg

    109JB's User interface for the Arduino GRBL controller-img_0409-jpg

    Enjoy.

    John B.

    Similar Threads:
    Last edited by 109jb; 10-07-2015 at 09:40 PM.


  2. #2
    Registered
    Join Date
    May 2014
    Posts
    97
    Downloads
    0
    Uploads
    0

    Default Re: 109JB's User interface for the Arduino GRBL controller

    Nice work. I too am barely and amateur programmer (although much more amateur than you apparently) What language did you use?

    I have been working on a script in Python that will output GCode and uses PySerial to stream it to GRBL.



  3. #3
    Member
    Join Date
    Jan 2005
    Location
    USA
    Posts
    1943
    Downloads
    2
    Uploads
    0

    Default Re: 109JB's User interface for the Arduino GRBL controller

    I used MS visual studio 2005 because I was trying to use an old laptop I had ling around. I will probably switch to Visual Studio 2010 soon though.



  4. #4
    Registered
    Join Date
    May 2014
    Posts
    97
    Downloads
    0
    Uploads
    0

    Default Re: 109JB's User interface for the Arduino GRBL controller

    Shows what I know; I thought that was some type of IDE or something. lol me.



  5. #5
    Member
    Join Date
    Jan 2005
    Location
    USA
    Posts
    1943
    Downloads
    2
    Uploads
    0

    Default Re: 109JB's User interface for the Arduino GRBL controller

    Visual studio is an IDE for developing Windows applications. They call it that because it can use many different programming languages. The version I have has what is essentially Visual Basic, although it has additional features for .net. You can also use Python within VS as well as C++, C#, JavaScript, and others. All for free.



  6. #6
    Member
    Join Date
    Jan 2005
    Location
    USA
    Posts
    1943
    Downloads
    2
    Uploads
    0

    Default Re: 109JB's User interface for the Arduino GRBL controller

    I corrected some issues and added a few features to my GRBL Interface. The main fix was that user settings weren't being saved correctly. The new link is:

    https://dl.orangedox.com/EqqZYCIOLOe...0Interface.zip



  7. #7
    Registered
    Join Date
    Feb 2015
    Posts
    11
    Downloads
    0
    Uploads
    0

    Default Re: 109JB's User interface for the Arduino GRBL controller

    Can you jog the machine with keyboard arrows when using this GUI?



  8. #8
    Registered
    Join Date
    Feb 2015
    Posts
    11
    Downloads
    0
    Uploads
    0

    Default Re: 109JB's User interface for the Arduino GRBL controller

    Quote Originally Posted by tklus View Post
    Can you jog the machine with keyboard arrows when using this GUI?
    Guess I should have read the manual first. I now see that it can jog with the keyboard looks great! thanks for all the work you put into this.

    Tim



  9. #9
    Member
    Join Date
    Jan 2005
    Location
    USA
    Posts
    1943
    Downloads
    2
    Uploads
    0

    Default Re: 109JB's User interface for the Arduino GRBL controller

    I've been doing some performance testing trying to figure out how to make this thing faster and I found something very interesting. During writing of the program, I had been using 10 to 5000 line G-code programs to test and everything was swell. Yesterday I decided to generate a large G-code file and run it. It didn't go so well. Performance was really slow. So over the last day I have been searching for solutions. I found a few things that really improve performance. I determined that the bottleneck was how fast the program could read a line of code and here are the things I found that could speed that up. I created a test program to experiment with simply reading the G-code, do most of the processing steps, and then going to the next line without the wait for grbl. Here are the things I found and the estimated improvement in the G-code reading part of the process.

    1 - I had been reading each line of code from the textbox that contains the G-code. Changing it so that the text is first placed into a one-dimensional array with each piece of the array being a line of G-code, and then performing the run from this array improved performance greatly. I wen from being able to read and process 4500 lines in about 68 seconds to being able to do it in 34 seconds.

    2 - The default was to echo the actual lines sent to a textbox with an OK response from grbl. I was also writing each response from GRBL into the serial monitor textbox. Eliminating the writing of the echo and the monitor responses took off some more time taking the 4500 line code down to 27 seconds.

    Those 2 helped, but my large file I was trying to test was 72,000 lines long and still brought the program to a halt, so there was more to do. In my test program, I included all of the monitoring stuff that the program has including the progress bars for sent lines, the buffer, and the receive buffer. Disabling the progress bars mad an absolute huge difference. Using the 72,000 line G-code file, I was able to scream through it in just 48 seconds. Simply enabling the Sent lines progress bar took that up so much that I wasn't about to let it got to the end. I ultimately just ran it with the progress bar enabled and noted how many lines it got through. In 48 seconds it only got through about 750 lines. So, just having the progress bars took read performance to 1 percent of its potential.

    So, stand by and there will be a new version uploaded. I still like the progress bar presentation and echo of the lines sent, so I won't be getting rid of them, but I am going to provide a toggle to turn them off for cases where top performance is required Large files with lots of short moves are what will be affected, so in other words, CAM created G-codes.

    I should have the new version ready to go sometime tomorrow. Actually today, since it is 12:50am where I live. Gotta get some sleep first though. Please stand by.

    John B



  10. #10
    Member
    Join Date
    Jan 2005
    Location
    USA
    Posts
    1943
    Downloads
    2
    Uploads
    0

    Default Re: 109JB's User interface for the Arduino GRBL controller

    So it took me a bit longer to sort out the performance issues that I found, but I have succeeded.

    When writing the program, I had been using 0-5000 line G-code programs for testing. I never noticed any performance issues on my Core i5 laptop, but they were there. I found it last week when I decided to run a CAM generated file that had about 45,000 lines. The program slowed to a crawl on the i5 laptop. It was so slow that at times, GRBL went into an idle state because it was waiting for the GUI to feed commands. I knew something had to be done and I wrote a small program to investigate and used a CAM generated file that is just over 1,000,000 lines long.. Here is what I found:

    1- The green progress bars at the bottom of the main slow things down too much for my liking, so they are gone. they have been replaced with text indicators.

    2- I had some excess code that I streamlined. Probably helped some but not really enough to notice.

    3- The big one was how the program was reading the g-code file. I had it to where it was reading a line of text from the textbox, performing necessary operations, and then moving on to the next one. I experimented with a couple other way. First, putting all of the G-code into an array, and then reading the array one element at a time. The second thing was tracking if the G-code was editied without saving and if not, re-opening the file and running directly from the open file. Both of these options worked very well. In my test program, that doesn't send to GRBL, they both ran the 1M line g-code file in about 41 minutes. Reading from the textbox ran for over 6 hours and I then decided enough was enough and I stopped it. On a smaller file, the improvement was 36X on the read portion. I added some code to track the planner buffer state for all lines except the first and last 50, and on a 45,000 line g-code, the program maintained the buffer at 16 or 17 for the entire run on my i5. It even makes it so the program will work on my 500 MHz Pentium III laptop running windows XP. On that machine it doesn't keep the buffer full at all times, but it does very well. The Cam file i am using has been edited to make all moves in rapid traverse, so it should be fine.

    I also added some things and fixed some things.

    I also am using a different installer. This will provide an uninstaller in the program folder in the start menu, and with it I can include other files. The tool table, revision log, and user manual will install in the program folder automatically. There is a link to the manual in the help pull down now. The download is at the same link which is listed below.

    https://dl.orangedox.com/EqqZYCIOLOe...0Interface.zip



  11. #11
    Member
    Join Date
    Oct 2015
    Posts
    7
    Downloads
    0
    Uploads
    0

    Default Re: 109JB's User interface for the Arduino GRBL controller

    Just got excited to try this, but "109JBs GRBL Interface has stopped Working" when i press connect. Win10.



  12. #12
    Member
    Join Date
    Jan 2005
    Location
    USA
    Posts
    1943
    Downloads
    2
    Uploads
    0

    Default Re: 109JB's User interface for the Arduino GRBL controller

    Your baud rate for the serial port connection is likely wrong. If the baud rate is wrong the connection can still be established, but no information received will crash the program. Set the baud rate correctly and it should work.

    Set thing under "Settings - Port Settings"

    I will investigate ways to detect this.

    Last edited by 109jb; 10-12-2015 at 06:38 PM.


  13. #13
    Member
    Join Date
    Oct 2015
    Posts
    7
    Downloads
    0
    Uploads
    0

    Default Re: 109JB's User interface for the Arduino GRBL controller

    Baud rate is correct. Program is saying: "error: Expected command letter"
    Also tried with lower baud rate, program is not crashing, either not connecting.



  14. #14
    Member
    Join Date
    Jan 2005
    Location
    USA
    Posts
    1943
    Downloads
    2
    Uploads
    0

    Default Re: 109JB's User interface for the Arduino GRBL controller

    unexpected command letter is a response from GRBL. There was likely a string in the buffer that did not have an end of line character. and when the program started, then when the first command from the GUI was sent it tacked on to the end of that line. I will investigate.

    Also, do you have $10=15. The program requires this as detailed in the manual.



  15. #15
    Member jalessi's Avatar
    Join Date
    Feb 2007
    Location
    United States
    Posts
    4553
    Downloads
    1
    Uploads
    0

    Default Re: 109JB's User interface for the Arduino GRBL controller

    John,

    Is there a specific file for GRBL like the Mach3 XML file?

    Jeff...

    Patience and perseverance have a magical effect before which difficulties disappear and obstacles vanish.


  16. #16
    Member
    Join Date
    Jan 2005
    Location
    USA
    Posts
    1943
    Downloads
    2
    Uploads
    0

    Default Re: 109JB's User interface for the Arduino GRBL controller

    Quote Originally Posted by jalessi View Post
    John,

    Is there a specific file for GRBL like the Mach3 XML file?

    Jeff...
    Jeff,

    I'm not familiar with the mach 3 xml file. I previously used linux. The only thing that you should need to set for the GUI to work right within GRBL is $10=15. If it isn't set for that, the program should check on first run and reset it. It may crash that first time but it should get the setting to grbl before the crash. Just restart and all should be fine.



  17. #17
    Member
    Join Date
    Jan 2005
    Location
    USA
    Posts
    1943
    Downloads
    2
    Uploads
    0

    Default Re: 109JB's User interface for the Arduino GRBL controller

    Quote Originally Posted by zarsss View Post
    Baud rate is correct. Program is saying: "error: Expected command letter"
    Also tried with lower baud rate, program is not crashing, either not connecting.
    Quote Originally Posted by 109jb View Post
    unexpected command letter is a response from GRBL. There was likely a string in the buffer that did not have an end of line character. and when the program started, then when the first command from the GUI was sent it tacked on to the end of that line. I will investigate.

    Also, do you have $10=15. The program requires this as detailed in the manual.
    zarass,

    If the error message was displayed in a popup box, then the program is connected and the connection is working. The reason I say this is because in order to get to the popup box, it means that the program read that line and parsed it to discover it was an error. The most likely reason is like I said before, that there was a string in grbl's read buffer already that didn't have and EOL character.

    An easy way to see if the connection is working is if the DRO goes from 0000.0000 to numbers without all of the leading 0's for x y and z. Something like 0.0000, or 1.1234.

    What you can try for now is to do a hard reset on the arduino before starting the program. I will look into adding a check for the connection, and also will add a few lines to send a request to grbl that will clear that receive buffer before proceeding.

    Note that all of the monitoring is set to off on startup, so you won't see any communication except for errors. This is for performance because on large files all that writing to the text boxes will eventually catch up and bog down the program. I have it set so that errors are always written to the serial monitor but everything else can be turned off and is by default. You can turn the monitor on using the check boxes above the serial monitor's text box. One turns on everything but the periodic status reports. To see these, use the other check box.



  18. #18
    Member
    Join Date
    Oct 2015
    Posts
    7
    Downloads
    0
    Uploads
    0

    Default Re: 109JB's User interface for the Arduino GRBL controller

    Hi. Looks like the problem is windows 10 related. Tried today on another computer with win10 and different arduino board, the same. At the moment of establishing connection, program crashing every time. Also tried re flash arduino with default settings.


    Attached Thumbnails Attached Thumbnails 109JB's User interface for the Arduino GRBL controller-109jb-jpg  


  19. #19
    Member
    Join Date
    Jan 2005
    Location
    USA
    Posts
    1943
    Downloads
    2
    Uploads
    0

    Default Re: 109JB's User interface for the Arduino GRBL controller

    Can you confirm if GRBL setting $10 is set to $10=15. This is required for the program to operate correctly.

    Also can you tell me what version you have downloaded from the Help - About menu?



  20. #20
    Member
    Join Date
    Oct 2015
    Posts
    7
    Downloads
    0
    Uploads
    0

    Default Re: 109JB's User interface for the Arduino GRBL controller

    $10=15. I have version 1.0.0.3



Page 1 of 3 123 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

109JB's User interface for the Arduino GRBL controller

109JB's User interface for the Arduino GRBL controller