HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Apr 09, 2011, 10:59 AM
Registered User
Vista, CA
Joined Feb 2008
1,269 Posts
Discussion
AR drone control with RC transmitter, yet another Wifi-less mod

Features

o precise control of drone
o cheap off the shelf hardware (Arduino Pro Mini or Nano, AR6100)
o started with firmware version 1.4.6, these versions can not be tested any more due to lack of existence in my lab
o tested with latest drone firmware versions 1.11.5 and 2.4.8
o true 'plug&play', disconnect HW and drone can be operated by iDev
+ no BEC needed
+ uses drone's serial port
+ no surgery of system files on drone
+ no need to make custom kernel for drone
+ prevents iDev highjacking of command port when in use
+ allows access to NAVDATA port for remote monitoring
+ allows access to video port for remote viewing
+ four different 'hot' selectable drone configurations
+ visual low battery alert (VLBA)
+ supports Mode 1, 2, 3 and 4 transmitters

Hardware

1) Drone
2) 5+ channel RC TX/RX, 4 channels for sticks, 1+ switche(s) for land/flightmode1/flightmode2
3) Arduino Pro Mini, Nano 16Mhz/5V or MiruPCB
4) Please look at the wiring diagrams to find the parts needed

Software

From what I gather from the net, most people doing this have access to a
Windows box (I have W7) and can download the Arduino IDE (arduino-1.0.5-r2.zip).

The implementation uses a pair of programs, one running on the Arduino, the
other running on the drone. The drone program is transfered and started by
the Arduino program.

rx2atp - receiver signal sampling and conversion to drone commands

Installation on Arduino Pro Mini, Arduino Nano

'rx2atp' is the program for the Arduino. It does not make use of any
Arduino environment library functions, exept the startup file and the
standard compiler support library, I hope they have not tinkered with...
This project has been tested with arduino-0022/3 and arduino-1.0-win.

Start the Arduino IDE, it comes up with an empty 'sketch', and select
<Sketch><Add File...>. Add the file 'rx2atp.c' from this package and
'Upload' it to the board.


at2so - forwarding drone commands from serial interface to socket

This program is uploaded and started on the drone by 'rx2atp'. It is loaded
into '/tmp' on the drone and does not survive a reboot of the drone.

Modifications to this program are not for the faint of heart. You need a
toolchain for the ARM processor that can generate programs for Linux on the
drone. At this point I use:
arm-2010.09-50-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.tar
on a Linux box.

miru

This thread has become fairly long and it is difficult to find the 'essentials', Pawelsky made a nice webpage that gets you the releveant information fast! Check out: http://mirumod.tk

Arduino Pro Mini wiring by Lorenzo29:
http://www.rcgroups.com/forums/showp...5&postcount=48

Arduino Nano wiring:
http://www.rcgroups.com/forums/showp...&postcount=484

REV 0.13 wiring:
http://www.rcgroups.com/forums/showp...postcount=1417
Drone 2 wiring:
http://www.rcgroups.com/forums/showp...postcount=2061

Latest revision REV 0.22 (consult README in .zip file for answers to some questions):
0.22 http://www.rcgroups.com/forums/showp...postcount=5949
0.21 http://www.rcgroups.com/forums/showp...postcount=5174

Proper terminal emulator in case you are on Windows 7:
http://digitizor.com/2009/08/29/how-...indows-7-free/
miru is offline Find More Posts by miru
Last edited by miru; Jul 20, 2014 at 10:24 PM. Reason: update
Reply With Quote
Sign up now
to remove ads between posts
Old Apr 10, 2011, 04:52 PM
Registered User
France - Brest
Joined Oct 2007
55 Posts
Hello,
Whaou, sounds good...
I will look into this in detail soon.
Thx Miru
Lorenzo29 is offline Find More Posts by Lorenzo29
Reply With Quote
Old Apr 10, 2011, 09:53 PM
Registered User
Joined Nov 2010
65 Posts
Nice solution, miru!
Looking into the source code, you are the super programmer!
Especially with high performance coding style, very impressive.
MAPGPS is offline Find More Posts by MAPGPS
Reply With Quote
Old Apr 11, 2011, 12:29 AM
Registered User
USA, CA, Fontana
Joined Mar 2005
1,107 Posts
Cant wait

