Developer

BR-0016-01-2.jpg?width=251In case you're looking for an optical flow sensor, there is now one available in the DIYDrones store for a penny under $40.

 

This sensor is based on the ADNS3080 mouse sensor which is a good choice for optical flow because:
   high resolution: 30 x 30 pixel frames meaning it can see features that lesser mice cannot
   high speed: 2000 to 6400 frames per second update rate which contributes to better low light performance than other mouse sensors
   SPI interface meaning it can be interfaced to many micro controllers and co-exist with other sensors

 

Other features:

  • Intended to interface with a 5v microcontroller.
  • 8mm lens with 11 deg FOV
  • Standard M12x0.5 lens mount meaning you can replace the lense easily  if required

 

Instructions for connecting the sensor to your APM/Oilpan are here.

 

Things to be careful of:

  • Performs best outdoors in well lit environments
  • Does not play well with Fluorescent lights (the blinking throws off the sensor)
  • Needs a somewhat varied surface to see movement (plain carpets are not it's friend)

 

Uses including odometry and obstacle avoidance but I've used it mostly for horizontal position hold.

 

Note: integration with ACM and the existing GPS pos hold is a work-in-progress but should hopefully be completed in a few weeks.  Here is a video of a slightly modified version of the ACM code using only optical flow (and sonar for altitude hold).

 

Inspiration and some technical help especially early on came from Marko Klein Berkenbusch and his blog on position hold with mouse sensor.

 

Hope you like it, all comments welcome!

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • Developer

    Not completely sure.  I've heard they will be back but they've had some problems getting their hands on the ADNS3080 sensors.  There is a better (but much more expensive) PX4FLOW sensor but it doesn't work with the APM (yet).

  • Same problem as steven_chan,

    image hang after a few seconds on my APM2.5,

    2.0 not tested

  • Hi Randy,

    Thanks for the reply, i have some image but after a few frame, it starts to hang. Currently i have borrow a APM2 and tested with no problem.


    I also have additional question, after testing with python (tuning the focusing), i use mission planner to test out the position hold as well as of-loiter, as i have notice, it seems that is not doing any position holding, is there anything else that i need to include to do the position holding??

    Thank you.

  • Thanks for the suggestion Randy. I'm having the same problem as Steven and in my case I sometimes see an image or do before the program gets stuck.

    What can we do to make the connection more reliable and/or focus the lens another way? Different computer? Different USB cable? Different location?

    Thanks for any tips!

  • Developer

    @Steven,

        that sounds like the serial connection between your computer and the APM board is unreliable so it's losing packets and it sounds like the python program isn't reliable enough to recover from that.

        does it ever display an image or is that the first thing that comes out?

        by the way, when the sensor and APM actually talk they don't use the serial protocol so this issue doesn'tnecessarily mean that there's anything wrong with the sensor..but it will be harder to get the lens focused without being able to see the image.

  • Developer

    James,

         They cross but shouldn't be connected.  txs.

  • Hi Guys, I was hoping some of you knowledgeable people might be able to clear something up for me - might seem like an amateur question - but that's pretty much what I am!
    On the diagram for connecting to APM2.5 the SCLK wire on the APM2.5 board is shown as connecting to the SCLK pin, but also crosses the RST pin. Might be a stupid question, but is there supposed to be a connection bewtween SCLK & RST pins on the APM2.5 board? Or should it be shown like the connection at A3 and indicate a connection only to the SCLK pin?

    Optical_Flow_Sensor_APM25.jpg

    Planning on doing some soldering this weekend, and I don't want to fry anything!
    Cheers, James.

  • No luck on my side. 

  • Hi Tobin, have you solve your problem?? i am also facing this problem for 2 months, from hardware till software, i have checked everything. but it will crash at some point be is Mission Planner or Python. The error in Python is

     sent 'I' to COM4 line 17incomplete (10 of 30), ignoring 12,12,16,16,20,16,12,8,8,

    Hi Randy, could you help us in this issue?

  • Hi Randy,

    I would like to test the optical flow sensor on my personal computer by means of a SPI-USB interface. In order to do that, I am wondering if you have the code needed to comunicate the optical flow sensor via SPI, i.e. without using the libraries provided by ardui-pilot.

    Thanks in advance.

    Gerardo.

This reply was deleted.