Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; AntiBotCaptcha has a deprecated constructor in /homepages/8/d680172117/htdocs/QA/qa-plugin/q2a-captcha-antibot-master/AntiBotCaptcha.php on line 22
Could you help with modifying self balancing drone code for a project, i think im close. - Electronoobs Q&A

10 Online
0 Member And 10 Guest
Today Visits : 1549
Yesterday Visits : 2810
All Visits : 317054

Welcome to Electronoobs Q&A, where you can ask questions and receive answers from other members of the community.



Categories


0 votes

I want to use a mpu6050 gyro and accelerometer module to read the angle the module is at and based on that angle, increase or decrease motor speed. I have modified the code from a self-balancing drone video which used PID. I attempted to remove the PID because it is unnecessary for my purpose of just reading the angle and changing motor speed while keeping the portions measuring angles. Then I added a simple if-then statement saying if the axis angle is within 0-45 degrees, set the motor speed to that (that anglex37) because the top motor speed is 2000 and it is not safe to go past 85% motor power in fear of damaging the vesc. I truly don't know how high of a speed I can code my motor to but I will adjust accordingly because I don't know if the Arduino motor speed is just rpms. 

Anyways here is the drone code:Drone code

Here is my code:My Code

asked in Arduino by (120 points)

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

To avoid this verification in future, please log in or register.
...