Just got my Arduino in yesterday. Can't wait to try it out.
actionplus is offline Find More Posts by actionplus
Reply With Quote
Old Apr 11, 2011, 09:02 AM
Registered User
sevensixty's Avatar
Joined Feb 2011
51 Posts
If you have made previous mods to the drone, will updating to the firmware reverse these (previous wifiless mod)? Will you be writing a step by step guide for us dummies?
sevensixty is offline Find More Posts by sevensixty
Reply With Quote
Old Apr 11, 2011, 01:22 PM
Registered User
Vista, CA
Joined Feb 2008
1,269 Posts
Quote:
Originally Posted by sevensixty View Post
If you have made previous mods to the drone, will updating to the firmware reverse these (previous wifiless mod)?
I don't know what mods you have done to yours, but I think if you can get it back to the point where you can fly it with your iDev, you should be good to go. I am a little worried about the startup scripts that have been changed by some mods though...

Quote:
Originally Posted by sevensixty View Post
Will you be writing a step by step guide for us dummies?
Anything for my friends... Let me know what is missing in the README file.

miru
miru is offline Find More Posts by miru
Reply With Quote
Old Apr 11, 2011, 01:27 PM
Registered User
Vista, CA
Joined Feb 2008
1,269 Posts
Quote:
Originally Posted by MAPGPS View Post
Nice solution, miru!
Looking into the source code, you are the super programmer!
Especially with high performance coding style, very impressive.
Thank you. I tested a new version (software only guys!) this weekend. This revision gets rid of the CPU hogging vertical counter and decouples the RX timing from the drone timing requirements. It opens the road to fully use the I2C interface for.... maybe a GPS?

miru
miru is offline Find More Posts by miru
Reply With Quote
Old Apr 11, 2011, 02:37 PM
Registered User
United States, FL, Daytona Beach
Joined Apr 2011
11 Posts
Is anyone familiar with the Arduino Nano? Thats what I have and I think my connection to the drone will be slightly different...

I'm having difficulty following the instructions in the README. could someone help me figure out what goes where between the drone and arduino? I have only ever used the nano's usb port for serial before...

Like, what is "drone 7" etc.

here's a link to info about the nano:

http://www.arduino.cc/en/Main/ArduinoBoardNano

I was using the other wifi-less mod using usb before, but I am really excited try this one! Great work!

EDIT: upon closer inspection of the port on the drone, the pins seem to be labeled 1-8 I guess that's what "drone 7" means haha
I'm still unsure about what goes where on the arduino side though...
genie360 is offline Find More Posts by genie360
Reply With Quote
Old Apr 11, 2011, 03:39 PM
Registered User
France - Brest
Joined Oct 2007
55 Posts
Hello,
Quote:
Originally Posted by genie360 View Post
Is anyone familiar with the Arduino Nano? Thats what I have and I think my connection to the drone will be slightly different...

I'm having difficulty following the instructions in the README. could someone help me figure out what goes where between the drone and arduino? I have only ever used the nano's usb port for serial before...

Like, what is "drone 7" etc.

here's a link to info about the nano:

http://www.arduino.cc/en/Main/ArduinoBoardNano

I was using the other wifi-less mod using usb before, but I am really excited try this one! Great work!

EDIT: upon closer inspection of the port on the drone, the pins seem to be labeled 1-8 I guess that's what "drone 7" means haha
I'm still unsure about what goes where on the arduino side though...
refer to this page from nosaari where you will find pin numbers on the drone connector...
The nosaari cable is different since for the USB mod we pick up +5V (pin 1), Data- (pin 3) and Data+ (pin 5). Pin 7 for GND is used on both USB and serial cables
For the Miru Mod, we need +12V (pin 2), RX (pin 4) and TX (pin 6) and GND (Pin 7).
Drone connector pin assignment :
http://code.google.com/p/ardudrone/w...eModifications

On the arduino nano, there are TX and RX pins on upper left (see picture below) that i suppose you could use.


To power your board... i would send the 12V of the drone connector (pin2 and 7) to the VIN and GND pins of the nano.

To power you receiver with 5volts, i'm not sure, but you should get 5volts available on pin 27 (5V pin) of the nanoboard... someone can confirm that when the nano is powered by VIN pin in 12V, there is 5V available on the 5V pin ?

Regards.

LD
Lorenzo29 is offline Find More Posts by Lorenzo29
Reply With Quote
Old Apr 11, 2011, 04:15 PM
Registered User
France - Brest
Joined Oct 2007
55 Posts
Hello,

