In 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!
Comments
Jan,
So the problem is that the surface quality is very low. It's only 1 or 2 in the logs above (it appears as the 3rd item in the "OF" lines). It really needs to be above 20 for it to try to use the sensor to compensate. Could you check the sensor using the cli menu's "test", "optflow". Maybe you need to focus the lens?
hmm..ok, i'll have a look at it. Last time I tried it it worked after a bit of tuning anyway.
I think I really need to introduce a speed controller into the mix. At the moment, the speed from the of sensor is integrated to calculate the position..and then this position is fed into a PID controller so the further you are from the target the more it leans...but what's better is to do what we do for regular loiter which is to turn the distance into a desired speed..and then compare the current speed to the desired speed and pass this into another PID controller which will adjust the lean angle to attain that speed.
I hope to add these changes into an upcoming release.
until then if you can post a dataflash log with the OPTFLOW log type enabled that'll allow me to check some of the basics..like ensuring that your squal value (surface quality) is sufficient for the sensor to do anything. Of course, also make sure that the pins are facing forward! :-).
@Monroe,
Yes, we don't have support for the Centeye optical flow sensor but I've been meaning to add that for at least 6 months. Just haven't gotten to it.
@Matt,
The original several hundred that shipped did not have an IR Filter on them so I'm a little surprised to hear that. I'll have to check with 3D robotics. The lens should be about 8mm with a fov of about 50 degrees although the sensor ends up seeing much less than that (more like 13deg I think) because most of the image from the lens falls outside of the little image sensor.
@OG, the wiki has been updated to show how to connect the optical flow sensor to the APM2. You probably knew that as your post is from some time ago...somehow I missed it! sorry!
@Brian,
Doug Weibel talked a little about doing that but I think he became busy with other things...so, "no" I haven't seen anybody accomplish that.
Dave, I commend the adventurous curiosity. I hope you are taking the precautions against possibility of the drone going out of control, and hurting yourself or others.
Hi Ammar,
I'm still working on getting it integrated into the latest code and although it's taking longer than i predicted I'm making progress. I checked in a chunk of code over the weekend and hope to complete the rest of it this weekend (hopefully).
So the image is appearing correctly but the x,y values aren't changing? Note that after capturing an image, you need to reset the sensor (i.e. disconnect/reconnect power) to get it back into it's normal state where it returns movement.
Can i also ask what surface quality value you're seeing? it needs to be over 10 or 20 to see movement so maybe you're in too dark a room? Try pointing it at a computer screen perhaps.
Now unfortunately the code is still a bit of a work in progress but it's getting close and hopefully I'll have a version you can play with in a week or so. Best to start with wiring it up according to the wiki.
If you know how to upload code using the arduino ide you can check the focus of your lense by uploading the example sketch (see testing the sensor on that same wiki page).
If you're loading the code through the arduino ide you can add this line to APM_Config.h and try regular LOITER:
#define OPTFLOW_ENABLED
If the code fits on the 1280 it should work. It didn't use to fit but let me check the size of trunk.
I got my sensor today! How can I test it out on my copters? I have the code loaded and enabled on my 1280 and 2560 apms. Is there any reason why it will not work on a 1280 if it fits? I have sonars on both as well. I have 2.0.54 loaded from the arducopter downloads.
Well, the indoor thing probably won't work unless someone can find a lens with a very low "fstop" value. The current one has an fstop value of between 1.8 and 2.0 apparently.
Hopefully we can eventually get it working well with the GPS. Perhaps using the GPS to get us within a meter or two of the target (the limit of the accuracy of the GPS) but then use the OFS to hold us still in one place.
-
1
-
2
-
3
-
4
-
5
of 6 Next