Arduino Controller

Discussions and questions about the Crazyflie Nano Quadcopter
Post Reply
tbitson
Beginner
Posts: 3
Joined: Fri Jul 05, 2013 4:30 pm

Arduino Controller

Post by tbitson »

I'm not sure if anyone else is working on this. I wanted a simple handheld controller that I could modify to fit my needs. I developed some proof of concept code to verify that an Arduino connected to an nRF24L01+ could communicate and control a CrazyFlie. Here an link to my demo code if anyone is interested.

https://bitbucket.org/tbitson/crazyflie ... controller
Demo unit in 3D printed case
Demo unit in 3D printed case
Inside of demo controller. Uses jumpers to connect modules.
Inside of demo controller. Uses jumpers to connect modules.
The list of materials and STL file for the printed case is at https://tinkercad.com/things/lQYpViQbkG ... er-case-10 and will be poster to the repo soon.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Arduino Controller

Post by tobias »

Nicly done and it seems like it was a lot of fun to develop!
How well are the analog sticks working? Do they go back to zero when released and do they seem to have a good and stable resolution?
humblehacker
Member
Posts: 34
Joined: Thu May 16, 2013 7:42 pm

Re: Arduino Controller

Post by humblehacker »

Wow! That's quite the proof of concept! I've been trying to program various versions of Arduino controllers for some time with little success. Between the Arduino Esplora and this Gamepad form built around an Arduino Leonardo (http://www.jameco.com/1/1/47752-dfr0182 ... duino.html) the platform is just screaming for a decent gamepad library for the ATmega32u4. Is that the board you are using?
What do you run the client on BTW? With microcontrollers like Arduino and microcomputers like the RPi getting closer and closer every day, I wonder how much more difficult it would be to make a stand-alone controller with the client built-in? I was thinking about trying this with the new Beaglebone Black (http://beagleboard.org/Products/BeagleBone%20Black) as it packs as much punch as an RPi but also comes with two embedded 32bit Microcontrollers. Another possibility might be the soon-to-be released Arduino Yun http://blog.arduino.cc/2013/05/18/welco ... ith-linux/ which combines the ATmega32u4 with a Linux chip running OpenWRT, but this probably wouldn't work very well with the cfclient.
tbitson
Beginner
Posts: 3
Joined: Fri Jul 05, 2013 4:30 pm

Re: Arduino Controller

Post by tbitson »

tobias - The small thumb joysticks are OK for indoor use. I disassembled the throttle joystick and removed the spring to allow full range. I'm looking to find a better joystick for controller.

The CrazyFlie has to be one of the coolest projects yet!
Last edited by tbitson on Sat Jul 13, 2013 3:55 pm, edited 1 time in total.
tbitson
Beginner
Posts: 3
Joined: Fri Jul 05, 2013 4:30 pm

Re: Arduino Controller

Post by tbitson »

humblehacker - for this first cut, a just used a Arduino Pro Mini 5V/16MHz. Once I get all the switches connected, I'll be out of pins so I will most likely move to a Mega, or possibly a DUE if I can get the RF24 library to work on the DUE. That would provide plenty of speed to and a color OLED display to graphically show heading like the CFClient.

- Tim
foosel
Expert
Posts: 175
Joined: Sat Feb 02, 2013 9:59 pm
Location: Obertshausen, Germany
Contact:

Re: Arduino Controller

Post by foosel »

tbiston, have you taken a look at something like an i2c io expander such as the PCF8575 for the buttons?
Image
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107
humblehacker
Member
Posts: 34
Joined: Thu May 16, 2013 7:42 pm

Re: Arduino Controller

Post by humblehacker »

tbitson wrote:humblehacker - for this first cut, a just used a Arduino Pro Mini 5V/16MHz. Once I get all the switches connected, I'll be out of pins so I will most likely move to a Mega, or possibly a DUE if I can get the RF24 library to work on the DUE. That would provide plenty of speed to and a color OLED display to graphically show heading like the CFClient.

- Tim
That would be awesome to see something that runs on the DUE. For whatever reason its been really hard to find a place for a 32bit, 3.3v Arduino so do keep us posted on any developments!
Also, if you find yourself testing on a Leonardo it might be possible to use it with the DFRobot Wireless Gamepad http://www.dfrobot.com/wiki/index.php/W ... U:DFR0182) which is basically a Leonardo wrapped up in a Dualshock Controller shell with XBee/BTBee/RFBee footprint...
With current developments pointing towards further integration between Microcontroller and MicroPC platforms, its not too much of a stretch to imagine a similar gamepad that could also host the headless client with the Crazyradio fitting into the XBee footprint... But right now I'd be satisfied with any use for my DUE...
Mohero
Beginner
Posts: 6
Joined: Sun Jun 16, 2013 9:05 am

Re: Arduino Controller

Post by Mohero »

That's some nice work.

My approach has been somewhat different, I have an Arduino Uno with a modified USB Hex so a computer thinks it's a Joystick instead of a USB -> Serial. I have an old 6-channel transmitter and removed all the guts from it, and I have the pots from the sticks into analog channels on the Uno, the switches & trims are all connected to digital inputs on the Uno, and obviously runs code for those to send joystick button commands down the USB. The other end of the USB is my Rasberry Pi, running the cfheadless client with some modifications to talk to an LCD Library that I've been working on to output status messages on the LCD. All powered from a 7.4v Li-Po pack with a 5v3A regulator.

I will happily post more details when I've got a bit further, currently I have a bug on the Arduino - if I press any button all the Axis go nuts, so some work to be done :)

My decision on this was that I find actual RC Heli transmitters very comfortable (I fly nitro RC Helis), so wanted much the same for the Crazyflie!

Flashing the Arduino code is also all done from the Pi.

J
MidLifeCrisis
Beginner
Posts: 3
Joined: Fri Aug 09, 2013 1:38 pm

Re: Arduino Controller

Post by MidLifeCrisis »

Hi,

I created my controller using an off-the-shelf set of components. I have an Olimex STM32-103STK, a MOD-WII, and a classic Wii controller. I get a nice bitmapped display (pretty small, but useful) and a 24L01 (not the +) and battery holder on the board

https://www.olimex.com/Products/ARM/ST/STM32-103STK/

Plug in a standard Wii Classic controller, and you have a low-res stand-alone RC unit. This code will also run on a bunch of other platforms, and I'll make it available soon. :-) On holiday in the Lake District at present, and working on the code at night...

Regards,

-- Paul.
diylink
Beginner
Posts: 1
Joined: Sun May 25, 2014 12:19 am

Re: Arduino Controller

Post by diylink »

Hi:
when I using this Arduino Controller example , it worked well,the crazyfile can receive the crtp packet .but it always return timeout when check ACK packet after sending crtp packet to crazyfile.anyone helps?
Post Reply