Compare commits
203 Commits
1bf6ce9d66
...
main
Author | SHA1 | Date | |
---|---|---|---|
774f7f41d6 | |||
2a585ff318 | |||
e700818a2f | |||
6be2d84f05 | |||
d943d6239e | |||
7a4b75c0a3 | |||
a46ad186db | |||
7b3c164c6d | |||
9da84bb7a8 | |||
1009a14673 | |||
2d1a6ae1f6 | |||
d099aac466 | |||
c4c56efb7a | |||
e975e5a93b | |||
e43a469647 | |||
f156423f8b | |||
f892d78745 | |||
5adf888713 | |||
2dd30990bc | |||
5104f71dc6 | |||
7b81c1dda8 | |||
a1d488be28 | |||
27935b52fb | |||
c3a9ff919d | |||
7cea94942a | |||
66a25a0606 | |||
2440990a6e | |||
b231e7228b | |||
009f4d1861 | |||
3e94aa1e00 | |||
9b30fba225 | |||
7f79189c49 | |||
0620e8ef26 | |||
24292d2e9b | |||
ce91a4b418 | |||
a2111224b3 | |||
1519d1adad | |||
cd215c317c | |||
ed2e686233 | |||
e4ab6273b2 | |||
f9cec7ea35 | |||
a0477deb64 | |||
5161756aa1 | |||
a3957aa47d | |||
3008b5dd95 | |||
1e3dd04ba7 | |||
957926cca2 | |||
73bea72ae4 | |||
a27535e901 | |||
d1780d7134 | |||
ef8daf1a2a | |||
a20e4ef745 | |||
8be0cb4a13 | |||
a33daf2a01 | |||
e5fbd9143c | |||
b7040826db | |||
fd41c9bbdf | |||
0c2f5f6064 | |||
b11ed673ef | |||
7087a257c3 | |||
2d060cbb15 | |||
d588ab6c6e | |||
37a453fd4e | |||
66eb28f496 | |||
b9a6f40e11 | |||
e12e552bb6 | |||
d2fb4972e9 | |||
7303af6f30 | |||
fd7be4083a | |||
df2b821da4 | |||
e3a4a53347 | |||
9c7f966ad6 | |||
4f9667ba16 | |||
855b079e1f | |||
16b569c49d | |||
f5c2e0d7a6 | |||
5333816f44 | |||
fba6149cf3 | |||
a941dd8700 | |||
b65de95a4e | |||
d7a4e2f51c | |||
7eeeda4210 | |||
1b393ff12b | |||
6064097fe3 | |||
2c3788d19e | |||
911ada0146 | |||
e9c90ab8d0 | |||
3bd7a07563 | |||
f0744a5ec0 | |||
e2ba053893 | |||
8f9109cd77 | |||
ebdb548599 | |||
465c5b186a | |||
960411167a | |||
4ee9a76291 | |||
e48daca357 | |||
811e58e453 | |||
d6467bbf15 | |||
d77db17b4f | |||
24894ebd33 | |||
774af615b7 | |||
38e7ea72a8 | |||
38c49e4205 | |||
f4b257de8e | |||
3635e32259 | |||
fd037dbef2 | |||
7d9ba29209 | |||
718cbe66d8 | |||
9a1ca56ac1 | |||
cfa8a9d74e | |||
5c10f8fbfc | |||
c491110afe | |||
d007b2de8f | |||
1b580320e9 | |||
bbf72a1bdf | |||
5e6f5a62a5 | |||
7504e037f7 | |||
56f9e57501 | |||
85ab692586 | |||
1b1b429c99 | |||
4ff4f26cec | |||
228a887ad5 | |||
f68dc2c19b | |||
b7ee9decc0 | |||
f05c78e400 | |||
49fe84e1a6 | |||
76ebfd9677 | |||
011cc8ccfd | |||
5a985367f2 | |||
22c057cec7 | |||
c30a08eda2 | |||
d766c5fc98 | |||
eee588c0b0 | |||
78d969f99e | |||
d7ad2f74a4 | |||
3d3014e08d | |||
d20b7b4150 | |||
7735322d30 | |||
3ba2bc53ac | |||
d19bb98936 | |||
7977e9c2c2 | |||
be0ed9359c | |||
cc872ce7f3 | |||
7ff6bcd8b3 | |||
a30ca1f04c | |||
7c338dda33 | |||
7540575c64 | |||
866dcd6ab2 | |||
64e15dcd60 | |||
190f84a93b | |||
9e1fd7c18c | |||
8d3714b258 | |||
3000842988 | |||
54162ae667 | |||
235784f87e | |||
01c591e96e | |||
1b608469fb | |||
fb4b6b11cb | |||
3994d90a9b | |||
53ae8822c7 | |||
4d7f967daa | |||
c2ff52bc71 | |||
c7c225f2c1 | |||
2f6ac6feb8 | |||
f3ce0db138 | |||
56962166b2 | |||
b4ab726293 | |||
c833c11aef | |||
3edf04530b | |||
36ae7c5be3 | |||
8decf60bb1 | |||
36df64d871 | |||
694550ebe8 | |||
8ccc6170e4 | |||
84fffaf40d | |||
d7aecf60ea | |||
a1203b6b9d | |||
c52161f3b4 | |||
2b16ea154f | |||
83e63ccba5 | |||
84fc9a93c1 | |||
e9231e92aa | |||
bbfd4965d8 | |||
df4145c734 | |||
a08ed6c5a8 | |||
67b283ef3b | |||
9e6ced19f9 | |||
85e978bbea | |||
af6a2916ab | |||
72bf01a813 | |||
b6a6f04333 | |||
73b03cfc1c | |||
da9096a56c | |||
c5f416fd22 | |||
f7989611b1 | |||
8305063e77 | |||
7ff11f475b | |||
cb11da3322 | |||
947cd9d7ba | |||
dc0cf71a5a | |||
6d6336df9a | |||
05ebf81568 | |||
3f1d5087d5 |
5
.gitignore
vendored
@@ -1 +1,4 @@
|
||||
.vscode
|
||||
.vscode
|
||||
*.png
|
||||
*.JPEG
|
||||
*.mov
|
BIN
docs/Assignments/extra_research/FR-1-Traces.jpg
Normal file
After Width: | Height: | Size: 77 KiB |
64
docs/Assignments/extra_research/FR-1-traces.md
Normal file
@@ -0,0 +1,64 @@
|
||||
# FR-1 Trace lengths
|
||||
|
||||
## The experiment
|
||||
For the experiment, I used FR-1 that has a thickness of 35µm. On there I will mill 4 trace sizes (0.4 mm, 0,6 mm, 0,8 mm and 1 mm) and they all have the same length of 7.5 cm’s. The traces are separated by 1 Cm.
|
||||
|
||||

|
||||
|
||||
In this experiment I will measure the temperature of the traces with a multimeter and a thermal laser. I will also watch the board closely for any damage. Since it is FR-1 I expect it to shows signs of damage under heat
|
||||
|
||||
## Some background information
|
||||
|
||||
### Resistance
|
||||
When you decrease a PCB trace width, the resistance of the trace increases.
|
||||
Imagine a trace like a water pipe. Whenever you make it smaller the water needs more pressure to flow with the same amount of water.
|
||||
The same analogy goes for electricity. So for longer traces this is also the case that the amount of resistance increases with length.
|
||||
Whenever the resistance increases different things happen when voltage travels trough them. A higher resistance causes a voltage drop.
|
||||
This can be explained using Ohm's law
|
||||
|
||||
$$V = I \cdot R$$
|
||||
|
||||
The Voltage drop is Amperage $$I$$ times the Resistance $$R$$. So if you have a higher resistance or a lower Amperage you will get a voltage drop.
|
||||
Another side effect of having a higher resistance is that the resistor or trace will heat up more easily.
|
||||
|
||||
### Capacitance
|
||||
The capacitance of a PCB trace is the amount of energy it can hold. It works like a capacitor it stores a small amount of energy.
|
||||
The capacitance is determined by the amount of copper is in the trace. So length, width and the thickness. When working with low frequency signals the capacitance is not super important.
|
||||
But when working with higher speed frequencies the capacitance can actually mess up the signal integrity.
|
||||
|
||||
## Heat generation
|
||||
Heat within traces is generated by the current flowing through it. Not the wattage. A good example of the is train lines. These run on 230.000 volts on thin wires while being able to supply multiple trains. The higher the voltage the easier it is the transport a higher amount of wattage.
|
||||
|
||||
## Results
|
||||
|
||||
the power. So I grabbed an old robot with 4 stepper motors attached but I could not get them to draw more than 1.6 Amperage. So that is why the maximum in this test is 1.6 Amperage. I also had a hard time finding a way to measure the temperature of the traces because we only had a heat gun here and the laser was not the place it was actually measuring. So 0,4 mm is not measured properly.
|
||||
|
||||
| Trace Width Trace | Resistance | Maximum safe Current in Ampere | Burn out Ampere |
|
||||
| :---------------- | ---------- | ------------------------------ | --------------- |
|
||||
| 0,4mm | 3.1Ω | 0.7 | 0.85 |
|
||||
| 0,6mm | 2.7Ω | 0.9 | 1.05 |
|
||||
| 0,8mm | 2Ω | 1.6 | ?? |
|
||||
| 1mm | 1.85Ω | ?? | ?? |
|
||||
| | | | |
|
||||
|
||||
|
||||
* The 0,4 mm trace was the first one I tested. I started with 0.7 amps for a few seconds. After that I increased the wattage to 0.85 amps and the trace instantly exploded and burned so I could not get temperature readings there.
|
||||
|
||||
* The 0,6 mm trace it held up well up to 0.9 amps where it started getting burn marks within a 5-10 seconds. The temperature rose to 50 degrees celsius. At 1.05 amps the pcb burned out at 68 degrees celsius.
|
||||
|
||||
* When testing the 0,8 mm trace I hit a roof with how much power I could consume with the robot. I could only get up to 1.6 amps and I did not manage to break the trace after powering it for a few minutes. The maximum I found before it started discoloring was 24 watts at 54 degrees celsius. This was measured after it was left on for 2 minutes.
|
||||
|
||||
* I could not get to the 1mm trace because the robot could not draw more than 1.6 Amperage. So thats why these are not filled in the table.
|
||||
|
||||
|
||||
## Extra notes on temperature
|
||||
When something keeps fluctuating in heat it will increase in size and shrink again. This can make it so your board deteriorate faster and make traces break faster. So it isn't recommended to use high wattages in pcb traces.
|
||||
|
||||
## Recommendations for next time
|
||||
Make bigger pads to hookup the power easier to the pcb and maybe remove all the excess copper but that takes a super long time.
|
||||
|
||||

|
||||

