GRBL Firmware

image_print

The LongMill runs off of GRBL firmware, an open-source firmware that is designed Arduino based CNC machines.

The GRBL Wiki has a wealth of knowledge on compiling, connecting, flashing, and modifying GRBL. We’ve also documented the flashing process here to make it easier for LongMill users to follow along whether their firmware has somehow gotten corrupted or they’re looking to upgrade their LongBoard to the latest version of GRBL.

Flashing GRBL Firmware to the LongMill

1) Download the Arduino IDE

Start by closing any programs (like UGS, CNCjs, Easel, etc.) that can connect to your LongMill controller. Since the LongBoard’s ‘brains’ come from an Arduino that it has on-board, you will need a program called “Arduino IDE” in order to compile and flash any firmware changes onto the LongMill. The download page can be found here: https://www.arduino.cc/en/main/software. ***If you have flashed GRBL firmware before using Arduino IDE, you will need to make sure to delete any old libraries for GRBL. Arduino typically saves libraries in the Documents > Arduino > Library folder of your computer for both Windows and Mac. If you do not delete the old library first, you will install the old version of GRBL.***  

2) Use the Arduino IDE to clear the EEPROM

Once Arduino IDE has been installed, plug your control board into your computer then open the Arduino IDE program. Click on the “Tools” menu at the top and make sure that “Board” is set to “Arduino Uno” or “Arduino/Genuino Uno” and “Port” is set to the port you normally use for your LongMill (for example, COM3). The naming scheme for port names on Mac can look a little bit different, but typically the correct port is indicated with “(Arduino/Genuino Uno)” in the name. Later on if your program fails to upload, you can come back and try a different port until you find the correct one. To ensure that all of the old settings are cleared from the board’s memory, we will do an EEPROM clear. You can find this ‘example program’ under File > Examples > EEPROM > eeprom_clear. Clicking this will open up a new window where you’ll see the window is titled “eeprom_clear“. Click on the “Upload” button on the top left of the program to compile and upload this code. If you run into an upload error at this step, you might still be connected to your LongMill on your computer in UGS or CNCjs, you’ll need to disconnect from the LongMill in that program and then you should be able to retry the Upload.

3) Uploading the GRBL firmware

Now that we’ve erased all previous memory from the control board, we can move forward by giving it new instructions to remember: this will be a brand new firmware installation. We keep all major LongMill firmware instances available for download, you’ll likely want to click to download the most recent one: LongMill Firmware (Oct 21, 2019) LongMill Firmware (Feb 25, 2020) Once downloaded, this will appear onto your computer as a compressed or ‘zipped’ file. Locate the downloaded file in your computer folders, ‘un-zip’ or ‘extract’ it (usually found when you right-click the file), and then you’ll notice a firmware folder with a name that matches the downloaded file and contains all the necessary files. If you open this folder up you should see a folder called “grbl“, and from there if you open up the “examples” folder followed by the “grblUpload” folder. If you notice a file called “grblUpload.ino” this is what you’ll want to open with the Arduino IDE program (this should be as simple as double-clicking the file which will open up a new window where you’ll see the window is titled “grblUpload“). Before hitting the “Upload” button, another step here is to prepare the GRBL library. This is done by clicking on “Sketch” in the menu, then: Include Library > Add .ZIP library. After clicking “Add .ZIP libary“, you’ll need to find your way back to the LongMill Firmware folder that you were already at before and select the grbl.zip file (shown in the picture). Click “Open” to add this GRBL library to the Arduino program. Now, upload the firmware code by clicking on the “Upload” button on the top left corner. It can take a minute or two for the firmware to finish uploading. Once completed you should see “Done uploading” in the turquoise bar as the bottom to let you know that the firmware has successfully been uploaded. Don’t worry about if you see a message for “low memory available”. The GRBL firmware uses up a lot of the Arduinos storage space but is designed to work very reliably regardless. The LongMill version is, if anything, a little bit smaller than the default GRBL firmware so it will be just as stable. You can check if your firmware has been correctly installed by going to Tools > Serial Monitor. This will open a window to show the console output of the Arduino. If your output looks garbled, make sure to set your baud rate to 115200. As you can see, the output shows the firmware version and build date. Your controller should now be flashed with the new firmware. Before opening your gcode sender, make sure to close the Arduino IDE first.