# Computer controlled cutting

## How to use the shopbot

## Machine safety
Make sure the machine is clear of any obstacles. And make sure the sacrificial layer is clean so the material on top is flat on the bed. If it's not clean you could clean it using the yellow vacuum cleaner.

When you operate the machine, do it alone. Because there are a lot of steps. If you forget one step you have to go back to step 1 and re-do everything.

Always check the exits out before you start the machine. Know where to leave in case of emergency.
Make sure you know where the fire extinguishers are

### Vacuum system
The vacuum is to suck up all the residue of the milling. In case the milling bit hits a screw. You instantly turn off the machine and check the bag.

If its on fire throw it out of the window.
If its not on fire. You have the inspect the bag closely for some time.
![alt text](image-7.jpg)
In case of emergency you can push the big red button and the machine will also turn off 

![alt text](IMG_8623.jpg)
This is the clip holding the bag in place. Pulling the clip will let the bag go.

### Personal safety
If you have long hair. Make sure your hair isn't loose. Use a hair band.
Make sure you don't have any loose clothing or other accessories on you.

Make sure you're not stressed, tired or in a bad state of mind.

## Using the shopbot
### How to change the milling bit
The plastic cover attached to the spinning part is called the dust shoe. Take it off the machine using the butterfly nut at the back.
![alt text](image-2.jpg)
![alt text](image-1.jpg)

Shaft size needs to be the same as the collet size. The collet is the part of the assembly that holds the milling bit
![alt text](IMG_8604.jpg)
First attach the collet to the nut. Then after that you can put the milling bit in. Like this
![alt text](IMG_8612.jpg)
not like this!
![alt text](IMG_8607.jpg)

Make sure you don't push the milling bit too far into the collet. Otherwise you may break the drill bit.
![alt text](IMG_8615.jpg)
![alt text](IMG_8614.jpg)
This should be the good length

Then you can go fasten the assembly to the machine. Make sure it is screwed on tight but not too hard so you still can get it off.
The key is connected to the tool that is used to change the spindle. The reason they are connected is so the head can't be spinning when changing it.
![alt text](IMG_8591.jpg)
![alt text](IMG_8616.jpg)

Always put away the tools when you're done. Always put them in the same place.
![alt text](image.jpg)
Fasten the dust shoe afterwards using the same butterfly nut.
![alt text](image-2.jpg)

### Preparing the machine
There are 2 different softwares on the machine. The V-Carve and shopbot software
* V-Carve is for making toolpaths, Fusion also could be used for this.
* Shopbot software is used to send gcode to the machine.

We use the Shopbot software so we can't change any parameters. Because it can really mess stuff up. 

First turn on the machine before turning on the shopbot software. Because when the shopbot software starts it attempts to connect with the machine.
![alt text](IMG_8620.jpg)
**Don't turn the key yet. Turn it before you start the job**

This is how the shopbot software looks:
![alt text](IMG_8631.jpg)

Go to command field and press `K`
Then you open the Keypad window. In there you can move the machine and the spindle. In there you can use the arrow keys for X and Y. For the Z axis PAGE UP and PAGE DOWN is used.
![alt text](image-3.jpg)

The reason why the screen and keyboard is angled this way is so the keys correspond with the direction is going.
![alt text](IMG_8634.jpg)

First thing you do when you turn on the machine is press the `Zero X Y` button.
![alt text](image-4.jpg)

After you've done that the X and Y should be zero.
![alt text](IMG_8640.jpg)

Now make sure again that the plate is clean. Then we can do the Z axis calibration. We do the `Z` leveling on the sacrificial layer. We put the plate that is attached to the machine under the bit and press the `level Z axis button`

![alt text](IMG_8642.jpg)
![alt text](image-5.jpg)
![alt text](IMG_8655.jpg)

After that we can put the material on the machine and fasten it.
The screws should go into the sacrificial layer but not in the layer under it. We use woody screws. Yes they are literally called woody screws.
![alt text](IMG_8667.jpg)

