2) Immediately realise that's probably a bad idea and there's absolutely no way in hell you'll finish it with your limited hardware knowledge
3) Continue anyway
4) Look around online to see if anyone's done this before and written about it
5) Find useful resources with useful advice (and then forget to document them)
6) Spend a long time looking for motors and propellers
7) Find cheap motors without a datasheet on Amazon. It'll be fine!
8) It's not fine. The motor shaft doesn't fit the propeller.
9) Look for propellers with the right shaft size
10) Give up after 2 hours
11) Order a different set of motors, this time they come with a propeller :)
12) Discover the attachment that comes with the propeller doesn't actually fit
13) Ok it's fine we'll just mount the propellers directly on the motor instead of via the attachment
14) Discover that the motors draw a stupid amount of current and practically short circuit your pathetic power supply in the process
15) Measure how much current the motors are drawing, how much thrust they're producing, and how much thrust is advertised, and use all that to get a rough estimate of the power required to run of the 4 motors at full speed
16) Jesus Christ, *how many* watts?
17) Decide you need a better power supply
18) In fact, may as well just order a battery. We'll need one eventually.
19) Research battery types
20) Discover that lithium-polymer (lipo) batteries are typically used for drones, because they're compact, light, and can provide a lot of power
21) Check the pi pico datasheet to see what range of battery voltages can power it
22) Oh phew, it's quite a wide range if we use the VSYS pin
23) Decide to get a 3.7V (1S) battery
24) Find a battery that looks good and order it
26) Have an existential crisis about lithium batteries. Did you know that many of these batteries have circuitry built in to prevent overcharging/over-discharging? Some circuits protect against short circuits and overcurrent as well. Some (in multi-cell packs) will balance the charge across the cells in the battery. Some even include temperature sensors. Lithium-ion (and lithium-polymer) batteries inherently have very dangerous chemistry, but they're paradoxically the safest batteries because we've put so much effort into making them safe...
27) Spend an hour reading about how lithium-polymer batteries can explode violently and ruin your life and destroy everything you love
28) Order fireproof bags to put the batteries in
29) Set up a circuit to test the battery with one of the motors
30) Absolutely do not short circuit the lipo battery
31) Think about how you're going to not short circuit the lipo battery
32) Make sure you have the wires the right way round so as to not short circuit the lipo battery
33) OH F*** I SHORT CIRCUITED THE LIPO BATTERY
34) Panic
35) Nothing happens
36) Calm
37) Plug the wires in the right way this time
38) The motor runs fine :)
39) Measure how much thrust you can get now. It's significantly less than advertised.
40) Check the voltage across the battery while the motor is running
41) Discover that there's significant voltage drop. Why does this 3.7V battery (charged to 4.0V) measure 2.4V when you run the motor? Sure, some drop is expected, but not that much...
42) Solder the stranded motor wires to solid core wires to see if that helps
43) It helps! There must have been a lot of resistance in the connection. The thrust is still far less than advertised. Of course.
44) Take a moment to congratulate yourself! After 43 steps, you have acquired a battery and some propellers
45) Now turn your attention to the flight controller. How the hell do we do this? Oh, right, PID controllers
46) Research PID controllers. They're just a controller that takes a measurement, checks how far it is from your desired measurement, and tries to get the two to match by outputting a signal (eg: to a motor or a heater). They have three terms: Proportional (the further from the desired measurement, the higher the signal), Integral (the longer we've been far from the desired measurement, the higher the signal), and Derivative (the faster we're moving towards the desired measurement, the higher the signal). You can set these terms as desired to try and balance out the system. If you get it wrong, your system might oscillate, or might not correct the error fast enough. None of that attempt at an explanation made any sense, did it?
47) Copy PID code from someone's blog post
48) Wait, how are we going to control the motors using the pathetically small output of a GPIO pin? Oh right we need transistors.
49) Figure out what kind of transistor you want. Probably MOSFETs, they generally have a higher switching speed, and you can't find any BJTs with the characteristics you're looking for...
50) Order some IRLZ44N transistors
51) Wire them up to a motor
52) You connected the motor the wrong way you buffoon
53) Fix the wiring
54) It works, yay
55) Now to moderate the transistor's gate voltage. You can use PWM for this.
56) Accidentally destroy 2 GPIO pins while trying to get PWM to work (I still have no idea how I managed this)
57) Finally manage to control the motors using PWM, and integrate this with the PID controller code
58) Now to determine the orientation of the drone...
59) Order an MPU6050 because it seems to be the standard based off 1 forum post
60) Learn about I2C to communicate with the MPU6050
61) Copy some code off an arduino forum post and adapt it to the pi pico
62) Discover you need a magnetometer to prevent the gyroscope readings from drifting
63) The MPU6050 doesn't have a magnetometer
64) Order an MPU9250, which should have a magnetometer
65) The MPU9250 you get doesn't seem to have a magnetometer either, what the hell??
66) Anyway, we're getting gyroscope and accelerometer readings, yay!
67) Feel a stong desire to make graphs
68) Spend a day figuring out how to do networking with the pi pico so you can send telemetry to your computer
69) Write a simple UDP server in Python for receiving telemetry from the drone
69) Have an existential battle with matplotlib
70) Win
71) Take a moment to sit back and enjoy the beautiful gyroscope/accelerometer graphs you've created
72) Realise the readings are off...
73) Discover that you need to calibrate the MPU6050
74) Write a program to calibrate the MPU6050
75) Take a moment to sit back and enjoy the beautiful gyroscope/accelerometer graphs you've created
76) Wonder how the hell you're going to get orientation out of this without significant drift due to gyroscope inaccuracies
77) Kalman filter? That sounds too complicated. Let's go with a complementary filter.
78) Figure out how to calculate the angle according to the accelerometer (ie: remember atan2 exists)
79) Implement the complementary filter to get orientation
80) Take a moment to sit back and enjoy the beautiful gyroscope/accelerometer/orientation graphs you've created
81) We have multiple tasks now (PID controller, telemetry, setting motor speed, interfacing with the MPU) so let's create a scheduler
82) Take *cough* 'inspiration' from RIOS
83) Fail to implement a pre-emptive scheduler (why will pico timers not interrupt themselves??? I still can't figure it out, seems to have something to do with interrupt priority)
84) Fine, let's just go with a cooperative scheduler
85) Add all the existing tasks to the scheduler
86) Forget an & symbol and spend the next hour trying to find out why your memory is being corrupted
87) Finally, you're ready to do a small test
88) Reignite your passion for lego
89) Build a test rig out of lego to simulate movement on one axis, like a see-saw. Have a motor on both sides.
90) It oscillates wildly and smashes into your desk (but nothing gets damaged)
91) Extend your Python server, and add a UDP listener on the pico, to allow you to tune you PID controller in real time. Actually, that's too much work, so enlist your mum to extend the Python server.
92) Fail to tune the PID controller even with the ability to adjust it in real-time. You absolute buffoon.
93) Realise the propellers you have are all in the same direction. Why is this a problem? The propellers turning creates torque, which rotates the drone. Four propellers all spinning in the same direction will cause the drone to spin. Two of the propellers need to be spinning in opposite directions. This is why drone propellers come in clockwise/counterclockwise pairs
94) Scream into the void
95) Discover that the propellers you ordered to go with the first set of motors actually do fit on the new motor!!! And they came in clockwise/counterclockwise pairs!!
96) The thrust provided is significantly less
97) Argh
98) Weigh all the hardware
99) It's probably still enough thrust? (about 85g of thrust - the battery is 18g, the motors 26g, electronics about 22g, so you have 22g remaining for the frame and other stuff... oh my goodness that's a tight margin, and you can't just max out the motor thrust, so that they still can throttle to control the pitch/yaw/roll)
100) Realise you don't have much time left. Ok let's just try make a frame and see how far we can get.
101) Realise you don't have the materials on hand to make a decent frame, and just use cardboard
102) The cardboard frame turns out all floppy
103) The motors and transistors are heating up when running and might ignite the cardboard if they run too long
104) There isn't any protection for the lipo battery from overdischarging. Your multimeter only goes up to 10A, so you can't check to make sure the current isn't too high.
105) The motors don't have a very fast response time. Maybe that's why the test rig was oscillating so much...
106) You don't have a plan to tune the PID controller with all 4 motors on. You could suspend it with a string, but you'd have to prevent the propellers getting tangled in it, and such a test rig would be very difficult to set up properly...
107) You're struggling to mount the pi pico and the transistors on the frame
108) Give up for now and go play some Vintage Story with your friend.