Controlling quadcopters through code running on PC

More
30 Apr 2016 08:36 #47475 by sytelus
My goal is to write some code (C++ or Python) to control popular RC quadcopters like Syma or Hubsan. Unfortunately most RC quadcopters don't have any published way to do programmatic control. I was thinking if I can send commands to Devo remote controller which in turn can send those commands to quadcopter then I can achieve that goal. So Deviation might be the gateway for this. I have few questions:

1. Can I connect Devo to PC via USB or other way and then send commands from PC to quadcopter?
2. Can I receive telemetry or status from Devo to code running on PC?
3. Can I receive FPV video stream from quadcopter to Devo to PC?

If above 3 can be done then that would be great!! Also if you have any advice on micro/nano quadcopter compatible with Devo with FPV then please let me know.

Please Log in or Create an account to join the conversation.

More
30 Apr 2016 14:29 #47489 by mwm
  1. Yes. Use the PPM input line to send channel information to Deviation. This has been done by a number of people for a variety of different transmitters. There's a thread on these forums ("Extra inputs for Devo Tx's" or some such) about doing this with an Arduino.
  2. Not using the above technique.
  3. Probably not. Most of the devo transmitters don't have an FPV receiver in them to start with, and I suspect getting the signal out of those that do will be a pita.

Frankly, using the devo is doing this the hard way. For the video signal, just get a cheap usb video dongle and an FPV receiver that works with your quad. That should work out of the box.

Controlling the quad is going to require at a minimum finding a PPM library and getting it connected to your hardware. Generating the inputs to the PPM signal is probably going to require writing code. Once you get there, you might as well lose the devo transmitter. The deviation code for the Hubsan and Syma protocols has been ported to the Arduino - and it includes support for telemetry on some of the protocols (not sure about those, though), Something like an Arduino micro with an NRF24L01 will cost you maybe $15, and at worst will require the same kind of code on your PC. They are working on a serial line protocol for communications to replace PPM, which would be a better solution but might require more code.

Another interesting prospect here is that instead of using an Arduino and a PC, use one of the SBC systems like a Raspberry Pi. it has the necessary IO hardware to drive the nrf module while running a desktop OS. That might be a better fit for your needs.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

More
02 May 2016 08:08 #47579 by sytelus
Thanks for the reply. My objective is to get to point as soon as possible where I can write code and control quads. I think extra cost of $500 or so is tolerable if it saves time. I searched around for Arduino based solution and the only link I found was below:
www.instructables.com/id/Easy-Android-co...nterfaceable-Relati/

Do you have any links for Deviation port to Arduino?

Also looking around some more it appears that getting telemetry would be very hard through Deviation because only some protocols support it and even those ones don't support it completely. For example, some protocols would allow GPS telemetry but none of the protocols I saw allowed things like IMU telemetry. I'm wondering if anyone know a good protocol with fuller telemetry and corresponding quad.

Finally, it looks like I might be going just wrong route here. I might rather just want to focus on quads that support MAVLInk protocol. This requires quads running APM/Pix* based autopilot and Arducopter firmware which is open source and fully programmable. However quads supporting these are few and far between and usually expensive compared to 100s of cheap other quads currently flooding the market. Also I haven't seen a single nano/micro or racing quad on market that supports MAVLink. If you know otherwise please let me know.

Please Log in or Create an account to join the conversation.

More
02 May 2016 14:12 #47587 by mwm
I'm confused by you having a $500 budget and calling some quad expensive compared to the "100s of cheap other quads". When you say "cheap quad", I think less than $50 for a micro or nano, or less than $70 for something that flies outside. Some of those have flight controllers that can be reflashed with open source firmware. At that same price point, you can find a number of flight controllers that run open source firmware as well. But they really aren't meant for PC control, so maybe not that good a choice. Or are you hoping to find a cheap BNF/RTF/PNP quad with GPS in the $200-$300 price range? Are there really "hundreds" of those? Not that I'd spend money on one, mind you.

Deviation is targeted at replacing the vendors firmware. Most of the protocols don't have any telemetry because the vendor doesn't have it. The vendors for those cheap quads tend to spin new protocols on a whim - sometimes without even changing the model name - and almost never have telemetry. Given that there are no models for many of these protocols with telemetry, we can't really reverse it, and there's not much call for rolling our own. Further, many of the values for the telemetry we do have were implemented from spec but nobody has tested them with vendor sensors.

So you get FrSky, Devo and DSM. There's some hubsan telemetry out there as well, but it doesn't fit on the 7E so hasn't been merged into deviation. The FrSky and DSM sensor->Rx protocols have been released, and you can roll your own sensors for those. And of course, you can generate voltages for external voltage sensors however you want: I use the FrSky external voltage to represent ° of roll in an RC yacht. Right now, FrSky is getting some attention, and will probably be the best bet when it gets merged into the builds.

You want the DIY multiprotocol module thread at www.rcgroups.com/forums/showthread.php?t...multiprotocol+module . There's now a github repository of the code as well.

if you want open source on the transmitter, the Taranis has support from FrSky and runs OpenTx, so their telemetry support is as good as you're going to find on an open source transmitter. It's not as flexible regarding protocols as deviationTx because of the hardware architecture, but that shouldn't affect your use.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

Time to create page: 0.035 seconds
Powered by Kunena Forum