|
||||
|
||||
## Files
|
||||
* [KiCad](TraceThicknesTest.zip)
|
BIN
docs/Assignments/extra_research/TraceThicknesTest.zip
Normal file
BIN
docs/Assignments/extra_research/image-1.jpg
Normal file
After Width: | Height: | Size: 81 KiB |
BIN
docs/Assignments/extra_research/image.jpg
Normal file
After Width: | Height: | Size: 91 KiB |
@@ -18,7 +18,7 @@ When designing the drone I wanted to do everything parametric. So im going to tr
|
||||
I've had a little bit of experience in fusion. Mostly with making basic cases. But now I wanna learn how to design everything perfectly parametric so if I need to change a length everything will scale with it without me needing to fix some things
|
||||
|
||||
### Previous experience with Fusion360
|
||||
I've had some expierence using fusion with my university for making cases in projects. but it was never explicitly thought to me.
|
||||
I've had some experience using fusion with my university for making cases in projects. but it was never explicitly thought to me.
|
||||
|
||||
|
||||
### Designing parametrically
|
||||
@@ -151,7 +151,7 @@ After that I created a sketch on the front surface with a offset so I could extr
|
||||
After that I sketched the motor arms and sketched holes on top to cut the holes.
|
||||
|
||||
### Parameters
|
||||
The parameter menu is very nice in Onshape It is on the side of the screen and it doesn't close automaticly when modeling. Which is very nice.
|
||||
The parameter menu is very nice in Onshape It is on the side of the screen and it doesn't close automatically when modeling. Which is very nice.
|
||||
|
||||

|
||||
|
||||
@@ -184,7 +184,7 @@ Then the Z Euler rotation should appear.
|
||||
|
||||
After clicking that I went into the modifiers menu and added a Generator and enabled additive. This makes sure that the Z angle only keeps going up. So it keeps spinning indefinitely.
|
||||
|
||||
After that you can select everything and press `Control + L` and then link animation data so all the propelors do the same. Then it should look like this. And if you press space they should start spinning.
|
||||
After that you can select everything and press `Control + L` and then link animation data so all the propellors do the same. Then it should look like this. And if you press space they should start spinning.
|
||||
|
||||

|
||||
|
@@ -19,21 +19,21 @@ everything is a circle or square or triangle. You can make anything with any pri
|
||||
### OpenScad
|
||||
Bas is teaching us how to use OpenScad
|
||||
|
||||

|
||||

|
||||
Everything needs to be within a function because otherwise it won't interact with eachother
|
||||
|
||||
If you place a # you can sort of debug and see where the shape is. Instead of blindly placing things
|
||||
|
||||

|
||||

|
||||
|
||||
You can declare variables by name=value;
|
||||
|
||||
Example:
|
||||

|
||||

|
||||
|
||||
|
||||
You can also do equations in openScad
|
||||

|
||||

|
||||
|
||||
The order of declaring variables matters. I found that out the hard way. because some variable wasn't working until I switched order.
|
||||
|
@@ -0,0 +1,68 @@
|
||||
# Hardware debugging
|
||||
|
||||
## Microcontroller programming
|
||||
|
||||
### FabAcademy controller families
|
||||
* Atiny
|
||||
* SAMD
|
||||
* RP2050
|
||||
* ESP32
|
||||
|
||||
### Atiny
|
||||
* Programming: UPDI
|
||||
* Sandbox board: Adrianino
|
||||
* 20Mhz
|
||||
|
||||
### SAMD
|
||||
* programming: JTAG
|
||||
|
||||
### RP2040
|
||||
dual core ARM controller.
|
||||
hardcoded bootloader.
|
||||
|
||||
### ESP32 S3,C3,C6
|
||||
* Wifi bluetooth
|
||||
* RISC-V 160MHz
|
||||
|
||||
### choosing a programming language
|
||||
* MicroPython, Not power efficient
|
||||
* C/C++, Runs anywhere most power efficient
|
||||
* Circuitpython, less efficient than micropython but easier
|
||||
* Rust, Can work but its difficult. Same as C/C++
|
||||
|
||||
|
||||
### First steps when using microcontroller
|
||||
Make a LED blink
|
||||
|
||||
|
||||
|
||||
|
||||
logic analyzer to see signal (wokwi) (similar to oscilloscope)
|
||||
|
||||
define your problem into smaller pieces (same goes for coding)
|
||||
|
||||
|
||||
don't jump to conclusion. Most of the cases of hardware design fails is in the user.
|
||||
Write down everything you did.
|
||||
rubber ducky method
|
||||
|
||||
Use a microscope
|
||||
Don't panic when something doesn't work
|
||||
Check the
|
||||
* Traces
|
||||
* Soldering
|
||||
* Chips
|
||||
* Connections
|
||||
|
||||
Tools:
|
||||
* Multimeter
|
||||
* * Parallel measurement (check the cables)
|
||||
* * Continuity
|
||||
* * Diodes
|
||||
* Logic analyzer
|
||||
* Oscilloscope
|
||||
|
||||
|
||||
|
||||
|
||||
Step -> svg file
|
@@ -4,62 +4,64 @@
|
||||
## The laser cutter (BRM 90130)
|
||||
Today we got a tour on how to use the laser cutter and how it works and maintenance. This is our laser cutter. We first got thought the safety instructions. We always need to stand on the red platform and always watch the lasercutter while its busy.
|
||||
|
||||

|
||||

|
||||
|
||||
//TODO: add parameters of the laser
|
||||
### Where the laser gets made
|
||||
On the back of the machine there is a hatch and under there the laser gets generated.
|
||||
|
||||

|
||||

|
||||
You see a spiral tube with at the end a mirror that shoots the laser into the cutting chamber.
|
||||
|
||||

|
||||

|
||||
Here is a closer image of the mirror that shoots it into the chamber. The 3 screws on the mirror are to align the mirror. If the mirrors are misaligned the laser won't aim well or aim at all.
|
||||
|
||||
### The nozzle and calibration
|
||||

|
||||

|
||||
This is the nozzle. There is also a mirror there to redirect the laser down onto the material. There are a total of 3 mirrors. One in the laser chamber. and 1 on the arm of the nozzle and one on top of the nozzle to direct it down onto the material. The blue tube is a air tube that goes into the nozzle that constantly blows air so the material and gasses don't end up inside. We also did a test with and without the air tube. This is the result.
|
||||
|
||||

|
||||

|
||||
|
||||
The top square is without and the one below that is with the air tube attached. You can see that there is a small difference in how it cut. What I also noticed is there are a lot less flames when the tube is plugged in.
|
||||
|
||||
You can also disassemble the nozzle to clean the lens inside.
|
||||

|
||||

|
||||
The lens needs to be pointed down with the curved side so the laser collects and concentrates on one point. otherwise you get cuts like this.
|
||||

|
||||

|
||||
The lens needs to be pointed up with the curved side so the laser collects and concentrates on one point and all the light gets bend to the center. otherwise you get cuts like this.
|
||||
|
||||

|
||||

|
||||
The top line cut is with a unfocused laser and the bottom line is with a focussed laser.
|
||||
But how do I focus the laser?
|
||||
There is a special tool to help you with that.
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
You place this on top of the material and then you can unscrew the nozzle a bit till it drops down on top of the plate like this.
|
||||
|
||||

|
||||

|
||||
|
||||
After you've tightened the nozzle again its focused and ready for cutting.
|
||||
|
||||
### Laser cutting machine safety
|
||||
Always stand near the laser cutting machine on the red platform. In case a fire breaks out spray it out with the water spray bottle on the side of the machine.
|
||||

|
||||
|
||||
### Turning the machine on
|
||||
When we first turned on the machine it made a lot of noise. Laser cutters are very noisy machines. The power switch is the big red switch on the side.
|
||||
|
||||

|
||||

|
||||
|
||||
When you turn the switch you also need to press the green button to reset the machine. And turn the auxiliary switch on the enable the air pumps. You also need to enable the air filtration systems. That can be done using the red button on the power strip.
|
||||

|
||||

|
||||
|
||||
After that you need to wait for a minute for the systems to start up. After that we can finally begin cutting!
|
||||
|
||||
|
||||
### Laser software (LightBurn)
|
||||
To control and program the laser we use LightBurn. It's a easy software to use in my opinion.
|
||||
|
||||
//TODO: lightburn docs
|
||||
### Testing materials
|
||||
minimum power is corner power. That's why our test went wrong.
|
||||
For testing the laser cutter we're gonna use cardboard, acrylic and wood.
|
||||
|
||||
|
||||
### Cardboard
|
||||
@@ -67,53 +69,53 @@ minimum power is corner power. That's why our test went wrong.
|
||||
#### Cutting test
|
||||
Cutting cardboard is really easy but don't do it too slow otherwise you get what we got. We accidentally burned the cardboard during the cutting test when lasering the name in the cardboard. It probably burned because the heat was near one location for too long.
|
||||
|
||||

|
||||

|
||||
This is the result of our cutting. Cardboard got a really wide curve that you can cut.
|
||||

|
||||

|
||||
But when looking at the backside you do see a difference with how much it burned. From there I think the best values for cardboard are high power and high speed 100s/100p or medium speed and low power 40s/25p.
|
||||
|
||||
We also had one small little incident when we where cutting out the letters. The laser was too too each letter so the cardboard got hot and burned a little. We also noticed that our laser couldn't output a laser at 10 power. So that's why we stopped measuring it in the rest of the tests.
|
||||
|
||||
These tests up here could be a fluke because all the minimum powers where left unchanged and random.
|
||||
|
||||
#### Karf test
|
||||
So we did all the test with exactly 10 centimeters. So there are 11 cuts.
|
||||

|
||||

|
||||
(100-97,45)/11=0.23181818181mm karf distance per line/cut
|
||||
|
||||
We also did a test with a full length piece to test if there are any biases.
|
||||

|
||||

|
||||
(100-99.62)/2=0.19mm
|
||||
|
||||
There is definitely some bias but that could be because cardboard can be squishy so maybe that's it.
|
||||
|
||||
#### Curve test
|
||||
In the first test we used 150 speed and 15 power. There the curves and edges of the laser where super good for example if you look at the E.
|
||||

|
||||

|
||||
|
||||
The second test we did with 200 speed and 15 power and there you can see around the edges that it burned more and the letters less. So either the minimum power needed to be decreased or the speed needs to be decreased for it to look better.
|
||||

|
||||

|
||||
|
||||
### Acrylic 4mm yellow
|
||||
|
||||
#### Cutting test
|
||||
We used the same test method as the cardboard but we found out that for 4mm thick acrylic you need high power and a super slow speed.
|
||||
|
||||

|
||||

|
||||
We first made the big one but we didn't have enough data on what speed and power where the best so we made an additional one with 10 speed and varying powers so we could figure out which where best. On an extra note: We dropped the big one and these 2 came out. With the smaller one the 2 fell out when we picked it up.
|
||||
|
||||
#### Kerf test
|
||||
We did multiple kerf tests because with the first one the material dropped down during the cutting because we didn't have the order of the cutting right. The second time we didn't have the tool at the correct height so the laser wasn't focussed properly. The last time we had everything right and that is our most accurate reading.
|
||||

|
||||

|
||||
First image where it dropped during cutting
|
||||

