Linux Based Autopilot System for Quadcopters

Started by harsha, May 11, 2015, 04:56:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

harsha

Hello RC India Members,

Its been a long time since I made any post here in RC India. I used to be an active member of the forum when I was back in India. I moved to USA as part of my Masters. Recently me and my team of graduate students started working on a Linux Based Autopilot system for Quadcopters. We completed building the Quadcopter as well as the software part testing of the Linux Based Micro Processor (Beglebone Black). We are going to start a github page and a source page with instructions for this project to make it open source. To give a peek into our project here are some pictures of the quadcopter and beaglebone black. This platform is still under development and many people allready used Raspberry Pi as their Linux Platform to get the data over FTP link or control the autopilot systems onboard using long distance Wifi antennas. I hope this thread will be helpful to the engineering students who want to develop their own autopilot systems.

List of Components we used:

1. APM 2.6
2. Beagle Bone Black with Ubuntu
3. External GPS and Compass Modules
4. Extra Barometric and Temperature Sensor
5. 3DR Xbee Telemetry
6. DT 750 Motors
7. 4S 3000 Mah LiPo Battery
8. TPlink Wifi Dongle
9.1047 Propellers
10. QUARK 25 A 4 in 1 ESC
11. H-Copter Frame from Hobbyking
12. Hobbyking 6ch Tx and Rx

We were limited with time so we actually bought off-the-shelf components from Hobbyking and other vendors to make the whole system. But the next step is to come up with an Autopilot system which will be replaced in the place of APM. A similar type of project has been done and still under development which is called as PixaHawk by 3DR and Erle Brain by Erle Robotics. Still those systems are pretty costly to use (ofcourse they are very precise and test proven so many times). So my plan is to make an autopilot system which will be affordable and easy to program. The advantage of Beaglebone or Raspberry Pi is that you can carry it to the filed in your pocket and attach it to our autopilot system along with external telemetry. You can write down your own server based applications to stream the data or control the autopilot with your mobile devices. FPV or Video Streaming can be done without any extra connectors as you can connect everything directly to the Beaglebone.

What we would like to know?

As I am away from the hobby and RC India group for a while I really dont know what is the requirements right now for the hobbyists especially for Multirotor Autopilot systems. If you guys can actually suggest and post your ideas/requirements what would you like to include in an autopilot system It would be helpful for us. We are planning to launch this system in India by the end of December 2015. Meanwhile we will update our source page and github with our progress to help others to understand how our system works and test it if you are really interested.

Happy Flying,

Harsha



liakhat

Wow.... great work Harsha  :hatsoff: :hatsoff: Nice to see ur project...
few things i want to know what exactly it is capable of doing??
& r u designing the new board or it will work with the existing APM??
will the board eliminates the FPV Video Transmitter??

harsha

Hi,

Thank you for the reply. Yes sir, the new board will be compatible with APM as well as our own Autonomous Flight Controller. Our Flight controller would be used to collect the data like Altitude,Pressure,Direction,GPS Co-ordinates. To make things easy we are first trying with APM Software. So those who are familiar with APM's wont need to worry to learn a new software again. The new system wont need a separate FPV Transmitter. It might need a 3G/4G data dongle to transmit the video to your FPV platform or Ground Station. We accomplished a low level transmission on our Ground Station with a webcam,but its like on our local wifi network as for now. So if you have a data dongle like Tata Photon you can use that to transmit your video. We would like take more inputs from the community as well to improve and meet your requirements.

However you might need a beaglebone to develop or program your autopilot as per your requirements. The good things about Beaglebone is that it have a USB port where you can plug in your wifi/video/audio devices and use them to do accomplish your requirements.

Our main objective is to design a low cost-high efficiency autopilot platform which can be used for further development. Say you can write your own server based API to see the data or live feed on your phone over a static ip address. Also we are trying to perfect the control algorithms to give the autopilot more stability.

One important thing is that even with open source communities there is still a lack of information on many fundamental things for beginners so we would also try to put our effort on the documentation part of the information. We would appreciate if any of the forum members can volunteer for us on this particular part to work along with us to setup and maintain the info. We also welcome students to ask us questions and learn about our autopilot system.

cyberhack

Hello harsh
Good to knw that someone is wrking on this project well abt the fpv u said using a 3g/4g dongle will do the wrk bt its similar to using a cellphone having a 3g simcard transmitting the data ... It would cost much than the fpv kit avalaible in market well and if its done by WiFi I mean the local network by any freeware that transmits video/auido it won't give us that much range... Correct me if am wrng somewhere in earlier threads we had discussed abt using a 3g dongle for fpv BT it will cost :(

akhilzid

Nice Interesting project, Sir can you please share the resource usage statistics(CPU, RAM, Bandwidth, Latency etc.) while video streaming. Is that based on MJPEG stream?

sadu

