Control drones with Smartphone

More
09 Apr 2015 09:55 - 10 Apr 2015 01:41 #30926 by tjkim93
Control drones with Smartphone was created by tjkim93
Hi,

I ported deviation protocols to Arduino mini for controlling drones with Android Smartphone.
Interface between Arduino and Smartphone is bluetooth.
I named the module as UniConTX and the schematic and codes are open.
Click here for more details





Here is a screen shot for controller UI


UniConTX Firmware can be updated through bluetooth from smartphone.
All models from deviation are not supported due to arduino mini memory limitation.
Only below models are supported. (Actually every model is not tested yet...)
If you want specific models, you need not install all modules. just install the module what you want.
ManufacturerModelTypeModule
AresEthos QX75QuadNRF24L01
AttopYD717QuadNRF24L01
AttopYD928QuadNRF24L01
AviatorYK016QuadNRF24L01
CheersonCX-10QuadNRF24L01
CheersonCX-11QuadNRF24L01
CheersonCX-205/SH6057QuadNRF24L01
CheersonCX-30QuadNRF24L01
FlytecsX-Drone NanoQuadNRF24L01
HiskyFF120QuadNRF24L01
HiskyHMX120QuadNRF24L01
HobbyKingQ-Bot MicroQuadNRF24L01
HuanQI 881QuadNRF24L01
HubsanX4QuadA7105
HubsanH107CQuadA7105
HubsanH107LQuadA7105
HubsanH107DQuadA7105
HubsanH111QuadA7105
Huaxiang ToysSky Walker 8983QuadNRF24L01
JDJXD 385QuadNRF24L01
JDJXD 388QuadNRF24L01
JDJXD 389QuadNRF24L01
JDJXD 390QuadNRF24L01
JDJXD 391QuadNRF24L01
JDJXD 392QuadNRF24L01
JDJXD 393QuadNRF24L01
JIAYUANS-2QuadNRF24L01
JJR/C1000AQuadNRF24L01
JJR/CF180QuadNRF24L01
JJR/CF182QuadNRF24L01
JJR/CH8CQuadNRF24L01
LandbowX-Dart NextQuadNRF24L01
Ni HuiU207QuadNRF24L01
NincoairQuadroneQuadNRF24L01
SanlianhuanSH 6043 LadybugQuadNRF24L01
SanlianhuanSH 6044QuadNRF24L01
SanlianhuanSH 6046 PufferQuadNRF24L01
SanlianhuanSH 6048 F22QuadNRF24L01
Sky WalkerHM-1306QuadNRF24L01
SkybotzMini UFOQuadNRF24L01
SkylineYD717QuadNRF24L01
SymaX1QuadA7105
SymaX2QuadNRF24L01
SymaX3QuadNRF24L01
SymaX4QuadNRF24L01
SymaX5CQuadNRF24L01
SymaX5C-1QuadNRF24L01
SymaX6QuadNRF24L01
SymaX7QuadNRF24L01
SymaX8CQuadNRF24L01
SymaX11QuadNRF24L01
SymaX12QuadNRF24L01
ToybaseL6036QuadNRF24L01
ToybaseL6038QuadNRF24L01
WalkeraQR LadybirdQuadCYRF6936
WalkeraQR InfraXQuadCYRF6936
WalkeraQR X350QuadCYRF6936
WL TOYSv929QuadA7105
WL TOYSv939QuadA7105
WL TOYSv949QuadA7105
WL TOYSv959QuadA7105
WL TOYSv202QuadNRF24L01
WL TOYSv212QuadNRF24L01
WL TOYSv222QuadNRF24L01
WL TOYSv252QuadNRF24L01
WL TOYSv252 ProQuadNRF24L01
WL TOYSv262QuadNRF24L01
WL TOYSv272QuadNRF24L01
WL TOYSv323HexNRF24L01
WL TOYSv333QuadNRF24L01
WL TOYSv343QuadNRF24L01
WL TOYSv353QuadNRF24L01
WL TOYSv393QuadNRF24L01
WL TOYSv626QuadNRF24L01
WL TOYSv636QuadNRF24L01
WL TOYSv646QuadA7105
WL TOYSv666QuadNRF24L01
WL TOYSv676QuadA7105
XINXUNX28QuadNRF24L01
XINXUNX30QuadNRF24L01
XINXUNX33QuadNRF24L01
XINXUNX39QuadNRF24L01
XINXUNX40QuadNRF24L01
YI ZHANX4QuadNRF24L01
YI ZHANX6QuadNRF24L01

