17. Machine design¶
Software Design: Arduino UNO, GRBL, & UGS¶
My main responsibility this week was to work with Mona to find a suitable software and G-code sender for our controller. We researched many options but then settled for GRBL, an open-source firmware for arduino boards to control the stepper motors in N7T, our machine.
Having no previous background in software design, we followed many guides online and they will be linked as I refer to them in this documentation.
Uploading GRBL onto the Arduino Uno¶
Firstly, I found a guide on how install the GRBL onto the Arduino Uno using Arduino IDE online. We connected the Arduino board to a computer using a USB cable and launched Arduino IDE. The Arduino IDE version we used is 1.8.13.
Then, I downloaded the GRBL file off the direct link. I extracted the grbl-master
file from the zip folder onto my desktop, and then I added the library to Arduino IDE by doing the following: from the menu bar Sketch
> Include Library
> Add .ZIP Library...
> Desktop
because I extracted the grbl-master folder there> grbl-master
.
Now that the library is added, we will be able to access the code set by GRBL to then compile it as a sketch and upload it to the Arduino. Therefore, the next steps are as follows: from the menu bar File
> Examples
> and then under the Examples from custom libraries
chose grbl-master
> grblUpload
. The following sketch should appear:
Then we edited the Tools
menu according to the port and board we were using:
And then Sketch
> Upload
. After done uploading, GRBL 0.8 was intalled onto our controller. However, we had to update it to a newer version later because of some issues with UGS. So we followed this link that had updated links to the newer versions of GRBL. Following the same exact steps, but with a different ZIP folder in the beginning, we installed GRBL 0.9 onto the Arduino; as per usual, the steps to do so are as follows:
First, we had to delete the old library off of Arduino IDE, you can find the steps in this link.
Then, we added the new library using the same steps the first time. Sketch
> Include Library
> Add .ZIP Library...
> Desktop
> grblmain
. Then compile the new sketch: from the menu bar File
> Examples
> and then under the Examples from custom libraries
chose grblmain
> GRBLtoArduino
.
We have successfully installed the newer version of GRBL onto the Arduino, all that is left now is to set up the interface and calibrate the machine.
The user interface and calibration of the machine¶
Before sending any G-code to N7T, we had to test the motors. To do so, I installed Universal Gcode Sender, and this is when we discovered that we needed to update the GRBL version of our Arduino UNO. But before doing so, and to save time, we tried another firmware, GRBL controller, to control the motors in the machine.
Upon installing the software, we connected the Arduino UNO to the computer with a USB cable, the CNC shield with the motors, and chose the rights ports. The connection was made almost instantly, and we were thrilled!
Using the arrows on the firmware, we started to test each motor and everything worked smoothly. However, the next day, we weren’t so satisfied. UGS was such an appealing firmware and its calibration options were attractive, so Mona and I gave it another go.
We installed UGS, and connected the Arduino UNO to the computer once again. Chose the port, set the baude rate to 115200 (compatible with the GRBL version we installed), and then launched the UGS setup wizard. Following each step, we were able to succesfully calibrate the machine and all was well.
To test the machine, and in fear of breaking the drill bit, we started experimenting on a foam block.
The design was meant to be a square; however, we got a rectangle instead.
We found that something was off, and upon further inspection, I concluded the issue was in the Y-axis calibration. Re-did that, and now, all was perfect.