meine
meine 🌒 - A CLI file manager and system utility built with Textual. It combines intuitive command parsing with rich t…
Python-based Quadcopter Flight Controller Software using a Raspberry Pi Pico, MPU-6050, and a FlySky radio transmitter…
Click on the image below to watch a brief video about Scout's development:
Further videos:
src folder.bonus_code folder.If assembled and wired exactly as depicted in my article describing Scout's hardware and electronics, only minor modifications need to be made to the Scout source code before using it in your own quadcopter.
However, this is a list of things that you may want to customize/tweak to tailor to your particular build (perhaps you used a different frame or different motors so my values do not fit your quadcopter well). All of these variables can be found in the first "SETTINGS" section of the Scout Flight Controller main.py module:
throttle_idle - when switched into flight mode (see step 7 in the steps below), the motors will spin up at a low RPM, providing a low level of thrust but not enough to lift the quadcopter off the ground. Thus, this sets the throttle level to achieve minimum thrust when the pilot has the throttle stick in the 0% position. You should customize this value according to your specific quadcopter's motor thrust and weight. You want it to provide a very minor level of power; enough to spin the propellers at a low RPM, but not enough to generate lift.throttle_governor - this is the maximum throttle that Scout will allow the pilot to give. In other words, if the pilot pushes their throttle stick to the 100% position, Scout will use this throttle level, with a linear relationship between the throttle_governor value and throttle_idle value according to the throttle stick position. For easy to control flight (what I prefer), use a relatively low value; enough where the quadcopter can generate significant thrust and ascend with ease, but not too much. For performance-oriented setups, use a higher value (max is 1.0, or 100%).max_rate_roll - the maximum roll rate, in degrees per second, that Scout will allow. So, if the pilot pushes all the way to the right on the roll stick (indicating maximum right roll), Scout will roll at this value. Higher values favor performance, lower values (like I have) favor controllability.max_rate_pitch - same as above, but for pitch.max_rate_yaw - same as above, but for yaw.pid_roll_kp, pid_roll_ki, pid_roll_kd, etc. Fortunately, you may be able to get away with leaving these mostly unchanged. Or, if you are not pleased with the way your quadcopter flies, you can increase or decrease these, but I'd recommend doing so proportionally. Or, you can adjust each P, I, and D gain for each axis individually if you'd like. There are plenty of explanations and tutorials online about PID tuning you can reference.Of the values above, the two most critical to update are throttle_idle and throttle_governor, as these are specific to the motors you have and weight of your quadcopter. In particular, the throttle_idle. Set this value to the minimum (or close to minimum) level of throttle you must apply to your motor for the propellers to begin spinning at a low RPM. You will just have to learn what this is through testing (with propellers off). The remaining values can likely be left as default.
But, if you do use the exact hardware I am using (same frame, motors, ESC's, 4S LiPo battery, etc.), in theory you will not need to make any modifications to Scout's source code whatsoever.
src folder onto the Raspberry Pi Pico. Provided you wired up everything exactly as depicted in the hardware article, you will not need to modify any parts of the code.0). If these either of these is not the case, the Scout flight controller has a built-in safety mechanism which abort at power-up.
1). This will put Scout into flight mode. You will see the propellers begin to spin at a low RPM, providing some thrust, but not enough for the quadcopter to lift off the ground.0) to switch back to standby mode, stopping the propellers.If you're interested in learning how the Scout Flight Controller was made and perhaps making your own flight controller, this is for you! In the spirit of promoting learning, I'm publicly sharing all that I learned during the three months I spent dreaming about and developing Scout. I wrote a 12-chapter series on how I developed the Scout Flight Controller and the hardware requirements. You can find the articles on Medium below:
Thanks to stienman, all 12 chapters are now available as a single ebook PDF download! Download the ebook here.
Please be aware that I, Tim Hanewich, the creator of this drone quadcopter code, do not assume any responsibility or liability for any consequences, including but not limited to injuries, damages, breaches of law, or any adverse events that may occur while deploying, testing, or using this code in any other way.
By accessing, modifying, or utilizing this code, you acknowledge and agree that you do so at your own risk. It is essential to exercise caution, adhere to safety regulations, and ensure compliance with all relevant laws and guidelines when working with drones or any related technology.
Furthermore, please note that the code and designs provided are intended solely for educational and informational purposes. While efforts have been made to ensure accuracy and safety, there are inherent risks associated with building and operating unmanned aerial vehicles. While this project is dedicated to promoting benevolent uses of drone technology, it is crucial to understand that unforeseen circumstances and unintended outcomes can arise.
Users and developers are encouraged to prioritize safety, conduct thorough testing, and act responsibly at all times. Your safety and the safety of others should always be your utmost concern. I explicitly disclaim any responsibility for any injuries, damages, or bodily harm that may occur as a result of using or replicating these materials.
more like this
meine 🌒 - A CLI file manager and system utility built with Textual. It combines intuitive command parsing with rich t…
search projects, people, and tags