# Idea final project

## Introduction
I wanted to combine 2 random objects that interest me into one project. A drone and a jumbotron. So im gonna make a drone with multiple screens on it that could for example be used for traffic control or entertainment purposes.

## What does the drone do?
The drone needs to be able to fly for at least 20 minutes. It needs 2 screens on both side so it can display images or video. I wanna program the drone myself so I know how drones work and how they keep themselves upright.

## Drone Requirements
### basic requirements
* 2 screens
* Speakers
* 20 min flight time
* custom microcontroller pcb that controls the drones and screens
* 50 meter range from controller

### Sensors
* GPS
* IMU/rotation sensor
* Read voltage from battery know battery percentage

### Requirements when far ahead
* Docking station
* Automatic docking
* Automatic pathing 
* Design own electronic speed controllers

## Images

![](../assets/result.jpg)

![](../assets/result2.jpg)

![](../assets/result1.jpg)
[last image credits](https://gareth-morrison.squarespace.com/drg)

## Drawing the drone

I have a few concept images above and this is the result my drawings.
![alt text](../assets/assets_week_2/fusion360/IMG_7688.jpg)
![alt text](../assets/assets_week_2/fusion360/IMG_7686-min.jpg)
![alt text](../assets/assets_week_2/fusion360/IMG_7712-min.jpg)
![alt text](../assets/assets_week_2/fusion360/IMG_7711-min.jpg)

In the second picture you can see that I wanted to make the drone 30 cm in length. But then I looked at the prices for bigger batteries and it started to get super expansive real fast. So I decided to make it smaller. So now im planning on making a drone 10 cm in length. Im still going for the design in the third image. You can also kinda see that I got my inspiration from the third concept art image. And im giving my on twist on it.

## Designing the drone
When designing the drone I wanted to do everything parametric. So im going to try to use as much variables as possible and make everything depend on each other so everything automatically scales when I change one parameter.

### Designing the drone parametrically
Designing parametrically is very hard because every constraint needs to be perfect. Otherwise when changing lengths the design will fold into itself like this.
![alt text](../assets/assets_week_2/fusion360/image.jpg)
I've spend one day getting the constraints perfect for the sketch so it scales well with everything. And this is the result of that. When I change one parameter in the variable menu the entire body scales with it. This is the final result of my design. I've made the body myself and I've imported the components from grabcad. So I had more time for blender and Onshape and so I could visualize it better.
![alt text](../assets/assets_week_2/fusion360/image-18.jpg)

### Rendering 
I've also made a render of the drone to visualize it for other people. Making this was kind of a pain because blender is a gigantic program. You can see my [docs](../Assignments/week_2_computer_aided_design_(cad)/drone_designing.md) to see where I struggled. This is my final result of the render. I've wished it looked nicer but I didn't have enough time to dive deeper into blender.

<video controls src="../assets/assets_week_2/blender/droneRender.mp4" title="Title"></video>

## Feedback from Bas and Henk
I've gotten some feedback on my design and about the use of screens. Maybe I should only use speakers or use LED matrixes. After thinking about it I think im going to give LED matrixes a spin.

## Drone electronics
For the drone I will need a lot of electronics. But I will also need a pcb for inside the drone so I don't have any loose connections. The main board needs a couple of components. Something to step down the voltage from the big battery or I will use two separate batteries one for the motors one for the control board. I will also need a sensor to know the position of the drone and a microcontroller. I also need a lot of power to power the screens so that will also be something interesting.

### Components 
* MCU
* [BNO085](https://shop.slimevr.dev/products/slimevr-imu-module-bno085)
* Something to drive the LED matrixes
* SD card/ secondary MCU to control the matrixes
* LED (mandatory)

### Drone remote electronics
I'm also building the remote for the drone

* Potslider for the throttle
* Joystick for left-right-forward-backwards
* battery
* screen to see status of drone
* LED (mandatory)

#### Joystick
I really wanna use a joystick for this project because having 2 potmeters under each other looks a bit weird.

### KiCad
The first thing I did was import the design rules for our milling machine. I used the file from the lecture to import it from because there we set everything up together.

![alt text](image.jpg)

Now im going to grab all the components needed for the board
* [Joystick](https://www.digikey.nl/nl/products/detail/c-k/THB001P/11687191) x2
* LED
* small oled screen
* xiao espS3


I was struggling a lot when thinking on how to connect the joysticks because the data sheet says it needs 5 volts. Until I realized they where potentiometers and they should work with any voltage. So I could directly connect the Joysticks to the MCU

Instead of it looking like this.

![alt text](image-1.jpg)
This configuration wouldn't have worked anyway because the voltage regulator forces the voltage to 3.3 so the mcu will only read one value.
It now looks like this:

![alt text](image-2.jpg)
So I have 2 joysticks that are directly connected to the mcu. A screen that works on the I2C protocol and a LED.

First when routing the joysticks I realized that the Xiao has analog on both sides of the board. So if I change the schematic so it connects to the other side I have a lot less longer traces.

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

![alt text](image-4.jpg)
So like this instead of needing them to go across the entire mcu.

I forgot to apply the design rules so I imported them again and now I have to retrace everything. Thanks Irja for checking them together.

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

Then I needed to draw the outlines. To draw curved lines I used [this tutorial](https://www.youtube.com/watch?v=aHIIXjRAhZA). It's hard to get the get everything symmetrical. Maybe there is already a tool to do that but I don't know where to find it.

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

This is the result of the board.

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



## BOM (bill of materials)
| item  | price | link     |
| :---- | ----- | -------- |
| item1 | 999   | link.com |