You can get Android application (BTCon4Drone) at play.google.com/store/apps/details?id=com.pinggusoft.btcon
Attachments:
Last edit: 10 Apr 2015 01:41 by tjkim93. Reason: tableized

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

More
09 Apr 2015 13:06 #30931 by PhracturedBlue
Replied by PhracturedBlue on topic Control drones with Smartphone
This is impressive work, The code you have here isn't that much different than what the UniversalTx does in PPM mode, and honestly I never imagined being able to fit it into 32K of flash (or maybe it doesn't fit, and you need to choose the protocols). Several folks have ported deviation's protocol to Arduino, and no one has ever discussed how they planned to do it here beforehand. I see no reason why the protocol stack needs to be rewritten to work with Arduino. Wouldn't it be better for everyone to figure out what things are incompatible and fix those, and then have a shim that lets you use deviation's protocol code as-is? By porting all the files, you've either signed yourself up to constantly maintain it and merge in fixes we do, or to let the code stagnate and not get the fixes we do. It is nothing personal, just something I keep seeing over and over, and it seems like wasted work when each person reinvents the wheel for arduino.

What did you write the android app in? I've been working on a similar app in Cordova (see this thread: www.deviationtx.com/forum/7-development/...n-for-mobile-devices ). Is your app open-source? This also seems like a duplicated effort, and you are obviously much farther along than I am.

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

More
10 Apr 2015 02:29 #30968 by tjkim93
Replied by tjkim93 on topic Control drones with Smartphone
Actually I tried to port protocol codes as-is, but I couldn't do because of resource (flash and ram) limitations on Arduino mini as you know.

My plan was...
1.Focusing multicopter protocols because my application was designed for it originally and memory size on Arduino mini.
only 7 protocols were ported - Devo, Flysky, Hisky, Hubsan, SymaX, V2x2, YD717
2.Reducing RAM usage so I decided to use C++ for instancing a protocol when it is used.
3.no changes in logic and flow except some initialization codes and controller channel handling as you see the codes ( github.com/PingguSoft/UniConTX ),
Initialization codes are changed because of reducing the code size, constants are moved to codes area for reducing flash and ram usage.
controller channel handling is changed because of compatibility of my Android application.
my Android application, BTCon4Drone was designed for MultiWii protocols originally and I decided to add the feature for supporting deviation protocols.
4.Telemetry related codes are not ported yet because of there are few models supporting the feature but it might be supported someday.

I don't think this kind of work is wasting because the goal is different..
Codes might be modified and redesigned for each goal unless codes have concrete structures for porting.
Anyway I will keep trying to update my codes whenever there are changes in your repository but I am not sure..

I really thank you for sharing your work and ideas..

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

More
10 Apr 2015 02:46 #30969 by PhracturedBlue
Replied by PhracturedBlue on topic Control drones with Smartphone
Don't get me wrong, I am glad for anyone working with the code. But if the code can be compressed for Arduino, those compressions can likely be used on ARM too. I have difficulty believing C++ will use less resources than properly designed C code. the protocol code itself really should be able to be made portable enough to work on just about any architecture. Certainly the SPI and timing code are unlikely to be portable, but the API could be fixed such that the effort was low.

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

More
10 Apr 2015 02:46 #30970 by tjkim93
Replied by tjkim93 on topic Control drones with Smartphone
I missed something about the application.

I am using eclipse with ADT for developing the application.
And the source is not open.. the app was designed for MultiWii protocols originally and deviation protocols are ported to UniConTX.
I opened the UniConTX codes and the communication between them is bluetooth serial.
I adopted MultiWii packet structure and some commands are added for controlling UniConTX from smartphone side.
The app sends protocol information when it starts and AETRF channel values every 20ms.
I'll share a video clip controlling Syma X5C with my app soon.

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

