Thursday, July 11, 2013

The new centerpiece


A good 8 hours of printing was done yesterday, fingers crossed the entire time. We needed a new centerpiece for revision 2 of the hexacopter and it's a big print! It's the by far the biggest print on the entire hexacopter. It was also the longest print we've done on our new Mendel, a 3D-printer from RepRapPro. It came out really nice, no warping or anything bad related to the long print time.

The new centerpiece, this is where all the electronics goes.

Wednesday, July 10, 2013

The Gimbal

The recipe:

1 x 3D-printer (A reprappro mendel in our case)
2 x standard 9g servos or similar (we used servos with metal gears)
1 x Raspberry pi camera module


Part of the task of making a system for acquiring photos and video from a flying vehicle is the need to compensate for the vehicle's motion. A great way of compensating for this is to make a device that if our vehicle rolls right, this rolls the camera to the left to compensate and keep the camera steady and horizontal in reference to the ground. For different applications you want to compensate for different maneuvers, roll, tilt and yaw. What we want on our hexacopter is only to compensate for roll and tilt. This keeps our camera level with the horizon (parallel to the ground) and this is just what we need. The rest we can compensate for in software post-processing. The idea is simple, 1 servo per axis of rotation, using the inverted gyro signals from the APM (the chip that controlls the hexacopter) and feeding these to the appropriate servo.


We got a raspberry camera module which is lightweight and really small, we want to shockproof our gimbal a bit so we went for some beefier servos with metal gears. You could probably do this with a standard 9g blue servo, they are almost the same dimensions, depending on manufacturer.


The whole system consists of 2-4 parts. One arm from the first servo to the second, making them perpendicular in the z-axis, something to attach the first servo to our frame and something to attach the camera to the second servo. With the little CAD-experience i have I came up with the following design.




This is the main part, all you need more then this is a box for your camera and something that attaches your gimbal to the frame. It turned out really small and simple, takes about 1.5h total to print without the bit that attaches to the frame and the camera mount. The camera mount will be made when we get the camera so we see that it fits. The almost finished product looks like this, where you attach your camera to the bottom servo (pointing down towards the ground in our case) and the top servo attaches to the frame.


Aaaaand, she's gone

So, yesterday was eventful. Took the copter out for a stroll in the morning breeze and before you knew it she slammed headfirst in to a brick wall. Literally. One of the motor mounts cracked, five out of six arms snapped and we lost four propellers. The top junction was torn to pieces as you can see below. After picking up the pieces and heading inside we quickly stated that all of the electronics survived. And there was much rejoicing, yaay yaay.

Sad copter.

After spending most of the day supergluing the chassi back into a state that looked not quite as mangled (I actually think that we should be able to fly again) we quickly started printing version 2 of the chassi.

This collision gave us a few valuable insights:
1. The sockets used in rev1 cannot withstand the kind of strain we are putting upon them (This we already knew, rev2 has had this flaw fixed since long)
2. Layer orientation when printing is of the UTMOST importance regarding durability of joints and how/if it breaks.
3. It is important to be able to rotate around your own axis so that you know which end of the copter is forward. 
4. Nothing gets you working on a new design as efficiently as when the old one breaks.

We have started printing the arms for the new revision, the new sockets are looking really promising! They fit very snugly and the sockets passed the inoffial ArchQuad durability test. This test consists of two people, each equipped with a pair of pliers, grabbing one end of the piece each and bending it downward (or upward, according to preference) and seeing if it breaks. It did not.

Printing away. It's slightly cross-eyed but nevertheless happy to see you!

The new arm with improved sockets. Also a wee bit slimmer.

New arm with socket ends attached. One could hardly guess that this isn't one single piece.



Monday, July 8, 2013

We have liftoff!

So, this morning we installed all of the parts that arrived late last week. Flashed the ESC:s, charged the batteries and mounted everything on the copter and out we went!

A pretty windy day in the north of Sweden, sorry for the rather lacking sound quality.
Test run 1:

First time ever the hexa left the ground. However briefly.

