Quad with optical flow position hold (sort of...)


I have been following this site for a while now, I guess it is time to post something myself.
Above is a picture of my latest scratch-built quadcopter running an STM32 ARM processor board with home-brew software. This is my second quad, on the first one (you can sort of see it in my profile picture) I used a home-mode, dual Atmega 328 board.
So far, the quad features the following setup:

  • Aluminium frame "Home-Depot" style
  • Alpha 370 size motors (HobbyPartz)
  • Salvaged 6dof sensor board from a Walkera XUFO 5 (4?)
  • 2-axis magnetometer (I know, 3 axes would make my life a little easier)
  • Maxbotix sonar range finder for low-altitude hold
  • Mediatek LS20031 GPS
  • Modified ADNS2610 optical mouse sensor for low-altitude position-hold
  • Custom software, using ChibiOS RT OS (http://chibios.sourceforge.net)
  • 72Mhz RC gear (Futaba TX, generic RX)
  • XBee telemetry downlink
  • Onboard data logging to SD/MMC card
  • Oh, yes: taped on keychain-camera for onboard video ;-)

Here is picture of the (rather untidy) electronics setup (the Xbee is normally mounted on the inside of the canopy, the mouse sensor and ultrasound sensor are underneath the copter for obvious reasons):

The software features working so far are:
  • Quaternion based attitude representation - tried Kalman filters at first, switched to a more DCM-like approach later
  • Attitude-hold and aerobatic flight modes (can be switched in flight)
  • GPS position hold (activated by channel 6 switch on TX)
  • OR alternatively at the moment: Optical flow position hold via a downward-facing, modified optical mouse sensor with custom optics (NOTE: both GPS position hold and mouse sensor position hold work, but only on a good day - definitely requires more tweaking/PID tuning)
  • Data logging to SD card (not very reliable atm - I do not really use this much since I have telemetry via Xbee)
  • "Ground station software" for data logging and displaying the state of the quad in various graphical ways

The software is written pretty much in straight C, making use of ChibiOS' multithreading. The ground software is a collection of Perl/Tk scripts - all my development happens on Linux.
Below is a video of the quad in "mouse sensor" position hold mode in my driveway - apologies for the terrible video, I will try and shoot a better one soon...

If somebody finds any of this useful or interesting, I am glad to share some more details...

Views: 6655

Comment by Rana on September 11, 2010 at 9:47pm
Marco, you are a very talented person and capable of doing things yourself too !I would suggest you to put your great efforts in the existing DIY Quad project "ArduCopter", where lots of other developers are contributing to make it happen for the benifit of the DIY community.

Best Regards

Comment by Faisal Shah on September 11, 2010 at 10:10pm
I am trying to setup an environment to program the STM32. I have the same board (STM32-STAMP). Do you have a barebones project using codesourcery-gcc setup you can send me (makefile, linkerscripts, etc .. ) using the ST Micro's Firmware library ? I'm trying *not* to rely on RIDE or other closed IDEs ... and only on 'unlimited' free toolchains such as eclipse + gcc + codesourcery. Thanks.
Comment by David Channon on September 12, 2010 at 12:32am
good work. It would be nice if you detailed the project on a blog or other place so other might learn from your obviously talent and hard work.
Comment by Knuckles904 on September 12, 2010 at 12:42am
Would you mind giving some details about the optics for the mouse camera sensor. I think thats a subject many people would love to hear about
Comment by Robin Lilja on September 12, 2010 at 2:41am
I really like the idea of using optical flow - some more info about how you modified the optics would be interesting to read about. Using two sensors would make it possible to calculate yaw as well, wouldn't it?
Comment by Danilo Scarato on September 12, 2010 at 3:01am
Good Work !
However, the captured image varies according to height and the optical sensor may detect a movement that does not exist, how did you solve this?
Comment by Hassan Azeem on September 12, 2010 at 2:33pm
Love the "Home Depot" style frame lol. Did that myself for my first quad. :D
Question: What is the total weight on this quad without batteries?
Comment by Patrick Koegel on September 12, 2010 at 3:46pm
Very nice.
Could you post some pictures of you mouse sensor and the optics you used.
Comment by Marko Kleine Berkenbusch on September 13, 2010 at 6:21am
@Faisal: I tried using CodeSourcery toolchain but had some trouble with it. I ended up building my own Linux toolchain from sources. My entire "IDE" consists of emacs and make basically. I used a Makefile and linkscripts that were part of ChibiOS.
@Danilo: You are correct, I use altitude from the sonar together with the mouse sensor to get positioning data.
@Hassan: I never really weighed it without batteries, as pictured it weighs 900g with a 3S 2200mAh Lipo - I believe the Lipo weighs about 160-180g....

I will try and take a few pictures and write something about the mouse sensor setup later - it is actually surprisingly simple...
Comment by Simon Wood on September 13, 2010 at 9:31am
Did you tilt compensate your 'optical flow', so as the frame tilts it understands that the mouse optics will report a move?

Mouse sensors are rediculously cheap, using more than one would (as Robin suggested) allow yaw measurements but also assist with height estimation - ie. both sensors indicating movement toward the outside of the frame as the ground approaches.



You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service