Sunday, February 2, 2014

And lift off

I found the problem why I could not get a lift off.

It turned out the one of the motors E-clips, which holds the brushless housing in place, was moved downwards on the shaft so the house wasn't attached properly. After I fixed that I could make a leveled lift off.

But the controlling wasn't that good with the MPU6050 alone. So instead of starting to get MAG and Barometer I decided to get a FreeIMU and that worked great.

After a lot off crashes and a lot of broken propellers, I think I'm close to have broken 12 of them :), I'm finally at a stage where I can start adjusting the PID values and actually learn how to fly.

My Bluetooth shield has been a great help as it is quite easy to go out and fly, and use the computer to adjust the settings on the run.

I also found out the it was important to adjust the throttle and pitch curves as I'm not experience enough to not pull the stick to much. So by setting a more flat curve around eg the hover point allows my somewhat fumbling stick movements to have less impact.

Monday, January 20, 2014

Shields vs break out boards

When I first started out with Arduino I though that shields was a great idea. Just plug them on top and start coding. Great for a programmer.

Then I got more shields and wanted to stack them on top off each other because I need there combined functionality but now the troubles starts.

First of all they wanted some of the same ports. For some shields that could be configure to use other port but not for all. And then I saw some strange behavior on some ports. E.g. pin 2 I use on my QuadCopter for one of the motors. But my shields made the pin unstable somehow. I know only basic electronic but what I found out was that some of the pin was used in some shields for some undocumented features or leds.

And then when I got my MEGA board some of the shields was not working correct which actually was stated in the docs.

So now I most of the time uses my shields as break out boards, so why not get them in the first place :)

Shields are a good place to start but in the long run I recommend break out boards - and they are quit easy to use. Just tin some pin headers on and use jump wires and you are good to go.

Bluetooth Telemetry

For me most of the fun in electronics is building the stuff. For instance my QuadCopter project is not as much flying, even though I'm looking forward to that part as well, but more about the technology and building.

So telemetry is an important factor for me building the QuadCopter. MultiWii offers a lot of data though the serial port (USB kabel) which can be shown i MultiWiiConf which is include when you download the MultiWii software. I also just yesterday found that there is a MultiWii WinGUI which is a .NET based windows interface. The last one is not as simple and all the information you see on one page with MultiWiiConf is in WinGUI split over several pages. But the last one gives a lot of options for logging and analyzing which is impressive.

So when I started out on this project I have my QuadCopter wired via the USB to the PC to get data. But needless to say that gave me a lot of limitation. The cord prevented it really from movement and it also did have some influence on the gyro.

Then I figured out that my Bluetooth shield was the solution. And it was quit easy. I will make another post about why not put the shield on top of the MEGA but rather just connect them using wires.

First you need to setup the Bluetooth. I use a shield from iteadstudion.

Set the switch and the jumpers into command mode. See more about that on this page.
Make sure you load the board with a empty sketch. Just a empty setup and loop kind of thing :)

Then connect with a serial monitor to the Arduino. I use Roger Meiers Cool Term but you can use the one with Arduino IDE as well. Baud rate is always 38400 when it is in command mode.

The set the following commands, dont type text in italic its just an explanation (Just type them in one line at the time follow by an Enter):
AT just a way of saying hallo to the "modem". Should respond with OK
AT+NAME=Quad this is the name your PC will see when it is discovered 
AT+ROLE=0 set it into slave mode 
AT+UART=115200,1,0 this is the baud rate for communication with the MultiWii software

If you are unsure how this AT command is done then read this.

This is pretty much it. You can read the documentation for other settings including the pin code. Default is 1234 and that's good enough for me :)

Then set the jumpers to D0 and the switch to data. See the link for at description of how to do that above.

Now all there remains is connection pin 0 on the shield to pin 0 on the Arduino and the same for pin 1. Then connect 5V and ground between the shield and the board and you are good to go.

Please note that when you are using the USB to program or what ever, then you need to cut the power to the shield to avoid conflicts.

Discover the Bluetooth on your PC and you can connect to that COM port from either MultiWiiConf or WinGUI. As simple as that.

There are also apps for Android and iPhone to mange some off the things using bluetooth. Haven't used any of them as I have been quite happy with the options of using my laptop. But never the less it might be worth looking into