Dubious results, as one can see. As the pilots choose to see it, the hexa did a backflip out of shear joy. It could also be slightly related to the fact that one of the motor controls made the motor spin the wrong way so it constantly tried to compensate and compensating only made things worse. The navigation system was also configured slightly wrong. So, back into the workshop and adjust these minor flaws, and back out again. This time, in addition we tried to find a place with slightly less wind.

A slightly more stable flight.

This time things went better. In this video, Erik is the pilot. He swung by to watch the ascent and just like that got to be in charge of it. The watchful observer will probably note that some (most) of the landing gear is missing. By this time we had had a couple of hard landings (Due to the wind, of course!) but slowly getting the hang of it! This also showed a couple of weaknesses in the design, which we choose to see as a very good thing at the prototype stage.






Friday, July 5, 2013

Delivery!


Here we go! The batteries and the new ESC's have arrived, so on monday we will hopefully mount everything on the hexa and around the middle of the week, all fingers crossed, we will have liftoff!

New batteries and ESC's!

We will keep you posted!

Thursday, July 4, 2013

Raspberry Pi Camera Module

Wow, great news.

Earlier today i emailed Liz at http://www.raspberrypi.org/ and told her about our project and that the camera that they have developed would suit us perfectly and she thought it sounded very interesting. She has agreed to send one of their office cameras to us for the hardware cost. I just got an email from her colleague Emma saying that they will post it tomorrow.

I'm at a loss for words, this is really amazing!

An enormous thank you to raspberrypi.org, we will be sure to update the blog frequently and we assure you that the camera will be put to good use!

//Jens

Up to speed

So, since we have been working on this project for about three weeks already, we quite a few things to share. Brace yourselves, it will be a very long post indeed.
It will probably be simplest to take them as they are divided within the project:

I want to add: When we move from early test stage to something actually useful in this project, everything will be publicly available.
So all the CAD files, all the code and all the conclusions will be free for everyone to use, contribute to and study.

- Project management (Jens)
Time spent mostly keeping in touch with external resources and making sure everything goes according to plan. A lot of the time has been supporting the other members and making sure that they have what they need in order to be able to continue in their work with as few speedbumps as possible. With that comes the task of ordering supplies and making sure that the budget is kept.

- Interface (Albin)
Using DroidPlanner (OpenSource Android app for UAV managing) and changing it to fit our every need he aims to make the planning of the mission as simple as possible without losing any crucial options. Not an easy task. The software communicates through a telemetry module at 433Mhz, connected to the phone's USB port. However, not all phones are able to provide power for the telemetry module, so a custom OTG-cable (USB->micro USB) with external power had to be constructed.
OTG cable with external power supply.

- 3D reconstruction (Alexander)
Our first idea was to try and use a Kinect or equivalent in order to get a reading of the terrain. It was however noted pretty quickly that this is not an option outdoors. This since the the Kinect uses an IR-cloud of points in order to recieve a matrix containing depth data, but IR-spectra is fully saturated already. In order words, it's like shining a flashlight during a really sunny day, nothing much happens.
It was then decided that we use fotogrammetry (a lot of input and help with this (and not only this) has come from Jonas Bohlin and Mattias Nyström at SLU) and hence cooperate closely with Anton in the camera part of the project.

On hold until Alexander returns from Skåne.

- GPS and proximity detection (Emma)
The first tests with the GPS (We are using a u-blox lea-6h) were very discouraging since the error was around or above 5m. The GPS coordinate is used in order to help the 3D-reconstruction so that the software knows where the picture was taken. Here we got some help from the russians, though. They have during the last few years launched satellite after satellite in order to construct their own version of GPS, named GLONASS (Globalnaja navigatsionnaja sputnikovaja sistema), which we swedes can freeride on. So, said and done; the GPS module was reflashed into a GLONASS module, and after taking a stroll it was confirmed that the coordinates were more or less spot on.
We are thinking of using the MB1240 XL-MaxSonar®-EZ4™ for proximity detection in +x, -x, +y, -y direction, but some further research has to be done in this area.

