Grbl Controller 3.0

Downloads: http://zapmaker.grblcontroller.s3-website-us-west-2.amazonaws.com/

Souce Code: https://github.com/zapmaker/GrblHoming

Record Issues Found: https://github.com/zapmaker/GrblHoming/issues?state=open

Grbl Controller is software that is designed to send GCode to CNC machines, such as 3D milling machines. It isn’t super smart, it just needs to give the user a nice way to get commands down to whatever controller they are using.

Version 3.0 is has been optimized for the Arduino to control Grbl shields. I am using it to control my Shapeoko milling machine. It is the only program I use with my Shapeoko in order to maximize the amount of real-world testing.

Grbl Controller is written using the Qt cross-platform libraries. It also gets some help from the QextSerialPort library to simplify choosing the correct USB serial port.

Qt is pretty cool because you can create a nice GUI application for Windows, Mac and Linux. Qt was originally developed by Nokia (ok, Trolltech to be exact, bought by Nokia). To develop in Qt you must be proficient in C++.

Why am I writing about this? I wanted a controller that would run on an old Pentium III laptop running Debian 6 – the only option was Universal G-Code-Sender written in Java, which unfortunately ran really slow on 256 MB of RAM due to the Java requirements. There is a pretty nice Windows-only project called GCodeSender that has been in use for the Shapeoko project since the early days.

I found a project on github called GrblHoming aka Grbl Controller, which was originally developed by Kosme, which showed promise for running native C++ on Linux, however it needed some attention.

I forked the project and started tweaking it to compile and run under Linux. I got it working and posted a version. Although it mostly worked, the bugs started to, well, bug me. I also knew people were interested in a native Mac version, so lots of hours later (mostly spent learning the ins and outs of Qt) I’ve produced version 3.0, which provides some neat enhancements like a status bar and time elapsed. It is also a near full rewrite to take into account how Qt protects memory objects across multiple threads using “signals and slots”.

For information on how to build it on all three platforms, check out this multi-page “manual”.

Give it a try and let me know if it works for you.

Here is an interface of the Grbl Controller V3.0. In this shot it is connected to my test Arduino running an older version of the Grbl code. The latest code doesn’t echo commands.

