Arduino Quadcopter with Android via Bluetooth

Hello all,

I have designed an arudino quadcopter from scratch ..I used an AtMega328p with Arduino bootloader as you can see in the attached picture , a serial Bluettoth module (the blue thing from top-left corner) and a PolouluMinIMU-9.

I used the frame of a RC quad Beetle v929 ..removed it's control board and added mine.Only kept proppelers ,frame,motors from that so they are certainly in the right position .

I have added in the picture the rotation of the motors and the Arduino pins on which every motor is connected to.
The whole thing is powerd by a 3.7V 1400mAh LIPO.

MOTORS are driven by MOSFETS integrate on my PCB they spin really fast are ok..

==========================================================
I am using an "X" configuration for the quad .. and using AHRS library for PolouluMin9 :

Then I get from the library the Euler angles: like pitch,roll,yaw and use the 3 angles in this equations(the equations are in the attached picture also right side ) for stabilizing the quad :

int user_pwm=255;//here I am setting the user pwm which will come from Bluetooth but this is for test


setup(){ //here I am initializing serial ,setting pin directions etc
----blabla
}

loop() //here is the library that calculates euler angles etc in a loop at 50 hz
{

getEuler();

// from here begins my code

analogWrite(6,  user_pwm + toDeg(pitch) - toDeg(yaw) ) //front motor I am considering M1 because X axis of IMU is on its side
analogWrite(9,  user_pwm - toDeg(pitch) - toDeg(yaw) ) //backmotor I am considering M3 because it is opposide to M1

analogWrite(10,  user_pwm + toDeg(roll) + toDeg(yaw) ) //left motor I am considering M2 because Y axis of IMU is on its side
analogWrite(5,  user_pwm - toDeg(roll) + toDeg(yaw) ) //right motor I am considering M4 because it is opposide to M2

}

*THIS are the equations I found from internet to stabilize quad but it does not specifies if it s for "+" or "X" quad configuration

front motor PWM = user_thrust + PIDpitch - PIDyaw
back motor PWM = user_thrust -PIDpitch - PIDyaw
left motor PWM = user+thrust+PIDroll+PIDyaw
right motor PWM = user thrust -PIDroll + PIDyaw

My questions are for you guys who made other quadcopters :

1)Are there any OTHER equations specifically for X- configurated quads or this equation for stabilization are ok working for both "X" and "+" configs ? I ask this because I can t tell which should be front motor M1 or M4 and what other forumas shoul I use if they are both considerd (M1+M4)/2?
Currently I am considering front of the quad function of gyrop position which is drawn by me on the picture X,Y axes.

2)Is it ok my gyro position according to axis for a X config ?
3)any reccomandations ?

  1. currently it does not lift off , it lifted once but rotated and durnet backwards :slight_smile:
  2. does someone has something similar or a piece of code for me something better ..I just want to lift off and stabilize it ...
    Nobody explains on the net how can Euler angles be proper converted in PWM nor if it depends of X config and + config .,or how important is the position of the gyro ,IMU ?

Thank you in advance and hope to see a reply from you soon ,
Catalin

http://forum.arduino.cc/index.php/topic,148850.0.html

Hey,

Now to begin with I have no problems getting personal messages.. But If you think that I'm the right guy to help you with your problem then a brief message together with a link to the thread you've posted is fine, not more, not less..

Now a project like this isn't easy to tackle if you don't know/understand math and physics.. But anyhow here is my 50 cents:
The equation you've posted is obviously for + (plus) configuration, (how do I know that, you may say?).. In the X-configuration you utilize all of the motors during any axis change, meaning, if you change the Pitch then all motors will have to compensate for that change.. For example: If we tilt forward (two front motors will have to decrease their throttle and the two back motors will have to increase).. If you look at the equation you've posted you can clearly see that if you change the pitch then you'll change the throttle of only two motors (indicating that it's a +-configuration).. Not to be rude or anything.. But it sounds like you haven't done your research.. Begin by reading about these equations and how people more or less have done it essentially.. You can also look at my code, because it is written in a simple way for quadcopter-beginners to understand..

Here is a link to my code: GitHub - baselsw/BlueCopter: Arduino Quadcopter firmware
And here is a link to my quadcopter( BlueCopter) thread, where I'm sure you'll find a lot of answers to a lot of beginner questions.. Be sure to read through the entire thread before posting any further questions.. : http://forum.arduino.cc/index.php?topic=184503.0

//Basel

sir plz send the android app