Could you please post a video explaining server poll function?
Great work Ole.
thanks for kind comments! I feel the pressure now
Regarding the “server poll function”. I have currently no good solution to restore a lost MAVLink connection due to a IP change. What I’ve done so far is pretty basic:
On booting the RPi it starts a phyton script. This script has a never ending loop that does 3 main things:
1, it contacts the Azure server to reports its IP and tell the server it is alive
2, it checks to see if there are incomming commands, if there are it downloads details and executes them. The commands are simple string executed as shell commands on the RPi. It reports back the status and result of running the command.
3, call the API of the modem to get status on connection like signal strength and type of connection (4G 3G etc), this is reported to the azure server
Typical commands are:
Start stop Arducopter with the correct IP
Start stop Video stream with the different quality
I’ve written a small .Net application that is running on my PC. It polls the Azure Server to report IP of PC, send commands for starting and stopping Arducopter, change video quality, display GSM connection quality on drone etc.
Arducopter is connecting directly via IP and MAVlink to the Mission Planner on my PC.
Both the modem on my PC and the modem on my quad has its own IP and allows incoming traffic. A special APN in the setup of the SIM card was required to get this to work. This setting, and if it is possible at all, depends on your subscription and network provider. In a normal modem connection you will share the IP with many others and you will not be able to connect directly to your device with just the IP.
The IP is different every time I boot the modem, but remains constant once I am connected. It does not seem to change over time or change of location (base station). I’ve left it on for days, and had it in my car.
However, I’m a little nervous about this. A change of IP would at the moment result in a loss of the MAVLink connection. So I have to make sure a loss of MAVlink connection will trigger RTH.
I’m no expert on Linux and arducopter but here are some solutions I’ve thought of:
Send a command to Arducopter to change the IP it is connecting to. From what I understand this is not possible without starting and stopping it. I can do that through my Azure Server, but it is not a good idea to start and stop Arducopter while it is in the air…
Run MAVProxy on RPi. In this setup the PC would connect to the RPi and not the other way around. But from what I understand running MAVProxy requires quite a lot of resources. I have not had time to test this.
Run MAVProxy on the Azure Server, but I’m not sure it is a good idea to be 100% relying on the Azure server as they do reboot from time to time. As a relay for commands it is ok, but to support a realtime connection I think it is better to connect directly from the RPi to the PC.
Set up a VPN connection. This should work I think, but I know little about network setup on Linux and have not had time to look into this.
For now, I will live with the direct connection and settle with making sure a change in IP triggers a RTH.
(Bernt Christian: I’ll make a video of everything once I have it all connected again)
Thanks for posting that! I was looking for something like that!
Making progress, here are some pictures:
Time to solder everything…
Testfitting everything… structure strength seems ok…but will glue everything in final assembly… Complete weight without batteries about 950gr
I soldered and built a battery for long flight times out of 20 Panasonic 18650 cells. 4S5P, 17 000 mah, around 930gr. Should give 60 minutes of hovertime. but I’m a little worried about the C rating, only a real test will show. eCalc gives : 2.8C at max throttle. 0.8C at hover. Batteries are rated at 1-2C. I have some other smaller and lighter batteries with much higher C rating for lifting gliders etc. Should be able to lift at least 1kg with power to spare.
Connecting with Mission Planner and testing camera, tilt, lights, motors…
Getting closer to first test flight…
Navio 2 build and first flights!
wow, looks really nice.
For the battery, you could also use NCR18650GA. Those are 10 amps per cell, instead of 6, which should get you covered, same mah, and everything else.
Keep it up. Looking forward to see flight videos.
wow, have not seen those batteries before. Same weight, slightly better capacity, double C rating, similar price. They look perfect!
Extremely good, like how the vibration isolation was integrated! One constructive comment for your next version; maybe an X8 is nicer to have so you get redundancy at long range.
The camera looks great with the blue lights. I don’t know that model but if those perforated sides are both microphones then the stereo sound would be perfectly positioned. I’m somebody who likes the sound of a drone, like some people like listening to a Ferrari exhaust:-) With those pancake motors and big props it should be sweet.
Did you dismiss the RasPi camera and action cams for a specific reason? I was under the impression even the best PC Web Cameras were still not any better. Of course things like the Go Pro win every time. I haven’t seen a specifc side-by-side example yet but I imagined if the RasPi camera was too bad I could try to get drivers for my Mobius in WebCam mode via USB connection. Just some random thoughts.
Good luck! Can’t wait to see how it flies and how those new tech batteries work out.
Awesome work! It’s nice to see this coming along. I have a question around the 3G/4G connectivity…
Do you have a way to display the Rx Signal levels (in dBm) of the 3G or 4G link as well as SNR value? With these one could ensure that safety limits are in place should you happen to get near a deadzone. For example if Rx level below -115dBm (for LTE this is just near the lowest limits) or SNR becomes very bad then the drone could engage RTH or RTL and avoid being un-reachable.
Since we are running linux I’m thinking with the right modem we could do AT commands to retreive the measurements from the modem. I actually have seen this done before in Windows, coded in .NET so surely we can do it in Linux.
The modems we did this with were Sierra Wireless (now Netgear) 3G and 4G AirCards…I think 313U or 319U models. You can get lots of info from the AT commands, not just the signal level and quality, but also the channela nd cell info. In addition you could even force switch bands… for example to force usage on lower 800MHz or now 700MHz bands in North America to get even more distance outside or penetration if flying indoors.
I apologize if I am rambling here but I while I am at it… there is also the issue of elevation. All serving antennas with cellular are pointing with some down tilt…so one could be flying and all of a sudden if you go to high the signal would cutoff drastically fast. I guess there could be some level of reflection from the ground plane but generally at cellular frequencies they will simply be absorbed by the ground. Again with this scenario having a fail safe on loss of signal would be good or some way to avoid going to high would be even better.
In the end though it’s a great project and I’m surprised not many people are doing this. There are some legal ramifications to deal with like in Canada you are supposed to maintain LOS at all times with the drone. Flying over cellular LTE network with unlimited range could get you out of LOS easily and if it happens to crash and make a big mess you have a SIM Card in there for law enforcement to find you (not the case with non-cellular telemetry & control).
Power…unlimited range over LTE yes…unlimited battery no…we need drone recharging stations. Who wants to get Elon Musk on board? Seriously though, I have only seen one such product and it was like $2000 for one charge pad. We need something affordable and that can be deployed easily and something modular we can put on any drone landing skid.
Yes, X8 would be safer, just at matter of cost…
The camera is a Logitech Webcam c920. On my previous quad I used the RPi camera. It works ok, and the RPi 2 can stream the camera and run Arducopter at the same time with no problems. However, the c920 has a better image when I try it on my PC, and the light handling is much better. It also emits a lot less GPS noise. I just wantet to try it, maybe I’ll go back to RPi camera. At the moment there is no good solution to stream c920 while Arducopter is running, but work is being done by others. It might be an option to add a second RPi for the camera. it is only another 50 gr or so. I just ordered 20 of those new 10A batteries for 6.4USD each, free shipping, 3-4 weeks…
Well, there is a way to get the signal strength through a REST based API on the modem. (The quad is using wifi to connect the RPi to the modem). I get info like current connection type , current throughput and a percentage indicating signal strength. I plan to simply adjust video bandwidth as connection quality changes, or just turn it off if it is very slow. Not too concerned with loosing video image. MAVLink is more important, but it works on weak connections. Arducopter has a feature where it triggers RTL when MAVLink connection is lost. This will be my “failsafe”
I do not really plan on doing a lot of long range flights, and certainly not in populated areas, Mostly doing this to see if I can make it work and because I find all the tech so fascinating. Actually flying it is not too interesting… I think a normal RC plane is a lot more fun to fly!
I had a very short testflight last night in the dark and it flies! I started with a light lipo battery and it was way overpowered and hard to control, it lifted at hardly any throttle input. With the big 17ah battery it was much better, lifted at about 50% throttle. Battery was low on charge, so this is promising.
Noticed problems with the ESCs, I think there are some serious timing issues and the motors glitched a lot. The ESC are really designed for small high RPM motors, the opposite of what I have… so I’ve ordered some others with adjustable timing…
The other issues was the vibration mount, it is too soft sideways, and at one point it caused the whole thing to oscillate in the air. I made it stiffer by just taping it in place. That solved it. Will make a new stiffer mount.
Other than that it flew great. The lights look cool and I love the sound of it, it is so quiet! The perfect stealth drone
Will make a video later, but I’m going on a 3 week holiday now, so there will be some time until the next update…
A quick test flight.
This is second test flight. Trying to see if adding separate ground signal cable to ESC helps, but issues with timing is still a problem. Motors squeal and glitch.
Flying with big battery 17Ah. Hovers at 11A, so a hovertime of more than 1 hour seems possible.
PID’s are not tuned yet, battery mount is temporary, but all components are mounted.
Waiting for new ESCs…
Perhaps it will draw even less amps with new ESCs and without the glitching.
I thought you were doing telemetry via direct link over 3G/4G (LTE) but from what you are saying is that you are providing wifi hotspot with the aircard and then porting connection over wifi…would this not introduce unecessary latency? Is there a reason why you don’t just have a direct connection with the 3G/4G modem to the RPI? I am working on similar project but I was not going to use any wifi because of latency reasons. Hopefully what I am trying to do is still possible… :-/
yes, it might, time will tell, but 11 A is pretty low already…
There is WiFi from RPi to onboard 4G modem. The introduces latency is not noticable. More than 95% or so of the latency is the 4G connection. You certainly can connect a USB modem directly, but it is not always straight forward and you need to pay special attention to reconnect etc. With the router all this is really easy, all you need is the make RPi work with WiFi. Another benefit is that you also have the option of flying with WiFi at close range which is free and faster.