Sunday, January 19, 2014

Unable to lift off

EDIT: I found the problem

We have a problem with our QuadCopter.

See the video where the problem is shown with a small view off the QuadCopter on top of live data from MultiWii


I found out that if I connect my Bluetooth shield directly to pin 0 and 1 on the Arduino MEGA and set the baud to 115200, I was able to connect to the MultiWii software on the MEGA using this and MultiWiiConf.

It has been very helpful to be able to get data from the QuadCopter and film it at the same time. Then I have analysed different things afterwards. I have used some software which can record a application and webcam at the same time.

Well back to the problem.

I start by calibrating the ACC and then I arm the motors in Horizontal mode. The motors start running at 1180 which is my set min. throttle.

The throttle stick is at this point all the way down and reads 1094. Then I pull up one click and the throttle is now 1130. Then I don't do any thing. The front and rear motors are still running at 1080 but the left and right start picking up. And then it picks up more and more throttle even though I don't touch anything.

At some point the left and right motors gets throttle enough to lift the quad, but as there are almost no throttle on front/rear it will flipped over. I cut off the motors on the video before that happens. But before this video I have flip the quad over quit a lot.

Graph of the motor throttle - motor 1 and 3 and front/rear.


I have also tried to give more throttle, and it lift of nicely, but suddenly it flips over. So I haven't quit got to fly yet.

I will try to figure out what is wrong and return with a post when I hopefully have a solution :)

By the way the stuff from Hong Kong has arrived. So now I have stuff for to Quads but I think I will start by getting this one to fly :D Have broken 2 sets (4 pcs) of propels already so I hope I get a solution soon

First attempt

We got the stuff from www.hobbyfly.com, a Danish RC shop.

I got the following:
1 x LiPo Safe brændsikker pose (lille)
1 x Hobbyfly / Maxxtrax 680 AC/DC 12/220V 80 Watt Lader
4 x EMP C2836/10-KV880
1 x Dynam Quadkopter 550 Carbon
4 x Pentium ESC 25A m. BEC
2 x EVO 11.1V 4200mAh 35/70/5C Li-Po batteri - Dean(T)
1 x Futaba 6J 2.4GHz senderanlæg m. R2006GS 6 ch. modtager
2 x APC 12x3.8SF
2 x APC 12x3.8SFP

I already had the computer equipment:
Arduino MEGA
AdaFruit GPS Shield
iteadstudio Bluetooth Shield
GY-521 MPU6050 Acc/Gyro

See setup in the following video


I was hoping to build the software my self, but I quickly realized that it was a difficult task to get the information from the MPU converted to some useful motor throttle levels.

Then I started to see what was on the open source scene. There was quite a lot. ArduCopter and MegaPirateNG just to mention the most popular ones. But I had a difficult time figuring out how to set it up for my Arduino MEGA - and I had to use a special Arduino IDE for both of them. That I didn't like much.
I even went out and bought a ARM 1 board, but never got it to work with the manager.

Then I found www.multiwii.com which was just what I was looking for. I could use the official Arduino IDE and I would run on my Arduino MEGA. And must of my electronic is supported. I am using version 2.3

I have not got it to fly yet, but more about that in another post.

I also got a MPX4115A, pressure sensor and a UltraSonic SDM-IO range finder. These are not yet supported by MultiWii, but I will work on these and make posts when that happens.

And so it begins

I'm a software programmer but have always had the fascination for the combination between software and hardware. And with hardware programs like Arduino a software developer suddenly have an edge :)

My oldest son study to be an Electronic IT engineer at Aalborg University in Denmark, so together we have foster some project we will try out which combines my software expertise and his journey into the world of electronics

The first project we have started is building a Quad Copter or a drone.

So we order the parts from www.hobbyking.com, but as they are located in Hong Kong and we are in Denmark on the other side of the world, the waiting was to much for us.

We had to do something. So I bought 4 uDirc toy helicopters

And we took them apart to get the motors only and assemble on a simple frame.

Well there was not enough trust to lift the Arduino UNO which we used to control the motors.

But every thing else seems to be working.

Here is a short video if this experience made during the Christmas holydays with my three kids.



We then order some stuff from www.hobbyfly.com in Denmark.

But more about that in the next post :)