153 thoughts on “Grbl Controller 3.0

  1. Hi Jason – Version 3.0 computes the XYZ position. Version 3.1, which I hope to ship very soon, will instead obtain the position directly from Grbl for accurate position information.

  2. I can’t find a link to download the source so I can build this on Linux. I found the page with Linux instructions, but can’t find the source code.

    Am I missing it?

    Thanks!

    • Hi Tim-

      Check out my Raspberry Pi instructions. They are roughly correct for building on other flavors of Linux: http://zapmaker.org/raspberry-pi/running-grbl-controller-on-raspberry-pi/

      The trick is to install git using apt-get and then issue git commands to pull the source from github. This can be done in two commands.

      Also, the flyout menus can be confusing (not my ideal UI, but I have to live with what WordPress gives me). Take a look at all the items above for flyout menus (cascading menus) – there are some potentially useful pages for building.

      Hope this works for you,

      zapmaker

      • Thanks. I see the git hub link on the top of this page now, was it always there? I would not surprise me if I had missed it!

        I’ll build it this evening and try it out on my mill. Thanks!

        • No, I put it there after I received your post. Your question told me that I needed to add the link on the top of the page. I checked out your site, very nice work on your shapeoko build.

          • Thanks! I think it’s a great platform. I’ve been using Universal G Code Sender and I’m very interested to see how your program compares.

  3. Hi Zapmaker,

    First, thanks a lot for developing this, it looks very promising!
    I mentioned GRBL-Controller the other day on the GRBL github page because now and again there is a mentioning of having a separate GUI for GRBL that also takes away some stuff from the Arduino board. IMO your program is at the moment very promising for this as it is written in a well supported toolkit.
    Now there’s a discussion going on here https://github.com/grbl/grbl/issues/202 about the future of GRBL, maybe you can have your say about what you think would be possible GUI wise with your program.
    Would be great!

    Regards, Peter

    • Thanks Peter – I’ll take a look and possibly comment. I’ve been holding back on my efforts with the program because I’m trying to get my shapeoko up to the point where I can do more advanced work. Not enough time in the day to multitask, unfortunately.

  4. Hey Zapmaker, really like Grblcontroller, starts up 100 times faster than UniversalGodeSender on my Rasp and i really like the Design.

    Just one Problem with the latest build from the github code, with grbl 0.9a it works fine, but i can’t get it running with 0.8c, i open the serial port and the sortware is stuck, controls do not get activated.
    The logfile reports:

    2013-03-29 17:19:34.514 INFO (DIAG) – Grbl Controller 3.3.4 has started
    2013-03-29 17:19:36.761 DEBUG (DIAG) – SENDING:
    2013-03-29 17:19:36.962 DEBUG (DIAG) – GOT:ok
    2013-03-29 17:19:37.162 DEBUG (DIAG) – SENDING: ?
    2013-03-29 17:19:37.363 DEBUG (DIAG) – GOT:
    2013-03-29 17:19:37.364 ERROR (DIAG) – Error decoding position data!
    2013-03-29 17:19:37.464 DEBUG (DIAG) – GOT:ok
    2013-03-29 17:19:37.665 DEBUG (DIAG) – SENDING: G21
    2013-03-29 17:19:37.665 INFO (STATUS) – > G21
    2013-03-29 17:19:37.866 DEBUG (DIAG) – GOT:ok

    Any Idea?

    Thanks

    Johannes

    • Hi Johannes-

      I ran a test with my pi and 0.8c and 0.9a and it works fine on my setup using 3.3.4. I’ve upgraded from 0.8c to 0.9a and back down to 0.8c. No problems.

      What I don’t see in your log is the GOT:Grbl 0.8c ['$' for help] message, which should be the fourth line in the logs.

      A few possibilities: Something in the 0.9 settings has confused the 0.8 code. First, you will need a terminal program like minicom and connect it to the COM port of the arduino.

      sudo apt-get install minicom
      minicom -b 9600 -D /dev/ttyUSB0

      The first thing that should happen is that you will see the Grbl prompt with the version. If you don’t see that, then there is a core problem. Next type $$ and make sure all 23 parameters that are displayed are correct.

      To exit minicom, type Ctrl-A and then type X, it will prompt if you want to exit. Let me know what you find out.

      • Thanks for answering.
        I just did some tests with 3 of my Arduino Boards, all cleaned (eeprom) and reflashed with the latest grbl 0.8c.

        All Boards show the grbl prompt in Minicom (as expected), but only the Uno Board is working with grblcontroller.
        The Nano and the Pro-Mini Board (all with 16MHz, 328 proz.) do not work with grblcontroller (grbl 0.8c and UniversalGcodeSender work fine on this boards).

        So there seems to be a problem with boards other than the UNO, maybe caused by another bootloader?
        What do you do to check for grbl on startup? Do you reset the Arduino? Are there any “special” wait cycles.

        Problem is that i soldered a pro-mini to my CNC, so it would be cool if it worked with that board.

        Thanks and happy Eastern
        Johannes

        • The way Grbl Controller works is it sends out a linefeed to get a response back, which is in some cases needed to tell something is there (the ‘ok’ response). I probably should remove that code or change it to only send the linefeed if it doesn’t get a version string right after connecting. I will look into fixing that, but until that happens, please try the following..

          My guess is that those other processors are slower than the uno and the response timeout occurs before the string is returned. Since you had to compile the code, what I would suggest you try is to open gcode.h in an editor like nano and change the value of SHORT_WAIT_SEC in gcode.h from 1 to 3 and run make. For example

          (change into GrblHoming folder)
          nano gcode.h
          (edit the line mentioned)
          Ctrl-O (writes out the file)
          Ctrl-X (exits nano)
          make

          then try it again.

        • Johannes-

          I have rewritten the startup code in the latest version 3.3.5 on github. If you modified the gcode.h as I noted in my other post, make sure you first do a git checkout gcode.h to overwrite it then do a git pull to get latest and follow it with a make (otherwise you will need to remove the entire GrblHoming folder and do a git clone).

          I’ve tested it with the pi and also with Windows. I posted a new Windows installer. Let me know if it works on the other two arduinos.

          Happy Easter!

          • YES!
            That did the trick ;_)

            Just tried it on my Laptop and it seems to work fine, will test it on my Raspberry later, but i guess it will work there too!
            Thanks a lot!

          • Glad it worked. Feel free to add any other issues you find up in the issues tracker on github (I saw the one you put up there).

          • I’ve also fixed the decimal point issue – version 3.3.6 now has three digits after the decimal. Currently only available on github – only for those who build their own, like on the pi. I may make a windows version eventually.

  5. Hello, congratulations for this software very interesting and good for beginners like me. :D
    I’m trying to build my first cnc, and would like to know how to connect the Arduino to the program ?
    it is necessary to program the Arduino with some special code ?
    I appreciate an answer, thanks.

    • You need to install the Grbl software. Download it from github and then reprogram your Arduino using the ArduinoUploader tool:

      http://www.ngcoders.com/downloads/arduino-hex-uploader-and-programmer/

      For the Uno, you will need to set the microcontroller to m328p, then in the AVR Dude Params you need to change -b19200 to -b115200

      Finally, select the hex file you want to upload. I used grbl_v0_8c_atmega328p_16mhz_9600.hex
      which I downloaded from http://bit.ly/SSdCJE (see Downloads section on this page https://github.com/grbl/grbl)

      You can get use other tools to do this, for example, see https://github.com/grbl/grbl/wiki/Flashing-Grbl-to-an-Arduino

      In theory, you should also be able to restore your original Arduino software using the uploader, but I don’t have the link handy for the hex file.

      • hello again, thanks for the reply.
        While waiting for an answer did uploud straight trough the Arduino program and it worked perfectly. Right now I have the “Grbl controller” to work seamlessly with arduino uno, very good for the first attempt, thank you and continuation of a good job. greetings.

        • Just a small question how do I change the settings to use my stepper motors, as set up in the footsteps of my engine to make a full turn?

          • You probably have a shield on the arduino that allows you to microstep the stepper motors. You need to know how many steps per revolution the stepper has (usually either 200 or 400) and then you need to know your microstepping value. If you are using the 18 tooth pulleys, then for X and Y I would start with the value of 43.74 (steps/mm).

            Command the X axis to move 10 mm and measure it. It will probably move 10 mm, 5 mm, or 20 mm. If it moved 5 mm, then you can decrease the microstepping by half or double the steps/mm setting. Reverse is true if you have 20 mm movement.

            Repeat for the Y axis. The Z axis uses different values because it uses a screw instead of a pulley.

            Take a look at http://www.shapeoko.com/wiki/index.php/Assembly_step_15

  6. Hi, I’m building a ShapeOko using a Raspberry-Pi, our Alamode (Arduino Uno compatible) and grblshield. The Alamode uses port /dev/ttyS0. I’m able to talk to grbl using Minicom, and was able to transmit a .nc file to it via Minicom. But, on GeblController, the drop down list of ports does not show /dev/ttyS0, so I’m unable to connect to it. Is there a way to add port dev/ttyS0 ?

    • I have modified the code to allow optional manual editing of the com port field. Pull down the latest changes and build and see if that works for you. The version will show 3.3.7.

      • Awesome. I don’t have access to my Pi until Monday morn (it’s lying at my work place). I’ll report back once I try it out. Thanks.

  7. Hi zapmaker, I tried ver 3.3.7, but it still doesn’t work. It reports “No data from COM port after connect. Expecting Grbl version string”.
    I tried using /dev/ttyAMA0 as well as /dev/ttyS0.
    Using $ dmesg | grep -i tty I got :
    [ 0.000000] console [tty1] enabled
    [ 0.583964] dev:f1: ttyAMA0 at MMIO 0×20201000 (irq = 83) is a PL011 rev3

    Using minicom -b 9600 -D /dev/ttyS0, I’m able to connect to the Alamode/grblshield, and receive the Grbl version string and settings using the $ command.

    Any idea what’s happening ?

    PS : I’m a HW guy, so my Linux-Fu is very limited.

      • Thanks for the update, good to know you can get it working, kind of.

        Here is the normal sequence: you connect your arduino to a USB port, then the OS sees the port, then you start Grbl Controller, which lists the port in the drop down.

        If you are opening Grbl Controller and then connecting the arduino, it may not work right. Also, when Grbl Controller opens the port, the arduino will automatically restart Grbl. I wonder if the restart isn’t happening on your arduino clone for some reason.

        Let me know if it is a sequence issue that you are running into or if it is something else. If I get a chance, I’ll try to pick up one of these clone arduinos and see what is happening.

  8. Pingback: | Domestic Hacks

  9. Hi, I have built a 2D Laser Plotter with grbl and recieved only this error massage:

    “No data from COM port after connect. Expecting Grbl version string.”

    Grbl works correct and well withe the G-code sender and a terminal program.
    I don’t use a Arduino. I have a ATmega328 on a bearboard with the steppers and a UM2102 USB Board from ELV.

    Any idea? If you need more Information (errolog etc) please contact me via mail.

    Thanks, Robert

    • Hi Robert – This is was a bug I fixed a few days ago. Please try with the latest source from github if you are using Linux or version 3.3.9 I posted on AWS (top link on this page). Please let me know if it fixed the problem.

  10. First – I love GRBL controller! Good job, and I’ll see you in Seattle.

    However… I have a reproducible problem with completing a sequence of G-code. If I send the code without “aggressive preload”, it works, but not with preload invoked. It also works with GRBLuploader. The code fills the buffer to the last command (M30), and the commands are processed correctly by GRBL, but the status stops at “99%”, the last few steps are not updated on the machine coordinate display, and there is no way to get control of GRBL again except by closing and reopening GRBL Controller.

    This sequence works every time :
    G92 x0 ( zero X to current position).

    G4 P0.15 (delay for gem stabilization)
    M8 ( shutter release – on, using flood coolent control)
    G4 P0.05 ( Edge triggered – wait 0.05 sec for shutter)
    M9 (shutter release – off)

    G0 X4 (next position (4 mm/inches = degrees).
    G4 P0.15
    M8
    G4 P0.05
    M9

    > Sequence repeats with X increments in steps of 4 to X356
    >> last sequence:
    G0 X356
    G4 P0.15
    M8
    G4 P0.05
    M9
    M30 ( stop)

    This fails every time. Identical to above but with different p values :
    G92 X0 ( zero X = current position)
    G4 P0.1 ( delay for incredibly slow live View Mode )
    M8 ( shutter release – on, using flood coolent control)
    G4 P0.2 ( wait, and allow for shutter speed )
    M9

    G0 X4 (next position (4 mm/inches = degrees)
    G4 P0.1
    M8
    G4 P0.2
    M9

    >>>With 88 more G code blocks with the final being X356

    I have many examples of different code – both failures and success. It does not matter how long the sequence is – I can have a 1000 lines or 10,000 lines and they all work, but control fails to return to grbl controller (and the last few machine coordinates are not updated). It also doesn’t matter if I use very short P values, like 0.02.

    It appears that GRBL Controller is sensitive to the TOTAL number of decimal digits after the P commands, but the command is executed correctly by GRBL. I suspect it has to do with what gets into the last buffer and what doesn’t, but I can’t see exactly what is going on.

    I’m using GRBL 0.8C on an UNO communicating at 9600 baud.

    If it would help I can send the complete files or any other information.

    -Andy

    • You are right. I tried the snippet of GCode and it does fail with Grbl Controller 3.3.9 in the way you said (works with AP off). Will look at it and hope to get this solved soon.

  11. … adding to my prior post, I am using 3.3.9 on Windows 7 64 bit, and it’s the work coordinates that do not get specifically updated for the last few X moves on return failure (didn’t notice the machine coordinates).

    • Andy-

      If you can send me example code that would make fixing this much easier/faster. Email me at this domain and preface with zapmaker at.

      Glad you are liking the tool, looking forward to meeting you also at the Seattle Maker Faire. Incidentally, I switch between running Windows 7 64 bit and on the Pi. Rarely do I run on standard Linux and the Mac.

    • Yes, I received them. I discovered and fixed the problem. There is a new build on the distribution site (first line on top of this page) version 3.4. I also has additional enhancements (which is why it took so long to get back to you). The new version appears to run both your files correctly. Please let me know if you run into any other problems, as I am curious about grbl and its subtleties with modal commands, which appeared to cause the problem.

      Incidentally, the solution was to always wait for the coolant off ok response before sending further commands.

      Thanks for catching this bug.

      • I’ve tested the 3.4 version. Yes, the code now works… but… I now have another problem – overall cycle speed.

        I don’t use the M8 [wait] M9 as “coolant” – just to trigger a relay for a camera (photographing obects on a rotary axis) for a predetermined shutter activation time after a programmed stabilization delay. The code worked “perfectly” on 3.3.9, but with the problem described above ( GRBLcontroller getting back to me).

        Now because of the wait for “ok” response on M9 with 3.4 and using the code I sent , the sequence now execute in 1 minute 17 seconds. 3.3.9 executes it in 38 seconds, and as fast a 25 seconds on some of my other code with smaller P values.

        Unfortunately, my device needs 30-40 seconds total cycle time and I was banking on your fabulous aggressive preload as it worked prior… With 3.3.9 my overall timing was deterministic with drive time and delay values (plus small overhead); now small G4 P0.x values between M8/M9 are somewhat meaningless as it seem to take about 0.6 second just to send an get “ok” on M8 M9.

        I found out that with 3.3.9 I can work around the prior issue if I burn a few G codes between the last M9 and the M30 (Stop), everything works fine.

        Like :
        M9 (last M9 in sequence)

        G92 Y0 (burn a few G-codes – I don’t use the Y axis)
        G0 Y10
        G0 Y-10
        G0 Y10

        M30 ( stop )

        It only locked up yout 3.3.9 in the failure sample I sent if I did
        M9 (last M9)
        M30.

        Any ideas? I’d hate to have to lock in your 3.3.9 with my work around and not have the benefit of your bug fixes and feature enhancements.

        -Andy

        • I was getting lockups randomly about 5-10 commands into the sequence with 3.3.9, so the behavior was different than you experienced. The “wait for M9 ok” stopped all the lockups from happening, which is why the fix.

          Although I could offer an option checkbox to not wait for M9 ok, if you and I are experiencing different behavior, that may not help much in the long run (possibly it is due to different builds or version of grbl?)

  12. Thinking more about it… yes, waiting for “ok” on M9 fixed the issue, but why do we have to wait for that? I imagine grbl knows that it has to wait for M9 to complete before execution of the next motion command, so all we have to do is keep the buffer full? Is there no way to do this without waiting for the “ok”. Maybe I’m missing something

    • This whole business of waiting for the ok was determined experimentally. It has something to do with the way grbl is coded. I am reasonably confident based on the logs that Grbl Controller isn’t causing the problem. Incidentally, the python script that does the buffer preloading that comes in the grbl source has the same lockup problem, so I’m pretty sure it is grbl.

      Keep track of which hex file you burned onto your arduino. Then we could both try the same version of grbl (or a newer one, but same binary) with 3.3.9 and see if we get the same failure mode. I’m trying to understand if this is a problem with grbl or with something else.

      Since I’m trying to get ready for the Maker Faire, code changes are going to be few and far between between now and then. You’ll have to stick with 3.3.9 for now until we can get this resolved.

  13. Thanks. I’m OK for now; Makerfaire is far more important. I downloaded the QTSDK from Nokia, installed github locally and and hey, 3.4 built fine (one warning). Encouraged by my minor success, I did the same with gbrl and it also builds. I haven’t written a line of C in 20 years, but I’ll fiddle with some simple stuff. :-)

  14. Hi, I just downloaded 3.4 and I have my grbl set to 115200, but the controller will only connect at 9600. Is that something on my end that I need to fix or did I stumble on a bug? (3.3.9 works fantastic btw so thank you VERY much)

  15. Pingback: Shapeoko CNC test dell’elettronica | peppeschizzo

  16. Hello
    I enjoy to use this but, I have a trouble with GRBL configuration
    I need to change direction of Z axis. « cause to side motor assembly »
    I select invert Z axis in option menu and now it’s ok for ‘manual axis control’ but gcode generate by « cambam » is invert.
    Example if I make the origine on the top of my piece an I send G1 Z-2.0 my driller go away , not in good direction .
    For the moment I use à text editor to replace all Z-xxx by Zxxx and Zxxx by Z-xxx
    I use 3.32 version on OsX

    How i can really change Z direction ?
    Thanks for your help
    Excuse me for my english i am french

    • The z-direction invert is only for manual control. To invert, you have to change the z-bit in the grbl config (and then undo the change you made to the invert checkbox). I don’t like the invert checkboxes, I inherited them from the original code and probably will take them out.

      Click on the GRBL settings button on the main screen. Then you will see the step port invert mask item. For more detail, look at https://github.com/grbl/grbl/wiki/Configuring-Grbl-v0.8

      The idea is to switch the z direction bit 7. Use a scientific calculator that has decimal to binary conversion (like the one that comes with Windows) and enter the decimal value you currently have, on my system it is 160 (it will likely be different in yours), convert to binary, which on mine is 10100000. Then change the left-most value (in my case it is a 1 to a 0. If yours is a 0, change it to a 1. Thus changing z direction on mine would be 00100000. Now switch that number back to decimal, which here would be 32 and enter and save. Now all of your z direction controls should be in the right direction.

      If that is still confusing, i can help you further, just let me know what value you have and i will tell you what value to enter.

  17. Hello,

    my eshapeoko will be connected via a lantronix ethernet-to-serial converter.
    Would you be interested in adding the possibility to connect to a tcp port via QTNetwork (instead of a serial port)? The lantronix module is transparent, anything that enters the tcp side exits via the uart txd, and anything that enters via rxd is sent via tcp.
    For example, network “ports” could be: tcp://host:port. That is easy to differentiate from normal serial port names.

    I’m also trying to implement that in “universal gcode sender”.

    best regards
    Sebastien, F4GRX

    • Not a bad idea. I will add it to the feature request list up on github. Practically speaking, I am probably not going to implement it anytime soon, so will need help from the community to get this into the software.

  18. Thank you! This does exactly what I wanted – can reset/reconnect and send the same file again, and again, and again.

    I had been growing very frustrated with G-code Sender, but your ‘controller has returned me from depression.

    Thanks.

    Geoff,
    Thailand

  19. Hello friend, I’m from Brazil and I have difficulty in English, well, I wonder what is the latest version of software available for dowload and the latest version for the Arduino UNO … and where can I download? Thank you.

    • At the bottom of this page you can find downloads:

      https://github.com/grbl/grbl

      I recommend either 0.8c because it is stable. There is a known problem with certain paths failing that I do not see in the newer 0.9a, The condition is rare. I have not worked with 0.9a enough to tell if it is a good version, but all indications are that it works fine.

      For Grbl Controller, the current version as of this writing is 3.4.6.

  20. Seems to give a strange error in the y-axis, when he completes an executable rights seems lost and step back to 0 when the routine wrong, what could it be?

  21. Hi Zapmaker,

    This might be a complete noob question.

    I’m running Win7, 64 bit, Ardiuno Mega 2560 (Ramps). I’ve uploaded the 8c .hex file OK. The Grbl controller looks good on the screen, and I can open a .nc file so a picture comes up. But, a message appears, “>(CTRL-X) No data from COM port after connect. Expecting Grbl version string”.

    I don’t know if it’s in Grbl, the g-code, or I’m doing something I shouldn’t.

    I’m diving in at the deep end here, and trying to get a laser cutter running. I’m getting away from the software that came with it.

    Any help would be most appreciated.

    Cheers

    Peter

    • Can you clarify which hex file you used/where you obtained it? You can’t use the hex file built for the uno with the mega 2560. If you think you have the right hex file, try changing the baud rate – I have a hex file for that hardware that needed 57600 baud, which was not expected.

      Grbl Controller requires that the Grbl initialization message appears before it proceeds with further communication.

      • I have the same Problem. I Changed the Buad Rate, but nothing happened. I just installized the grbl Controller on mi PI according to your tutorial on the Page.
        All this 12 steps worked fine.
        Do i have to change some settings or shut i need to write a HEX code somewhere?

        I don’t have installed the Motors or driver Sheeld…maybe that can be the reason?

        Thank you for helping me!

        • You don’t need the motors or shield installed to test grbl. If you don’t have Windows to upload the hex file and only the pi, it can be done if you use curl to download the hex file, use apt-get to install Arduino IDE, then use avrdude that it installs to upload the hex file.

          If knowing the exact steps to install the hex file would be useful from the pi, let me know and I will write it up.

  22. Hi, thanks for your reply,
    The hex file came from here:-
    https://raw.github.com/grbl/grbl-builds/master/builds/grbl_v0_8c_atmega328p_16mhz_9600.hex

    I’m guessing here, but change the baud rate within the Grbl Controller?
    Is it necessary to use a G-Code uploader, or can I select a file?

    “Grbl Controller requires that the Grbl initialization message appears before it proceeds with further communication.” Sorry, but I don’t understand this. I did a quick scan of your instructions and couldn’t find anything related to it.

    Thanks again for your help. It looks like you might need to do a “Grbl for Dummies” book :o )

    Cheers

    Peter

    • I will probably need to go over this with you in email. I’ll email you with the email you registered. I’ll try to explain here, though:

      First, you can’t use that hex file on a 2560 because it is for the uno which has different pin numbers – you need a hex file specific to the 2560. Is that arduino something you got with the laser cutter or did you set it up yourself? If it came with the laser cutter then it should already have grbl on it. Or are you replacing different software with grbl?

      Grbl connects via USB serial to your computer. This means you can actually use a serial terminal program like teraterm to give it instructions, but it is unwieldy for normal work. All grbl versions that i know will display a message in the terminal program at power up, and Grbl Controller acts like one of those programs and displays that power up message. But Grbl Controller does one other thing – it analyzes that startup message and if it isn’t right or missing, will not proceed (just the way it is written).

      Once I get some of these questions answered I can probably point you in the correct direction.

  23. Hi Zapmaker,

    Thanks for taking up your time and trouble. I am completely at sea over this.

    After your last post I did realise I had downloaded the wrong hex file. I’ve been trying to hunt out the correct one. It will be uploaded as soon as I get it.

    The laser cutter is one of those cheap ones from eBay. The software in it was limiting and unreliable, and the only instructions are written in “Chinglish”, with a dash of Chinese characters thrown in. Try Googling “Moshidraw”, and read the horror stories. Most of the people have gone to Mach3 and different driver boards, as I did.

    I don’t want to go into the whole sorry saga of the various stepper driver boards and the mistakes I made with them. But I pulled out that Chinese driver board (which is protected by a dongle) and now want to replace it with the Arduino Mega 2560. This was something I already had bought for a 3D printer that never got off the ground. The whole system is Ramps 1.4.

    There is a site http://www.cooperman.talktalk.net, (Tweakie.cnc), who uses a laser on his CNC milling machine. As there is only the X and Y axis, he uses the Z axis to fire the laser. It works very nicely too, it was something I had tried, just before my Xylotex board died. $NZ200 down the drain. (My own fault though, I had the amps set way too high).

    So now it’s the turn of the Arduino boards to face the ultimate sacrifice, which I hope they don’t.

    The Grbl Controller looks nice and simple, ideal for me. At this stage I only want to cut with the laser, engraving is a different matter and will need to be done with different software. I’m in no hurry for that though. I will use either VCarve Pro 4, or Inkscape to generate the g-code.

    That message on power-up, is that sent automatically, or does the user send it? I watched a YouTube video, where, I think, “$”, was typed in.

    So there you have nearly all of it, I hope I have given you enough info.

    Have a great weekend,

    Cheers

    Peter

  24. Hello! Friend, how can I do to edit the source Grbl Controller? Therefore like to translate it to Brazilian Portuguese.

    • You need to install Qt. Go to http://qt-project.org/downloads.

      Assuming you have done a git clone of Grbl Controller, open GcodeSenderGUIthreads.pro in Qt Creator. Double-click on the .pro file in the editor tree to open. At the bottom of the file add TRANSLATIONS += trlocale/GrblController_pt-BR.ts and save.

      Do a build.

      In Qt Creator, go to menu Tools > External > Linguist > Update translations.

      In the folder GrblHoming\trlocale you will see a new file added called GrblController_pt-BR.ts

      Edit that file and include your translations.

      In Qt Creator, go to menu Tools > External > Linguist > Release translations.

      In the same trlocale folder there is now a file called GrblController_pt-BR.qm. At this point you should be able to run Grbl Controller from Qt Creator and test your translations.

      Once happy, you can copy the qm file into C:\Program Files (x86)\Grbl Controller\trlocale if running Windows 64 bit and launch the release version of Grbl Controller and it should pick up the translation based on your PC’s locale.

      If you would like, please pass on the GrblController_pt-BR.ts to me and I will include it in the next release. Note that you have to run the update operation anytime the code is changed (that’s my job) and any contributors to these files will should update the translations if any strings are added or changed (not too frequent).

      Hope that helps.

  25. Thanks Zapmaker. Just entered the shapeoko community with a purchase of a shapeoko 2. Got it built this weekend and ran the hello world from the Universal G-code sender. In the future, I’m thinking I may want to run the machine from a RaspPi, so I think I want to switch to your software. But I tried printing out the same hello world file in Grbl Controller (v3.5), and everything was moving SUPER slow. I’ve even noticed responses from the board are slow.. like the result of the $$ command or manual control button presses. There seems to be a delay that I don’t get when I run Universal Gcode Sender. (I’m running all of this on a high powered windows 7 machine at the moment.) Any ideas?

  26. Not sure what happened… i posted a comment last night but i think it got deleted :(

    Anyhow, I really like this piece of software. Right now I’m using a high powered windows machine, but I’d like to run my ShapeOko 2 off of a Raspberry Pi like you did, so this software would really fit the bill.

    Only problem is that I’m seeing different behavior when using this program versus the universal g-code sender. All of the responses from the arduino seem to be slow (even things like manual control buttons or the $$ command have a delay) and then once I send a file, everything moves super slow. Any ideas what might be wrong? I have it set to 9600 baud in both programs.

    Thanks for any help.

    FG

    • How long does hello world take to run on GrblController 3.5? When doing an air run with grbl 0.8c on Windows 7 64 bit I am seeing a time of 3 min 14 sec.

      In theory when you installed, the option dialog item “Use aggressive preload…” should be checked. Don’t run with it unchecked except for testing problems.

      If you can, try pulling down a slightly old version off my download site and see if there is any difference in performance. I made a modification in 3.5 to deal with a grbl timing issue that could have repercussions in response time. Someone posted a request on github to make the delay configurable. Maybe that has something to do with it.

    • I run it on Linux.I set the delay on 20ms between two character.Problem is solved.But runs “TinyPOV.PCB.gcode” .Coat about 1 hour and 48 minutes.Is it normal?

      • I run it on Linux.I set the delay on 20ms between two characters senting.Problem is solved.But runs “TinyPOV.PCB.gcode” .Coat about 1 hour and 48 minutes.Is it normal?

  27. for (int i = 0; i write(&buf[i], 1);
    if (result == 0)
    {
    err(“Unable to write bytes to port probably due to outgoing queue full. Write data lost!”);
    break;
    }
    else if (result == -1)
    {
    err(“Error writing to port. Write data lost!”);
    result = 0;
    break;
    }
    SLEEP(20); //after sending every character I delay 20 ms
    }

    //after sending every character I delay 20 ms
    Is the delay too long?If it below 20ms, it will occours “wait for ok fialed” when machine is working

    • As I emailed you, we need to figure out why you need to set the delay to 20ms. The problem with setting it so high is that you will no longer be able to provide grbl with enough commands to buffer and the job will go slower and get too many accelerations that are not needed.

      It may be a problem with grbl having problems with your gcode. You can try turning on command filtering in the GrblController Options and see if that changes anything.

  28. Hello,

    i use the GRBL Controller 3.5 with my eshapeoko. Everything works fine but the aggressive Preload Function doesn´t work. There is no difference when i try it with or without the function checked. Circles are milled very slow. What can i do to get the aggressive Preload strategy working ?

    Thanks
    Kind Regards
    Kay

    • There should be a distinct difference in behavior between the two modes. One way to tell is if you open GrblController.log in your home folder after a file send. In the following example, the value in SENDING[value] is the item number being sent. If aggressive preload is enabled, then a number of SENDING should be sent before the GOT ok for that item number are received, as in this example. If you don’t have it enabled, then you will always get an ok with the same item number immediately after the corresponding SENDING item, never a mixture of both types.

      2014-02-08 11:32:29.811 DEBUG (DIAG) – SENDING[15]: G2 X7.6825 Y15.3769 I0.2873 J-0.2546
      2014-02-08 11:32:29.811 INFO (STATUS) – > G2 X7.6825 Y15.3769 I0.2873 J-0.2546
      2014-02-08 11:32:30.214 DEBUG (DIAG) – SENDING[16]: G2 X7.8483 Y15.3463 I0.0039 J-0.4441
      2014-02-08 11:32:30.214 INFO (STATUS) – > G2 X7.8483 Y15.3463 I0.0039 J-0.4441
      2014-02-08 11:32:30.637 DEBUG (DIAG) – GOT[15]:ok for G2 X7.6825 Y15.3769 I0.2873 J-0.2546
      2014-02-08 11:32:30.648 DEBUG (DIAG) – GOT[16]:ok for G2 X7.8483 Y15.3463 I0.0039 J-0.4441

      Also, please try the recently released 3.5.1 which removes a fixed delay that could result in similar behavior to aggressive preload disabled. 3.5.1 by default sends characters as fast as possible, and option setting can slow down the sends. At the moment you can build 3.5.1 for raspberry pi and a Windows version is available on my downloads page.

  29. Hi there,

    nice project! I used it for my shapeoko because of the “long lines” fix. Works great.
    I saw there is version 3.5.1 which fixes the other issue (no queueing on the grbl).
    Any chance to put out a binary anytime soon?

    Cheers,
    Alex

    • I’ve just put a 3.5.1 binary of Grbl Controller for Windows on my downloads site. I hope to put Mac up there soon – let me know if you need Mac.

      Reason for delay was I have hoping to add some additional settings for the next version but didn’t get around to it fast enough.

  30. salve
    avrei un quesito ho acquistato lo shield grbl per arduino per controllarela mia cnc per farla funzionare devo caricare qualcosa su arduino oppure questo software fa tutto lui ???

    • Reposting the Google translation: hello
      I have a question I bought the shield for Arduino grbl controllarela for my cnc to make it work I need to load something on this or arduino software does all he

      The shield just controls the motors so nothing is loaded on that. You do need to overwrite the arduino software on the Arduino and replace it with grbl. I use ArduinoUploader to do that.

      I recommend you first install grbl before you put the shield on and make sure you can talk to grbl with Grbl Controller. Once you get that working, power down and install the shield. Powering up should still work with Grbl Controller.

      You will need to properly set the grbl settings through Grbl Controller such as the steps/mm. See this:

      https://github.com/grbl/grbl/wiki/Configuring-Grbl-v0.8

      Eventually you will need to hook up the steppers to the shield and also a source of 12-24VDC.

      If you need more help, I can point you to some web sites that walk you through the process.

  31. I just tried out your interface and I think it is very nice!

    I intend to use it with a Sherline table top milling machine I am converting to CNC. As a convenience, can you add zero position buttons per axis in addition to the all axes zero? When using a mill, you often use an edge finder to locate the origin of your stock, and this is done one axis at a time. I can achieve this with the G92 command, but having buttons (a little bit larger too) would be a nice addition.

    Thanks,
    Jamie

    • Thanks for the suggestion. I have added it to the project’s github issues list. I will consider it for inclusion sooner than later, however, currently I’m backed up on other activities, so could be a little while before I get to it.

  32. Great program Zap! I have used it several times now and it seems great. I did however run into a problem yesterday and wanted to see if anyone else had experiences similar issues.

    I am using Ubuntu Server 12.04LTS and I built GRBL-Controller following these instructions:
    http://zapmaker.org/projects/using-qt-for-cross-platform-development-building-grbl-controller/building-linux/

    I am running version 3.51

    I have cut out a few parts with great success, however yesterday after a particularly long engraving, I went to run a shorter trace cut. The CNC stopped in the middle of it and complained that it had lost connection to the arduino (com port). I closed and re-connected, but the connection was not established. The only way I was able to reconnect to the arduino was after I unplugged the usb port and re-attached. GRBL-Controller connected OK, but when I went to move the Z axis up 10mm, (using the buttons in the GUI) it actually launched up to over 100mm. I dont know what the trouble is, but unplugging and re-attaching the arduino did not fix it. I am going to reboot and try another grbl sender in the mean time.

    Anyone else have this issue or something similar?

      • Sorry you have had trouble with the lost connection. I have heard of this happening once before due to the PC sending data too fast for the Arduino/grbl. You could try an air run with the options item Character send delay ms set to 10 and see what happens. Without making this change unfortunately there is no other way to know this is the cause without experimenting or going with a slower PC.

        Sometimes if grbl acts strangely it may have buffered commands and then they all start up again – so I want to make sure that the cause isn’t that versus the home button, if you could send me a series of repro steps or enter them in github.com/zapmaker/GrblHoming issues page I would appreciate it. I can modify the code to clear out the grbl buffer under error cases which is done by close and reopening the com port – my very first version did that every time, but people complained that it was unnecessary, and they were correct, so I took it out – i just need to use that technique selectively. Thanks for the info.

        • Zap, Sorry for the delayed reply. I will try and spend some more time with the tool to give you a good detailed list of steps that I run through to introduce the problem. I had two more questions I wanted to ask:

          1. Is this the preferred/best way to communicate? I am happy to comply with your preference.

          2. As I try to debug this problem, is there a more “lean” or simpler way to send gcode that I can use as my reference? Just so I know it isn’t my arduino acting up?

  33. Hi,

    Nice looking bit of software, I’m just building a cnc machine at the moment, and am going to be using your software as it looks great for the job. I wondered what you thought about having a couple of macro buttons the user could load g code into?

    I was planning on putting a laser cross hair on my machine, it would be offset from the tool position of course. So I plan on aligning the job with the laser, then it’s a set offset to get the tool in that same position. Having a button I could press to do that offset would be really handy.

    • A few versions ago I redesigned the UI to be dynamically sizable. On a PC right now I can get down to 633 x 463. It would be really hard to go any smaller, but not impossible. The biggest problem are the dialogs, which are harder to make smaller, but you could make them tabbed to get around all the widgets on the dialog. As for the main screen, if you could go without certain widgets like the position and replace with simple text, it would be possible to to shrink even more, probably down to the size you say.

      • Ok Cool,

        I was thinking about it a bit more the other day, and was going to suggest a tabbed method, and some bits that would not be needed like the port selection. That could be done as a command line switch for instance.

        There would be some spare GPIO pins on the PI as well. They could be used to either do the tabbing of the display (i.e physical buttons to switch between the display screens) or maybe for the direction (jog) buttons.

        I have not yet looked at the code at all, but does it sound reasonable to be able to break it up easily into a tabbed display / use some external I/O to control what displayed or used for jog buttons?

        • The idea is very interesting. I’ve gone ahead and backed that KS project, if I find time I’ll see what it will take. Any ideas appreciated. If you don’t want to use this comment system, you can email me at this web site domain with the domain name part as a the user name.

    • Thanks, but i’m currently limiting my work to enhancing Grbl Controller features and fixing bugs, so I’m not doing work-for-hire. There are web sites that bring software developers together with those looking for one-off jobs, which you may want to look into (unfortunately I don’t have any to recommend because I am not familiar with them)

    • I don’t have the information you need for moving to cnc milling from regular milling, but there are resources on youtube that could help. Possibly people on the shapeoko forum could direct you towards this kind of resource. Basically you need to be able to draw what you need milled on a CAM program and then tell the CAM program how you want the parts milled – there is a preferred process for this – for example, it can be frustrating if you generate gcode from such a program only to find that you cut out a circle and forgot to add tabs, causing the circle to pop out and get damaged by the rotating bit.

      I hope to provide better information on this topic on my web site in the future.

  34. I watched with great interest the videos from Openbuilds.com (wonderful stuff!) and this was the first time I had heard of this shield and software. I was hooked until they said that the steppers are always (unlocked) and he could turn them freely by hand! Do all the arduino based stepper controllers work this way???? I have two CNC machines, both run open loop steppers and I can not even imagine running them this way. ‘REAL’ controllers always ‘lock’ the steppers so the cycle is step-hold-step, the idea of step-off-step is frightening to me at best as any resistance to movement means step-lost step-step….. Also a system with a butter smooth ballscrew driven z axis would drop the head without holding current!

  35. Thank you very much for the answer and for the pointer to the parameters. I read it all and I’m left with only two questions remaining…. E-STOP SWITCH I saw no mention of an input for this most important function. It is clear that ‘hard stops’ will also stop everything but I wonder if there is a specific input I am missing? Lastly I have not yet started with Arduino (other than the software) so my question is how do all these inputs (limit switches and such) and outputs (spindle on/off) attach to the board. I saw your board, it appeared to have only stepper outputs and power inputs, but it appeared to use all the pins from the Arduino board….

    • I’m still working out the appropriate e-stop procedure. I am looking at a relay control system operated by a button that turns off power to the spindle and the Arduino stack (including shield) and also feed that info back into Grbl Controller. The goal is true emergency stop with no software involved.

      The simplified approach is to reset the Arduino and then click the close port on Grbl Controller. You can just reset the Arduino, but Grbl Controller doesn’t recognize the event and continues to stream commands – I’ve see grbl start up again unexpectedly, which is not good.

      I hope to get a hook up diagram put together soon to answer your questions, as they are good ones. e-stop is one of my higher priorities right now.

  36. Hi, Im from switzerland, expect some funny english ;) .

    Well, Im using this software wit my cnc router and it works pretty well. my only problem atm is that it stops after ~2.5hrs of continuous running. It simply stops an posts “Wait for ok failed”. happened now 2 Times, both times at nearly the same time. the whole Milling Time would be more than 7.5hrs.

    Im Running the newest version (3.5) on a Mac with OS 10.9, GRBL 0.8c on Arduino UNO R3 SMD.

    Hope you can help me on this one, I have no Idea what could be necessary to get it running correctly.

    Thanks in advance!
    Florian

    • Version 3.5 has a timed delay between each character (3.5.1 made this an adjustable settings)- running 3.5 rules out the problem with grbl not keeping up. Another problem I’ve seen sometimes is confusion by grbl on certain unsupported commands. Enable command filtering and try again and see if anything improves (Tools > Options > Command Filtering > Filter file commands before sending checked). If not, send me the five to ten lines of log output from GrblController at the time the error occurs.

      I’ve also heard of screensaver/sleep problems causing similar issues (where parts of the computer go to sleep after user inactivity).

      Also, if you feel comfortable, send me the file and I can run it on my Mac, PC, pi and see if is a file, computer, Grbl Controller, or grbl issue. Email me at this domain with the username zapmaker.

  37. After a long time in this project:
    - When will G40, G41, G42, G43, G44, G45, G49 implemented?
    - Toolchain would be nice also.

    • Those commands are handled by grbl code and not part of Grbl Controller. Grbl currently supports the commands listed here: https://github.com/grbl/grbl/wiki

      Thus it would depend on the grbl team to implement those commands, and I’m not sure if they are planning on doing that – I would request that feature on their github issues page. Grbl Controller by default passes on whatever command is issued to grbl (unless command filtering is turned on).

      Good gcode reference: http://en.wikipedia.org/wiki/G-code

      • “Those commands are handled by grbl code and not part of Grbl Controller. ” you mean g-code as I suppose. Well, many members of this community are realy waiting that G40, G41, G42, G43, G44, G45, G49 are implemented.
        So thank you very doing so.
        cheers – MillBambi

        • grbl runs on the Arduino chip and it is responsible for deciding how to handle, say, G40 (tool radius compensation). As far as I know, G40 is not supported by grbl. Grbl Controller passes on whatever command it is given to grbl and grbl decides whether to process it or not.

          There are a number of reasons why some commands are supported and some not, including not enough processing power, not enough space/memory on the chip, developers not having enough time to work on it, etc. I don’t know why these are not implemented.

          But be aware that Grbl Controller can filter out commands that it believes to not be supported – this is a checkbox you can tick or untick in Tools | Options. Make sure it isn’t filtering and let grbl tell you!

          You may have to look at other software to do what you need (i.e. maybe LinuxCNC can do it?).

  38. Pingback: Tinkerlog » Keychain made with ShapeOko

  39. Pingback: Keychain made with ShapeOko | Arduino collector blog

  40. Can you advice some hardware to use with this program?
    I’m thinking to make someone powered by PIC, but Arduino seems a good option too.

  41. Hi Zapmaker

    I have the same problem as other guys already had.
    When i start the grbl Controller and want to open my Port, i get the message: no Data from Com port after connect…..

    Now i’ve read the following…but don’t know how to do:

    For the Uno, you will need to set the microcontroller to m328p, then in the AVR Dude Params you need to change -b19200 to -b115200

    How can i upload the HEX Code for the Arduino…?
    Where and with which command can i upload a Hex code?

    Finally, select the hex file you want to upload. I used grbl_v0_8c_atmega328p_16mhz_9600.hex

    i know these things are basics but i have no idea..can you help me?

    • The official page that explains how to upload a hex file containing grbl exists here: https://github.com/grbl/grbl/wiki/Flashing-Grbl-to-an-Arduino

      The alternate way is to download the hex file to your computer from https://github.com/grbl/grbl (towards bottom of page), run ArduinoUploader (assuming Windows) and modify the command line in the edit box to -b115200 (for the UNO), modify the COM port, select the hex file and upload.

      You can determine the COM port in Windows if you launch the Arduino IDE and look at the available ports – it will be a port value 5 or higher. If you have more than one that is 5 or higher you will need to disconnect your arduino, review the available ports and see which one disappeared – that is your Arduino COM port. Reconnect the Arduino.

      You most likely obtained and uploaded a 9600 baud hex file, so set Grbl Controller to 9600 baud, set the COM port and connect (Open). That should work. If using Linux it is trickier – let me know if you need help with that.

      If this still doesn’t help, let me know.

  42. Pingback: Workflow | m3ch47r0n1cs

  43. Pingback: Grbl Controller | estu.net

  44. Your comment is awaiting moderation.
    hello zapmaker.
    I am a newbie, and i am willing to make a cheap CNC lathe machine using arduino uno and grbl controller. what i have done so far is that i have downloaded the hex file from github.com and uploaded it using Xloader. but my aruino uno does not work on it.with the hex file uploaded, all of my outputs are high for the time except 4 pins, which does not change whatsoever.
    Please help me with this.
    Thanks

    Reply ↓

    • I noticed you posted multiple places on my site. I am responding with the same response so that people can see it no matter which page they visit.

      First, make sure that Grbl Controller is communicating with Grbl. If you are seeing output in the status window when it connects, that is a good first step. If you type into the command box g0 z10 the Z work coordinates should update to 10.000.

      Look at connection diagram:
      https://github.com/grbl/grbl/wiki/Connecting-Grbl

      When I gave the g0 z10 command, pin 7 goes high. When I gave the g0 z-10 command, pin 7 goes low. Pin 4 shows PWM on my oscilloscope. This is with version 3.6.1 of Grbl Controller and 0.8c of grbl on an Uno.

  45. Hi there,

    I’ve been using universal g-code sender sucessfully with my ShapeOko and wanted to try grblcontroller. I notice that there seems to be a delay after each line of the gcode in grblcontroller that’s not present with gcodesender. Is that normal? Is that changable?

    Thanks,

    -eric

    • There are two possibilities – if you have the “Aggressive preload” unchecked it will happen. Also, if the “Characters send delay ms” is set to a non-zero value it could happen.

      The current version when installed should have these set correctly for no delay. Certain upgrade paths could cause these to not be set to defaults.

      If both of these are set correctly, can you send me a sample of your file that exhibits the problem and I will look at it, zapmaker at this domain name.

  46. Pingback: Arduino shield for CNC-machine with GRBL | Swedish Prototype

    • If you are having trouble with the new Linux static library-based Grbl Controller I posted, I added this note (until I can fix the problem):

      For Linux it may be necessary to run this command before installing. I hope to remove this dependency at some point. Also, chmod 755 the installer file you downloaded so you can run it. After installing, GrblController executable will be found in ~/GrblController folder:

      sudo apt-get install “^libxcb.*” libx11-xcb-dev libglu1-mesa-dev libxrender-dev

  47. Hello, I would to ask you, how do you define what port on your Arduino UNO is for X axis, Y axis and Z axis? I am using Arduino UNO R3 and 3x EasyDriver v 4.4, but I am having problems setting everything up. I ran some random programs via Arduino interface and the motors work fine, now I would like to control them via g-kode. I did use the Xloader to send .hex file on arduino, now I downloaded your controlling software but I don’t know where I can define the ports for motors…

    thanks in advance for any help!

    Luka

  48. Hi. I’m using GRBL Controller v 3.6.1 to control a lathe, using X and Z axes (as it is the standard). Is there a way to get the Visualizer to plot the tool path in the XZ plane? I would appreciate any help with this.

    Thanks in advance!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>