How to build your own LTE Quadcopter

Having a quadcopter being controlled through LTE network without any limit in its flying range ( with an exception of battery backup and LTE coverage limit of course ) had always been a very appealing and interesting notion. There are few solutions available which are costly, So I wanted to come up with a cheaper alternative

First, lets begin with the main parts that will be needed to build on your LTE controlled Quadcopter.
See the required parts below

- Raspberry Pi (Amazon Link)   price ~$40
- F450 Quadcopter Kit (Ebay Link)  price ~$80
- LTE Dongle (Amazon Link)  price ~$50
- Battery Pack (Lipo) (Ebay Link) price ~$18
- Lipo Charger (Ebay Link) price ~$25
- Flight Controller CC3D (Ebay Link) price ~$13
- PC Gaming Joystick (Amazon Link) price ~$29

Some Background

A Quadcopter consists of four arms with a motor and propeller on the end of each arm. Two propellers are turning clockwise and the other two are turning counter-clockwise. There is a flight controller which keeps it leveled and converts your input commands into motion which it needs to fly. There are many cheap flight controllers available in the market. The one I used is called Open Flight CC3D. It costs only $13. Some other popular alternatives are

- Hobbyking KK2.1.5 Flight controller
- APM2.6 Ardupilot Flight Controller
- Naze32

Main parts of Quadcopter consists of a frame, a receiver, a flight controller, electronic speed controls, motors, and propellers. See below  for complete picture

Quadcopter Operation


Quadcopter motion (Throttle, Yaw, Pitch, Roll) commands are sent via RC Transmitter to RC Receiver and are  converted to PWM signals which are then used by flight controller to control the speed of Motors via Electronic Speed Conrollers (ESC). Most modern transmitters use a 2.4 Ghz frequency. RC receivers come mostly with 6 channels receivers.  Channels are the amount of things you can control. For example a four channel transmitter means you can only control four motors/servos/accessories. Mostly RC transmitter has 6 channels. These channels are controlling the Throttle, Yaw, Pitch, Roll, Aux 1, and Aux 2 (Aux can be used for different feature on your Quadcopter)

The output of the receiver is in the form  PWM signals. PWM stands for Pulse Width Modulation. PWM is a technique used to transmit data in the form of a varying pulse width. In the case of R/C electronics this time is usually 1-2 milliseconds.  For example, full throttle on your transmitter will send a 2 ms pulse to flight controller while zero throttle means puls of width 2 ms. Same rule applies to other controls on your transmitter. PWM pulse frequency is 20ms. The image below represents a typical PWM frame

PWM Signal output from RC Receiver

Replacing UHF Radio Link with IP Communication 

Main objective here is to replace the UHF radio link (2.4 Ghz) with IP communication network. Instead of using RC Transmitter we will use a regular PC gaming joystick to send control commands to Quadcopter through IP network. The commands are received by LTE dongle connected to Raspberry pi computer which converts these commands to PWM signals. The PWM signals are then used by CC3D flight controller to control the motion of flight.  See the below figure for end to end communication path

LTE Quadcopter

Note: If you are not familiar with raspberry pi, please visit https://www.raspberrypi.org/ to get some understanding .To put it short, It is is wonderful cheap little computer that can be used to make home media center, VPN, make robot and many more interesting projects. You can use almost any language on RPi though I always prefer to use Python as being very easy , high level and dynamic programming language

Raspberry Pi 2

Installing LTE modem on Raspberry Pi

I used Sakis3g script to install the drivers and application to configure the LTE modem. You can find more information at http://www.sakis3g.com/

How to communicate with LTE Dongle Private IP

One of the issue with LTE modem (dongle) is that it will be assigned private IP and will use Network Address Translation (NAT) to communicate to external world. NAT is the process where firewall assigns a public address to a network device inside private network. NAT save on the IP addresses as every network device (LTE dongle in our case) does not need a public address, and also it would hide these private devices from the outside world. For our quadcopter LTE dongle, it means that we wont be able to use the IP which is assigned to it in order to establish any IP communication to it. To overcome this problem we have to use our home Wifi router's port forwarding feature (application of NAT). Since our router's public IP is known to us ,therefore forwarding packet to our home PC coming from LTE quadcopter will not be an issue.

Let's assume that LTE dongle is assigned private IP 10.10.10.50 by the LTE network, Let's  also assume our home computer has private of 192.168.10.44 which was assigned by the Wifi router. Secondly our Wifi router has public IP of 173.75.180.60 which is known to us. We use TCP port 50050 for any communication from LTE quadcopter to Home PC. Now all we have to do is defining port forwarding table in our home wifi router. The basic rule that needs to be defined is to forward all incoming TCP packet with destination port of 50050 to our controller PC which has IP 192.168.10.44 and you are all set to have IP communication between Quadcopter and our home PC



Now here is how our end to end Communication will work

- Using Python's socket module function, Raspberry Pi (with LTE modem connected) will open a TCP connection to a port 50050 and IP 173.75.180.60.

- Python Socket Module on our home pc waits until a client connects to the port you specified

- Our home router forwards all incoming TCP packet with destination port of 50050 to our controller PC which has IP 192.168.10.44

- Once a socket is open, you can read from it like any IO object.

Below is the very basic python code that I used to do the communication between Raspberry Pi and home Computer as explained above. The code is just to give you a starting point while you can optimize the code below to have much better stabilized flight :)

Python Code on PC side




Python Code on Raspberry Pi side




Video Streaming from Quadcopter to Home Wifi Network 

