Espritmodel.com Telemetry Radio
Reply
Thread Tools
Old Jun 28, 2013, 06:12 PM
Registered User
Joined Jan 2012
12 Posts
Data
Raspberry PI a UAV with potential or Linux ARM UAV

Guys it is crazy all that we need to do is come together and write the code for the hard point version of Debian for a next level UAV.

Not only does it have a full HD 5mega pixel camera with live streaming it also has GPIO lines for GPS, and gyroscopes etc.

It's insane that people are taking a back seat on this issue. If you can write arduino then you can pretty much write C, we make a project then all contribute.

Think of the potential 3/4g data streams, along with other sensors actively collecting data on the environment. For example you can transmit radio signals through the GPIO and it would be great to send a message to the other side of the world with no additional hardware.

Although python is not my favourite object orientated language if a UAV program is made then it can be transferred easier to other boards of users personal satisfaction. The specification would be to support present ground station software.

Come on hype yourself up. Get coding again or start buy buying a full spec pc for $25. Then tell me why the board doesn't belong there. On a final note the on board camera image processing could notice objects like buildings, and be programmed to either go round or over it... Ardupilot you have to buy a FPS setup, to see that. The raspberry cuts the costs so much that people are probably scared of the abilities. If your going to celebrate Independence Day why not devote an hour of coding? Every UAV manufacturer are crapping themselves!
Snipez is offline Find More Posts by Snipez
Reply With Quote
Sign up now
to remove ads between posts
Old Jun 28, 2013, 06:48 PM
Team Higher Than The Clouds
United States, NY, New York
Joined May 2012
168 Posts
Also take a look at the UDOO.
Techmeister is offline Find More Posts by Techmeister
Reply With Quote
Old Jun 28, 2013, 06:59 PM
Registered User
Minnesota
Joined Sep 2004
504 Posts
You should sketch out a design schematic and figure out how you'll connect up all the required sensors to the pi (gps, imu, pressure sensors, volt, amp sensors, etc.) Oh, don't forget about the RC sub system. You probably will want to read the signals from the RC servo so you can use the pilot stick and switch commands as inputs to your autopilot. And you'll need to drive servos, so think about how many of those you'll need and how you'll connect them to the pi. You'll also really want a manual/auto switch, especially early development so you can rescue your craft and land it manually if you encounter a program bug, or gain out of tune, or something you hadn't anticipated. Oh, and leave a uart or something open to do radio modem communication with the ground station.

So that should put you in pretty good shape on the hardware side. Now you can start thinking about the software. You probably need to write at least a few drivers. If your IMU has an SPI interface, then I'm pretty sure the stock spidev in embedded linux will leave you wanting something custom and directly written for your hardware. The gps is probably going to be sitting on the other end of a uart, some of the other items might be i2c interface. Think about how you will drive servos. How many PWM generator lines does the pi have and expose? How will you do a pass through from your receiver in manual mode. Will you need to shove this task off to some external hardware? Then how will that interface to the pi since you are probably starting to run really low on I/O at this point. Will you run into any user/kernel space contention or delays trying to juggle all these drivers and data and timing from linux kernel drivers? It's actually quite a bit of IO work for your typically embedded system, and if your pi goes out to lunch for 1/2 a second catching up on interrupts and IO, that kind of hurts you in terms of reading your sensors, computing your attitude, driving your control surfaces to keep yourself stable ... weird things can happen when your computer gets too busy.

