Show Posts
Pages: 1 [2] 3 4 ... 17
16  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
17  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
18  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
19  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
20  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
21  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
22  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
23  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
24  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
25  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
26  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
27  Community / Exhibition / Gallery / Re: BlueCopter - Arduino Quadcopter on: January 19, 2014, 12:29:38 pm
@Satiro: If it's not hovering then your not giving it enough throttle, push it a little more.. Post a video of the quad. in action.. I need to see what you're talking about..

@TheAviator: I saw this error in the log you posted before, and ignored it because I thought you knew what it meant.. You got that error because the pin change interrupts are not defined for the DUE.. Just as I said a couple of times before, if you're trying to port the code to another board than the leonardo you'd have to go ahead and re-write the entire RX-section..  So that is what you'd have to do..

//Basel
28  Community / Exhibition / Gallery / Re: BlueCopter - Arduino Quadcopter on: January 19, 2014, 06:53:18 am
@TheAviator: Sure thing.. Even if the sensors come separately they will work.. What's important here is that you think of the orientation of the sensors when soldering them! The library initializes the compass sensor (HMC5883L), so if it's not present that will maybe cause some problems on the I2C bus (not sure, but maybe).. So you either buy one compass sensor or you'll have to go into the library and remove it altogether..  I bought my IMU on ebay, and as of now, there are a lot of 10DOF sensors like mine on there, so check it out..

Everything as far as I can see looks fine on the pictures (cool quad btw =) )..

The reason for the Errors in MPULib is that the MPU "name" is already used by something else in the DUE jungle of library's and core! But not only the MPU "name" but also the buffer name.. Change all the "MPU" to small letters "mpu" everywhere in the sketch (mostly in Sensor.ino and BlueCopter.ino).. And change buffer to buffer0 instead.. This will make it compile without any problems..

Yes, the buffer-array consist of the x,y,z coordinates respectively..

//Basel
29  Community / Exhibition / Gallery / Re: BlueCopter - Arduino Quadcopter on: January 18, 2014, 04:42:22 pm
Basellllll he could fly! thank you! you're the same guy! but hey, he is wavering a bit and is a bit hard to keep it standing up! are they Kp values​​? will decrease and try again! look, I'm just using a battery of 3000mAh lipo with 20C discharge! Dude, if you can help me with the issues I thank MATLAB! as I told you is an academic work and have knowledge of the subject! then I'll post a video with the flight!

I'm glad to hear that =)! Try decreasing the Kp values (just do small changes, it shouldn't be a lot).. If it still wiggles a lot, try decreasing the Kp and Ki for the YAW axis (SMALL CHANGES HERE ALSO)!  I'll give you tips and help you with your matlab scripts.. But I don't have the time to write and test something for you, I hope you understand..

//Basel
30  Community / Exhibition / Gallery / Re: BlueCopter - Arduino Quadcopter on: January 17, 2014, 02:10:50 pm
Basel, I had to set the ESC's again worked. Tonight beginning again trying to check their latest PID values​​!
Basel, how do I view the oscillations of Ku to determine other values​​! so would the frequency and would find the starting values​​! It is possible to visualize with MATLAB scripts? and what data to send to the serial port to view the oscillations? can help-me!

My matlab work was done on an old computer (that I passed on to another family member).. So unfortunately, I don't have anything for you in that department.. It is possible to do what you mentioned, but you will have to code it yourself.. it won't be pretty though because it'll be running faster than the serial interface, so you won't find a real optimum because of the delays.. I think you're making things hard on yourself.. Your optimal PID values should be very near mine (the ones that came with the firmware in the first place).. Worst case scenario, you'd have to reduce the gain and integral parts a notch.. As I mentioned earlier, I managed to run my code with minimal PID changes (only reduced the gain on the rate PIDs a little, because I didn't want that fast a response).. When I say a little I mean from 0.250 to 0.230.. And the Rx part on that small quadcopter is a whole new story for itself.. So even if you add/remove features from the firmware, as long as the timing, IMU and quadcopter configuration are the same you won't have to change the PID settings that much.. So use the original PID values and play around with the gain a little until you get successful lift off.. If you want to do it all from scratch then I maybe can give you some tips, because what you are talking about is a university course in itself, and as you understand would be difficult to teach in a forum..

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