Commit 1709380a authored by Charles De Mey's avatar Charles De Mey
Browse files

GCODE stuff

parent 1a268691
......@@ -4,11 +4,11 @@ This group includes [Teddy Warner](http://fabacademy.org/2021/labs/charlotte/stu
<iframe width="900" height="650" src="https://www.youtube.com/embed/r6Nm2AUASLg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
During this machine-building assignment, our lab group of students split into two separate groups to build machines, as we concluded that four people working on each machine would give each of the group members a fair amount of work, without leaving the work to a couple of students. We split these groups base off on each students strengths, putting all mechanically inclined students in one group, consisting of [Graham Smith](http://fabacademy.org/2021/labs/charlotte/students/graham-smith), [Grant Fleischer](http://fabacademy.org/2021/labs/charlotte/students/grantfleischer), [Charles De Mey](http://fabacademy.org/2021/labs/charlotte/students/charles-demey), and I, and putting the software-oriented students in a separate group, whos machine page can be found [here](INSERTLINK). That being said, this split allowed each group to challenge themselves, not solely focusing on their strengths but also being required to complete the entirety of the system. The entirety of my group's machine documentation can be found [here](INSERTLINK), while this page will focus on parts of the system that I completed or worked on.
During this machine-building assignment, our lab group of students split into two separate groups to build machines, as we concluded that four people working on each machine would give each of the group members a fair amount of work, without leaving the work to a couple of students. We split these groups base off on each students strengths, putting all mechanically inclined students in one group, consisting of [Graham Smith](http://fabacademy.org/2021/labs/charlotte/students/graham-smith), [Grant Fleischer](http://fabacademy.org/2021/labs/charlotte/students/grantfleischer), [Charles De Mey](http://fabacademy.org/2021/labs/charlotte/students/charles-demey), and [Teddy Warner](http://fabacademy.org/2021/labs/charlotte/students/theodore-warner/), and putting the software-oriented students in a separate group, who's machine page can be found [here](http://fabacademy.org/2021/labs/charlotte/Group%20Assignments/week07%20%28Other%20group%29/). That being said, this split allowed each group to challenge themselves, not solely focusing on their strengths but also being required to complete the entirety of the system. The entirety of our group's machine documentation can be found [here](INSERTLINK), while this page will focus on parts of the system that I completed or worked on.
## Machine Planning
It actually took a a little while to decide what the focus of our project would be. We decided to make a pizza-making machine since almost everybody loves pizza. The basic idea is that we will have two tools, a sauce dispenser and a cheese dispenser. [Last year's group machine](http://fabacademy.org/2020/labs/charlotte/groupasswk17.html) was similar with the technique they used to dispense the cupcake batter, but ours is more complex. This is becuase we incorporated tool changing as well (switiching between the sauce and cheese hoppers) which forced us to rethink how we were going to mount the different hoppers. For the movement of the gantry and hopper, we decided to build a standard CNC with an X-axis, Y-axis, and Z-axis. The motors we used for each of these axis are stepper motors similar to the ones on 3D-printers. For opening and closing the hoppers to control whether the elements would go through, we used a small servo motor on each of the hoppers. We need to rotate the bottom cover very little, so this was the best solution. It is also easier to write programs for the servo motors than it is for the stepper motors so there was no reason not to use servos.
It actually took a a little while to decide what the focus of our project would be. We decided to make a pizza-making machine since almost everybody loves pizza. The basic idea is that we will have two tools, a sauce dispenser and a cheese dispenser. [Last year's group machine](http://fabacademy.org/2020/labs/charlotte/groupasswk17.html) was similar with the technique they used to dispense the cupcake batter, but ours is more complex. This is because we incorporated tool changing as well (switching between the sauce and cheese hoppers) which forced us to rethink how we were going to mount the different hoppers. For the movement of the gantry and hopper, we decided to build a standard CNC with an X-axis, Y-axis, and Z-axis. The motors we used for each of these axis are stepper motors similar to the ones on 3D-printers. For opening and closing the hoppers to control whether the elements would go through, we used a small servo motor on each of the hoppers. We need to rotate the bottom cover very little, so this was the best solution. It is also easier to write programs for the servo motors than it is for the stepper motors so there was no reason not to use servos.
We started the project by brainstorming and thinking through different machine ideas. Our group settled on a pizza preparation CNC machine, which we coined the *"Pizza Pizza CNC"*. The machine is a Marlin-based, 3 axis CNC, with tool-changing functionality to switch between a sauce and cheese dispensing toolend. With these goals in mind, we split up some of the machine work into individual systems each one of us could work on, and then bring together at the end. My work on the project included the machine's electronics, wiring, firmware, and electronic housing, as well as the machine's Z-carriage and axis, and the frames endstop and belt tensioner mounts.
......@@ -25,7 +25,7 @@ A big feature in our *Pizza Pizza CNC* is the tool-changing functionality. Our t
The beginnings of this carriage stemmed from some work done by one of my groupmates, [Graham Smith](http://fabacademy.org/2021/labs/charlotte/students/graham-smith), who started our work by creating a group Fusion file where he rendered a model of our CNC idea. In this render, the Z-carriage ran along with the machine's Y-axis on two steel rods. I began the gantry design with this carriage to run on the two steel rods. The carriage itself is a pretty simple piece, using linear bearings to move along the rods, with two underside slots running parallel to each other to hold the bearings in place. Each of these slots runs the length of the carriage, however towards the center of the slots, there is a small lip up, allowing the steel rods to still move while holding the linear bearings in the four corners, at the ends of each slot. The final bit to this design is a bolt-on endcap for two of the sides of the carriage, ensuring the bearings don't leave the carriage's slots.
![](../images/week09/SoloCarrage.png)
<figcaption>Underside of Z-Carrage - Linear Bearing Mounts</figcaption>
<figcaption>Underside of Z-Carriage - Linear Bearing Mounts</figcaption>
From here, I added two little features near the two endcaps, allowing for the Y-axis belt to be clamped to the carriage. The carriage will be pulled along the axis by this belt, attached to a stepper motor and idler on each end of the steel rods. These little features stray off the carriages centerline to the left, allowing for the belt running towards the right of the carriage to be unaltered. Each of the belt clips matches has a slot with matching teeth to mesh with the Y-axis belt, allowing for the feature to hold the belt without slipping.
......@@ -33,7 +33,7 @@ With the Y-axis motion part of the carriage flattened out, I began the Z-axis de
![](../images/week09/CarrageNoClaw.png)
The final bit to this carriage puzzle was the Z-axis claw. Similar to the carriage itself, this claw utilizes linear bearings to roll vertically on the axis's two steel rods. The claw is driven up and down by the 8mm threaded rod attached to the Z-axis stepper motor, meshing with the rods corresponding nut. The pass-through hole for this nut is designed to allow the nut to sit flush with the top surface of the claw and can be inserted into the claw as you would a brass insert, by heating the nut with a soldering iron, while applying pressure to guild the nut into the hole. Next to the claws' nut is a small feature laying on the underside of the claw. This jut-out box ensures the Z-axis endstop hits the claw before the claw's linear bearings hit the bottom of the axis. From this feature, the claw ramps up into the hopper holding end. This end consists of a 240-degree semi-circle, allowing for the end to slide into the bottom end of the hopper, and the rais to lock the hopper in the semi-circle. This claw was finished up with a small chef hat icon, which I imported into Fusion as an *SVG* before extruding the outlines of the design into some of the claw's space. Below is the finished Z-Axis Carriage model, including the Y-axis motion, Z-Axis, and the claw of the machines.
The final bit to this carriage puzzle was the Z-axis claw. Similar to the carriage itself, this claw utilizes linear bearings to roll vertically on the axis's two steel rods. The claw is driven up and down by the 8mm threaded rod attached to the Z-axis stepper motor, meshing with the rods corresponding nut. The pass-through hole for this nut is designed to allow the nut to sit flush with the top surface of the claw and can be inserted into the claw as you would a brass insert, by heating the nut with a soldering iron, while applying pressure to guild the nut into the hole. Next to the claws' nut is a small feature laying on the underside of the claw. This jut-out box ensures the Z-axis endstop hits the claw before the claw's linear bearings hit the bottom of the axis. From this feature, the claw ramps up into the hopper holding end. This end consists of a 240-degree semi-circle, allowing for the end to slide into the bottom end of the hopper, and the raise to lock the hopper in the semi-circle. This claw was finished up with a small chef hat icon, which I imported into Fusion as an *SVG* before extruding the outlines of the design into some of the claw's space. Below is the finished Z-Axis Carriage model, including the Y-axis motion, Z-Axis, and the claw of the machines.
<iframe src="https://charlottelatin3.autodesk360.com/shares/public/SH56a43QTfd62c1cd968f3de6d5998f6ae72?mode=embed" width="900" height="650" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true" frameborder="0"></iframe>
......@@ -222,7 +222,9 @@ One of the coolest aspects of running Marlin on our CNC is its easy LCD interfac
<hr/>
## Pizza GCODE
## GCODE
### Pizza GCODE
To prepare a pizza in our *Pizza Pizza CNC*, a *.gcode* script will need to be ran on the machine, just like a 3d printer or other CNC machines. I broke up the task of this *.gcode* into different steps...
......@@ -239,14 +241,14 @@ To prepare a pizza in our *Pizza Pizza CNC*, a *.gcode* script will need to be r
These 10 different steps were split up into sections that could be generated, and others that would have to be written line by line.
### Fusion Work
#### Fusion Work
I began the pizza gcode work in Fusion 360, as I planned on generating a circle toolpath we could run to lay down sauce and cheese on our pizza. Our desired pizza size was a 12" diameter crust, so I began by putting a circle representing this crust on a workplane sized like our machine's bed. Then I created an offset circle running on the inside of this crust, representing the layer of sauce and cheese, leaving a crust around the outside. With this basic circle done, I saved the sketch as an SVG to my computer.
![](../images/week09/FusionCircle.png)
<figcaption>Sause and Cheese Circle Sketch in Fusion 360</figcaption>
### Estlcam
#### Estlcam
With this SVG created, I next moved onto the actual toolpath generation for these circles. For this process, I used a nice simple toolpath generation software called Estlcam, a software I've used in the past whenever doing pen plotting with my CNC. Earlier during my sophomore year of high school, I used this software to write an English process analysis piece, that I've included below, to show a little more of ways the software can be used.
......@@ -258,12 +260,65 @@ With this SVG created, I next moved onto the actual toolpath generation for thes
![](../images/week09/EstlcamToolpath.jpg)
### GCODE Testing
#### GCODE Testing
<iframe width="900" height="650" src="https://www.youtube.com/embed/azvfDjM_h1E" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<hr/>
### Servo GCODE
I did not know anything about GCODE other than the fact that it is a format that machines can understand and that each command correlates to a specific movement or change. I used [this website](https://marlinfw.org/meta/gcode/) extensively while figuring out what commands to use for what task. This site offers brief explanations of hundreds of different commands.
The first thing I needed GCODE for was just to have an understanding of what each servo position meant. Using the website mentioned above, I first decided to find the command that is meant for servo angle positioning. After doing a routine "ctrl + f" command to find anytime on the page that the word "servo" is mentioned, I found [this page](https://marlinfw.org/docs/gcode/M280.html)
This page offered an explanation of how to write commands to change the servo position. Teddy had configured the Mini RAMBo that we used to turn motor pins to become servo pins. When we attached the servos from each hopper to different servo pins, we were able to identify how each servo would be addressed in the GCODE. We found that the cheese servo had to be addressed as "P0" and the sauce servo had to be addressed as "P1".
This meant that we already had 2 of the 3 parts to make this command complete. The last part was to change the angle of the servo. I had to experiment quite a bit to find out which angles we would actually need to use. To adjust the servo to that angle position I just have to type "S" + desired angle.
These are the important cheese servo angles:
```
M280 P0 S8 // cheese servo closed
M280 P0 S15 // cheese servo half open
M280 P0 S21 // cheese servo completely open
M280 P0 S27 // cheese servo half open (other side)
M280 P0 S36 // cheese servo closed (other side)
```
These are the important sauce servo angles:
```
M280 P1 S30 // sauce servo closed
M280 P1 S38 // sauce servo half open
M280 P1 S43 // sauce servo completely open
M280 P1 S48 // sauce servo half open (other side)
M280 P1 S55 // sauce servo closed (other side)
```
### Tool changing GCODE
The tool changing aspect was not difficult, but did take a lot of time and effort. Since all of these movements would occur in a straight line (as opposed to an arc or a circle) I had to use the "G01" command. [This page](https://marlinfw.org/docs/gcode/G000-G001.html) talks more in-depth about the aspects of this command. This command is actually quiet simple though since the only things you have to write is "G01" and then the desired XYZ coordinates. For example, to move the gantry to "143, 67, 17" the command would be "G01 X143 Y67 Z17"
This is the tool changing code to pick up the sauce hopper:
```
G28 // home the machine
G01 X86 Y14 Z5 // start pos for tomato hopper
G01 X148 Y14 Z5 // get z-axis right above holder
G01 X148 Y14 Z14 // lift to get the hopper on the z-axis instead of holder
G01 X100 Y14 Z14 // pull out with the hopper
```
This is the tool changing code to pick up the cheese hopper. As you can see, the only difference between this code and one for the sauce hopper is just the y-coordinate. Instead of having "Y14" as the coordinates, I just had to change it to "Y250"
```
G28 // home the machine
G01 X86 Y250 Z5 // start pos for cheese hopper
G01 X148 Y250 Z5 // get z-axis right above holder
G01 X148 Y250 Z14 // lift to get the hopper on the z-axis instead of holder
G01 X100 Y250 Z14 // pull out with the hopper
```
## Manufacturing & Assembly
![](../images/week09/Corners_Cura.jpg)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment