PMW3901 speed

Hello,

I’ve looked at a few site and datasheets for the PMW3901 and found that the speed is listed as 7.4 rad/s. Why is rotational speed specified? I want to know the max X/Y speed for the PMW3901. Other optical flow sensors list the max IPS (inches per second). For example, the ADNS-3080 has max 40 IPS. Does anyone know the max IPS for the PMW3901?

Hi @finallyfunctional ,

because the sensor measures a flow rate, which is in rad/s. The maximum horizontal speed depends on the distance to the moving surface (e.g.: ground). So if you are at 1m, the maximum speed is 1x7.4 = 7.4m/s and if you are at 10m altitude, the maximum speed is 10x7.4 = 74m/s.

The ADNS-3080 is supposed to be in an optical mouse so it makes sense that they already converted the flow rate into IPS or m/s for some “typical” distance. Note that the value also depends on the optical lens used on the sensor.

This is how you can compute the equivalent ground velocity: PX4-Autopilot/optflow_fusion.cpp at fb3adc3faa9154a42a0bef35577bff1e8a95fd72 · PX4/PX4-Autopilot · GitHub
and the compensated optical flow is computed like that: PX4-Autopilot/optical_flow_control.cpp at fe80e7aa468a50bec6b035d0e8e4e37e516c84ff · PX4/PX4-Autopilot · GitHub

I am trying to gain a better understanding of how to obtain velocity using the PMW3901. I have read through the PX4 source code and want to use a simplistic example to verify whether or not I have the right idea.

Suppose my drone is flying straight and level in the PMW3901 X-axis direction at 10 meters altitude. For this example, there is no z- or y-axis variation and no gyro compensation is used.

If the PMW3901 reports delta_x = 10 during the PMW3901_SAMPLE_INTERVAL of 10mS, what is the drone speed in the X-axis direction?

Also, in the PMW3901 drive code, PX4-Autopilot/src/drivers/optical_flow/pmw3901/PMW3901.cpp, a scaling factor of 385.0 is used to compute delta_x and delta_y. Can you let me know where this value was obtained or derived?

Thank you.

vel = flow_rate * distance
and
flow_rate = delta_x / PMW3901_SAMPLE_INTERVAL.

Regarding the 385 scale factor, it’s given by the manufacturer to convert a register value to a “delta_x” flow.

1 Like