Really great to see this! Been doing a lot of research on the exact same topic and would really like to help you guys out(I'm a code junkie).

I was working with APM and its python scripting support to write an autonomous multicopter that would follow any visual object in a radius while avoiding obstacles and tracing out a smooth path. While I was busy scribbling in my notepad the guys at PerceptivLabs came out with their http://www.flytheshift.com/.

Now a very long sighted idea I had was to design something with additional hardware and components that supported auto battery changes while mid air :giggle: yes, somewhat similar to airplanes refueling in the air :D

Think about the awesome scripted airshows we can have if aircraft could communicate with each other? The swarm robotics performed by some guys at MIT (headed by an Indian-origin professor) is bind blowing. This is a very very promising area for research and development. Once you give something a brain to think, the possibilities are endless :)

Have you looked into using a HAL for running APM directly on a beagle board? Navio+ (http://www.emlid.com/shop/navio-plus/#Description) is actually a hardware project that ports APM to run it native on a Pi board. There's ample documentation here: http://docs.emlid.com/Navio-APM/installation-and-running/ which I'm sure you can incorporate into a beagle board.

harsha

I did not collect the stats while I stream video. I will do it next time when I stream the video over Beaglebone.

Here is a reference how we did it

http://derekmolloy.ie/streaming-video-using-rtp-on-the-beaglebone-black/

Webcam is connected over USB and we stream the video over our lab wifi signal. Thanks for reminding me about the CPU Performance data. Also we tested other way of taking the pictures as well as live feed over long range wifi signal previously on Raspberry Pi and had faced some issues. We are also trying to solve this as part of our image recognition engine that will be later associated into this system for object identification. Well there is one particular discussion that is going on right now at our lab. "Integration of FPV with VR Headset" and the good thing about this, The FPV feed is over your mobile phone which can be fitted into a google cardboard headset. So far we are succeeded in splitting the images to create this Virtual Reality experience for the user. Everything is done using the opensource platforms. It will be nice if someone can actually contribute their time towards coding the custom made apps for our system once its released. I will be glad to help the community by contributing this technology as a development platform for future hobbyists.

harsha

I have looked into NAVIO platform.For now we are trying to let the user to use a CAPE to integrate Beaglebone and APM hardware. But our main objective is to come up with a CAPE which is the "AUTOPILOT" system sitting directly over the Beaglebone Black. The fundamental idea is to use the Beaglebones GPIO pins,UART and other I/O pins to integrate the number of sensors (which is pretty similar to NAVIO). Take a look at Erle Robotics made Erle Brain project. Its an opensource project too. This guy actually worked hard to design the whole autopilot on Linux platform. There is no need for any other external boards. So in the same way we are trying to come up with our own design but which have more robust algorithms to fly the multirotors more stable (which is the brain here ;D). Also we are looking to introduce this kind of platforms into Indian Market which will help the students to develop the skills related to this hobby by having hands-on experience. So we are trying to keep the cost as low as possible to make it available for student projects too.

I do not know about Flyshift. I just saw the link. What I learned form the introduction video is that this system is actually recognizing the object and moving the gimball as well as the quadcopter it seems.(correct me if i am wrong). One of our student teams actually did this project this semester. They actually used OpenCV based libraries to do this. Moving a gimball is an easy task while communicating with quadcopter depending on the obejct traking might be something tricky. We are not yet perfected something related to this part and would like to see what are the possibilities.

It will be great as you said if we can have auto-scripts which can be used to make the flying robots intelligent. That is the reason we are more concerned towards the internal algorithms for making it more stable platform on our hardware. With linux the possibilities are unlimited.

I really like the idea of auto battery changes. Can you elaborate your idea a little bit more so that It might be helpful for me and other fellow hobbyists to understand when they read this thread.  :)


harsha

Hi Cyberhack,

I am not sure about the data transfer rates and wifi bandwidth speed in India,because I never tested this kind of setup when I was there. We tested one particular application for a competition when I did my first project here in USA. So we had this large range wifi signal transmitter,the pi is actually on board of the UAV. We connected our GCS with the pi over FTP to collect the pictures for target identification in the field and also to get the live feed over the same signal through VNC viewer in the pi. It was really slow. However,FPV platforms have a very good transmission rate as it is made for a specific application. So lets compare the systems over 3G card and FPV system. A normal FPV system might be available around $20-30 in USA and a sim card with a data plan will cost the same. But when we are using this 3G/4G bandwidth over Pi/Beaglebone we can create a ip to stream the video on your laptop of mobile phone or VR headset. Also we can get other data related to sensors or can be used to change parameters of autopilot onboard where as the FPV is generally used for a first person view with some data on the screen related to altitude,yaw angle or position. Large range wifi can be used to do this but the setup is costly. So I looked into some other options for transmitting the video and other data using different options (Xbee,2.4ghz,5.8Ghz,low frequency) and working to come up with a better and low cost solution for this. How much will it cost for a beginner FPV kit in India? and can you point me towards the thread where this 3G and FPV setup comparison happened? it would be helpful for me to read and do my research to develop this in a cost-effective method. If you would like to add some points or correct me at some point of the discussion please do so,I consider myself as a beginner, I would like to learn more everyday.

sadu

The college students here needs stuff like this, yes! They are the most impressionable target audience for you guys. I was only focusing on the software side(my hardware skills are terrible) and have not looked at it since graduation.

