-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PMW3901MB optic flow sensor driver #2529
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you for this driver, I'll test it soon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this on a crazyflie, but I can't get it to work. Spi transactions look good with logic analyzer, but no reply from the sensor. On which board did you test this code ?
Hi Gautier, I tested this on the crazybee f4fr pro (=stm32f4) of the eachine trashcan, with the spi bus connected to the pads of the desoldered max osd chip. |
I'm using the flow deck v2 and with crazyflie v2.1 (stm32f4) and the range sensor is working, so I guess the power on the board is correct. The chip select line seems to be correctly used and the transmitted values are the correct one. |
The range sensor uses only one of the two power pins, so it is not necessarily true that the optic flow sensor should also work then. Apart from that I have no idea what could be going wrong right now, I can take a closer look after the weekend. I would really like to be sure that the two voltages are present and correct. If that doesn't work, maybe adding a pull-down on miso changes anything? |
I checked the power levels and they seem to be all good for both of them. Some thing for the internal 1.8V regulator. This might also be a hardware issue on by sensor. I will try to test it with the original firmware. |
Fixed all comments. Will check if sensor still responds on my test setup with latest commit. Edit: I had to test it on my trashcan branch (here) because the crazybee board is not merged with master yet, but there it all seems to work fine. |
I reflashed the original firmware, but none of my decks are properly detected. Do you have any idea how to check that with crazyflie firmware ? From the doc, it tries to read the one wire memory chip, but in my case there is no reply at all. Even the multi-ranger, which is working for sure. |
@tomvand your crazybee board, is it using ChibiOS or libopencm3 ? I think the problem comes from the spi driver of ChibiOS that is not implementing (yet) the select/unselect option. |
@tomvand check the |
@tomvand did you get a chance to test with my modifications (https://github.com/paparazzi/paparazzi/tree/pmw3901mb-pr) ? I would like to merge this before the next release (soon) |
Will check and review changes this morning. edit: reviewed and tested, works well! Glad to hear it is actually flyable. Ready to merge. |
(bump because I'm not sure if edited comments show up as new) |
merged with 022e6ab |
This PR adds a driver for the PMW3901MB optic flow sensor as found on the bitcraze flowdeck.
I only have access to a bench setup right now, if anyone could flight-test this it would be highly appreciated (@gautierhattenberger?). The sensor readings appear very noisy so I'm curious how well it works in closed-loop.