Go Down

Topic: BlueCopter - Arduino Quadcopter (Read 176015 times) previous topic - next topic

baselsw

@Jakko: Glad it worked out for you.

@thagz: Place your quadcopter on a flat surface. Print the following variables with Serial.print: accx_temp, accy_temp, accz_temp. You'll find these variables in Sensors.ino under updateAcc(). Use the printed numbers as your offsets.

Don't forget to zero out the offset macros before you do this (ACC_X_OFFSET, ACC_Y_OFFSET, ACC_Z_OFFSET)

/ Basel

thagz

Thanks Basel,

So sorry to ask you this but is the angle 0 will be taking values like more than thousand? cause my one keep stacking until the number become so big. I saw this on printed values.

Thanks again.

anshulsanam


I designed a mini quadcopter which is about 4.5x4.5cm(Main Body). The main body is the PCB.



It weighs about ~20 grams with the battery. I'm using the MPU6050 with the DMP using the i2cDevLib. I am using raw radians for pitch, roll, and yaw these measures are read from the MPU6050's DMP. The motors are attached to the body using electrical tape(Black thing around motors). The motors are 8.5mm in diameter and are driven by a n-channel mosfet. The mode of control right now is bluetooth(HC-05 module). The code being used is my own. I have a control loop on all axes, the pitch and roll have the same values since the quadcopter is symmetrical. The problem I have is that PID tuning is next to impossible, the best I got was a ~2 second flight (Video in slow-motion).

At first I was using my own code for the control loop, but it wasn't as effective as the Arduino PID library.

The output of the PID loops are mapped to -90 to 90 on all axes. This can be seen in the code

myPID.SetOutputLimits(-90, 90); //Y angle   
myPID1.SetOutputLimits(-90, 90); // X angle
myPID2.SetOutputLimits(-90, 90); // Yaw angle
myPID.SetMode(AUTOMATIC);
myPID1.SetMode(AUTOMATIC);
myPID2.SetMode(AUTOMATIC);


My full code is attached, but what do you think the problem is?

Vladgone

Hi, can somebody help me ? I would like do the same project but i use ITG/MPU 3 axis, can i just modify the "sensor.ino " file and can someone  explain how that file (sensor.ino) work ? Sorry for the English. :)

Thanks

thagz

Hi anyone here had problem with the motors not spinning at the same rate. Are motors really have to be spinning at the same rate with this program?

lacanau

Hi anyone here had problem with the motors not spinning at the same rate. Are motors really have to be spinning at the same rate with this program?

I'm having the same problem. I guess it's impossible to have all the motors running at the same speed after you run current through them because of inherent variations in the physical design of them. Small as they may be.

My plan is to rig my quad with some rope and pulleys so that it cant fly off too far to the side anywhere and then play with the values until I'm happy.

What I really want however is for my MPU6050 (accelorometre, gryo) to be able to recognise the tilt and compensate for it. That would be the best design I reckon. If you don't have one / aren't plannign on using one then probably it's best to just play with the values until you are happy.

thagz

But if you got unbalanced motor output, would it not lead to unreliable PID Values?
 

thagz

Is this possible to be done by a small quad? the problem i got is that the values of my PID wont oscillate if it is lesser than 0.1, but after doing so, the quad only can output small value for motors after coming back from pid algorithm.

baselsw

thagz: Which values are you printing? The code works fine with ordinary to small quadcopters.

To the others, I can try to answer questions about the BlueCopter code. I cannot and do not have the time to read a highly customized code or create any tutorials at the moment.

/ Basel

thagz

I found out the problem is not on pid but instead on the polarity of my aux2 which is for rate angle switch. Really sorry. Anyways does the gyroscope change values on different places? When I calibrate it inside my lab it was okay, but after I go out it is not the same numbers. Shouldn't I expect for a zero on my start up? Is there any possible way why I cannot raise my pid values for roll and pitch above 0.1? And how should I proceed on tuning the yaw axis?

thagz

Basel, Is the accelerometer z axis really unstable? im getting like real big fluctuation. Anyways does the PID values you got can be used for small quad? if so my quad is really oscillating even though it is really as low as  0.1 for P, 0.011 for D and 0.004 for I, this is for my PITCH AND ROLL, and Yaw got 0.1 -P and 0.002 for I. Im stuck at tuning this.
One more thing the moving average filter, if it is equals 2, does that mean that the update rate equals to 400hz, if i raise it to 4, does that mean that Am I actually dividing the update rate by 4??

baselsw

@thagz: Read my post here: http://forum.arduino.cc/index.php?topic=184503.msg1413036#msg1413036

and also read my post here: http://forum.arduino.cc/index.php?topic=184503.msg1416196#msg1416196


/ Basel

thagz

I got it lift off already with a bit of fast oscillation. After this, once i get the rate mode right then thats when i go for angle mode?

Go Up