When drilling the plate onto the sacrificial layer you should put force on the plate because otherwise it will go up and the material needs to be flat on the sacrificial layer.
**This is wrong!**
![alt text](IMG_8673.jpg)
This is good. Make sure to press down on the material as your drilling it into the sacrificial layer.
![alt text](IMG_8676.jpg)


#### Shopbot software
After you've done everything to prepare your job file. You can go back to the shopbot software. In there you need to go to the job home. Your job home is your starting point. Then you go to `[Z]ero > zero X and Y axises`. When you press that you will see on the control window the X and Y are both 0
![alt text](IMG_8712.jpg)
![alt text](IMG_8715.jpg)

Then you can import the file.
![alt text](IMG_8716.jpg)
Then this window will pop up.
![alt text](IMG_8718.jpg)
**Once you press start the machine will start. Make sure the machine is clear of any obstacles or other stuff. MAKE SURE EVERYTHING IS TURNED ON. Vacuum, shopbot, Milling drill**


Spacebar can pause the machine in operation.







Pass depth should be half the diameter of the tool









In your design you can make the drill holes to hold the material down. Then you would do these first before doing the rest of your design.








What jog home does is. It goes to the start position of the last job





#### V-carve
When you open up the software it will ask for the job setup
<insert image of vcarve>

The first parameter is the material size and thickness.

XY datum position is the starting position of the job
updown Y
leftright X

<insert image of these settings>

after you've set everything up you can click ok. After that you need to import the vectors.
The best importing filetypes are .DXF or .PDF


After that you can set the vectors on your board en tweak it. 

Then you can create toolpaths
First drilling toolpaths


The first thing we add ourselves are the screw holes marks so we can screw the material in place. These don't have to get drilled through the entire material.

For the outer cut. create a seperate toolpath and make sure the cutting depth is the height of the material. Don't forget to add tabs. When adding tabs make sure you have enough. The longer your cuts are the more tabs you will need.


Pocket toolpath. Is for not cutting through the entire material but for creating a pocket in the material. For most cuts we're going to use this

always do the outer cutout last and do the screw holes marking first. After screwhole marking do the screws then you can do the rest of the toolpath jobs.
Place the woodies atleast 1 cm from the outer cut.

Save the screw markings and the rest of the design in 2 seperate files. So you can first do the screw marking and then afterwards the rest of the design.

Offset and raster are 2 different paths of cutting

## Testing the machine
We ran some tests on snap fit, conventional or climb milling and we varied with the feed and rpm. We did 2 of the 3 tests wrong the first time. With the Rpm and the feed tests we cut against the grain of the wood.

### Feed and rpm test
![alt text](IMG_8848.jpg)
The top 3 are the feed tests. The values of those where 60 90 120. From top to bottom. The other 3 lines we varied with the rpm. //TODO: add rpm values

#### Calculating the Vcutting and Tchip of the lines


### Snap fit test
The first time we did the snap fit test we set the offsets wrong. We accidentally did it to the outside instead of towards the inside.
![alt text](IMG_8869.jpg)
The first test where the 3 blocks on the right. We couldn't get those into the wood. Afterwards realized we set the offset wrong so the next day friday morning we did it again and then we got the expected result. The -0.1 was kind of snap fit but still a bit loose. -0.2 and -0.3 where more loose so these weren't qualified for snap fit. After that I wanted to try -0.05 and that worked even better than the -0.1. Because we could lift the wood partially without the snap fit getting loose and we still could get the piece of wood out.

<video controls src="jj-500.mp4" title="Title"></video>

### Climb vs conventional milling 
You can see a big difference in the edges with conventional and climb. Climb milling leaves a lot more dust and splinters on the edges. But as Neil explained climb is better when you're finishing a hole through. That will leave a clean hole. For surface cutting is conventional better.
![alt text](image-8.jpg)