So that's all the hard stuff taken care of now on to the fun stuff, writing an autopilot. You'll need to think about some fairly math intensive code to estimate your roll, pitch, yaw from the available sensor data (which doesn't tell you this directly.) Enter the world of vectors, transforms, quaternions, kalman filters, but this is the fun part (IMHO) :-) You'll need some sort of PID or state space controller. You'll need a way to manage and shove data through out your code. You'll need a way to configure various options and tune your gains for specific airframes. You'll need to decide if you are going to massively thread your application, or go with some sort of 'grand loop' design and non-blocking IO. You might want a mission system, safety monitoring systems, route/plan following. Do you get fancy and compute headings and distances in wgs84 math, spherical math, or just do everything in a local X, Y, Z coordinate system. You'll find that all your sensors are noisier and wronger than you would hope and you'll probably have to readjust your control strategies as you go and tackle a plan b or plan c at some point when the sensors you need to make plan A work well enough are just too noisy.

Oh, then you'll need a communication link from air to ground and back using some sort of protocol that you borrow or develop. You'll need a ground station, probably none of the existing ones will exactly do what you need, or they've been developed for a different autopilot (and different features and capabilities in mind.)

You'll probably see your costs go up substantially from that initial $25 pi investment as you start filling in all the other hardware pieces. And inevitably something will crash or fly away or get plugged in backwards and fried, so plan on some hardware attrition and replacement funds in the back of your head.

Personally I'd keep the payload/camera/vision stuff on an entirely different computer than the autopilot ... the computer vision stuff is a huge load on these little embedded cpu's and you will struggle to run it all effectively on a single pi.

But it's all good stuff. There's no reason you couldn't use a pi for the heart of an autopilot. Probably there are guys already doing it. It's not a small project though if you are starting from scratch, there is a lot to consider and a lot of challenges along the way. But nothing gets done if you think it will be too hard and give up before you start. Some of the coolest stuff was started by people too naive to know how much trouble they got themselves into, and by the time they figured out how hard it all was, they had a few things working so might as well keep pushing forward.
clolson is offline Find More Posts by clolson
Reply With Quote
Old Jun 28, 2013, 07:29 PM
Team Higher Than The Clouds
United States, NY, New York
Joined May 2012
168 Posts
There was a forum started on something like this awhile ago...it didnt get too far.
http://www.rcgroups.com/forums/showthread.php?t=1504990

In terms of a servo driver:
Raspberry Pi driving RC servos through a PIC 16F690 with Face Detection (3 min 19 sec)
Techmeister is offline Find More Posts by Techmeister
Last edited by Techmeister; Jun 28, 2013 at 07:35 PM.
Reply With Quote
Old Jun 28, 2013, 09:45 PM
Registered User
snelan's Avatar
Joined Jul 2012
413 Posts
I know most people implement a Linux system for things like target recognition, stitching pictures, IR detection, etc - but I see no real reason other than simplicity to try to combine that system with the Auto Pilot system. Wouldn't it be more realistic to just use an APM or Piccolo and a SEPARATE BeagleBoard+3/4G Modem to handle everything? This has been done and it much simpler from a software and hardware standpoint than using one centralized flight computer.
snelan is offline Find More Posts by snelan
Reply With Quote
Old Jun 28, 2013, 09:55 PM
Registered User
Minnesota
Joined Sep 2004
504 Posts
That's roughly what we are doing here. Starting with a Gumstix overo (800mhz) + an APM2.5. We rewrote the APM firmware to only query sensors and relay the data via one of the serial ports, and then also the APM handles servo and fail safe duties. The linux computer runs the 15-state kalman filter, all the PID logic, navigation, communication, logging, etc. The linux computer sends servo commands back to the APM2.5 which drives the actual servos. This has worked out rather well for us and is fairly compact/simple architecturally. I wrote up a couple blog entries on my prototyping process.

http://gallinazo.flightgear.org/category/uas/ardupilot/

Since then we designed a relatively simple board that everything plugs directly into, and it provides power and volt/amp sensing from the big source battery (4 cell, 5 cell, etc.) That gets rid of 90% of loose wires, although you'll always have a few wires to servos, power in, payload, and a few other odds and ends.

Not saying there aren't 1000 other good ways to do an autopilot, but this has served us quite well and it's nice having a lot of headroom on the overo so we aren't constantly needing to try to tweak out a couple extra instructions per second or find a place to save 2 bytes of memory because we just hit the limit again. The overo (as is the beagle and th pi) are pretty much full blown linux computers that can even run a graphical desktop with keyboard and mouse if you hooked it all up...

You can get an 800 mhz overo for $109 which is 4x the pi (assuming the $25 price is correct, I've never actually shopped for a pi), but in the grand scheme of things, you'll have at least a couple grand invested in hardware before you are done so the $75 differential for some extra clock rate and ram isn't too bad in my view. Plus I've been running gumstix hardware on my autopilots since around 2005-2006 with the original gumstix so I've been sticking with what's comfortable, proven, and what I know ... (but others are comfortable with other hardware and that can be made to work very well too.) Engineering is all about making the best choices you can (knowing no choice is ever perfect in every respect) and then making the very best of it you can and hopefully in the end tying it all together into a clean, efficient system that performs well.
clolson is offline Find More Posts by clolson
Last edited by clolson; Jun 28, 2013 at 10:00 PM.
Reply With Quote
Old Jul 03, 2013, 04:27 AM
Registered User
Joined Apr 2013
68 Posts
I'm also attempting a Raspberry Pi auto pilot project. If anyone wants to colaborate and share knowledge, I'd be really keen.

The RPi is a good processor, but it requires extra hardware to drive servos plus an IMU, radios and whatnot. If we could establish a common suite of hardware, then it's just a matter of developing the software. I've already started developing for the gadgets I've chosen. I'm blogging my progress here
www.camelsoftware.com/blog
SuperCamel is online now Find More Posts by SuperCamel
Reply With Quote
Old Jul 04, 2013, 07:53 AM
Registered User
Joined Apr 2013
68 Posts
As far as IMUs go, the minIMU9 or the AltIMU-10 from Pololu are great with the RPi. They are tiny and can be plugged directly into the GPIO pins on the Raspberry. There is some open source AHRS software for the minIMU9 and further instructions here
http://blog.davidegrayson.com/2012/1...pberry-pi.html

I've had a look at the code and it'd be fairly simple to hack the AHRS program into an AHRS API, which could then be used in autopilot software.
SuperCamel is online now Find More Posts by SuperCamel
Reply With Quote
Old Jul 27, 2013, 02:05 AM
Registered User
Joined Apr 2013
68 Posts
Here is a pic of how I'm assembling my RPi based autopilot. The AltIMU is stuck firmly to the RPi board with epoxy putty. The Arduino is there to simply convert integer values to servo signals and also to read analog inputs (battery voltage). All other processing is done by the RPi.



The entire thing, when it is packaged up, is only slightly thicker than the RPi by itself and it fits easily into the Bixler.

I've made a few leaps and bounds in terms of the software too. I'm hoping to fly this thing with a PS3 controller connected to my laptop via an encrypted digital datalink (FireLink). I'm still working on FireLink and I have only briefly tested it on the ground so far, but I don't forsee any major issues. I hope it works well, because it'll save having to add an RC receiver and all the associated hastle with getting PPM into the Raspberry Pi.
SuperCamel is online now Find More Posts by SuperCamel
Last edited by SuperCamel; Aug 03, 2013 at 02:40 AM.
Reply With Quote
Old Jul 28, 2013, 03:52 AM
Registered User
Joined Apr 2013
68 Posts
Here is a demonstration of the computer moving the flight controls.

FireTail UAV Autopilot (0 min 49 sec)
SuperCamel is online now Find More Posts by SuperCamel
Reply With Quote
Old Aug 03, 2013, 02:26 AM
Registered User
Joined Apr 2013
68 Posts
Remote control is working . . .
Bixler 2 UAV controlled with FireLink (1 min 10 sec)
SuperCamel is online now Find More Posts by SuperCamel
Reply With Quote
Old Aug 13, 2013, 07:42 AM
Registered User
Joined Apr 2013
68 Posts
A maiden flight is getting close!

FireTail UAV Engine Ground Runs (1 min 29 sec)
SuperCamel is online now Find More Posts by SuperCamel
Reply With Quote
Old Aug 26, 2013, 04:20 AM
Registered User
Joined Apr 2013
68 Posts
I've now got a couple of autopilot modes working and I've done test flights. I haven't been able to film any of the flight tests due to lack of hands, however I have flown this thing in both 'Manual' and 'Pitch & Roll' mode and it works very well. I have found the PS3 controller to be very twitchy and difficult to fly with in manual. I guess it just takes practice. Switching to Pitch & Roll mode makes it a whole lot easier.

Pitch & Roll mode is simply an autopilot mode where the elevator and aileron channel inputs move the desired pitch and roll of the autopilot. For example, moving the elevator stick all the way back will cause the aircraft to pitch up 30 degrees. Sticks at neutral will make the aircraft fly straight and level. I think APM calls this Fly-By-Wire?

I'm currently trying to package the ground control software so it can be installed on MS Windows so others can try it out. If I can do this, would anyone be interested in trying it out?

I'll also post some instructions on my website on how to compile and install the autopilot software on the Raspberry Pi. They will be lengthy instructions and for the keen-but-not-linux-savvy person it would be easier just to post me a 4gig SD card and I'll copy my SD card onto it. I'd be happy to do that for the price of a stamp & envelope.
SuperCamel is online now Find More Posts by SuperCamel
Reply With Quote
Old Oct 05, 2013, 03:43 AM
Registered User
Joined Apr 2013
68 Posts
I've done some flying and it all works. I still haven't got a video of it flying yet, due to a lack of hands! It's coming soon though I promise. After I rebuild the thing.

Raspberry Pi UAV Autopilot - FireTail Algorithm Demo (2 min 0 sec)


Raspberry Pi Autopilot 'FireTail' - Bixler 2 Installation (3 min 6 sec)


It's a bit difficult to install and configure at the moment. A lot of the settings must be set by editing config files and some are still hard coded into the autopilot. It's something I'm working on to make it easier for others to use this system.
SuperCamel is online now Find More Posts by SuperCamel
Reply With Quote
Old Oct 13, 2013, 02:42 AM
Registered User
Joined Apr 2013
68 Posts
Flight tests!

Raspberry Pi UAV Test Flight (0 min 54 sec)


I didn’t end up flying in any mode other than Pitch & Roll mode. The oscillations were terrible and the aircraft was pretty much uncontrollable. I’m not sure if it’s a matter of adjusting gain, or if I’ve misunderstood autopilot theory. Either way, the previous autopilot algorithm worked a LOT better and I’m thinking about reverting back.

Amazingly there was no damage to the aircraft. I did manage to break my ground station radio though. I tried to fold out one of the dipole antennas, but actually bent the circuit board and cracked it. Gee that made me cranky. One of the great things about the RFD900s is that there are two antennas spots! So it still works OK, I just don’t have any ‘diversity’.
SuperCamel is online now Find More Posts by SuperCamel
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Build Log Making noise with the Raspberry Pi: custom boat sound effects system blutoh Homebrew Hacks for Model Boats 497 Aug 16, 2014 02:54 PM
Discussion Raspberry Pi for multi rotor 360walt Multirotor Talk 15 Apr 15, 2013 09:33 AM
Discussion Raspberry pi discussion. chaosdestro0 Multirotor Talk 1 Feb 19, 2012 01:41 PM
New Product Raspberry Pi $35 Capture device or more? CzechPilot FPV Talk 6 Jan 27, 2012 02:52 PM
Discussion Raspberry Pi - Autopilot game changer? CenTexFlyer UAV - Unmanned Aerial Vehicles 10 Sep 17, 2011 04:27 PM