More
12 Jul 2015 01:37 #35349 by Richard96816
Replied by Richard96816 on topic Control drones with Smartphone
Add a couple of sticks and you'll definitely have something cool.

Nice work!

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

More
28 Dec 2015 09:50 #41195 by VanDerPloeg
Replied by VanDerPloeg on topic Control drones with Smartphone
tjkim93,

Great work! Im looking to control my Cheerson CX-10 with Arduino, but I don't have an android phone to use your program with. I have been trying to figure out the bluetooth serial protocol you use so I can control it from a serial terminal, and have been able so far to get the version and set the RF protocol. But I still can't get it to work, because I don't know the "controller ID" which I need to supply when I start RF. How can I find it? Also, when I set the RF module and protocol (Im using nRF24L01), what are the "options"?

Thanks a lot!
VanDerPloeg

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

More
28 Dec 2015 17:18 #41200 by mwm
Replied by mwm on topic Control drones with Smartphone

tjkim93 wrote: And the source is not open.. the app was designed for MultiWii protocols originally and deviation protocols are ported to UniConTX.


Just saw this, so I thought I'd point out that this might be a copyright violation. If you are distributing a binary that was built with a deviation source file, then it's a work derived from that source, and you can only legally give someone the binary as described by the license.

If you aren't building such an app, or aren't giving it to anyone else, or are distributing properly already, then this isn't an issue, and I'm sorry for the confusion.

On the other hand, I've been thinking that it might be a good idea to spin off the protocols from deviation into a separate project, to make them easier to use for things like this and the multi-protocol module.

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
29 Dec 2015 01:32 #41225 by VanDerPloeg
Replied by VanDerPloeg on topic Control drones with Smartphone
Good point, but I was looking to only modify the Arduino code (which is under GNU) to work headless. Wasn't planning on distributing it anyways. Could be wrong, thanks for the heads up.

Getting the deviation protocols into another project would be great, I've been wanting to do some autonomous control with arduino

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

More
29 Dec 2015 09:56 #41242 by FDR
Replied by FDR on topic Control drones with Smartphone
Honestly I don't see the reason of separating the protocols just because of the license.
That would have GNU license as well, so anyone could use any part of it as far as he or she would publish his or her code under the same GNU license...
...or probably I might misunderstood the problem here.

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

More
31 Dec 2015 00:22 #41267 by mwm
Replied by mwm on topic Control drones with Smartphone
Sorry, it isn't because of the license. It's to create a single repository that everyone working on protocols at this level can use. Other projects (there's deviation, and the multi-protocol module, and possibly this one) would then suck in that project and build it.

This would require cleaning up and documenting the API, which is a good thing. Doing that would also have licensing implications, though possibly not good ones. It would make it easier for other projects to use the protocols. But the real win would be that protocols contributed to it via one project would be added to others by updating that repository.

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
31 Dec 2015 06:03 #41274 by pcb45
Replied by pcb45 on topic Control drones with Smartphone
Hi tjkim93,

I have the same question VanDerPloeg has. Any chance you could briefly explain the serial protocol? Making progress but a quick explanation would really help use the library interactively for testing etc.

Thanks!

VanDerPloeg wrote: tjkim93,

Great work! Im looking to control my Cheerson CX-10 with Arduino, but I don't have an android phone to use your program with. I have been trying to figure out the bluetooth serial protocol you use so I can control it from a serial terminal, and have been able so far to get the version and set the RF protocol. But I still can't get it to work, because I don't know the "controller ID" which I need to supply when I start RF. How can I find it? Also, when I set the RF module and protocol (Im using nRF24L01), what are the "options"?

Thanks a lot!
VanDerPloeg

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

More
31 Dec 2015 08:21 #41278 by FDR
Replied by FDR on topic Control drones with Smartphone
Ah I see!
That's reasonable...

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

Time to create page: 0.099 seconds
Powered by Kunena Forum