## Assignment
### Inspiration

For this assignment I used some inspiration from [this](https://www.pilatshop.nl/) website. It has a lot of neat snap fit designs to get some inspiration from. Since this won't contribute much to my final project I still wanted to make something useful so I decided to make a food plateau for my mother. We looked through it together and made some drawings based on what we needed. 
![alt text](image-9.jpg)
My first thought was to make a chair. But then I realized it may not be comfortable and it would be a hassle to get home. So I started brainstorming with my mom and we found this that she liked.
![alt text](image-10.jpg)

So then we reverse engineering figuring out how it was assembled.
![alt text](image-11.jpg)

### Designing
I also tried making the design fully parametric. So that was also an additional challange.
During designing I used everything I learned from week 2 and also learned some new stuff. For instance I needed a reverse intersect command. But that didn't exist. So I asked chatgpt for help and it said I should use the combine tool.
![alt text](image-12.jpg)
Using his method I created the cuts in the sides of the legs.
![alt text](image-13.jpg)
By using the Leg as a Target body and the bottom plate as the tool to cut I could carve out the holders for the platform. And with the Keep tools button the platform stays after the cut. 

![alt text](image-14.jpg)
This is my end result. 
It's made kinda straight forward. First creating 3 platforms and then one leg. And then I made these leg revolve in a circular pattern like this.
![alt text](image-15.jpg)
Now the amount of legs are also parametric.

### Laying the design 
Fusion has a very nice tool to arrange all components of a 3d object onto a flat surface.
![alt text](image-16.jpg)

It can be found under the modify menu. As fusion already tells you it's the perfect tool to arrange items for manufacturing.
![alt text](image-17.jpg)

Once you click it you have to go to Envelopes and select the plane you want the components on.
![alt text](image-18.jpg)
After that you can go back to Objects and select the components you want placed.

![alt text](image-19.jpg)
Like this. If you want to rotate a component you should unselect it and only select the face. The face you select will go upwards. I struggled a lot with this and tried finding the answer on fusions youtube channel but [that video](https://www.youtube.com/watch?v=7egLufCg5tk) was outdated.
![alt text](image-20.jpg)

### Manufacturing
Fusion has a manufacturing workspace for laser cutting, CNC machining and milling.
![alt text](image-21.jpg)
In there im going to prepare the components to be cut using the shopbot. 
Now im going to switch over to the Manufacture tab.
![alt text](image-24.jpg)
First I need to add the bit that im going to use to fusion. This can be done in the Tool Library.
![alt text](image-22.jpg)
There is already a 5 mm tool but with the wrong settings. For example it has 3 flutes instead of 2 and I don't know if the other dimensions are correct. So im going to check that later because Dylan is now working with the machine.
![alt text](image-23.jpg)

#### Creating toolpaths
First im going to press the setup button as Patrick also did when he showed us how to use fusion for CAM.
![alt text](image-25.jpg)
When I was looking through the menu's I saw stock and hovered it to look what it meant.
![alt text](image-26.jpg)
So basically the wood we're cutting is the `Stock`. So I measured the wood and it was 1 meter by 2 meters and 18mm thick. So im going to enter that as my values for my stock
![alt text](image-28.jpg)
These are my values. I also added offsets so it doesn't put the material in the middle but in the edge so the wood can still be used for other cuts.

When creating a toolpath it needs a tool assigned. We are using a preset from the fusion library the 5mm 3 flute bit. But we needed to modify it to 2 flute so that's what we did. The rest of the values where good and we had no issues milling.

![alt text](image-35.jpg)
//TODO: Stock point (Starting point)


#### Problems with generating toolpaths
First when trying to create toolpaths I tried using `Adaptive clearing`. But that method removes all the material. After watching a [video about wood CAM on youtube](https://www.youtube.com/watch?v=CJnHcZCIHng) I found out what tools and buttons I needed to press.

When trying to generate toolpaths for 3D. I saw that with the `3D contours` I couldn't automatically generate tabs. Only the `2D Contours` could do that. I also asked chatgpt for help on how to do it. And it said to make my own tabs.

![alt text](image-27.jpg)
![alt text](image-29.jpg)
A lot of issues because of the tabs and using the wrong cut settings. The other problem I was also having is using the wrong cut method. I was using a post processing cut method to clean things up while I should've used one that is made to remove a lot of material and cuts instead of toolpaths that make smooth edges.


//TODO: hier meer toevoegen van desktop thuis


#### Fixing the issues
I solved the problems with the simulations by creating 2 separate toolpaths for the outside cut with tabs and the 3d cut for the curved cut. I was scared that the 2D cut would remove the fillet but then I realized a day later in the tram that it only did the outer bottom cut and that the curves still needed to be cut. So I first needed a 2D cut with tabs and then a 3D cut for the filet and then my toolpaths would be complete.  So first the `2D contours` where I can autogenerate tabs and then the `3D contours` for the filets.
![alt text](image-36.jpg)

#### Evaluating the settings with Irja
Tuesday morning around 9 Irja and me wen't over our settings and helped each other with the last parts before we started cutting. I still needed to add drill holes. I asked Irja how she did that. She said the she needed to make circles in the sketch and extrude them as individual components.

![alt text](image-30.jpg)
So these are all the drill holes I made. After I've extruded them I wen't back into the manufacture tab to add drill holes. Henk later on said I should add more drill holes at the edges. So I did that here. 
![alt text](image-37.jpg)
Then I needed to drill the holes.
![alt text](image-31.jpg)
I used this toolpath to create the drillholes. Then I selected all the faces. One very important thing to do that Irja told me is to set the offset 2 mm below your material height.
![alt text](image-32.jpg)
Otherwise it will drill through the entire material instead of 2 mm as a marker.

![alt text](image-33.jpg)
This is my final results of my toolpaths. In the simulation I also don't get any errors.

![alt text](image-34.jpg)
So it's time to create the file.

#### Post processing
Post processing is the part where your toolpaths get converted to instructions for your machine. In my case it's the shopbot.

![alt text](image-38.jpg)
After doing all the toolpaths I can finally press `Create NC Program` to create a .shb file.
![alt text](image-39.jpg)
The only thing that I needed to do was to add the ShopBot post processor. Then I could hit `Post`. After that my shopbot file was created.

In this operations tab you can select which toolpaths you wanna post process.
![alt text](image-40.jpg)
So for my first file I only want the drill holes.

![alt text](image-41.jpg)

https://cam.autodesk.com/hsmposts

#### The cutting 
When I started cutting I quickly noticed a problem. The toolhead wasn't going the right way. That was because the X and Y weren't set properly in the setup.
![alt text](image-42.jpg)

The second issue I had was that the plunge too high So it went through the entire material at once and started moving. To fix that I needed to enable `Multiple depths` And set `Maximum Roughing` to 2.5mm instead of 15mm. So it doesn't go down 15 mm at once but 2.5mm.
![alt text](image-43.jpg)
![alt text](image-44.jpg)

The third issue is that a lot of material doesn't get sucked into the vacuum system. We checked the tube of the vacuum system together and I re-taped it. Henk checked some other things but in the end we lowered the shoe and that seemed to help.
![alt text](IMG_8925.jpg)

Henk pointed out to always turn off spindle when you walk away or pause the machine during operation otherwise the spindle may create friction/heat and that can catch on fire and cause accidents.

### The result
This is the result. Tomorrow morning im going to sand it down and assemble it.
![alt text](IMG_8941.jpg)
When I was removing the tabs I accidentally broke one of the legs. And during sanding I broke another one so I ended up with 3 legs instead of 5. For the next time im also setting my own tabs instead of letting fusion 360 autogenerate the tabs because it placed them in some really inconvienent places.
![alt text](IMG_8954.jpg)