-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[WIP] PMW3901 page (optical flow) #559
[WIP] PMW3901 page (optical flow) #559
Conversation
TODO before merging:
|
Moreover I'm not sure if the small module from TIndie is actually designed by them. We need to check this to put the right name of the manufacturer |
@DanielePettenuzzo in terms of cabling and adaptors: you have schematics for connecting on the Pixhawk 4. My question is, from these sensors, which ones do require some specific wiring and buy out adaptor plugs to connect to the Pixhawk 4 pins? Or do they bring already the required cabling? That should be something to be documented as that would help people understand if they need to buy extra plugs and cabling to connect it to the Flight Controller. |
And we recently made changes to the pixracer board config to be able to get a SPI port on the WIFI port. We should also add a small section about this because it's a very small (in terms of size) setup. |
@TSC21 except for the HEX uavcan module I think the other 3 don't come with the wire and the user will have to solder a cable for it. Yes I agree that we need to specify this |
Also see PX4/PX4-Autopilot#12738 and PX4/PX4-Autopilot#12477 (comment) |
en/sensor/pmw3901.md
Outdated
# PMW3901 Flow Sensor | ||
|
||
PMW3901 is an [optical flow](../sensor/optical_flow.md) asic that computes the flow internally and provides a difference in pixels between | ||
each frame over a SPI interface. It is basically a tracking sensor similar to what you would find in a computer mouse, but adapted to work between |
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.
"an SPI" (FYI, the rule in English is that the "an" is used before word that sounds like it has a vowel first. So "an esssPI").
en/sensor/pmw3901.md
Outdated
# PMW3901 Flow Sensor | ||
|
||
PMW3901 is an [optical flow](../sensor/optical_flow.md) asic that computes the flow internally and provides a difference in pixels between | ||
each frame over a SPI interface. It is basically a tracking sensor similar to what you would find in a computer mouse, but adapted to work between |
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.
People do search on component part numbers, but they just as much (or more) look for products. So it is worth highlighting the relevant products as early as possible.
I know you have a list below, so we could forward reference it - e.g. after the sentence ending in "SPI interface" have another one. The PMW3901 is used in a number of products including Bitcraze, x, y, z - see full listing below.
en/sensor/pmw3901.md
Outdated
|
||
### Bitcraze | ||
|
||
The Bitcraze optical flow module exposes directly the SPI interface from the PMW3901 module. The board also has a distance sensor that can be wired via I2C. This distance sensor is the VL53L0x ToF sensor for STMicroelectronics. The range of the sensor is very limited (2 meters) and will be reduced when flying in the sunlight. We therefore highly recommend to use another external distance sensor. This board was mainly tested with the [Lidar Lite V3](../sensor/lidar_lite.md) on larger vehicles and with the [Lanbao CM8JL65](../sensor/cm8jl65_ir_distance_sensor.md) on smaller vehicles. |
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.
Not essential, but consider putting each sentence on a new line. Makes things slightly easier for translators.
en/sensor/pmw3901.md
Outdated
|
||
### Bitcraze | ||
|
||
The Bitcraze optical flow module exposes directly the SPI interface from the PMW3901 module. The board also has a distance sensor that can be wired via I2C. This distance sensor is the VL53L0x ToF sensor for STMicroelectronics. The range of the sensor is very limited (2 meters) and will be reduced when flying in the sunlight. We therefore highly recommend to use another external distance sensor. This board was mainly tested with the [Lidar Lite V3](../sensor/lidar_lite.md) on larger vehicles and with the [Lanbao CM8JL65](../sensor/cm8jl65_ir_distance_sensor.md) on smaller vehicles. |
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.
for or "from" STMicroelectronics?
en/sensor/pmw3901.md
Outdated
|
||
### Bitcraze | ||
|
||
The Bitcraze optical flow module exposes directly the SPI interface from the PMW3901 module. The board also has a distance sensor that can be wired via I2C. This distance sensor is the VL53L0x ToF sensor for STMicroelectronics. The range of the sensor is very limited (2 meters) and will be reduced when flying in the sunlight. We therefore highly recommend to use another external distance sensor. This board was mainly tested with the [Lidar Lite V3](../sensor/lidar_lite.md) on larger vehicles and with the [Lanbao CM8JL65](../sensor/cm8jl65_ir_distance_sensor.md) on smaller vehicles. |
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.
What is a reasonable range/good range for a distance sensor?
The Hex optical flow module is a very small board containing the PMW3901 flow module, the VL53L1X distance sensor and an IMU to better synchronize the flow data with the gyro data. These three sensors are then sampled by a microcontroller onboard. The goal of the microcontroller is to then expose 2 UAVCAN messages containing all the necessary data. | ||
|
||
This board can be connected to the CAN port on any Pixhawk board. All tests were performed connecting it to the CAN1 port on a Pixhawk 4. Differently from the other sensors, this one needs UAVCAN running on PX4. To enable UAVCAN you will have to set the UAVCAN_ENABLE parameter to 2 (if you have have UAVCAN sensors but no motor controllers) or to 3 (if you have also your motor controllers on CAN). | ||
|
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.
If I use an external distance sensor, is there anything special I need to do to make sure that PX4 properly fuses the external one rather than using the inbuilt one that comes with UAVCAN message?
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.
not sure anymore. I need to check this one
This is a great start at getting the information and makes it very easy to compare the different options. The problem for me is that this doesn't quite fit into the existing docs structure. My thinking is that generally you want to be able to look at the to level optical flow page to get a good idea of the options and any common setup, then drill down to more detail. The detail pages then link back up to the top page for the common setup. The reason that works is that it is obvious how you extend when new things come along So what I'd kind of like to do is pull this apart.
Does that make sense? |
|
||
### Thone | ||
WORK IN PROGRESS | ||
|
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've also tested this board, the Alientek atk-PMW3901 https://www.aliexpress.com/i/32979605707.html
Had to reverse-engineer some pinouts, only trust the SPI pinouts and V+/GND
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.
@jkflying Further down your linked page they had this:
Does that help you with the missing pins?
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.
Those are the pins on the parent board this is mounted to, and reflect the labels of the schematic/microcontroller on the other side. There are a bunch of CS lines for example, I had to trace the circuit board to figure out which one is the real one on this board. Other pins like the VCC and the VUSB they have don't work as power supplies.
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.
Thanks. I've sorted by just showing the SPI pins in the connection diagram in other doc. Have included your doc too "for the moment".
@jkflying Can you confirm that you saying zero rotation is when the board is aligned on the vehicle with that notch facing the back? ie Is this the recommended rotation? (for PX4FLOW the recommendation is 270) |
Yes
I don't think it has a 'recommended' orientation. Any should work fine, as long as SENS_FLOW_ROT is correct. |
@DanielePettenuzzo Can you address the comments/questions please? |
@hamishwillee regarding the SENS_FLOW_ROT being default to 270 for the PX4 Flow this is because with this rotation the forward facing arrow that is drawn on the module will be aligned with the orientation of the autopilot. |
@hamishwillee I addressed all your questions/comments and pushed a new commit. I still didn't change the structure since I was super busy lately. Would you have time to change the structure to what you think is best and then I can go in and add all the missing parts. |
@DanielePettenuzzo Thanks very much. I don't think I can alter structure while it is on your repo - can you push to this repo and change what the PR is comparing? Then yes, I can play with this! |
replaced by: #580 |
In PX4 we are now supporting several optical flow boards based on the PMW3901 sensor:
The goal of this page is to compare the 4 types of boards and then to be able to use the selected one with PX4.
This is not finished. The page still has the PX4FLOW youtube video because I'm trying to find some PMW3901 videos that I took a few months ago. The diagrams are hand made by me and can be improved.
FYI @hamishwillee @jkflying @mhkabir