Show Posts
Pages: 1 [2] 3 4 ... 18
16  Using Arduino / Project Guidance / Re: Arduino Quadcopter with Android via Bluetooth on: March 03, 2014, 04:36:01 pm
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: https://github.com/baselsw/BlueCopter
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
17  Community / Exhibition / Gallery / Re: BlueCopter - Arduino Quadcopter on: March 03, 2014, 04:16:50 pm
@neinteresee: It sounds like you're having some problems with your calibrations.. The PID shouldn't start increasing/decreasing by its own..  It could also be that your RX (transmitter/receiver) is transmitting something that isn't zero (corresponds to a signal of 1500ms), thus explaining your fenomenon.. I can't really say anything more than this based on the information you've provided..  Satiro is finished with his quadcopter, he even sent me a video showing of the quadcopter first flight during his thesis presentation.. The quadcopter flew without any problems as far as I could see.. I don't know if it's okay to post his video without his permission, so if your still reading this thread Satiro, will you please post your video here..

@dizzwold: Based on the information you've provided it doesn't sound like you're ready for a project like this.. This project isn't for beginners (I'm sorry to say).. I would love to help you, but that would be a full time job in this case.. Try out something simpler to begin with.. When you're ready, read about quadcopters (dynamics and how other have done it etc etc.. There is a lot of information about this topic on the internets!).. When you're a arduino guru, start looking at my code and understand it.. If you've got further questions after that, then I'll be happy to help..

//Basel
18  Community / Exhibition / Gallery / Re: BlueCopter - Arduino Quadcopter on: February 16, 2014, 11:31:08 am
shoot... I was planning on using one of the Arduinos that operates on 3.3V, is it necessary for me to have 5V too? Should i just connect 3.3V to both?

In that case connect both to 3.3V yes..
19  Community / Exhibition / Gallery / Re: BlueCopter - Arduino Quadcopter on: February 16, 2014, 10:12:52 am
hey basel, I recently got my hands on what I think is the same IMU you've described in your first post...
so do I just need to use 4 wires (vin/gnd/sda/scl), or do i need to ground the rest of the pins?

Hey, You can keep them floating.. Just make sure that Vin is coupled to 5V and V3.3 is coupled to 3.3V..

//Basel
20  Community / Exhibition / Gallery / Re: BlueCopter - Arduino Quadcopter on: February 15, 2014, 11:37:57 pm
Thank you everyone for your kind words..

@GoussLegend: Well, it is very fast.. It might drift a little (but nothing noticeable because the I-term kicks in very fast and counters the changes).. I've optimised the PID-controller (so haven't got any problems as of yet..

Well, it is clear to me too.. But using the accelerometer is an bad idea (as you said, because of the vibrations and such).. Theoretically if everything is stable it might work (you can calculate it).. But I'm sure that it's too slow to make it control something.. GPS would be a better choice (and sorry no, I'm not to keen on making this happen for my quadcopter soon)..

@mhurt: You can find everything on the first page of this thread.. My first post contains all the connection diagrams and a couple of posts down you'll find my BOM..

//Basel
21  Community / Exhibition / Gallery / Re: BlueCopter - Arduino Quadcopter on: February 08, 2014, 07:22:07 pm

Currently I am trying to make your code work for the arduino UNO. I have managed to get my own RX.ino code working. It decodes a PPM-SUM  signal correctly, using only 1 interrupt, and then write it to the rxval array.
But I am still having some trouble with outputting a good signal to the ESC's. It seems like I can't get the analogWrite(MOTOR░,m░_val) to work with my ESC's. I am using Turnigy Plush 18A ESC's, so those should work with what I'm trying to do, but it just doesn't.

When I start up everything the speed controllers do not arm correctly, they just continuously beep, and do nothing else. I wrote some code to display the mX_val that is written with analogWrite. The values I am getting out of that (when going from 0 throttle to max thr quicly) are as follows:


This should be correct? And what should be the MOTOR_ZERO_LEVEL value? It is currently set at 125, and the MOTOR_ARM_START is 140. Do you have any idea what might be wrong?
Also, when I move the copter, the motor values that are outputted, sometimes go far beyond 300, that can't be right, can it? And then when the copter is still, some of the motor values are still above 254, is that okay?

I read I can't use the servo library as an alternative for analogWrite, if I can't get this to work, but could I then use some different code that generates a servo PWM signal with the right 20ms pulse spacing, or would that be too slow and need another interrupt of whitch I have only 1 left.

I hope you can help me, thanks in advance!



If they are beeping continuously that means that they didn't have enough time to check for the signal type.. Most ESC (with a atmega8) can handle both PWM and standard servo signals.. But in-order for it to determine the type of signal, it needs some kind of delay directly after it gets power (the delay should be as long as they are still beeping).. This is taken care of in-code by stopping any changes in outputs to the motors (this happens in SAFE/armed mode).. So as long as the quad is in safe mode the quadcopter will send a MOTOR_ZERO_LEVEL signal to the ESC.. Most ESC doesn't like PWM signals less than 100 (so I set it to 125, I got this number by trying the limits of the ESC).. It shouldn't though be too high, because you'll lose a lot of resolution.. The MOTOR_ARM_START is the PWM signal sent to the motors as soon as you leave SAFE mode.. This will make the motors spin with a low velocity (and will also be your controller zero).. This is because the PID-controller and ESC doesn't like when the motors stop completely.. With other words it is dangerous to stop them completely (some ESC will think that the host is disconnected and later not respond to any signals sent).. So it is important to have some margins for error..

Your outputs look ok, no problem there.. Yes, the outputs can exceed 254 (this is because of the integral part of the PID).. But you don't have to worry, because Arduino's awesome analogWrite contains a boundry check.. So if you send 300 through analogWrite, then 254 will be sent.. The same goes for negative numbers.. If you send anything less than zero, then the library will send 0 and nothing else...

To solve your problem, start up your quadcopter in safe mode (don't un-arm it yet).. Wait for the beeping to go away, THEN and only then un-arm/leave safe mode..

And no, I don't recommend the servo library..

//Basel
22  Community / Exhibition / Gallery / Re: BlueCopter - Arduino Quadcopter on: February 07, 2014, 01:23:06 pm
Basel, with its answer only gave even laugh! kkkkkkkkk! but what I would like is to know where you are? Your e-mail? your profession? so i can send you my written work! and if to thank you for helping me! would not a beer but a Whisky 18! if you can send me an email: satiromedeiros@yahoo.com.br .... As I said before! You're the Man!
I am an engineering student of 28 years in the last year! and my wife is pregnant!

I'd love to see your written work.. I'll e-mail you with my info..!

//Basel
23  Community / Exhibition / Gallery / Re: BlueCopter - Arduino Quadcopter on: February 06, 2014, 03:38:27 pm
I just have one more question about it. If we examine the X axis, while rotating clockwise it started to have values from 0 to 125, so its ok. But, while rotating counter clockwise its values from 256 to 125 or more lower.

My question is shouldn't be it like -125,0,125. I can understand that zero is the middle point while parallel to the ground. The values should be like -1 -2 -3 ... -25 ... -40 in the counter clockwise rotation. Am I right?

How was yours?

You simply need to calibrate your sensor.. I don't have my quadcopter around.. So can't really look up the exact range.. Simply google it or start another thread with your question in hand.. Let us keep this thread specific to the BlueCopter firmware, so that we don't fill it with information other users don't have use of (this will make other users ask the same questions over and over and over again because they simply don't want to browse this huge thread)..

//Basel
24  Community / Exhibition / Gallery / Re: BlueCopter - Arduino Quadcopter on: February 06, 2014, 12:29:41 pm
@Satiro: Yes, and I don't have the problems that you're describing.. Did you try to disable the software RX expo? Do you want my information to send me a beer or invite me to your examination ceremony =P?

@TheAviator: I forgot that you're using a Due.. Yeah, those numbers look a lot better.. Just use the code that you posted earlier and hopefully that's all what's needed to get angles..

//Basel
25  Community / Exhibition / Gallery / Re: BlueCopter - Arduino Quadcopter on: February 03, 2014, 02:46:11 pm
It seems fine. And now how could I measure angles? I didn't understand the low pass filter and average filter process.
I don't want to write any code without understanding. Could you please explain steps until measure angles?

it's not fine.. These aren't rotations.. These are the sensors getting banged against a table.. There is something wrong with the measurements.. And I'm not really sure where the problem lies.. You measured the angles correctly in the previous code you posted "as far as I could see".. You need to look into your sensors and the reason for the outrageous outputs..

//Basel
26  Community / Exhibition / Gallery / Re: BlueCopter - Arduino Quadcopter on: February 03, 2014, 12:38:10 pm
@Satiro: There's no bug in the code that I provided.. Maybe something you picked up while changing the code to work with your UNO... Anyway, something you can try is to de-activate the software expo.. Just comment out #define RX_EXPO, and try again..

@TheAviator: There is something wrong with your y-axis.. Did you solder these chips yourself? Or did you buy some kind of module? Instead of mixing together all my parts from the bluecopter firmware.. Try the example sketch that I've provided in the examples folder in the MPU library folder.. Or rather instead, try this sketch and report the serial output:

Code:
#include <MPULib.h>
#include <Wire.h>


MPULib MPU;
// the setup routine runs once when you press reset:
void setup() {               
Serial.begin(115200);
while(!Serial);
MPU.init();
}

// the loop routine runs over and over again forever:
void loop() {
int buffer[3];
float buffer2[3];
MPU.getAxlData(buffer);
MPU.getGyroData(buffer2);
Serial.print("AX: ");
Serial.print(buffer[0]);
Serial.print('\t');
Serial.print("AY: ");
Serial.print(buffer[1]);
Serial.print('\t');
Serial.print("AZ: ");
Serial.print(buffer[2]);
Serial.print('\t');
Serial.print("GX: ");
Serial.print(buffer2[0]);
Serial.print('\t');
Serial.print("GY: ");
Serial.print(buffer2[1]);
Serial.print('\t');
Serial.print("GZ: ");
Serial.println(buffer2[2]);
delay(10);
}

//Basel
27  Community / Exhibition / Gallery / Re: BlueCopter - Arduino Quadcopter on: January 22, 2014, 04:18:33 pm
@Satiro: If you have the same IMU as me then use the pressure sensor for the altitude.. This type of implementation would need some serious re-writing of the firmware.. You'd have to put in the sensor reading code, time the reading sequence right (this have to be measured) write a loop that won't interfere with the other sensors and finally add a new PID for the altitude.. This would take some time to write and test (time that I don't really have).. If I even consider implementing this kind of thing then it won't be until summer time that I start to work with it..

@TheAviator: If you read the datasheet for the several components you can find out the answers to these questions yourself.. Anyway, from the Arduino Due page, http://arduino.cc/en/Main/arduinoBoardDue , You can clearly see that some pins can source 15mA and others 3mA.. These pins can also sink 6- or 9mA.. The current needed to run the sensors is above these limits (see the datasheet for the sensors), which in fact means that it won't work.. If you need to turn off/on the sensors in code then you'd have to connect GND to Due's GND and VCC to a mosfet which in turn you control with one of Due's many pins with a code similar to the one you wrote above..

//Basel
28  Community / Exhibition / Gallery / Re: BlueCopter - Arduino Quadcopter on: January 21, 2014, 05:00:30 pm
@TheAviator and others that are considering to use the Servo library:

I do not, recommend using the servo library! Doesn't matter what I said, it's just to slow! Even if the Due is running at 84Mhz that won't matter because the Servo library is set to work at 50Hz on all boards (it's calculated inside the library depending on the frequency the system is running at).. Now even if you speed up the servo library to let us say 500Hz, I don't really know how your ESC will respond to that.. It may not respond at all because it's expecting a 50Hz signal.. But sure thing try it out if you'd like (hell I'm starting to get interested too smiley ).. The reason that I'm not recommending the Servo library is because I started out my code with the Servo library =P .. So I know what will happen (control-wise), if you slow down the output signal to 50Hz.. I managed to get the rate-mode to work (if I remember it right).. And it's not easy to fly the quadcopter in rate-mode as a beginner..! But again, I'm here to give you some tips, it's up to you to do what ever you want to do in the end =P..

@Satiro: Now that is good news.. Did you use the original PID-values or did you change them all?? And in that case, can you please post your final PID values (all of them)..
It's hard to fly the quadcopter in windy conditions without any training.. I did the same thing one time, but I managed to fly against the wind by tilting the quadcopter in the opposite direction and increasing the throttle a notch and finally emergency landed the thing (you do that by simply decreasing the throttle a lot and increasing it a lot again 2-3meters above the ground followed by decreasing it slowly =)! Sounds like you simply need a lot of training =)..

//Basel
29  Community / Exhibition / Gallery / Re: BlueCopter - Arduino Quadcopter on: January 21, 2014, 05:06:12 am
I was browsing  through your PID library and I was confused by one of the controller constructs defined for the Rate Level Mode; could you discuss how it works?

@Naoki7: Sure thing.. I had some problems with the derivate part of the PID and the controls.. I wanted a large derivate action for the signal and some kind of dampning for the controls.. So I split the derivate part into the control part (setP) and signal part (dError).. The reason for analogWrite is that it's faster! Servo Write works at 50Hz and analogWrite at 500Hz.. I've already answered these questions previously.. For a detailed explanation you'd have to search this thread!

@Satiro: I'm sorry to hear that.. But you shouldn't have done this to begin with.. You need to be able to control it, as well as control it from a distance (this needs training obviously).. But how did it fly in the beginning then.. Was it stable?

//Basel
30  Community / Exhibition / Gallery / Re: BlueCopter - Arduino Quadcopter on: January 19, 2014, 05:05:02 pm
Basel, I will try to go for a clearing place! Here I try to make a short film and am sending you next! Look, posted a scrip matlab previously, but as said can not open! if you could you would see that I can read the "1 degree of freedom" sensors and then enters the digital PID will then link to the serial communication, all in Simulink! turn behind can download it! Tell me how you did to get the basic values ​​as you already said before! they are a starting point! was scropt MATLAB or Simulink was in?

It was entirely in MATLAB.. I don't like simulink.. Graphical programming has never been my favorite thing to work with..  I need a close-up of the quadcopter in action (so I can observe the response)..

//Basel
Pages: 1 [2] 3 4 ... 18