|
||||

|
||||
Second image where the Z offset wasn't right
|
||||

|
||||

|
||||
Third image where we did everything right
|
||||
|
||||
#### Focus test
|
||||
One of the lines of the focus test didn't go right because it was near an edge and the line bend. So we can't use of the lines to conclude something.
|
||||

|
||||
You can see it start off thin then get a bit wider and then smaller. So the laser is focused, unfocused then focused. It's hard to see but its visible with the middle line
|
||||

|
||||
You can see it start off thin then get a bit wider and then smaller. So the laser is focused, unfocused then focused. It's hard to see but its visible with the middle line.
|
||||
|
||||
#### Extra Acrylic things
|
||||
You can mend acrylic together using acetone. You can also remove the laser frequently lines using acetone. It's a powerful chemical that can do a lot with acrylic.
|
||||
@@ -121,20 +123,20 @@ You can mend acrylic together using acetone. You can also remove the laser frequ
|
||||
### Wood 9mm thick
|
||||
With 9 mm wood we had a lot of issues with cutting it. Because it is so thick it chars really easily and it's almost impossible to cut without charring
|
||||
|
||||

|
||||

|
||||
|
||||
#### Cutting test
|
||||
We tried to cut the wood but it really was engraving. We needed to add more passes along the wood, because we where trying to cut 9 millimeter thick wood.
|
||||
On the outer line we did 4 passes with 20 speed and 80 power and that didn't even cut through.
|
||||

|
||||

|
||||
We also did a couple of extra tests with Henk where he configured the laser. We got very close to cutting without charring but we weren't completely through.
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
#### Focus test
|
||||
Here we aligned the laser to the middle. So on the outer parts you see that the line is thicker and in the middle it's going thin again.
|
||||

|
||||

|
||||
|
||||
### Extra notes for laser cutting
|
||||
When designing watch out with copy pasting lines and don't overlap them. Then you will get duplicate lines and also duplicate cuts.
|
||||
@@ -142,12 +144,78 @@ When designing watch out with copy pasting lines and don't overlap them. Then yo
|
||||
When cutting also make sure that your design that you're cutting doesn't drop down during cutting.
|
||||
|
||||
## Files
|
||||
|
||||
//TODO: Files
|
||||
|
||||
|
||||
|
||||
## Making a construction kit
|
||||
After brainstorming for a while I'm gonna make a drawer construction kit. It's gonna be for a simple 4 drawer box right now.
|
||||
|
||||
## Fusion tips
|
||||
use drawing tab (thanks michelle)
|
||||
### Drawings
|
||||
I first have drawn out every part I needed and the necessary cuts and connections to make it sturdy. I ended up with this. I really like drawing first before I construct it because I can visualize the box better and make changes before I design it digitally.
|
||||
|
||||

|
||||

|
||||
|
||||
### Designing
|
||||
I started by designing my base for my construction kit in fusion360 as a sketch.
|
||||

|
||||
I have made the teeth on the outside so I could extrude them as a separate body so I could use the pattern tool to attach them to the sides.
|
||||
|
||||
### Patterns
|
||||
|
||||
Once I extruded the teeth as separate bodies I could use the pattern tool to automatically generate the rest of the teeth.
|
||||

|
||||
Using that tool I made the multiple bodies into one body.
|
||||
For some reason I couldn't enter the a variable in the Quantity section of the pattern tool. Even through I have set the Variable to not be a unit.
|
||||
|
||||
### Combining bodies
|
||||
After I did that four times I was left with a lot of separate bodies. So to combine them I went into the Modify tab and then selected combine.
|
||||

|
||||
|
||||
### Kerf and press fit
|
||||
|
||||
### Aligning the teeth parametrically
|
||||
|
||||
### Turning the 3D model into a SVG file
|
||||
|
||||
Here I've had some struggles because when using Fusions build in export utility it only exports the sketches. After that I creating a new sketch and then projecting the 3D design onto the sketch.
|
||||

|
||||
But the issue with this is that it isn't 100% accurate
|
||||
|
||||
Then I tried the Shaper Origin tool. But that crashed my fusion when I tried running it. After struggling for a while Michelle came to me and showed me the drawing tab of Fusion where you can define flat drawings of your 3d models and export them as svg.
|
||||
The tab is found here.
|
||||

|
||||
|
||||
Once you press that this menu will pop up
|
||||
|
||||

|
||||
|
||||
The standard settings are fine. You maybe wanna increase the sheet size to get your full design on it.
|
||||
|
||||