Currently I am having trouble transmitting video from Quadcopter to Home Computer. I used  netcat utility to do the streaming but it makes  RPi reset every time. I believe I need to provide separate power bank. I will give update on it once successful, hopefully soon.


32 comments:

  1. This is awesome! I've been thinking of ways to do this and today I thought of this exact solution, however I know zero python...
    Thankyou :)

    ReplyDelete
    Replies
    1. Hi, this is really good .. thanks for sharing

      Delete
  2. Awesome project! I have one question, what data plan do you use for the dongle? Thanks!

    ReplyDelete
  3. Awesome project! I have one question, what data plan do you use for the dongle? Thanks!

    ReplyDelete
  4. That is probably every drone pilot's dream. To have a drone that is not range limited would be awesome! :) But, you do need a powerful flight controller for that, and if you want to get more familiar with types of flight controllers, and see reviews of some of the best models, I suggest checking out this article: http://mydronelab.com/accessories/quadcopter-flight-controller.html

    ReplyDelete
  5. Don't like it. The modem should be connected directly to CC3D to save weight. CC3D has UART port. CC3D should have modem dialing software. The modem's casing and USB port should be removed to save another 20 grams. Solder USB leads directly to CC3D.

    ReplyDelete
  6. I publicly recommend this on google plus even though this is a last resort solution.

    ReplyDelete
  7. Hi Very Nice Blog I Have Read Your Post It Is Very Informative And Useful Thanks For PostingAnd Sharing With Us And Your Writting Style Is Very Nice

    BUY NOW The Intercel UltraSAM 4G/LTE router An industrial-grade cellular modem router supporting various networks and service types including UMTS/HSDPA/HSUPA/LTE and delivering high download speeds of up to 100 Mbps.
    ultrasam4w

    ReplyDelete
  8. Thank you for this your broadcast provided bright clear concept.

    หนังสยองขวัญ

    ReplyDelete

  9. Hello. This post couldn’t be written any better! Reading this post reminds me of my previous roommate. He always kept chatting about this. I will forward this page to him. Fairly certain he will have a good read. Thank you for sharing.
    bigdata training institute in chennai

    ReplyDelete
  10. I think this is an edifying post and it is incredibly useful and instructed. in like manner, I should need to thank you for the undertakings you have made in making this article. Liposuction clinic

    ReplyDelete
  11. My life is beautiful thanks to you, Mein Helfer. Lord Jesus in my life as a candle light in the darkness. You showed me the meaning of faith with your words. I know that even when I cried all day thinking about how to recover, you were not sleeping, you were dear to me. I contacted the herbal center Dr Itua, who lived in West Africa. A friend of mine here in Hamburg is also from Africa. She told me about African herbs but I was nervous. I am very afraid when it comes to Africa because I heard many terrible things about them because of my Christianity. god for direction, take a bold step and get in touch with him in the email and then move to WhatsApp, he asked me if I can come for treatment or I want a delivery, I told him I wanted to know him I buy ticket in 2 ways to Africa To meet Dr. Itua, I went there and I was speechless from the people I saw there. Patent, sick people. Itua is a god sent to the world, I told my pastor about what I am doing, Pastor Bill Scheer. We have a real battle beautifully with Spirit and Flesh. Adoration that same night. He prayed for me and asked me to lead. I spent 2 weeks and 2 days in Africa at Dr Itua Herbal Home. After the treatment, he asked me to meet his nurse for the HIV test when I did it. It was negative, I asked my friend to take me to another nearby hospital when I arrived, it was negative. I was overwhite with the result, but happy inside of me. We went with Dr. Itua, I thank him but I explain that I do not have enough to show him my appreciation, that he understands my situation, but I promise that he will testify about his good work. Thank God for my dear friend, Emma, ​​I know I could be reading this now, I want to thank you. And many thanks to Dr. Itua Herbal Center. He gave me his calendar that I put on my wall in my house. Dr. Itua can also cure the following diseases ... Cancer, HIV, Herpes, Hepatitis B, Inflammatory Liver, Diabetis, Fribroid, recover your ex. You can contact him by email or whatsapp, @ .. drituaherbalcenter@gmail.com, phone number .. + 2348149277967 .. He is a good doctor, talk to him kindly. I'm sure he will also listen to you.

    ReplyDelete
  12. Great post! This is very useful for me and gain more information, Thanks for sharing with us.

    Education
    Technology

    ReplyDelete
  13. The blog you had post is verymuch useful for us to know about the Web designing. thanks for your information sharing ith us.
    Web Designing Institute in Coimbatore
    Web Designing Course
    Web Design Classes
    Website Design Course
    Learning Web Design

    ReplyDelete
  14. Awwsome informative blog ,Very good information thanks for sharing such wonderful blog with us ,after long time came across such knowlegeble blog. keep sharing such informative blog with us.
    Aviation Academy in Chennai | Aviation Courses in Chennai | Best Aviation Academy in Chennai | Aviation Institute in Chennai | Aviation Training in Chennai

    ReplyDelete
  15. Awwsome informative blog ,Very good information thanks for sharing such wonderful blog with us ,after long time came across such knowlegeble blog. keep sharing such informative blog with us.
    Aviation Academy in Chennai | Aviation Courses in Chennai | Best Aviation Academy in Chennai | Aviation Institute in Chennai | Aviation Training in Chennai

    ReplyDelete
  16. Wow, Nice blog. Thank you so much for the efforts of this blog. Visit for
    Maldives Honeymoon Packages

    ReplyDelete