Main concern as it is said in NAVIO docs is the latency issues you come across the kernel. If you have that figured out and get good enough response times, half the job is done. If an 8bit processor can do this, just imagine the difference of it functioning inside a full linux environment! Pixhawk is essentially APM running on a 32bit ARM and look at what it can do...

Shift uses it's own processor and sensor arrays to transfer telemetry data to your APM and control your gimbal. It moves both the copter and gimbal to maintain a smooth transition all the while keeping a downlink to the control app. This is what I could gather from the videos. I have not looked further into what's lying underneath but quite sure that this is an add-on to a flight controller and not one itself. Now it communicates with the controller though MAVLINK, a protocol defined for small UAVs. It might use some algorithms to detect the protocol, once you know that it is pretty much defined for everything you'd want to do to an aircraft and also send your own customized messages(http://qgroundcontrol.org/mavlink/start). Mostly used for ground control stations like APM telemetry kit + planner, but it's serial comms and can couple with anything that has serial I/O.

Well it's not really plausible, something I thought about while not really in my senses :D no where near serious like the others.
DJI Inspire has a slick battery that you can connect by just sliding it in. We use multiple batteries to power our copters now, which handles cases where one goes dead. Now combine these two: with some small servos that control its locks and few sensors on a multicopter.
You use only a single battery while keeping the other bay empty. Attach some electromagnetic wizardry or additional servos to the other copter delivering the lipo to function like a crane that can lower the battery and pick the old one up. Also possible to eliminate other copter by using a docking bay sort of thing floated up in a helium balloon? :giggle:


cyberhack

Well it was a long ago ..

http://www.rcindia.org/rc-general-topics/mobile-phone-as-fpv-tx-and-rx/

also visit the links in the posts made by others in the topic ....

i dnt exactly remember wat all we had discussed bt may be this help.. have a look
well harsh the fpv set here for 200mw is around 6k and 600mw is 7k (rounding the figures ) well most of them import it so u may consider the  same price BT if we consider the FPv set price and the 3g service price  we can't say its the same data charges here are a lot more and even WiFi facility is weak unless and until money is Nt a concern.

BT I gt the point u made u can make a IP and use that link for both fpv as well as telemetry tHaTs good BT still Nt in India till its based on the WiFi and internet we need free transmission no charges then it would be feasible for all

akhilzid

also can you please explain how did your current stream works, via ffmpeg / motion / any other open sources / self coded things?

all the web cam streams normally based on uvc/mjpeg and take lot of resources(mainly CPU) to serve a decent stream(but still around 10 frames) that does not leave some room for calculations(In BB also same happens in RPI too). and if you need to record that stream? that should be a challenge.
my suggestion is (if you still need to integrate digital fpv) then you should consider integrating one more processong unit(any micro router like TPlink mr 3020/ DLink DIR505 with openwrt) to handle network and video capabilities.

miginstruments

So the idea is to use APM as the main controller that will control the rotor. And the beaglebone will be used to transmit telemetry data and video. Or you want to use the beaglebone itself as the main Flight Controller.

harsha

I understand sir. There is a solution for this. For video and data transmission you need a wifi signal,a long range one to be specific. Also it doesnt mean that you need an internet connectivity or data connectivity,you just need the signal to transfer only that video and whatever the data you want on the GCS. We did this and we had wonderful results,as I said before this setup will cost more money as the long range wifi signal transmitter and receiver setup is a costly one.

Also our primary goal is not just the FPV part,we are trying to get into the flight stabilization algorithms to perfect them. When we have an algorithm which can balance the quad from the take off and until the landing, this means you almost have an autonomous system. Then we can start applying all the necessary mods and developments one by one. But thank you very much for the info that you have provided me. It is really helpful.

harsha

Here are the steps we did:

1. Beaglebone as a GCS - Done
2. Beaglebone on-board and video - in progress(lot of issues with video transmission speed,trying to work on it after June)
3. Beaglebone with APM to configure the flight and control over wifi - done
4. Beaglebone with our custom made CAPE with more number of sensor integration - long shot,deadline in December

So our end goal for this year is to complete Beaglebone Based Autopilot system,in the initial phase it will work with APM software. Later we will design our own software for all the users. The whole package will be affordable and will be available on our supplier website in India.

Pros: Precise flight stabilization and control
Cons: Latency issues and Range Problems (we will try our best to solve them)

miginstruments

Good Initiative. Lets hope for the best. And I think this is one of the best Platform to discuss your work over here, since there are lot of Hobbyists with a lot of experience also a lot of professionals who knows Embedded System. One of our Forum member ve designed his own Transmitter using Arduino. And there are people who are trying to come up with their own Controller as well. But you ve to keep this Thread Alive by posting the developments regularly, so that members should not loose their interest in it.

abhra

 :hatsoff:  to your effort i am actually looking for a linux based autopilot for my btech project but pixhawk firecape and navio+ are insanely costly. If u guys have any web site or something I might involve in your project. currently i am using a pixhawk and connected it to a raspberry-pi for autonomus flight. looking forward to see your board in market (really frustrating to see all the autopilots so costly).