- Magnetometer (Erik)
In order to find out if the motors affected the magnetometers an oscilloscope was brought (courtesy of the University) in and an analog magnetometer used. After building an amplifier circuit and still seeing no output on the oscilloscope the test was rendered inconclusive and we decided not to trust the analog version. We took a leap of faith and ordered digital magnetometers. We hence ordered 2 units MicroMag 3-Axis Magnetometer (together with an Arduino mini) from SparkFun.

- Camera (Anton)
A lot of research has gone into this part of the project, since it is the base for a lot of the collected data. It was pretty obvious that we would need a Raspberry Pi that would act brain and to which the magnetometer and GPS would send their data to be recorded. This gave a lot of options as far as interfaces goes. We have USB, I2C and also the option to buy a CMOS camera module and connect it to an Arduino with a processing shield. A small program was constructed for the USB webcam we had borrowed (Logitech C910), but the Pi could not power two of them. A USB hub with external power supply was brought in as temporary solution while we ordered USB extension cables which could be modded for external power. This was simply done as such: Cut the cable in two, solder the data cables (white and green) back together. Solder the ground back together with an external ground lead that goes to minus pole of external battery. Cut the +5v (red wire) of the male end and insulate it. Solder an external lead that goes to plus pole of external battery onto the red wire coming from the female end of the USB. Done!
USB cable with external power.

The FPS however was not great, we got around 4fps with one camera. According to the Pi community this camera has some compatibility issues, which was apparent since errors appeared on each initialization of the camera (even if it then proceeded to take pictures). Apparently this camera hogs ALL the USB bandwidth, so two cameras is not an option, and even with one, the USB of the Pi is not enough to allow for 1080p streaming. There is also a Raspberry Pi Camera Module that would suit us perfectly, but it is on backorder in every shop imaginable and estimated time of delivery is around 10 weeks, which is not an option.

Recently got the servos ordered though, so now a draft for a pan-tilt mount (So that the camera is always looking straight down) is being done in CAD.

- Construction (Jens and Anton)
Since Krister (one of the administrators of the master program in engineering physics) is very involved and keen that the students have access to relevant technology and want us to be cutting edge, he has through different channels acquired a few 3D-printers that we are free to use in this project. 

3D-printing one of the motor mounts.

This has been a tremendous help for the construction. Since we are used to running simulations of things, there was no reason why this would be an exception. All the simulations made are done in COMSOL multiphysics in order to try strain during rotation and flexing.
Example of a simulation with rotational stress in order to determine weak points.

So, we started printing. This is slow business, so we spent the better part of two weeks printing the prototype. Anton serviced the 3D-printers and Jens made most of the CAD sketches for the upcoming parts. 
One of the arms between motor mount and centerpiece.

Two complete arms including motors.

Centerpiece (this took about 7½ hours to print!)

Landing gears.

So, the final prototype now looks like this:

ArchCopter v1.0

We have a slight problem in order to get liftoff however. Full of optimism, we ordered 6 ESC:s (motor controllers, Turnigy AE-30A btw), but according to various forums we were strongly recommended to flash them in order to improve stability and battery time. This did not look easy at first look, and seemed to require a lot of extra equipment, until we stumbled across OlliW's guide, where all you need is an Arduino (which everyone has lying around, right?) Strongly recommend it:

BUT! Make sure you have the right firmware selected. Something we did not double check and hence we fried one of the ESC:s. So, we are now waiting for delivery of another (And yes, we learned from our mistakes and order two so we now have one spare)

We have also built a box where all the electronics (APM2.5 used for navigation, Orange RX for radio control and the corresponding telemetry module that matches Albins) sit snugly that will be mounted within the temple-like body of the copter (for protection).
Electronics box
We have, in spite of our troubles with the ESC:s been able to run a simple motor test:

Motor test 1.


I've tried covering everything in an appropriate amount of detail, but if you feel that there is anything missing, feel free to post here or email at ArchCopter@gmail.com