dear Miru, may i ask you three small questions ?

For your information, I read every readme file and notes from your zip package and even tried to guess the answers by exploring your source code. Unfortunately, i didn't manage it

1) Switch assignment
The GEAR switch is for Land/TakeOff
and
The AUX1 switch is for emergency crashing ?

2) Did you implement the auto hovering function when the roll/pitch stick (mode 2) is on neutral position ?
This function was implemented on MHeeli (wifi) mod.
To my point of view, it was quite convenient but not fully satisfactory. Very often during flight, when by no chance the roll/pitch stick passed thru this neutral position, for a brief, the drone was trying to hoover...
To solve this, i did a modification to the MHeeli code to take advantage of the three positions switch on my Spektrum DX7 radio.
- Lower position : Land
- Mid position : Take-off and Fly with auto-hovering (when roll/pitch stick is in neutral function) enabled.
- Upper position : Fly with auto-hovering function disabled
This modification is very convenient when you begin to be used to fly with the drone and if the pilot doesn't dare to switch to the No Hoovering flight, he can stay on the mid position and stay safe...

I went through you code, pfuuuuu, not easily understandable for me...
So, if you could help me to understand if auto-hoovering is implemented when roll/pitch stick is on neutral it would give me some clue if i need to study a modification to implement the three position switch trick.

3) Drone setup and starting procedure.
3.1 Do we need to place both radio stick to neutral in order to start ?
I suppose, the response is Yes !
3.2 Do we need to set the "travel adjust" values of radio channels in order to get the correct AT values to be sent to the drone (-1, 0 and +1) ?

Well, thank's for this mod Miru, it sounds good.

Laurent D
Lorenzo29 is offline Find More Posts by Lorenzo29
Last edited by Lorenzo29; Apr 11, 2011 at 04:35 PM.
Reply With Quote
Old Apr 11, 2011, 04:19 PM
Registered User
United States, FL, Daytona Beach
Joined Apr 2011
11 Posts
Quote:
Originally Posted by Lorenzo29 View Post
To power you receiver with 5volts, i'm not sure, but you should get 5volts available on pin 27 (5V pin) of the nanoboard... someone can confirm that when the nano is powered by VIN pin in 12V, there is 5V available on the 5V pin ?

LD
I can confirm that you get 5V off the 5V pin...

Thanks Lorenzo29 for the clarification! I got it set up now... Now I just have to figure out how to get it working with my 5ch transmitter.

With my previous mod (nosaari mod) I was able to just have channel 5 connected to both takeoff/land pin and emergency pin. This actually worked surprisingly well. I would flip the switch... the drone lights would go red = user emergency and would not take off. Then I just did it again and it would reset emergency and take off at the same time.

Then in flight i had the choice of either putting the switch down to land, or go down, up quickly for emergency.

Kind of a weird work around, but it worked!

Anyone have any idea how I can use my 5 ch with this mod? I think emergency works differently because when I try do what I did before ^ it just blinks orange 4 times. cant get it to take off
genie360 is offline Find More Posts by genie360
Last edited by genie360; Apr 11, 2011 at 05:12 PM.
Reply With Quote
Old Apr 11, 2011, 04:26 PM
Registered User
Vista, CA
Joined Feb 2008
1,269 Posts
Lorenzo29 thank you for answering the nano question.
Genie360 I looked at the Arduino nano a couple of days ago and was not quite sure how the FTDI chip is connected and what he bootloader does with it. The drone is somewhat finicky about what's on it's serial port during powerup. Let me know if you get it working, would be less research for me!
miru
miru is offline Find More Posts by miru
Reply With Quote
Old Apr 11, 2011, 04:33 PM
Registered User
United States, FL, Daytona Beach
Joined Apr 2011
11 Posts
Just took off!! Just as a test I doubled up on the rudder channel... so rudder on my transmitter now does rudder and emergency... I reset the emergency with the rudder stick, flipped gear switch and up it went!