|
||||
|
||||
Now you will enter this screen. You wanna set the scale to 1:1 and change the orientation to the top (if you've designed from the top).
|
||||
|
||||

|
||||
You can Left click to place your design on the paper. Once you've placed everything you can select the outer borders and press delete.
|
||||
|
||||

|
||||

|
||||
|
||||
So you end up with this.
|
||||
|
||||
Now you can export the file as DXF file that LightBurn can understand.
|
||||
|
||||
### Result lasercutting
|
||||
I didn't complete this weeks assignment because I didn't have enough time and I still needed to fix stuff for my internship. This is the furthest I got. I ended up at the issue that the teeth weren't aligned properly.
|
||||
|
||||

|
||||
|
||||
## Vinyl cutter
|
||||
https://modsproject.org/ (made during fabacedemy) (using for making pcb's, cnc machine and roland vinyl cutter)
|
||||
Roland GX-24
|
||||
Connects through webusb but doesn't work
|
||||
|
||||
|
||||
|
BIN
docs/Assignments/week_04_programming/IMG_8180.jpg
Normal file
After Width: | Height: | Size: 474 KiB |
BIN
docs/Assignments/week_04_programming/IMG_8182.jpg
Normal file
After Width: | Height: | Size: 368 KiB |
BIN
docs/Assignments/week_04_programming/IMG_8197(1).mp4
Normal file
BIN
docs/Assignments/week_04_programming/IMG_8200.jpg
Normal file
After Width: | Height: | Size: 176 KiB |
BIN
docs/Assignments/week_04_programming/IMG_8212.jpg
Normal file
After Width: | Height: | Size: 361 KiB |
BIN
docs/Assignments/week_04_programming/IMG_8213.jpg
Normal file
After Width: | Height: | Size: 389 KiB |
BIN
docs/Assignments/week_04_programming/image-1.jpg
Normal file
After Width: | Height: | Size: 77 KiB |
BIN
docs/Assignments/week_04_programming/image-10.jpg
Normal file
After Width: | Height: | Size: 171 KiB |
BIN
docs/Assignments/week_04_programming/image-11.jpg
Normal file
After Width: | Height: | Size: 92 KiB |
BIN
docs/Assignments/week_04_programming/image-12.jpg
Normal file
After Width: | Height: | Size: 406 KiB |
BIN
docs/Assignments/week_04_programming/image-13.jpg
Normal file
After Width: | Height: | Size: 327 KiB |
BIN
docs/Assignments/week_04_programming/image-14.jpg
Normal file
After Width: | Height: | Size: 113 KiB |
BIN
docs/Assignments/week_04_programming/image-15.jpg
Normal file
After Width: | Height: | Size: 257 KiB |
BIN
docs/Assignments/week_04_programming/image-16.jpg
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
docs/Assignments/week_04_programming/image-17.jpg
Normal file
After Width: | Height: | Size: 148 KiB |
BIN
docs/Assignments/week_04_programming/image-18.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
docs/Assignments/week_04_programming/image-19.jpg
Normal file
After Width: | Height: | Size: 116 KiB |
BIN
docs/Assignments/week_04_programming/image-2.jpg
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
docs/Assignments/week_04_programming/image-20.jpg
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
docs/Assignments/week_04_programming/image-21.jpg
Normal file
After Width: | Height: | Size: 90 KiB |
BIN
docs/Assignments/week_04_programming/image-22.jpg
Normal file
After Width: | Height: | Size: 76 KiB |
BIN
docs/Assignments/week_04_programming/image-23.jpg
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
docs/Assignments/week_04_programming/image-24.jpg
Normal file
After Width: | Height: | Size: 126 KiB |
BIN
docs/Assignments/week_04_programming/image-25.jpg
Normal file
After Width: | Height: | Size: 120 KiB |
BIN
docs/Assignments/week_04_programming/image-26.jpg
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
docs/Assignments/week_04_programming/image-27.jpg
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
docs/Assignments/week_04_programming/image-28.jpg
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
docs/Assignments/week_04_programming/image-29.jpg
Normal file
After Width: | Height: | Size: 64 KiB |
BIN
docs/Assignments/week_04_programming/image-3.jpg
Normal file
After Width: | Height: | Size: 76 KiB |
BIN
docs/Assignments/week_04_programming/image-30.jpg
Normal file
After Width: | Height: | Size: 215 KiB |
BIN
docs/Assignments/week_04_programming/image-31.jpg
Normal file
After Width: | Height: | Size: 102 KiB |
BIN
docs/Assignments/week_04_programming/image-32.jpg
Normal file
After Width: | Height: | Size: 122 KiB |
BIN
docs/Assignments/week_04_programming/image-33.jpg
Normal file
After Width: | Height: | Size: 212 KiB |
BIN
docs/Assignments/week_04_programming/image-34.jpg
Normal file
After Width: | Height: | Size: 212 KiB |
BIN
docs/Assignments/week_04_programming/image-35.jpg
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
docs/Assignments/week_04_programming/image-36.jpg
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
docs/Assignments/week_04_programming/image-37.jpg
Normal file
After Width: | Height: | Size: 60 KiB |
BIN
docs/Assignments/week_04_programming/image-38.jpg
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
docs/Assignments/week_04_programming/image-4.jpg
Normal file
After Width: | Height: | Size: 182 KiB |
BIN
docs/Assignments/week_04_programming/image-5.jpg
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
docs/Assignments/week_04_programming/image-6.jpg
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
docs/Assignments/week_04_programming/image-7.jpg
Normal file
After Width: | Height: | Size: 83 KiB |
BIN
docs/Assignments/week_04_programming/image-8.jpg
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
docs/Assignments/week_04_programming/image-9.jpg
Normal file
After Width: | Height: | Size: 151 KiB |
BIN
docs/Assignments/week_04_programming/image.jpg
Normal file
After Width: | Height: | Size: 159 KiB |
158
docs/Assignments/week_04_programming/lecuteNotes.md
Normal file
@@ -0,0 +1,158 @@
|
||||
# Lecture notes
|
||||
## Architecture
|
||||
RISC-V (Reduced instruction set)
|
||||
Use EEPROM to save configuration or other things (easy to write to from program)
|
||||
FLASH (harder to write to)
|
||||
|
||||
|
||||
## Microcontrollers
|
||||
* AVR
|
||||
* ARM
|
||||
|
||||
RP2040
|
||||
With PIO you can create custom periphirals
|
||||
|
||||
## Programming
|
||||
Python recommended but I'm using C++ anyway.
|
||||
Rust is also usable but very hard to set up.
|
||||
|
||||
bootloader, Program to load programs
|
||||
|
||||
Arduino
|
||||
board + toolchain + libraries + IDE + bootloader + Header programming
|
||||
|
||||
|
||||
Simulation: WowKi
|
||||
tinkercircuit
|
||||
|
||||
|
||||
this week:
|
||||
Browse through the datasheet of your microcontroller
|
||||
write a program for a microcontroller
|
||||
simulate it.
|
||||
|
||||
try multiple dev environments
|
||||
|
||||
## Lecture notes local thursday
|
||||
|
||||
First C got introduced and then 20 years ago C++ got introduced. And the arduino IDE by a clever italian.
|
||||
|
||||
LED's blink at 400-600 Terahertz humans can't see that but chickens can.
|
||||
Micropython can't run on every microcontroller
|
||||
C++ runs on anything
|
||||
Rust isn't matured enough for microcontrollers and embedded
|
||||
|
||||
|
||||
sending code to the avr microcontrollers
|
||||
`avrdude`
|
||||
|
||||
You can run AVR's without bootloader's
|
||||
|
||||
Arduino bootloader connects the board to the arduino software.
|
||||
|
||||
The bus in a microcontroller is a data highway
|
||||
I2C multiplexer. Can add more pins to a microcontroller using I2C or you can add several devices with the same address.
|
||||
ADC - analog digital convertor
|
||||
DAC - digital analog converter
|
||||
|
||||
In the past 5 volt was used. Nowadays a lot of 3.3 volt is used.
|
||||
|
||||
Always add a LED on a custom board.
|
||||
|
||||
Arduino uno made 20 years ago.
|
||||
|
||||
PlatformIO
|
||||
|
||||
### RP2040
|
||||
Add the board library to the arduino boards manager.
|
||||
`File > Prefrences > additional boards url's`
|
||||
then add it in this link. `https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json`
|
||||
Then you can select the board in the connect menu and then it installs the toolchain.
|
||||
|
||||
|
||||
comment in your code. Comment why it works.
|
||||
|
||||
What happens when you press compile and upload
|
||||
`Starts compiling > Starts linking > opens communication with microcontroller > uploads firmware > done`
|
||||
|
||||
|
||||
basic arduino commands
|
||||
* digitalWrite(pin, LOW/HIGH)
|
||||
|
||||
|
||||
One of the most used things. Pulse Width Modulation (PWM).
|
||||
|
||||
Current flows from high to low
|
||||
|
||||
Connecting a LED using the microcontroller as a ground is better but it also reverses the programming LOW and HIGH.
|
||||
It's better because it can handle more power when it is the ground of the led
|
||||
|
||||
## PlatformIO + vscode
|
||||
|
||||
benefits using vscode
|
||||
* Intellisense
|
||||
* Git in the editor
|
||||
|
||||
First create new project
|
||||
|
||||
Then you can select the MCU and the framework
|
||||
|
||||
### For unsupported boards:
|
||||
Click the nearest board. And follow the community instructions
|
||||
|
||||
|
||||
Change platformio.ini
|
||||
from
|
||||
```ini
|
||||
[env:pico]
|
||||
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
|
||||
board = pico
|
||||
framework = arduino
|
||||
board_build.core = earlephilhower
|
||||
```
|
||||
|
||||
to
|
||||
```ini
|
||||
[env]
|
||||
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
|
||||
framework = arduino
|
||||
board_build.core = earlephilhower
|
||||
board_build.filesystem_size = 0.5m
|
||||
[env:seeed_xiao_rp2040]
|
||||
board = seeed_xiao_rp2040
|
||||
```
|
||||
### What is every folder
|
||||
* src - for source code
|
||||
* lib - project specific libraries
|
||||
|
||||
### How to add libraries
|
||||
Click the platformIO icon
|
||||
Then click the libraries button
|
||||
Then you can search a library and click add to project.
|
||||
|
||||

|
||||
|
||||
After that it will edit platformio.ini and there you will see the library added to the project. It's also in `.pio/libdeps`
|
||||
|
||||
## Micropython
|
||||
With micropython an OS is installed.
|
||||
You can get the firmware for here. https://micropython.org/download/RPI_PICO/
|
||||
|
||||
To upload the firmware you need to connect it to your laptop and set the microcontroller in boot mode by pressing: hold boot > click reset > release boot. Now it will appear on your laptop as a drive. Now you can delete the old UF2 file and drop in the new micropython firmware. It should automaticly unmount itself and start the micropython firmware.
|
||||
|
||||
Now if you install the Raspberry Pi Pico package on vscode you can create a new project and once the project is created and you've connected the microcontroller. A new project will pop up with a terminal under it.
|
||||
|
||||

|
||||
|
||||
`Control + Shift + P` in vscode
|
||||
|
||||

|
||||
|
||||
Make sure the file is named boot.py otherwise it won't start when the microcontroller gets power.
|
||||
|
||||
Pulseview - to view .vcd files from logic analysers
|
||||
|
||||
## Very important
|
||||
On linux machines you need to install platformio-udev. Otherwise you can't upload to your board.
|
||||
|
||||
|
739
docs/Assignments/week_04_programming/programming.md
Normal file
@@ -0,0 +1,739 @@
|
||||
# Embedded programming
|
||||
|
||||
## Introduction
|
||||
I'm very familiar with coding in C++ because of my university. At the moment im studying computer sciences at the Applied University of Amsterdam.
|
||||
|
||||
|
||||
### Switching to platformIO.
|
||||
At the local lecture we got thought how to use platformIO. I was already used to Arduino IDE v2. But I found the UI and the speeds of PlatformIO very nice so that's why I decided to switch to PlatformIO.
|
||||
|
||||
First off. I created a new project with the Xiao espC3 because the espC6 isn't registered on the list. I've googled a bit and that's because PlatformIO needs to get profit so they ask money to the board developers to add the board to their platform. So we need to set the correct board later on.
|
||||

|
||||
When it created the project. I copied all the files over to the src folder and renament my drone.ino to main.cpp. Now I had a lot of include errors because Arduino IDE automatically imports everything and with PlatformIO you need to define everything yourself. So I started out in the Library manager installing all the libraries to the project I needed.
|
||||
|
||||

|
||||
|
||||
#### Setting the correct board
|
||||
|
||||
Before
|
||||
```ini
|
||||
[env:seeed_xiao_esp32c3]
|
||||
platform = espressif32
|
||||
board = seeed_xiao_esp32c3
|
||||
framework = arduino
|
||||
```
|
||||
|
||||
After
|
||||
```ini
|
||||
[env:seeed_xiao_esp32c6]
|
||||
platform = https://github.com/mnowak32/platform-espressif32.git#boards/seeed_xiao_esp32c6
|
||||
platform_packages =
|
||||
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.2
|
||||
framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip
|
||||
framework = arduino
|
||||
board = seeed_xiao_esp32c6
|
||||
```
|
||||
|
||||
To get the correct configuration if it isn't listed on PlatformIO, is to go to the Board manufactors website and hope there is a PlatformIO example configuration. For example this example was listed on the Xiao website. [Link](https://wiki.seeedstudio.com/xiao_esp32c6_with_platform_io/).
|
||||
|
||||
#### Installing libraries in platformIO
|
||||
To install a library click the platformIO icon. In there click the libraries button. Then you can search a library and click add to project. Now you have added a library to your project!
|
||||
|
||||

|
||||
|
||||
After that it will edit platformio.ini and there you will see the library added to the project. It's also in `.pio/libdeps`
|
||||
|
||||
### Important for linux users.
|
||||
When setting up PlatformIO on another system we ran into the issue that the machine couldn't upload the code properly. We first checked how the OS interacted with `dmesg`. `dmesg` on linux shows the kernel activity. After a while we found out we needed to install the package `platformio-udev`. What it does it add some rules for the kernel on how to handle the mcu's.
|
||||
|
||||
### Programming and compiling and uploading
|
||||
Using platformIO is really straight forward. The only folder you should look at in your platformIO project is the `src` folder.
|
||||
|
||||

|
||||
|
||||
In the main.cpp file you can write your program to run on a microcontroller.
|
||||
|
||||
On the bottom of your screen you see that there are a few new buttons.
|
||||
|
||||

|
||||
|
||||
The Compile and Upload and Serial console buttons are going to be the most used. Compile compiles the code and checks if it's correct. If it has incorrect syntax you need to correct it. The upload button compiles the code first and then sends it to the Microcontroller. The Serial console is a really nice debug tool to see what the microcontroller is doing if you added print statements in your code.
|
||||
|
||||
|
||||
## First code to read from the BNO085
|
||||
I first wanted to create the drone firmware myself. But then I looked through some research papers and existing programs and saw all the math that was needed to keep it upright. Then I decided to modify an existing program.
|
||||
This was my first attempts at getting the sensor to read
|
||||
|
||||
### Issues with old code
|
||||
|
||||
### Using the wrong library for the BNO085
|
||||
First used the wrong library I used the Adafruit bno0xx library instead of the Sparkfun bno08x library. The Example script below this reads the BNO085 sensor and returns the values in the arduino serial console.
|
||||
|
||||
??? failure
|
||||
|
||||
```cpp
|
||||
#include "conf.h"
|
||||
#include <Adafruit_BNO08x.h>
|
||||
#include <sh2.h>
|
||||
#include <sh2_SensorValue.h>
|
||||
#include <sh2_err.h>
|
||||
#include <sh2_hal.h>
|
||||
#include <sh2_util.h>
|
||||
#include <shtp.h>
|
||||
|
||||
Adafruit_BNO08x bno08x(BNOINTERRUPTSIG);
|
||||
sh2_SensorValue_t sensorValue;
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
Serial.println("setup started");
|
||||
// Setup all ESC
|
||||
// ledcAttach(MOTOR1, PWMFREQ, PWMRESOLUTION);
|
||||
// ledcAttach(MOTOR2, PWMFREQ, PWMRESOLUTION);
|
||||
// ledcAttach(MOTOR3, PWMFREQ, PWMRESOLUTION);
|
||||
// ledcAttach(MOTOR4, PWMFREQ, PWMRESOLUTION);
|
||||
Serial.print("Setup Started");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// put your main code here, to run repeatedly:
|
||||
sleep(3)
|
||||
if (!bno08x.begin_I2C()) {
|
||||
Serial.println("Failed to find BNO08x chip");
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
|
||||
Serial.print("Game Rotation Vector - r: ");
|
||||
Serial.print(sensorValue.un.gameRotationVector.real);
|
||||
Serial.print(" i: ");
|
||||
Serial.print(sensorValue.un.gameRotationVector.i);
|
||||
Serial.print(" j: ");
|
||||
Serial.print(sensorValue.un.gameRotationVector.j);
|
||||
Serial.print(" k: ");
|
||||
Serial.println(sensorValue.un.gameRotationVector.k);
|
||||
}
|
||||
|
||||
//https://randomnerdtutorials.com/esp32-pwm-arduino-ide/
|
||||
//https://github.com/adafruit/Adafruit_BNO08x/blob/master/examples/rotation_vector/rotation_vector.ino#L25
|
||||
```
|
||||
|
||||
??? example
|
||||
|
||||
```cpp
|
||||
#include <SparkFun_BNO080_Arduino_Library.h>
|
||||
#include <Wire.h>
|
||||
#include "conf.h"
|
||||
|
||||
BNO080 myIMU;
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
Serial.println("setup started");
|
||||
// Setup all ESC
|
||||
// ledcAttach(MOTOR1, PWMFREQ, PWMRESOLUTION);
|
||||
// ledcAttach(MOTOR2, PWMFREQ, PWMRESOLUTION);
|
||||
// ledcAttach(MOTOR3, PWMFREQ, PWMRESOLUTION);
|
||||
// ledcAttach(MOTOR4, PWMFREQ, PWMRESOLUTION);
|
||||
Serial.print("Setup Started");
|
||||
|
||||
Wire.begin();
|
||||
myIMU.begin();
|
||||
Wire.setClock(400000); //Increase I2C data rate to 400kHz
|
||||
myIMU.enableRotationVector(50); //Send data update every 50ms}
|
||||
}
|
||||
|
||||
|
||||
void loop() {
|
||||
|
||||
if (myIMU.dataAvailable() == true) {
|
||||
float roll = (myIMU.getRoll()) * 180.0 / PI; // Convert roll to degrees
|
||||
float pitch = (myIMU.getPitch()) * 180.0 / PI; // Convert pitch to degrees
|
||||
float yaw = (myIMU.getYaw()) * 180.0 / PI; // Convert yaw / heading to degrees
|
||||
|
||||
Serial.print(roll, 1);
|
||||
Serial.print(F(","));
|
||||
Serial.print(pitch, 1);
|
||||
Serial.print(F(","));
|
||||
Serial.print(yaw, 1);
|
||||
|
||||
Serial.println();
|
||||
}
|
||||
}
|
||||
void calibrateESC() {
|
||||
ledcWrite(MOTOR1, 1100);
|
||||
ledcWrite(MOTOR2, 1100);
|
||||
ledcWrite(MOTOR3, 1100);
|
||||
ledcWrite(MOTOR4, 1100);
|
||||
}
|
||||
|
||||
//https://randomnerdtutorials.com/esp32-pwm-arduino-ide/
|
||||
//https://github.com/sparkfun/SparkFun_BNO080_Arduino_Library/blob/main/examples/Example24-UncalibratedGyro/Example24-UncalibratedGyro.ino
|
||||
```
|
||||
|
||||
## New driver
|
||||
After researching for a while and looking through other fab academy projects I found out that other people also made drones with micro controllers and used a pre-made driver that they customized (https://fab.cba.mit.edu/classes/863.23/Architecture/people/Zhixing/finalproject.html). After doing some research on how to keep the drone upright I also decided to use an existing driver because the math required for that is way above my level. Im gonna be using the [dRhemFlightVTOL](https://github.com/nickrehm/dRehmFlight/tree/master) driver. The only problem is that it doesn't support my Inertial measuring unit (BNO085). So I will have to customize the driver to make it work with it.
|
||||
|
||||
## Editing the new driver
|
||||
Adding in support for the BNO085. The original driver doesn't support the BNO085.
|
||||
I first started off searching for every instance of an existing sensor.
|
||||

|
||||
From there I started out changing everything to BNO085 and also importing the correct library. As I have found the correct library earlier in the code.
|
||||
|
||||

|
||||
|
||||
### The purple text (Compiler flags)
|
||||
The purple text are compiler flags. They tell the compiler what to do with certain pieces of code or variables.
|
||||
|
||||
| Flag | What does it do |
|
||||
| :-------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| #define <var> <value> | What define does is it replaces a variable with a value at compilation. This can save some memory by using less variables |
|
||||
| # if | Everything between #if and #endif or #elif is compiled if the #if is true. So if the variable isn't defined the code will not get included while compiling. So it also won't get run when uploading it to the microcontroller |
|
||||
| #elif | Same as #if except using this you can have multiple cases |
|
||||
| #include | Include a library into the code |
|
||||
| #else | If none of the cases are met this is used |
|
||||
| #error | Throws an error during compiling when ran by the compiler |
|
||||
| #endif | end of a #if, #elif or #else |
|
||||
|
||||
### Setting the correct library
|
||||
I added a compiler case for my sensor and added the correct library to it.
|
||||

|
||||
|
||||
### Setting correct value selection
|
||||
I am not sure what it does. It sets some values for the calculations later on. So I copied over the configuration for the MPU6050 because it was the most similar to the BNO085. 
|
||||
|
||||
### Setting up the sensor
|
||||
For this part I went into the documentation of the Sparkfun BNO0xx library. I first looked through the rest of the code what values it wanted because with the BNO085 you need to enable which information you want.
|
||||
|
||||

|
||||
When digging deeper into the driver to where it pulls the data from the sensors you can see what values it want's and according to that I can go through the documentation to enable the correct data outputs.
|
||||
|
||||
I went to the [examples list](https://github.com/sparkfun/SparkFun_BNO080_Arduino_Library/tree/main/examples) of the library and clicked every data example I needed.
|
||||
|
||||

|
||||
I first clicked the data type I needed.
|
||||

|
||||
Then I copied the line that enabled the data output.
|
||||
|
||||

|
||||
Then I inserted it into the driver code.
|
||||
|
||||
### Getting data from the sensors
|
||||
This step goes similar to the last step except you need to copy over another bit.
|
||||
|
||||

|
||||
|
||||
What this part does is acquire the sensor data and storing it in a variable. The same needs to be done in the driver like this.
|
||||
|
||||

|
||||
|
||||
The only issue is that the BNO085 can't output degrees. So we need to convert the radians to degrees using a simple formula I found on google.
|
||||
|
||||

|
||||
|
||||
The same also has to be done later on in the error correction algorithm
|
||||
|
||||

|
||||
That was the last we needed to change. Hopefully it works now since I still need to fix some compile errors.
|
||||
|
||||
## Creating my own controls
|
||||
I want to create my own controller. So I need to edit the current controls. The base driver attempts to set up radio communication. We won't be using that so I'm gonna comment that out.
|
||||
|
||||

|
||||
|
||||
When attempting to compile it still throws some errors so there are still functions being called from the original radio script. The error log indicated it comes from line 1239
|
||||

|
||||
|
||||

|
||||
So I will be needing to make my own case to control the drone.
|
||||
|
||||
|
||||
### Hijacking the controls from the original driver.
|
||||
I need to reverse engineer the controls because now it just calls a function called radiocontrols() that manages the controls. There are 4 pwm channel that controls where the drone is going. I wanna make my own controller and simulate these pwm signals.
|
||||
```cpp
|
||||
thro_des = (channel_1_pwm - 1000.0) / 1000.0; // Between 0 and 1
|
||||
roll_des = (channel_2_pwm - 1500.0) / 500.0; // Between -1 and 1
|
||||
pitch_des = (channel_3_pwm - 1500.0) / 500.0; // Between -1 and 1
|
||||
yaw_des = (channel_4_pwm - 1500.0) / 500.0; // Between -1 and 1
|
||||
```
|
||||
From looking further in the code it has safety protocols when the channels go too low or too high so using that we have a range where the pwm speed should be.
|
||||
|
||||
```cpp
|
||||
// Triggers for failure criteria
|
||||
// Line 1260
|
||||
if (channel_1_pwm > maxVal || channel_1_pwm < minVal)
|
||||
check1 = 1;
|
||||
if (channel_2_pwm > maxVal || channel_2_pwm < minVal)
|
||||
check2 = 1;
|
||||
if (channel_3_pwm > maxVal || channel_3_pwm < minVal)
|
||||
check3 = 1;
|
||||
if (channel_4_pwm > maxVal || channel_4_pwm < minVal)
|
||||
check4 = 1;
|
||||
if (channel_5_pwm > maxVal || channel_5_pwm < minVal)
|
||||
check5 = 1;
|
||||
if (channel_6_pwm > maxVal || channel_6_pwm < minVal)
|
||||
check6 = 1;
|
||||
```
|
||||
In this case minVal is 800 an maxVal is 2200. So we need to stay between these ranges to control the drone. In theory you can send any value to the ESC because it calibrates to the lowest and highest values you give it but there is a range. From past experiences I have experienced that 12bit PWM is not sufficient, 16 bit is needed.
|
||||
|
||||
[ESC calibration](https://ardupilot.org/copter/docs/esc-calibration.html)
|
||||
|
||||
|
||||
I wanna control to drone using another microcontroller, specifically an esp because then I can use the espNOW protocol to connect them together and get communication running between them. First I wanna make something functional before I upgrade it so that's why I'm starting out easy.
|
||||
|
||||
|
||||
### Components for the controller
|
||||
Im going to start off with 2 sliding potentiometers and a espC3 for throttle and for left-right. The Driver expects PWM frequencies so I'm sending PWM frequencies based on the potsliders.
|
||||
|
||||

|
||||
|
||||
* [PotSlider](https://nl.aliexpress.com/item/1005006733220962.html) x2
|
||||
* ~~[espC3 supermini](https://nl.aliexpress.com/item/1005008125438785.html) x1~~
|
||||
* [MCU changed to espC3 XIAO](https://www.seeedstudio.com/Seeed-XIAO-ESP32C3-p-5431.html)
|
||||
|
||||
### Wiring the controller
|
||||
To read the Pot meter values we need to read the resistance from the potslider. So we need analog read. When looking at the data sheet I can see that I can use pins from 0 to 5.
|
||||
|
||||

|
||||
|
||||
Wiring it is pretty straight forward, VCC to 3v3, GND to GND and the out pin to a analog pin.
|
||||
|
||||

|
||||
|
||||
### Programming the controller
|
||||
#### Testing if I can upload
|
||||
I started out by creating a new PlatformIO project. And selected the `Lolin Wemos C3 Mini`. Then I tried to upload some code to see if it worked.
|
||||
|
||||

|
||||
In short the answer was yes. I was a bit surprised because the ESP-C3 supermini isn't in the list of platformIO.
|
||||
|
||||
#### Reading the Potentiometer
|
||||
Reading the potentiometer is really straightforward. The only line we need is `analogRead()`, something to tell the pin that's it an input and something to print it to console.
|
||||
|
||||
```cpp
|
||||
#include <Arduino.h>
|
||||
|
||||
void setup(){
|
||||
Serial.begin(9600); //Opens serial bus
|
||||
pinMode(0, INPUT); //sets pin 0 to input
|
||||
}
|
||||
|
||||
void loop(){
|
||||
Serial.println(analogRead(0)); //prints the result of analogRead() to console
|
||||
}
|
||||
```
|
||||
|
||||
When attempting to upload this I got this error a few times.
|
||||

|
||||
Then I remembered from the local lecture that if you `press and hold boot > press reset > release boot`. You can start the microcontroller in boot mode so you can easily flash to it.
|
||||
|
||||
After flashing it onto the microcontroller I could test it.
|
||||

|
||||
|
||||

|
||||
|
||||
I've noticed there are some ghost values when it needs to be 0 so I need a small area where it's always 0. The upper side of the Potentiometer is always 4095 thats the max value so that's good.
|
||||
|
||||
##### Fixing the ghost measurements
|
||||
Im going to map everything lower than 80 to 80 using software. The reason im doing 80 is because then it will keep on counting up from 80 instead of jumping from 0 to 81 and I didn't see any ghost readings above 80.
|
||||
|
||||
Luckily there is an arduino function called `map` that can do this. [Source](https://docs.arduino.cc/language-reference/en/functions/math/map/). The syntax is like this `map(value, fromLow, fromHigh, toLow, toHigh)` so it's really easy to use. This is how I implemented it.
|
||||
|
||||
During coding I realized this could be done way easier and simpler. So this is my result
|
||||
??? code
|
||||
```cpp
|
||||
#include <Arduino.h>
|
||||
|
||||
int pot1 = 0;
|
||||
int Mpot1 = 0; //mapped pot
|
||||
|
||||
void setup(){
|
||||
Serial.begin(9600);
|
||||
pinMode(0, INPUT);
|
||||
}
|
||||
|
||||
void loop(){
|
||||
pot1 = analogRead(0); //store potmeter value in pot1
|
||||
|
||||
if (pot1 <= 80){ //check if pot1 is lower than 80, if yes make it 80
|
||||
Mpot1 = 80;
|
||||
}
|
||||
else {
|
||||
Mpot1 = pot1; //if pot1 is above 80 just copy over pot1 to Mpot1
|
||||
}
|
||||
Serial.println(Mpot1);
|
||||
}
|
||||
```
|
||||
This code works and makes any value under 80 automatically 80. And keeps all values above the original value.
|
||||
|
||||
I've cleaned it up a bit and turned it into a function so I don't have to copy paste code later on so it stays cleaner.
|
||||
Result:
|
||||
??? Code
|
||||
```cpp
|
||||
#include <Arduino.h>
|
||||
// declarations
|
||||
int normalizePot(int pin, int minValue);
|
||||
|
||||
// constants
|
||||
const int potPin1 = 0;
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(9600);
|
||||
pinMode(potPin1, INPUT);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
|
||||
Serial.println(normalizePot(potPin1, 80)); //print the output of the function directly
|
||||
}
|
||||
|
||||
int normalizePot(int pin, int minValue) //function
|
||||
{
|
||||
int pot = analogRead(pin); //read the pin
|
||||
|
||||
if (pot <= minValue) //if the value is below 80 return 80 and go back to the loop
|
||||
{
|
||||
return 80;
|
||||
}
|
||||
else //else return the original value and return to the loop function
|
||||
{
|
||||
return pot;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Now I wanna map the potmeter values as if it is a PWM signal. The PWM signal for this script goes from 1100 to 2200 as seen earlier in the documentation. I wanna be more on the safe side and I'm going for 1400 - 2000 range so I don't accidentally trigger the failsafe.
|
||||
|
||||
??? Code
|
||||
```cpp
|
||||
#include <Arduino.h>
|
||||
// declarations
|
||||
int normalizePot(int pin, int minValue);
|
||||
int mapPot(int normalizedValue);
|
||||
|
||||
// constants
|
||||
const int POTPIN1 = 0;
|
||||
const int MAXPWMVALUE = 1400;
|
||||
const int MINPWMVALUE = 2000;
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(9600);
|
||||
pinMode(POTPIN1, INPUT);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
|
||||
Serial.println(mapPot(normalizePot(POTPIN1, 80))); //call normalizePot and put the output into mapPot then print it
|
||||
}
|
||||
|
||||
int mapPot(int normalizedValue){
|
||||
return map(normalizedValue, 80, 4095, MINPWMVALUE, MAXPWMVALUE); //map the normalized value to the PWM range
|
||||
}
|
||||
|
||||
int normalizePot(int pin, int minValue) //normalize the pot value to a range of 80 to 4095 instead of 0 to 4095 because the potmeter is at lower values not accurate
|
||||
{
|
||||
int pot = analogRead(pin);
|
||||
|
||||
if (pot <= minValue)
|
||||
{
|
||||
return 80;
|
||||
}
|
||||
else
|
||||
{
|
||||
return pot;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This is my new code. It maps the values from 80 to 4095 to a range of 1400 to 2000.
|
||||
|
||||
### Connection between the controller and the flight controller
|
||||
#### Controller side
|
||||
Now that I have PWM values the driver can understand I wanna test if the driver works and if I can get readings from the driver. Because it needs some kind of controller script to start. For the wireless communication I wanna use ESPNOW, because the protocol works without internet. The 2 esp's directly connect to each other. The only downside is that you're stuck with esp's because the protocol only works on esp's.
|
||||
|
||||
I am following [this](https://randomnerdtutorials.com/esp-now-esp32-arduino-ide/) tutorial to create an ESPNOW connection.
|
||||
|
||||
What I first need to do according to the tutorial is get the receiver esp their mac adress. Luckily that gets displayed when uploading to the esp.
|
||||
|
||||

|
||||
After `MAC` there is the mac address. I've saved it in my controller code as a compiler flag `#define receiverMAC "d8:3b:da:37:66:00";` So I could use it later on. I don't know if the libraries accepts this compiler flag but I will find out soon enough.
|
||||
|
||||
I first need to create a struct with the data I wanna send. A stuct is a collection of variables named under one big variable.
|
||||
|
||||
```cpp
|
||||
typedef struct struct_message {
|
||||
char a[32];
|
||||
int b;
|
||||
float c;
|
||||
bool d;
|
||||
} struct_message;
|
||||
```
|
||||
This is a struct in the tutorial but I wanna send my potentiometers their pwm value. So mine will look like this.
|
||||
```cpp
|
||||
typedef struct struct_message {
|
||||
int PWMCH1;
|
||||
int PWMCH2;
|
||||
int PWMCH3;
|
||||
int PWMCH4;
|
||||
} struct_message;
|
||||
```
|
||||
Now I just realised I was looking at the receiver sketch instead of the sender sketch. But there is no damage done yet because the same struct is needed in both of the scripts. I do need to change the way I declare my mac address. The mac address needs to be stored in an array. like this:
|
||||
```cpp
|
||||
// REPLACE WITH YOUR RECEIVER MAC Address
|
||||
uint8_t broadcastAddress[] = {0xD8, 0x3B, 0xDA, 0x37, 0x66, 0x00};
|
||||
```
|
||||
Then I added in the rest of the code from the tutorial like this.
|
||||
|
||||
??? code
|
||||
```cpp
|
||||
#include <Arduino.h>
|
||||
#include <WiFi.h>
|
||||
#include <esp_now.h>
|
||||
|
||||
// declarations
|
||||
int normalizePot(int pin, int minValue);
|
||||
int mapPot(int normalizedValue);
|
||||
|
||||
// constants
|
||||
const int POTPIN1 = 0;
|
||||
const int MAXPWMVALUE = 1400;
|
||||
const int MINPWMVALUE = 2000;
|
||||
const uint8_t broadcastAddress[] = {0xD8, 0x3B, 0xDA, 0x37, 0x66, 0x00};
|
||||
|
||||
//Define the struct that will be sent
|
||||
typedef struct struct_message {
|
||||
int PWMCH1;
|
||||
int PWMCH2;
|
||||
int PWMCH3;
|
||||
int PWMCH4;
|
||||
} struct_message;
|
||||
struct_message myData; //declare the struct as myData
|
||||
|
||||
esp_now_peer_info_t peerInfo; //create a class object of the ESPNow class
|
||||
|
||||
void setup()
|
||||
{
|
||||
// Set device as a Wi-Fi Station
|
||||
WiFi.mode(WIFI_STA);
|
||||
|
||||
// Init ESP-NOW
|
||||
if (esp_now_init() != ESP_OK) {
|
||||
Serial.println("Error initializing ESP-NOW");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Serial.begin(9600);
|
||||
pinMode(POTPIN1, INPUT);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
Serial.println(mapPot(normalizePot(POTPIN1, 80))); //call normalizePot and put the output into mapPot then print it
|
||||
|
||||
// Set values to send
|
||||
myData.PWMCH1 = mapPot(normalizePot(POTPIN1, 80));
|
||||
myData.PWMCH2 = 1000; //test values
|
||||
myData.PWMCH3 = 1000;
|
||||
myData.PWMCH4 = 1000;
|
||||
|
||||
// Send message via ESP-NOW
|
||||
esp_err_t result = esp_now_send(broadcastAddress, (uint8_t *) &myData, sizeof(myData));
|
||||
|
||||
if (result == ESP_OK) {
|
||||
Serial.println("Sent with success");
|
||||
}
|
||||
else {
|
||||
Serial.println("Error sending the data");
|
||||
}
|
||||
}
|
||||
|
||||
int mapPot(int normalizedValue){
|
||||
return map(normalizedValue, 80, 4095, MINPWMVALUE, MAXPWMVALUE); //map the normalized value to the PWM range
|
||||
}
|
||||
|
||||
int normalizePot(int pin, int minValue) //normalize the pot value to a range of 80 to 4095 instead of 0 to 4095 because the potmeter is at lower values not accurate
|
||||
{
|
||||
int pot = analogRead(pin);
|
||||
|
||||
if (pot <= minValue)
|
||||
{
|
||||
return 80;
|
||||
}
|
||||
else
|
||||
{
|
||||
return pot;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
I added that it could connect to the internet and that it attempts to send data. I quickly realised that the mac address I entered was from the controller itself and not the receiving end. So I quickly corrected that mistake.
|
||||
|
||||
Now when I compile it I get errors that the data isn't being send correctly. The issue could be that the second microcontroller isn't turned on with the receiver code.
|
||||
|
||||

|
||||
|
||||
#### Drone side
|
||||
|
||||
For the drone I'm going to start of with a seperate script to see if it works and then start implementing it into the drone driver. I started off with copy pasting the program into my editor and uploading it to my microcontroller. The only thing I needed to do is copy the struct from the controller, because they need to be the same. So this is my code im going to test now.
|
||||
|
||||
??? Code
|
||||
```cpp
|
||||
/*
|
||||
Rui Santos & Sara Santos - Random Nerd Tutorials
|
||||
Complete project details at https://RandomNerdTutorials.com/esp-now-esp32-arduino-ide/
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files.
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
*/
|
||||
|
||||
#include <esp_now.h>
|
||||
#include <WiFi.h>
|
||||
|
||||
// Structure example to receive data
|
||||
// Must match the sender structure
|
||||
typedef struct struct_message {
|
||||
int PWMCH1;
|
||||
int PWMCH2;
|
||||
int PWMCH3;
|
||||
int PWMCH4;
|
||||
} struct_message;
|
||||
|
||||
// Create a struct_message called myData
|
||||
struct_message myData;
|
||||
|
||||
// callback function that will be executed when data is received
|
||||
void OnDataRecv(const uint8_t * mac, const uint8_t *incomingData, int len) {
|
||||
memcpy(&myData, incomingData, sizeof(myData));
|
||||
Serial.print("Bytes received: ");
|
||||
Serial.println(len);
|
||||
Serial.print("Char: ");
|
||||
Serial.println(myData.PWMCH1);
|
||||
Serial.print("Int: ");
|
||||
Serial.println(myData.PWMCH2);
|
||||
Serial.print("Float: ");
|
||||
Serial.println(myData.PWMCH3);
|
||||
Serial.print("Bool: ");
|
||||
Serial.println(myData.PWMCH4);
|
||||
Serial.println();
|
||||
}
|
||||
|
||||
void setup() {
|
||||
// Initialize Serial Monitor
|
||||
Serial.begin(9600);
|
||||
|
||||
// Set device as a Wi-Fi Station
|
||||
WiFi.mode(WIFI_STA);
|
||||
|
||||
// Init ESP-NOW
|
||||
if (esp_now_init() != ESP_OK) {
|
||||
Serial.println("Error initializing ESP-NOW");
|
||||
return;
|
||||
}
|
||||
|
||||
// Once ESPNow is successfully Init, we will register for recv CB to
|
||||
// get recv packer info
|
||||
esp_now_register_recv_cb(esp_now_recv_cb_t(OnDataRecv));
|
||||
Serial.println("Waiting for data");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
A weird thing I found out is that my esp32C3 Supermini doesn't work wirelessly that well. When I uploaded the code it still didn't work untill I held my finger on the antenna.
|
||||
|
||||
<video controls src="../../../Assignments/week_4_programming/IMG_8197(1).mp4" title="Title" type="video/mp4"></video>
|
||||
|
||||
I've delved a bit deeper into it and then I found online that with the first batches of espC3 supermini's have issues with the antenna. When I was debugging it I noticed that connecting the ground to the antenna fixed it when I tried it with a pin. But when soldered on it didn't work anymore and then only thing that worked was my finger.
|
||||
|
||||

|
||||
Result of bridging ground and the antenna. Sadly didn't work. After that I grabbed the Xiao espC3 and connected it. It almost worked like a drop in replacement I only needed to change the Potpin. After that it worked flawlessly.
|
||||
|
||||

|
||||
|
||||
Now I can start integrating the code into the drone driver.
|
||||
|
||||
The first thing I did is add the correct libraries at the top of the file. So it looks like this now
|
||||
|
||||
```cpp
|
||||
#include <Arduino.h>
|
||||
#include <SparkFun_BNO080_Arduino_Library.h>
|
||||
#include <PWMServo.h>
|
||||
#include <esp_now.h>
|
||||
#include <WiFi.h>
|
||||
```
|
||||
|
||||
After that I added my own ESPNow define so I could use that later on in the code. I want the code to stay variable and user specified so thats why im continuing the way it was made.
|
||||
|
||||

|
||||
|
||||
After that I added the global variables for the ESPNow protocol.
|
||||
|
||||

|
||||
|
||||
Then I uncommented `RadioSetup()` again so it could be used again and I added a case for my ESPNow protocol.
|
||||

|
||||
|
||||
|
||||
In the PWM receive function I added an additional case so my PWM values actually get intergrated into the code.
|
||||
|
||||

|
||||
|
||||
At the end of the program I added the ESPNow Initialization function and the callback function for when the data is received.
|
||||
|
||||

|
||||
|
||||
When I compile it now it should work. Except that it doesn't work.
|
||||
|
||||

|
||||
From looking at the errors it looked like the PWMServo library wasn't compatible with the ESP32. When looking around on google from PWMservo libraries for the ESP32 I found the correct library on [this](https://randomnerdtutorials.com/esp32-servo-motor-web-server-arduino-ide/) website. When I added that I needed to edit the class creation to the correct library and then it finally compiles!
|
||||
|
||||
From:
|
||||

|
||||
|
||||
To:
|
||||

|
||||
|
||||
Result:
|
||||

|
||||
It compiles!
|
||||
|
||||
The next day when testing the code. The microcontroller would suddenly disconnect. First I tried setting every pin to something else because there where pins being defined the espC6 doesn't have. When I finally set the debug level to verbose.
|
||||
I did that by adding this line in my platformio.ini file. [Source](https://community.platformio.org/t/how-to-set-up-log-level-to-be-able-to-debug-the-esp32/8278)
|
||||
```ini
|
||||
build_flags = -DCORE_DEBUG_LEVEL=5
|
||||
```
|
||||
|
||||
Now I can see everything that the microcontroller is doing. I saw that it used pin 12 and 13 for USB. And somewhere in the program pin 12 and 13 where re-assigned. So I removed that it got reassigned and then the communication worked flawlessly again.
|
||||
|
||||

|
||||
|
||||
Now I can finally test. When adding debug print statements for my sensor I found out it wasn't responding. Then I looked at the pins of the sensor and found out when I re-seated it I accidentally killed it.
|
||||
|
||||
I had it like this:
|
||||

|
||||
|
||||
Instead of like this.
|
||||

|
||||
So I had the 3v3 connected to the sensor it's ground and the ground connected to the SCL pin. So that killed it.
|
||||
|
||||
## Sources
|
||||
### Code
|
||||
* [espnow](https://randomnerdtutorials.com/esp-now-esp32-arduino-ide/)
|
||||
* [arduino map function](https://docs.arduino.cc/language-reference/en/functions/math/map/)
|
||||
* [BNO085 library examples](https://github.com/sparkfun/SparkFun_BNO080_Arduino_Library/tree/main/examples)
|
||||
* [PlatformIO espC6](https://wiki.seeedstudio.com/xiao_esp32c6_with_platform_io)
|
||||
* [ESC calibration and PWM](https://ardupilot.org/copter/docs/esc-calibration.html)
|
||||
* [ESP32PWMServo lib](https://randomnerdtutorials.com/esp32-servo-motor-web-server-arduino-ide/)
|
||||
* [PlatformIO Debug level change for ESP](https://community.platformio.org/t/how-to-set-up-log-level-to-be-able-to-debug-the-esp32/8278)
|
||||
|
||||
### Parts
|
||||
* [PotSlider](https://nl.aliexpress.com/item/1005006733220962.html)
|
||||
* [espC3 supermini](https://nl.aliexpress.com/item/1005008125438785.html)
|
238
docs/Assignments/week_05_3dprinting_and_scanning/3D_Printing.md
Normal file
@@ -0,0 +1,238 @@
|
||||
# 3D printing
|
||||
|
||||
## Hero shot
|
||||
|
||||
## Introduction
|
||||
I'm already familiar with 3D printing. I owned 2 3D printers. The ender 3 and the Bambu A1. With the Ender 3 I really learned how to repair the machines and how to configure them. With the Bambu A1 that's all kind of thrown out of the window because it does everything for you.
|
||||
|
||||
## Things to do before and after printing
|
||||
Before we started printing we need to clean the buildplate otherwise there is a chance that the print won't stick to the bed properly. And then the print would fail. Thats why we have 70% Ethanol. After printing we need to make sure the nozzle is empty, because if someone else wants to use the printer and wants to use a different filament there is a chance it will get clogged or the filament will burn because they have different melting points.
|
||||
|
||||
## Filament sizes
|
||||
On the market there are 2 different filament sizes 1,75 is currenctly the most used one. It's used in Ender, Prusa and Bambu. There is also 2.85
|
||||
|
||||
## Our printers and design rules
|
||||
We have 4 printers where ~~3~~ 2 work. We have an Ender 3, Prusa MK3S, Voron and a INFI-20.
|
||||
The Prusa works amazingly and has calibration out of the box. The ender is a bit harder to calibrate. You need to hold a piece of paper under the nozzle and rotate the knob under the bed till you feel a small bit of friction on the paper. Then that corner is calibrated.
|
||||
We also have the INFI 20 which is a bit more confusing to calibrate and I don't have expierence with it. We also have the Voron printer but Henk still needs to do some stuff with it.
|
||||
|
||||
### Design rules tests.
|
||||
#### Prusa MK3S.
|
||||

|
||||
These 3 prints where done on the Prusa printer. There are still some differences between the tests. So filament also matters when printing. They where all PLA but I don't know how old the filament was. So that could also be a variable on why it printed like this.
|
||||
|
||||
#### Ender 3
|
||||
This print was made on the ender 3.
|
||||
During printing the Ender got clogged and we couldn't continue testing on the printer.
|
||||

|
||||
|
||||
#### Repairing the ender
|
||||
During the design rules 3D print the ender got clogged and we needed to repair it.s
|
||||

|
||||
When I tried unloading the filament the motors ripped out the filament from the tube and broke it on the inside.
|
||||

|
||||
|
||||
According to Henk you see that it has under extrusion and that the cause could be that the filament got stuck. That could be a possibility because the filament leader got undone during the print.
|
||||
|
||||

|
||||

|
||||
|
||||
While unscrewing the PTFE tube from the hotend it didn't come off and was stuck. After heating the nozzle up and a lot of pulling I finally got it out.
|
||||

|
||||
This was inside the filament tube. I tried pushing on the other side with filament and it didn't come out. After that I tried pushing with an alan key and that also didn't work. After that Henk told me he would look at it.
|
||||
|
||||
|
||||
## Extra assignment from Henk
|
||||
Because I found the brick laying layer printer on github I'm gonna test the strength of the this way of 3d printing.
|
||||
|
||||
The test object. Im going to hold it on a Table and put on weights till it breaks
|
||||

|
||||
|
||||
## Bricks!
|
||||
### How do I create it using the python script?
|
||||
The [python script]((https://github.com/TengerTechnologies/Bricklayers)) is really easy to use. You need to run it in the cli and give it a path to a file and then it will convert it.
|
||||
|
||||
```bash
|
||||
python3 bricklayers.py test_1h21m_0.08mm_205C_PLA_ENDER3.gcode -extrusionMultiplier 1.2
|
||||
```
|
||||
### The prints
|
||||
#### With planar infills
|
||||
The first one I printed with an extrusionMultiplier of 1.6x.
|
||||
```bash
|
||||
python3 bricklayers.py test_1h21m_0.08mm_205C_PLA_ENDER3.gcode -extrusionMultiplier 1.6
|
||||
```
|
||||
|
||||
Infill settings
|
||||

|
||||
These settings apply to all test prints to keep consistency.
|
||||
I first printed the baseline. So I have a reference point to how strong the normal prints are.
|
||||
|
||||

|
||||
|
||||
This is the second print
|
||||

|
||||
In the second print you can see that it messed with the layer heights. But it doesn't really look like bricks. Only small portions of the print have these artifacts.
|
||||
|
||||
After that I tried breaking it and measuring how much kg of force it needs using this device. It was too much and we got Err. So we needed to make it structurally weaker. So we decided to print the rectangles upright so it would be easier to break.
|
||||
|
||||
### Prints with NonPlanar infill
|
||||
There is also a script in the github repo with NonPlanar infill. Im going to try that with these settings:
|
||||
```bash
|
||||
python3 bricklayersNonPlanarInfill.py Brick-EM1.4-WR1-NP1-AMP-0.6-FREQ1.4.gcode -extrusionMultiplier 1.4 -wallReorder 1 -nonPlanar 1 -amplitude 0.6 -frequency 1.4
|
||||
```
|
||||
|
||||
With Planar infill you don't see the Z axis move as much but with the NonPlanar Infill you can see the Z axis move a lot more.
|
||||
<video controls src="../../../Assignments/week_5_3dprinting_and_scanning/IMG_8367 (3).mp4" title="Title"></video>
|
||||
|
||||
|
||||
#### Getting good prints
|
||||
Getting good prints on nonplanar infill is a lot harder than planar infill because the layers the printer is printing are constantly changing.
|
||||
|
||||

|
||||
With this print I increased the raft. It helped a bit but at some point the print got loose from the raft. Here are all the failed bricklaying prints.
|
||||
|
||||

|
||||
First I increased the brim size of the print but that also didn't work out. After that I used a cube as base and let it stick out 5mm above the build plate like this.
|
||||

|
||||
So I have a even bigger and stronger raft. After the print I knocked the small little platform off with a hammer and then I had a print I could test.
|
||||
|
||||
### Testing the strength
|
||||
To test the strength I made a makeshift setup with a scale on a hook. Then I put the plastic test subject on the bar and pulled really hard until it broke. Then I could read the amount of kg needed to break it from the scale.
|
||||
|
||||

|
||||
|
||||
I made 3 prints. One normal using normal settings. One with brick using `Bricklayers.py` and one using `bricklayersNonPlanarInfill.py` using the commands above.
|
||||
|
||||

|
||||
This is the end result. At the bottom are all the failed prints. At the top are the finished and tested prints. On the left there is the `bricklayers.py` print. The 2 in the middle have no modifications. The one on the right has the `bricklayersNonPlanarInfill.py` modification. The 2 on the left broke in the middle at the same point. Of the left one I got a measurement of 27,75kg. The one in the middle and right I didn't get the measurement because my phone couldn't record the screen of the scale. That's why im doing them again.
|
||||
|
||||
| Which Print | Force down needed to break it |
|
||||
| :---------------------------- | ----------------------------- |
|
||||
| No modifications | 24Kg |
|
||||
| Planar infill bricks | 27,75Kg |
|
||||
| Non planar infill with bricks | 31,4Kg |
|
||||
|
||||
I also noticed that the non planar infill broke at the same point twice. It could be because the print was getting unstable up there. Because the print failed a couple of times at that point when I was printing it without a solid platform.
|
||||
|
||||

|
||||
So if it was more stable during printing it may have been even stronger.
|
||||
|
||||

|
||||
|
||||
## Creating something that can't be made subtractively
|
||||
I wanted to make something simple because my University has been giving a lot of assignments to do during my internship. So I wanted to focus on that. I created a cube with a hole in it and in there another hole on another axis. That way it can't be made subtractively.
|
||||
|
||||
Result:
|
||||

|
||||

|
||||
|
||||
## 3D scanning
|
||||
For this week we also needed to do 3D scanning. When other people where doing it it looked very easy. But when I tried myself it was hard to do and to get everything right.
|
||||
|
||||
Assembling the scanner is really straight forward. First screw on the adapter and then you can screw on the camera
|
||||

|
||||
After that you can plug the usb-c to A cable in the side of the camera and then screw in the locks.
|
||||

|
||||
After that we can go to the software. Since it's an creality camera we also need the crealityScan software.
|
||||

|
||||
Then I was greeted with this screen. I pressed start and left all the default settings for the camera. Then I could start scanning.
|
||||
The first object I was trying to scan was a ESP32S3 but apparently pcb's are too reflective for the camera to pick up on. So I got this error a lot.
|
||||

|
||||
Then I grabbed a fume extractor for soldering and that worked like a charm.
|
||||

|
||||
After I pressed that I was done scanning. I could click one click process and that processes the entire scan to a 3D model with textures.
|
||||

|
||||
|
||||

|
||||
After it fully processed the scanning I could export it as a object file and then I can do various other things with it. For example import it into blender and use it.
|
||||
|
||||

|
||||
This is the end result of the scan. Maybe in hindsight it wasn't smart to use the mat to scan because the scanner needs reference points and with a mat you take that all away because it looks the same all over the mat.
|
||||
|
||||
## SLA printer (resin)
|
||||
Henk showed us how to ELEGOO Mars 3 worked. First we sliced the model in CHITUBOX. CHITUBOX is a program to slice 3d models for SLA/resin printers. Then we went to the printer to prep it and after that we needed to clean it.
|
||||
|
||||
### Slicing
|
||||
For slicing we used CHITUBOX. It's a slicer that's supports the ELEGOO resin printers.
|
||||

|
||||
It looks like this. I wanted to slice something so could also do it later on myself.
|
||||
First we need to import the file using the Open button at the top.
|
||||
Once you've imported the file you wanna make sure your part is not touching the plate. 
|
||||
Because if you are printing direct to the plate it will be very hard to remove later on according to Henk.
|
||||
Because we don't want to touch the build plate we are going to need supports.
|
||||

|
||||
To add supports we need to press this button to go to the support screen.
|
||||
After entering the screen we can press auto support to automatically generate supports.
|
||||

|
||||
Once we pressed that we can go back to the other tab and press slice to slice it all to a file.
|
||||

|
||||
Then we can put it on a USB stick and start preparing the machine
|
||||
|
||||
### Preparing the printer
|
||||

|
||||
First Henk showed how to calibrate the plate for printing. You need a piece of paper and a alan key to calibrate the plate.
|
||||
|
||||

|
||||
Once the plate is on the bottom you can set the Z axis on the screen to 0. And pull the paper up to straighten the plate out.
|
||||
|
||||

|
||||
|
||||
After that Henk poured in the resin. Always make sure when you're working with resin to use gloves.
|
||||

|
||||
|
||||
After that we where trying to get the file loaded on the machine but it didn't show up. So first Henk formatted the drive to FAT32. Then I also did it on my machine. But after re-plugging the drive in my machine after putting the file back on. The file disappeared so we grabbed another usb stick. With the new usb stick it did read the file so we had a bad usb stick.
|
||||
|
||||
### Cleaning the printer
|
||||
When we where cleaning the machine it got really messy. We needed lot's of paper towels.
|
||||
|
||||
Once the print was done we needed to remove the build plate so the print could cure in the vat of alcohol.
|
||||

|
||||
When removing the plate Henk told us to be careful with the Resin on top to let it drip into the resin reservoir.
|
||||
|
||||
After that he submerged the print in alcohol and tied the wire on the top around the lid so the soft resin print didn't touch the bottom or the sides.
|
||||
|
||||
When the print was curing Henk told us that we needed a funnel and a filter to put the rest of the resin back in the container so it can be re-used later.
|
||||
|
||||

|
||||
The filter is needed because there could be loose cured parts in the resin which can mess up prints later on if they go into the bottle.
|
||||
|
||||

|
||||
|
||||

|
||||
Henk also told us to use the plastic scraper when scraping the leftover resin out of the tray.
|
||||
After the print finished curing we could remove it from the plate and put it in the curing chamber without the vat of alcohol.
|
||||

|
||||

|
||||
|
||||
Then we needed to clean everything we used thoroughly with isopropanol. Otherwise the resin will harden over time and it will be very hard to get it off.
|
||||

|
||||

|
||||
|
||||
|
||||

|
||||

|
||||

|
||||
Also make sure to clean the bottom of the tray. Otherwise it can harden when it's attached to the resin printer and that could break the printer.
|
||||
|
||||
End result:
|
||||

|
||||
|
||||
|
||||
Resin printers are very nice because they are extremely accurate but the only downside is the cleanup after printing.
|
||||
## Assignment
|
||||
* [x] Create something that can't be made subtractively
|
||||
* [x] Test printer design rules
|
||||
|
||||
* [x] 3D scanning
|
||||
* [x] Test strength brick laying print
|
||||
* [x] Test strength brick laying non planar infill print
|
||||
* [x] Test strength normal print
|
||||
|
||||
|
||||
## Files
|
||||
* [Rectangle for brick test](rectangle.3mf)
|
||||
* [Rectangle for brick test with baseplate](BiggerBasePlate.3mf)
|
||||
|
||||
|
||||
## Links
|
||||
* [Github project bricklaying printing](https://github.com/TengerTechnologies/Bricklayers)
|
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8277.jpg
Normal file
After Width: | Height: | Size: 335 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8278.jpg
Normal file
After Width: | Height: | Size: 359 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8291.jpg
Normal file
After Width: | Height: | Size: 411 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8344.jpg
Normal file
After Width: | Height: | Size: 240 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8347.jpg
Normal file
After Width: | Height: | Size: 202 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8348.jpg
Normal file
After Width: | Height: | Size: 407 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8349.jpg
Normal file
After Width: | Height: | Size: 306 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8353.jpg
Normal file
After Width: | Height: | Size: 238 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8363.jpg
Normal file
After Width: | Height: | Size: 270 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8373.jpg
Normal file
After Width: | Height: | Size: 243 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8381.jpg
Normal file
After Width: | Height: | Size: 309 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8383.jpg
Normal file
After Width: | Height: | Size: 260 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8395.jpg
Normal file
After Width: | Height: | Size: 360 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8398.jpg
Normal file
After Width: | Height: | Size: 398 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8399.jpg
Normal file
After Width: | Height: | Size: 390 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8404.jpg
Normal file
After Width: | Height: | Size: 322 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8414.jpg
Normal file
After Width: | Height: | Size: 302 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8421.jpg
Normal file
After Width: | Height: | Size: 451 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8426.jpg
Normal file
After Width: | Height: | Size: 355 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8432.jpg
Normal file
After Width: | Height: | Size: 379 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8434.jpg
Normal file
After Width: | Height: | Size: 450 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8436.jpg
Normal file
After Width: | Height: | Size: 395 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8440.jpg
Normal file
After Width: | Height: | Size: 336 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8441.jpg
Normal file
After Width: | Height: | Size: 388 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8442.jpg
Normal file
After Width: | Height: | Size: 376 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8445.jpg
Normal file
After Width: | Height: | Size: 401 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8449.jpg
Normal file
After Width: | Height: | Size: 432 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8452.jpg
Normal file
After Width: | Height: | Size: 417 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8454.jpg
Normal file
After Width: | Height: | Size: 343 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/IMG_8462.jpg
Normal file
After Width: | Height: | Size: 290 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/image-1.jpg
Normal file
After Width: | Height: | Size: 102 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/image-10.jpg
Normal file
After Width: | Height: | Size: 161 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/image-11.jpg
Normal file
After Width: | Height: | Size: 167 KiB |
BIN
docs/Assignments/week_05_3dprinting_and_scanning/image-12.jpg
Normal file
After Width: | Height: | Size: 188 KiB |