Please forgive me, the PID isn’t workink well yet… I hope this is usefull and that you could learn something.
In the past video series we’ve used the MultiWii platform for the flight controller. Now I want to make my own code for the flight controller.
In this second part we combine the PWM signals from the receiver (part 1) with the IMU data and create the PID control.
Help my projects on Patreon : https://www.patreon.com/ELECTRONOOBS
my Q&A page: http://electronoobs.com/eng_preguntas.php
——————COUPONS——————–
FuriBee X215 PRO: https://www.gearbest.com/brushless-fpv-racer/pp_708379.html?lkid=11509435
Crealitu CR10: https://www.gearbest.com/3d-printers-3d-printer-kits/pp_441282.html?lkid=11382974
Anet E10: https://www.gearbest.com/3d-printers-3d-printer-kits/pp_664901.html?lkid=11382975
4k XIAOMI drone: https://www.gearbest.com/rc-quadcopters/pp_728058.html?lkid=11382963
——————LINKS——————–
Webpage tutorial: http://www.electronoobs.com/eng_robotica_tut9_2.php
PID video:https://www.youtube.com/watch?v=AN3yxIBAxTA&t=2s
PID webpage: http://www.electronoobs.com/eng_robotica_tut6.php
Previous series: https://www.youtube.com/watch?v=S8TSkGQ2EWY&t=9s
Drone build webpage: http://www.electronoobs.com/eng_robotica_tut5_1.php
STL files: http://www.electronoobs.com/eng_robotica_tut9_stl1.php
Joop Brokking videos: https://www.youtube.com/watch?v=2MRiVSyedS4&t=1s
—————-MATERIAL—————-
Full part list: http://www.electronoobs.com/eng_robotica_tut9_part1.php
Arduino NANO: https://www.gearbest.com/boards-shields/pp_265453.html?lkid=11383052
MPU6050: https://www.gearbest.com/development-boards/pp_22530.html?lkid=11383057
LIPO battery: http://www.ebay.com/itm/T-Plug-11-1V-1500mAh-25C-3S-VOK-Discharger-Lipo-Battery-For-RC-Helicopter-/192064598545?hash=item2cb7f13211:g:-moAAOSw2xRYZLf9
ESC 12A: http://www.ebay.com/itm/4-x-Emax-12A-Speed-Controller-ESC-with-SimonK-Firmware-For-FPV-QAV250-Quadcopter-/162242575330?hash=item25c6693be2:g:4EwAAOSwLF1YBIT-
1804 brushless motor: http://www.ebay.com/itm/4x-Brushless-Motor-1804-KV2400-for-220-240-Blackout-Mini-Quadcopter-2400kv-/131520498802?hash=item1e9f3b8c72:g:blcAAOSw~OdVYZYf
5030 propellers: http://www.ebay.com/itm/8-pairs-Gemfan-5030-5-3-3-Blade-Propeller-for-QAV250-QAV210-Quadcopter-green-/121723124570?hash=item1c57437b5a:g:6n4AAOSwLVZVwroq
LIPO connectors: http://www.ebay.com/itm/10-Pairs-20pcs-T-Plug-Connector-Female-Male-Deans-For-RC-Lipo-Battery-Helicopter-/282414841624?hash=item41c13c7f18:g:644AAOSwol5Y3H6I
Slide switch: http://www.ebay.com/itm/50-Pcs-2-Position-SPDT-1P2T-3-Pin-PCB-Panel-Vertical-Slide-Switch-LW-/171865305033?hash=item2803f86fc9:g:8IAAAOSw4UtWTtfs
Drone body: DIY : http://www.electronoobs.com/eng_robotica_tut5_1_parts1.php
Or : http://www.ebay.com/itm/250mm-Mini-Multicopter-Quadcopter-Racing-Drone-Glassy-Carbon-Frame-Kit-FPV-ED-/132055523479?hash=item1ebf1f6097:g:nQwAAOSw9GhYbpUv
—————-SCHEMATICS————
Full schematic: http://www.electronoobs.com/images/Robotica/tut_9/Schematic_full.png
One axis schematic: http://www.electronoobs.com/images/Robotica/tut_9/one _axis_schematic.png
ESC calibrate: http://www.electronoobs.com/images/Robotica/tut_5/ESC_calibrate.png
Lipo connection: http://www.electronoobs.com/images/Robotica/tut_5/LIPO_connection.png
Propeller spin direction: http://www.electronoobs.com/images/Robotica/tut_5/Propeller_direction.png
———————CODE——————-
Gyro read: http://www.electronoobs.com/eng_robotica_tut9_code3.php
Acc read: http://www.electronoobs.com/eng_robotica_tut9_code4.php
Full angle read: http://www.electronoobs.com/eng_robotica_tut9_code5.php
ONE axis flight controller: http://www.electronoobs.com/eng_robotica_tut9_code6.php
TWO axis flight controller: http://www.electronoobs.com/eng_robotica_tut9_code7.php
Like share and subscribe to motivate me. Thank you
very good video as always, . There is spelling mistake in discription last line axis
I couldn’t manage to make the drone fly straight. I couldn’t find the correct PID values. I’ve made 100 tests and still noting. Stay tuned for future updates. You could always use the MultiWii platform. Also, if you consider helping my projects chek my Patreon: https://www.patreon.com/ELECTRONOOBS
I hope that you’ll be able to learn sommething new with this video.
Really, really nice work, man. 🙂
finally
Thanks for your hardwork it’s because of you we LEARN.
Nice tutorial but your codes registered as virus on my computer. Very informative though.
You need to make integral windup protection.
Also calculating rol, pitch, and yaw angle as you made kind a bad idea. Euler angles in 3d rotation sometimes works bad (gimbal lock) = crash.
You need to use quaternions instead of euler.
read about this things
Too complicated to understand
good
Hey, thanks a lot for sharing. I always love watching your videos! , may I ask what editing softwares you use ? I am guessing adobe premier pro and after effects but still.
Cheers!
there is a mistake in line 294 it should be (-400) not -4000 9:46. You probably forgot while typing
Then just get a betaflight compatible flight controller, and it will fly