Obviously this is no good to fly the thing but it's good to know the drone is actually getting the signal. Now just have to figure out a better way to deal with emergency. I'm thinking maybe adding a push button on the arduino for now
genie360 is offline Find More Posts by genie360
Reply With Quote
Old Apr 11, 2011, 04:35 PM
Registered User
United States, FL, Daytona Beach
Joined Apr 2011
11 Posts
Quote:
Originally Posted by miru View Post
Genie360 I looked at the Arduino nano a couple of days ago and was not quite sure how the FTDI chip is connected and what he bootloader does with it. The drone is somewhat finicky about what's on it's serial port during powerup. Let me know if you get it working, would be less research for me!
miru
miru it seems like the drone is working fine with the nano. I'm only 2 flights in but will continue testing and share the results here.

PS thanks a lot for this mod, I'm loving it already.
genie360 is offline Find More Posts by genie360
Reply With Quote
Old Apr 11, 2011, 05:07 PM
Registered User
Vista, CA
Joined Feb 2008
1,269 Posts
Quote:
Originally Posted by Lorenzo29 View Post
1) Switch assignment
The GEAR switch is for Land/TakeOff
and
The AUX1 switch is for emergency crashing ?

2) Did you implement the auto hovering function when the roll/pitch stick (mode 2) is on neutral position ?
This function was implemented on MHeeli (wifi) mod.
To my point of view, it was quite convenient but not fully satisfactory. Very often during flight, when by no chance the roll/pitch stick passed thru this neutral position, for a brief, the drone was trying to hoover...
To solve this, i did a modification to the MHeeli code to take advantage of the three positions switch on my Spektrum DX7 radio.
- Lower position : Land
- Mid position : Take-off and Fly with auto-hovering (when roll/pitch stick is in neutral function) enabled.
- Upper position : Fly with auto-hovering function disabled
This modification is very convenient when you begin to be used to fly with the drone and if the pilot doesn't dare to switch to the No Hoovering flight, he can stay on the mid position and stay safe...

I went through you code, pfuuuuu, not easily understandable for me...
So, if you could help me to understand if auto-hoovering is implemented when roll/pitch stick is on neutral it would give me some clue if i need to study a modification to implement the three position switch trick.

3) Drone setup and starting procedure.
3.1 Do we need to place both radio stick to neutral in order to start ?
I suppose, the response is Yes !
3.2 Do we need to set the "travel adjust" values of radio channels in order to get the correct AT values to be sent to the drone (-1, 0 and +1) ?

Laurent D
Hi Laurent, please check the attachment, I started a writeup for the next revision. To answer your questions:

1) yes the gear switch is the land/launch and the AUX1 (3 position) switch is for the other functions. Center is normal -> GEAR switch land/launch. Down sends FTRIM/COMWDG/LED once, center if afterwards for launch. Up causes an EMERGENCY, which does different things on the drone depending on if you are in the air or on the ground. In the air, it kills the motors, on ground it resets the last EMERGENCY in the drone (in case you flipped over or ran into something and the motors cutout).

2) This implementation always 'hovers' if you let go of the AILE/ELEV stick. Check at_prgr() it is only told to send PCMDs when the drone is in the air (that's different from FreeFlight). at_prgr() checks if the AILE/ELEV stick is in the center and will reset the 'enable' in the PCMD if so. I like your use of the AUX1 channel, it's almost like a heli. But what about FTRIM, EMERGENCY?

3.1) I only make sure on boot that the throttle stick is centered, AUX1 is centered and GEAR is down. Centering the sticks before launch is a good idea, but I ran out of ideas how to signal the user that I am not launching because....
3.2) Please read the attached pdf file about the setup. It is for the next revision but applies to the current as well.

miru
miru is offline Find More Posts by miru
Last edited by miru; Apr 11, 2011 at 06:16 PM. Reason: zip -> pdf, addition
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Mini-HowTo RC Controlled AR.Drone w/o WiFi! nosaari Multirotor Talk 116 Mar 14, 2014 02:23 PM
For Sale Parrot AR Drone w/TX/RX mod *Flies Nice* Z06 Tony Aircraft - Electric - Helis (FS/W) 4 Apr 16, 2011 09:42 PM
Discussion Wifi Boosted AR.Drone Fallengod Multirotor Talk 7 Feb 12, 2011 10:52 AM
Discussion And yet another AR drone Arial Video project taudronis Multirotor Talk 17 Dec 07, 2010 11:04 AM
Sold Parrot AR.Drone Four rotor platform control with your iPodTouch/iPhone/iPad Hoverup Aircraft - Electric - Helis (FS/W) 0 Oct 12, 2010 03:54 PM