Compare commits

...

203 Commits

Author SHA1 Message Date
774f7f41d6 extra notes 2025-06-23 10:01:50 +02:00
2a585ff318 fix wrong information in research 2025-06-23 09:56:40 +02:00
e700818a2f edit flowchart 2025-06-17 12:41:03 +02:00
6be2d84f05 3d files 2025-06-17 11:51:20 +02:00
d943d6239e fix image tag 2025-06-10 13:34:46 +02:00
7a4b75c0a3 3d printing 2025-06-10 13:33:25 +02:00
a46ad186db schedule 2025-06-07 16:43:41 +02:00
7b3c164c6d docs 2025-06-04 16:35:06 +02:00
9da84bb7a8 fix accidentally overwritten image 2025-06-04 16:33:51 +02:00
1009a14673 docs 2025-06-04 16:26:30 +02:00
2d1a6ae1f6 stable flight in theory been achieved 2025-06-03 12:26:06 +02:00
d099aac466 fix controller so middle of joystick is actually 1500 now 2025-06-03 11:36:33 +02:00
c4c56efb7a typos 2025-06-02 15:52:28 +02:00
e975e5a93b BOM 2025-06-02 15:10:52 +02:00
e43a469647 docs 2025-06-02 10:33:53 +02:00
f156423f8b change video links 2025-06-02 10:19:17 +02:00
f892d78745 docs motor burnout 2025-06-02 09:55:00 +02:00
5adf888713 code update and presentation stuff 2025-05-28 12:23:32 +02:00
2dd30990bc added useless boot sequence 2025-05-27 15:29:12 +02:00
5104f71dc6 fix scrollingtext function for matrix controller 2025-05-27 14:50:37 +02:00
7b81c1dda8 link fix 2025-05-27 10:00:40 +02:00
a1d488be28 Killswitch drone 2025-05-26 14:50:47 +02:00
27935b52fb added code for matrixes 2025-05-22 17:20:14 +02:00
c3a9ff919d docs update 2025-05-22 13:43:13 +02:00
7cea94942a BOM 2025-05-22 11:47:32 +02:00
66a25a0606 docs! 2025-05-21 16:24:36 +02:00
2440990a6e docs 2025-05-21 15:22:18 +02:00
b231e7228b updated music 2025-05-21 15:04:30 +02:00
009f4d1861 docs 2025-05-21 12:14:51 +02:00
3e94aa1e00 docs 2025-05-20 15:11:20 +02:00
9b30fba225 docs 2025-05-15 15:06:15 +02:00
7f79189c49 docs wildcard week 2025-05-15 14:59:16 +02:00
0620e8ef26 fix math 2025-05-14 12:14:46 +02:00
24292d2e9b math 2025-05-14 12:13:09 +02:00
ce91a4b418 final project 2025-05-12 16:51:27 +02:00
a2111224b3 replace how data get's received and passed on the rest of the code 2025-05-08 16:02:04 +02:00
1519d1adad trashed all the servo stuff 2025-05-08 15:26:33 +02:00
cd215c317c docs update 2025-05-08 11:07:28 +02:00
ed2e686233 typo 2025-05-08 10:45:01 +02:00
e4ab6273b2 checklist 2025-05-08 10:41:43 +02:00
f9cec7ea35 fix docs 2025-05-07 17:46:10 +02:00
a0477deb64 docs 2025-05-07 17:43:01 +02:00
5161756aa1 typos 2025-05-07 12:50:39 +02:00
a3957aa47d fix image 2025-05-07 12:47:22 +02:00
3008b5dd95 burnout! 2025-05-07 12:46:55 +02:00
1e3dd04ba7 3d modeling docs 2025-05-06 22:15:12 +02:00
957926cca2 added docs 2025-05-06 20:26:50 +02:00
73bea72ae4 added gif 2025-05-06 16:41:02 +02:00
a27535e901 styling 2025-05-06 16:27:02 +02:00
d1780d7134 checklist 2025-05-06 16:23:22 +02:00
ef8daf1a2a styling 2025-05-06 16:22:31 +02:00
a20e4ef745 docs 2025-05-06 16:19:13 +02:00
8be0cb4a13 unfinished docs 2025-05-06 13:48:44 +02:00
a33daf2a01 updated code to use internal pwm timers of esp instead of software pwm 2025-05-06 13:48:27 +02:00
e5fbd9143c files 2025-05-06 11:38:42 +02:00
b7040826db styling 2025-05-06 11:22:34 +02:00
fd41c9bbdf fix images and docs 2025-05-06 11:20:36 +02:00
0c2f5f6064 styling 2025-05-06 11:17:58 +02:00
b11ed673ef Generative design 2025-05-06 11:14:24 +02:00
7087a257c3 docs 2025-05-05 14:44:31 +02:00
2d060cbb15 add code to read buttons and to read joystick X axises as 0 or 1 2025-05-01 16:40:03 +02:00
d588ab6c6e todo 2025-04-30 15:19:24 +02:00
37a453fd4e todolist 2025-04-30 15:18:52 +02:00
66eb28f496 docs 2025-04-30 12:39:06 +02:00
b9a6f40e11 molding and casting docs (: 2025-04-30 12:10:13 +02:00
e12e552bb6 docs 2025-04-30 11:27:02 +02:00
d2fb4972e9 fr1 2025-04-30 11:16:55 +02:00
7303af6f30 typo 2025-04-29 16:33:26 +02:00
fd7be4083a extra thoughts 2025-04-29 16:21:08 +02:00
df2b821da4 more docs 2025-04-29 16:17:46 +02:00
e3a4a53347 extra research 2025-04-29 16:16:59 +02:00
9c7f966ad6 docs 2025-04-29 10:31:36 +02:00
4f9667ba16 docs 2025-04-29 10:27:50 +02:00
855b079e1f docs moulding and casting 2025-04-27 14:09:05 +02:00
16b569c49d docs 2025-04-23 13:27:51 +02:00
f5c2e0d7a6 images 2025-04-23 13:13:05 +02:00
5333816f44 docs update 2025-04-23 13:07:24 +02:00
fba6149cf3 typo 2025-04-21 23:56:22 +02:00
a941dd8700 fix 2025-04-21 23:45:23 +02:00
b65de95a4e markup 2025-04-21 23:42:27 +02:00
d7a4e2f51c mkdocs.yml update 2025-04-21 23:39:48 +02:00
7eeeda4210 formatting 2025-04-21 23:37:45 +02:00
1b393ff12b formatting 2025-04-21 23:36:56 +02:00
6064097fe3 formatting 2025-04-21 23:35:45 +02:00
2c3788d19e machining docs 2025-04-21 23:33:45 +02:00
911ada0146 docs 2025-04-21 23:16:32 +02:00
e9c90ab8d0 fix folder structure 2025-04-21 22:23:57 +02:00
3bd7a07563 machining docs start 2025-04-21 22:22:43 +02:00
f0744a5ec0 image 2025-04-09 13:04:13 +02:00
e2ba053893 docs 2025-04-09 13:03:25 +02:00
8f9109cd77 typo 2025-04-08 14:50:20 +02:00
ebdb548599 batteries 2025-04-08 14:46:46 +02:00
465c5b186a images 2025-04-08 11:24:32 +02:00
960411167a docs networking 2025-04-08 11:21:01 +02:00
4ee9a76291 updated code to send all data 2025-04-07 11:29:34 +02:00
e48daca357 docs week 11 2025-04-04 13:41:48 +02:00
811e58e453 fix video 2025-04-02 12:32:32 +02:00
d6467bbf15 Now def fix video 2025-04-02 12:22:20 +02:00
d77db17b4f fix video? 2025-04-02 12:17:01 +02:00
24894ebd33 fix video 2025-04-02 12:12:39 +02:00
774af615b7 fix broken video link 2025-04-02 12:09:36 +02:00
38e7ea72a8 docs update 2025-04-02 11:27:59 +02:00
38c49e4205 diagram 2025-04-01 11:41:13 +02:00
f4b257de8e diagram 2025-04-01 11:40:57 +02:00
3635e32259 mermaid test 2025-04-01 11:19:59 +02:00
fd037dbef2 new pcb and start programming 2025-04-01 10:54:43 +02:00
7d9ba29209 yeet 2025-04-01 10:54:29 +02:00
718cbe66d8 more clear docs 2025-04-01 10:54:25 +02:00
9a1ca56ac1 cleanup and removed debug code 2025-04-01 09:46:35 +02:00
cfa8a9d74e output finally works
forgot to set standard values for controller when it's not connected
2025-03-31 13:23:48 +02:00
5c10f8fbfc Fix motors not getting armed 2025-03-31 13:10:27 +02:00
c491110afe docs output devices. group assignment individual assignment 2025-03-27 16:04:28 +01:00
d007b2de8f docs 2025-03-26 12:05:16 +01:00
1b580320e9 group 2025-03-26 12:03:48 +01:00
bbf72a1bdf added images 2025-03-26 12:00:35 +01:00
5e6f5a62a5 typo 2025-03-26 11:22:24 +01:00
7504e037f7 more input devices docs 2025-03-26 11:18:21 +01:00
56f9e57501 board houses 2025-03-26 11:12:13 +01:00
85ab692586 docs about drone control board 2025-03-26 11:04:13 +01:00
1b1b429c99 docs 2025-03-26 01:49:41 +01:00
4ff4f26cec added images and a lot of docs 2025-03-25 17:13:54 +01:00
228a887ad5 docs 2025-03-24 13:15:39 +01:00
f68dc2c19b docs 2025-03-19 10:55:32 +01:00
b7ee9decc0 docs update 2025-03-18 15:00:16 +01:00
f05c78e400 drone driver seems to work 2025-03-17 16:42:34 +01:00
49fe84e1a6 docs broken programmer 2025-03-17 15:07:43 +01:00
76ebfd9677 It finally outputs data
now need to get it parsed  correctly
2025-03-17 15:06:52 +01:00
011cc8ccfd typo 2025-03-17 10:26:55 +01:00
5a985367f2 images 2025-03-17 10:04:07 +01:00
22c057cec7 docs about removing tabs and stuff 2025-03-12 11:07:13 +01:00
c30a08eda2 added image 2025-03-12 10:45:42 +01:00
d766c5fc98 docs 2025-03-11 17:14:07 +01:00
eee588c0b0 update mkdocs.yml 2025-03-11 16:33:56 +01:00
78d969f99e Docs cleanup 2025-03-11 12:05:09 +01:00
d7ad2f74a4 docs 2025-03-11 11:37:10 +01:00
3d3014e08d computer controlled cutting docs 2025-03-10 14:06:39 +01:00
d20b7b4150 docs cleanup 2025-03-10 10:53:42 +01:00
7735322d30 assets 2025-03-07 12:52:45 +01:00
3ba2bc53ac group assignment stuff 2025-03-07 12:52:18 +01:00
d19bb98936 cnc stuff 2025-03-06 18:13:50 +01:00
7977e9c2c2 corrected links 2025-03-05 18:00:46 +01:00
be0ed9359c Lecture notes 2025-03-05 18:00:27 +01:00
cc872ce7f3 update notes 2025-03-05 17:51:31 +01:00
7ff6bcd8b3 Added files 2025-03-05 10:48:07 +01:00
a30ca1f04c more electronic design group assignment 2025-03-05 10:27:43 +01:00
7c338dda33 group assignment 2025-03-05 10:25:16 +01:00
7540575c64 Final project progression on way to control the drone 2025-03-04 16:55:53 +01:00
866dcd6ab2 Final project 2025-03-04 15:58:43 +01:00
64e15dcd60 electronics rambling about design rules 2025-03-04 13:18:16 +01:00
190f84a93b More rambling about speakers 2025-03-03 17:22:34 +01:00
9e1fd7c18c docs update 2025-03-03 15:26:43 +01:00
8d3714b258 revert mkdocs changes 2025-03-03 12:48:20 +01:00
3000842988 update mkdocs 2025-03-03 12:43:36 +01:00
54162ae667 Added mathjax to mkdocs 2025-03-03 12:40:04 +01:00
235784f87e images 2025-03-03 11:01:53 +01:00
01c591e96e speaker stuff 2025-03-03 11:01:34 +01:00
1b608469fb lecture notes + docs about electrical design and resistors 2025-03-02 21:03:20 +01:00
fb4b6b11cb lecture notes 2025-03-02 13:23:23 +01:00
3994d90a9b Lecture notes Week 6 2025-02-26 18:05:16 +01:00
53ae8822c7 added extra docs 3d printing 2025-02-26 11:41:00 +01:00
4d7f967daa added link 2025-02-26 11:35:41 +01:00
c2ff52bc71 file removal 2025-02-26 11:31:46 +01:00
c7c225f2c1 Added graph 2025-02-26 11:15:43 +01:00
2f6ac6feb8 checkboxes 2025-02-26 10:47:08 +01:00
f3ce0db138 docs about cleanup 2025-02-26 10:44:42 +01:00
56962166b2 images for 3d printing 2025-02-26 10:26:10 +01:00
b4ab726293 docs about strength testing bricks 2025-02-26 10:23:26 +01:00
c833c11aef docs update + images 2025-02-25 16:46:52 +01:00
3edf04530b Added 3d files 2025-02-25 16:37:28 +01:00
36ae7c5be3 fix video 2025-02-25 16:27:16 +01:00
8decf60bb1 resin printer docs 2025-02-25 16:04:21 +01:00
36df64d871 update mkdocs.yml 2025-02-25 12:31:32 +01:00
694550ebe8 3d printing docs 2025-02-25 12:26:31 +01:00
8ccc6170e4 typo 2025-02-21 11:16:28 +01:00
84fffaf40d notes about platformio 2025-02-19 13:49:11 +01:00
d7aecf60ea Added new MCU 2025-02-19 13:20:58 +01:00
a1203b6b9d easier readibility 2025-02-19 13:19:38 +01:00
c52161f3b4 change docs order 2025-02-19 13:08:29 +01:00
2b16ea154f more typos 2025-02-19 13:00:30 +01:00
83e63ccba5 debug level docs 2025-02-19 11:14:54 +01:00
84fc9a93c1 fix video 2025-02-19 11:01:56 +01:00
e9231e92aa fix typo 2025-02-19 11:00:53 +01:00
bbfd4965d8 fix video 2025-02-19 10:59:21 +01:00
df4145c734 docs - it finally compiles now except the IMU is dead 2025-02-19 10:56:04 +01:00
a08ed6c5a8 explanation intergration ESPNow into drone code 2025-02-18 15:45:29 +01:00
67b283ef3b ESPNow docs and problems with antenna 2025-02-18 14:59:26 +01:00
9e6ced19f9 added sources 2025-02-18 12:17:45 +01:00
85e978bbea put code block in collapsible box 2025-02-17 17:04:31 +01:00
af6a2916ab docs about normalising potpin 2025-02-17 17:03:24 +01:00
72bf01a813 docs + first potmeter program 2025-02-17 15:55:12 +01:00
b6a6f04333 docs about adding sensor code 2025-02-17 13:03:07 +01:00
73b03cfc1c Compiler flags docs 2025-02-17 10:46:14 +01:00
da9096a56c docs programming 2025-02-17 10:01:48 +01:00
c5f416fd22 added png's to gitignore 2025-02-17 09:45:02 +01:00
f7989611b1 Update platformIO.ini to Xiao espC6 2025-02-17 09:44:36 +01:00
8305063e77 name change 2025-02-14 11:30:10 +01:00
7ff11f475b forgot to add libraries to main.cpp 2025-02-14 11:29:56 +01:00
cb11da3322 project conversion to PlatformIO 2025-02-14 11:22:20 +01:00
947cd9d7ba repo cleanup + MCU lectures 13-02-2025 2025-02-14 10:49:55 +01:00
dc0cf71a5a laser cutter information correction 2025-02-12 13:26:52 +01:00
6d6336df9a drawings 2025-02-12 12:14:34 +01:00
05ebf81568 added result 2025-02-12 12:07:07 +01:00
3f1d5087d5 laser cutter f360 docs 2025-02-12 12:00:05 +01:00
574 changed files with 7847 additions and 717 deletions

5
.gitignore vendored
View File

@@ -1 +1,4 @@
.vscode
.vscode
*.png
*.JPEG
*.mov

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

View 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 cms. The traces are separated by 1 Cm.
![alt text](FR-1-Traces.jpg)
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.
![alt text](image.jpg)
![alt text](image-1.jpg)
## Files
* [KiCad](TraceThicknesTest.zip)

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

View File

@@ -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.
![alt text](image.png)
@@ -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.
![alt text](../../assets/assets_week_2/blender/image-4.jpg)

View File

@@ -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
![alt text](image.jpg)
![alt text](../../assets/assets_week_3/image.jpg)
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
![alt text](image-1.jpg)
![alt text](../../assets/assets_week_3/image-1.jpg)
You can declare variables by name=value;
Example:
![alt text](image-2.jpg)
![alt text](../../assets/assets_week_3/image-2.jpg)
You can also do equations in openScad
![alt text](image-3.jpg)
![alt text](../../assets/assets_week_3/image-3.jpg)
The order of declaring variables matters. I found that out the hard way. because some variable wasn't working until I switched order.

View File

@@ -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

View 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.
![alt text](IMG_7954.jpg)
![alt text](../../assets/assets_week_3/IMG_7954.jpg)
//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.
![alt text](IMG_7917.jpg)
![alt text](../../assets/assets_week_3/IMG_7917.jpg)
You see a spiral tube with at the end a mirror that shoots the laser into the cutting chamber.
![alt text](IMG_7918.jpg)
![alt text](../../assets/assets_week_3/IMG_7918.jpg)
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
![alt text](IMG_7920.jpg)
![alt text](../../assets/assets_week_3/IMG_7920.jpg)
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.
![alt text](IMG_7949.jpg)
![alt text](../../assets/assets_week_3/IMG_7949.jpg)
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.
![alt text](IMG_7928.jpg)
![alt text](IMG_7930.jpg)
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.
![alt text](../../assets/assets_week_3/IMG_7928.jpg)
![alt text](../../assets/assets_week_3/IMG_7930.jpg)
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.
![alt text](IMG_7952.jpg)
![alt text](../../assets/assets_week_3/IMG_7952.jpg)
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.
![alt text](IMG_7936.jpg)
![alt text](IMG_7937.jpg)
![alt text](../../assets/assets_week_3/IMG_7936.jpg)
![alt text](../../assets/assets_week_3/IMG_7937.jpg)
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.
![alt text](IMG_7951.jpg)
![alt text](../../assets/assets_week_3/IMG_7951.jpg)
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.
![alt text](../../assets/assets_week_3/image.jpg)
### 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.
![alt text](IMG_7925.jpg)
![alt text](../../assets/assets_week_3/IMG_7925.jpg)
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.
![alt text](IMG_7923.jpg)
![alt text](../../assets/assets_week_3/IMG_7923.jpg)
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.
![alt text](image-9.jpg)
![alt text](../../assets/assets_week_3/image-9.jpg)
This is the result of our cutting. Cardboard got a really wide curve that you can cut.
![alt text](IMG_7985.jpg)
![alt text](../../assets/assets_week_3/IMG_7985.jpg)
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.
![alt text](image-10.jpg)
![alt text](../../assets/assets_week_3/image-10.jpg)
(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.
![alt text](image-11.jpg)
![alt text](../../assets/assets_week_3/image-11.jpg)
(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.
![alt text](IMG_7968.jpg)
![alt text](../../assets/assets_week_3/IMG_7968.jpg)
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.
![alt text](IMG_7967.jpg)
![alt text](../../assets/assets_week_3/IMG_7967.jpg)
### 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.
![alt text](IMG_7977.jpg)
![alt text](../../assets/assets_week_3/IMG_7977.jpg)
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.
![alt text](IMG_7979.jpg)
![alt text](../../assets/assets_week_3/IMG_7979.jpg)
First image where it dropped during cutting
![alt text](IMG_7980.jpg)
![alt text](../../assets/assets_week_3/IMG_7980.jpg)
Second image where the Z offset wasn't right
![alt text](IMG_7981.jpg)
![alt text](../../assets/assets_week_3/IMG_7981.jpg)
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.
![alt text](image-5.jpg)
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
![alt text](../../assets/assets_week_3/image-5.jpg)
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
![alt text](image-4.jpg)
![alt text](../../assets/assets_week_3/image-4.jpg)
#### 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.
![alt text](image-6.jpg)
![alt text](../../assets/assets_week_3/image-6.jpg)
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.
![alt text](image-8.jpg)
![alt text](fab2025-henk.jpg)
![alt text](../../assets/assets_week_3/image-8.jpg)
![alt text](../../assets/assets_week_3/fab2025-henk.jpg)
#### 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.
![alt text](image-7.jpg)
![alt text](../../assets/assets_week_3/image-7.jpg)
### 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.
![alt text](../../assets/assets_week_3/IMG_8068.jpg)
![alt text](../../assets/assets_week_3/IMG_8069.jpg)
### Designing
I started by designing my base for my construction kit in fusion360 as a sketch.
![alt text](../../assets/assets_week_3/FusionBaseSketch.jpg)
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.
![alt text](../../assets/assets_week_3/F360Pattern.jpg)
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.
![alt text](../../assets/assets_week_3/F360combine.jpg)
### 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.
![alt text](../../assets/assets_week_3/F360Project.jpg)
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.
![alt text](../../assets/assets_week_3/DrawingTab.jpg)
Once you press that this menu will pop up
![alt text](../../assets/assets_week_3/Drawingsettings.jpg)
The standard settings are fine. You maybe wanna increase the sheet size to get your full design on it.
![alt text](../../assets/assets_week_3/Drawingscreen.jpg)
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).
![alt text](../../assets/assets_week_3/Squareboxdrawing.jpg)
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.
![alt text](../../assets/assets_week_3/beforedelete.jpg)
![alt text](../../assets/assets_week_3/afterdelete.jpg)
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.
![alt text](../../assets/assets_week_3/IMG_8078.jpg)
## 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

View 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.
![alt text](image.png)
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.
![alt text](image-1.png)
`Control + Shift + P` in vscode
![alt text](image-2.png)
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.

View 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.
![alt text](image-3.jpg)
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.
![alt text](image-4.jpg)
#### 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!
![alt text](image.jpg)
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.
![alt text](image-5.jpg)
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.
![alt text](image-6.jpg)
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.
![alt text](image-7.jpg)
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.
![alt text](image-8.jpg)
### 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.
![alt text](image-8.jpg)
### 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. ![alt text](image-9.jpg)
### 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.
![alt text](image-11.jpg)
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.
![alt text](image-12.jpg)
I first clicked the data type I needed.
![alt text](image-13.jpg)
Then I copied the line that enabled the data output.
![alt text](image-10.jpg)
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.
![alt text](image-14.jpg)
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.
![alt text](image-15.jpg)
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.
![alt text](image-16.jpg)
The same also has to be done later on in the error correction algorithm
![alt text](image-17.jpg)
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.
![alt text](image-18.jpg)
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
![alt text](image-20.jpg)
![alt text](image-19.jpg)
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.
![alt text](IMG_8180.jpg)
* [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.
![alt text](image-21.jpg)
Wiring it is pretty straight forward, VCC to 3v3, GND to GND and the out pin to a analog pin.
![alt text](IMG_8182.jpg)
### 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.
![alt text](image-22.jpg)
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.
![alt text](image-23.jpg)
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.
![alt text](image-24.jpg)
![alt text](image-25.jpg)
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.
![alt text](image-26.jpg)
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.
![alt text](image-27.jpg)
#### 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.
![alt text](IMG_8200.jpg)
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.
![alt text](image-28.jpg)
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.
![alt text](image-29.jpg)
After that I added the global variables for the ESPNow protocol.
![alt text](image-30.jpg)
Then I uncommented `RadioSetup()` again so it could be used again and I added a case for my ESPNow protocol.
![alt text](image-31.jpg)
In the PWM receive function I added an additional case so my PWM values actually get intergrated into the code.
![alt text](image-32.jpg)
At the end of the program I added the ESPNow Initialization function and the callback function for when the data is received.
![alt text](image-33.jpg)
When I compile it now it should work. Except that it doesn't work.
![alt text](image-34.jpg)
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:
![alt text](image-35.jpg)
To:
![alt text](image-36.jpg)
Result:
![alt text](image-37.jpg)
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.
![alt text](image-38.jpg)
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:
![alt text](IMG_8212.jpg)
Instead of like this.
![alt text](IMG_8213.jpg)
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)

View 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.
![alt text](IMG_8363.jpg)
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.
![alt text](IMG_8373.jpg)
#### Repairing the ender
During the design rules 3D print the ender got clogged and we needed to repair it.s
![alt text](IMG_8347.jpg)
When I tried unloading the filament the motors ripped out the filament from the tube and broke it on the inside.
![alt text](IMG_8291.jpg)
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.
![alt text](IMG_8348.jpg)
![alt text](IMG_8349.jpg)
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.
![alt text](IMG_8344.jpg)
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
![alt text](image.jpg)
## 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
![alt text](image-1.jpg)
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.
![alt text](IMG_8277.jpg)
This is the second print
![alt text](IMG_8278.jpg)
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.
![alt text](IMG_8381.jpg)
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.
![alt text](IMG_8383.jpg)
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.
![alt text](image-18.jpg)
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.
![alt text](IMG_8421.jpg)
I made 3 prints. One normal using normal settings. One with brick using `Bricklayers.py` and one using `bricklayersNonPlanarInfill.py` using the commands above.
![alt text](image-15.jpg)
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.
![alt text](IMG_8462.jpg)
So if it was more stable during printing it may have been even stronger.
![alt text](image-17.jpg)
## 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:
![alt text](image-9.jpg)
![alt text](IMG_8414.jpg)
## 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
![alt text](image-4.jpg)
After that you can plug the usb-c to A cable in the side of the camera and then screw in the locks.
![alt text](IMG_8353.jpg)
After that we can go to the software. Since it's an creality camera we also need the crealityScan software.
![alt text](image-5.jpg)
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.
![alt text](image-6.jpg)
Then I grabbed a fume extractor for soldering and that worked like a charm.
![alt text](image-2.jpg)
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.
![alt text](image-7.jpg)
![alt text](image-8.jpg)
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.
![alt text](image-3.jpg)
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.
![alt text](image-10.jpg)
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. ![alt text](image-11.jpg)
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.
![alt text](image-12.jpg)
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.
![alt text](image-13.jpg)
Once we pressed that we can go back to the other tab and press slice to slice it all to a file.
![alt text](image-14.jpg)
Then we can put it on a USB stick and start preparing the machine
### Preparing the printer
![alt text](IMG_8395.jpg)
First Henk showed how to calibrate the plate for printing. You need a piece of paper and a alan key to calibrate the plate.
![alt text](IMG_8399.jpg)
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.
![alt text](IMG_8398.jpg)
After that Henk poured in the resin. Always make sure when you're working with resin to use gloves.
![alt text](IMG_8404.jpg)
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.
![alt text](IMG_8426.jpg)
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.
![alt text](IMG_8432.jpg)
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.
![alt text](image-16.jpg)
![alt text](IMG_8434.jpg)
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.
![alt text](IMG_8436.jpg)
![alt text](IMG_8440.jpg)
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.
![alt text](IMG_8442.jpg)
![alt text](IMG_8441.jpg)
![alt text](IMG_8445.jpg)
![alt text](IMG_8449.jpg)
![alt text](IMG_8452.jpg)
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:
![alt text](IMG_8454.jpg)
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)

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Some files were not shown because too many files have changed in this diff Show More