MechFlow V1 Optical Flow and Rangefinder Sensor

MechFlow V1 is a combined optical-flow and laser time-of-flight (ToF) rangefinder module built around a PixArt PMW3901 optical flow sensor and an ST VL53L1X ToF rangefinder, output over a single UART using the MSP v2 protocol. This can be used to improve horizontal position and altitude control especially in GPS denied or indoor environments.

../_images/mechflow_v1.jpg

Where to Buy

The sensor is available from The Mechintel Store.

Connection to Autopilot

../_images/mechflow_v1_wiring.png
  • The flow sensor should be mounted on the underside of the vehicle with the camera lens pointing downwards

  • MechFlow V1 exposes four signals: GND, 5V, RX and TX, available both on a 4-pin JST-SH 1.0mm connector (pin 1 to pin 4: GND, 5V, RX, TX) and on solder pads, so it can be wired to any autopilot’s UART port either with a JST-SH cable/adapter matching the autopilot’s connector, or by soldering directly to the pads. The GND/5V and auxiliary SPI pads are on the top (front) of the board with the lens; the TX/RX UART pads are on the bottom (back)

  • Connect module GND/5V to the autopilot’s peripheral power rail, module TX to a spare serial port’s RX pin, and (optionally) module RX to that same serial port’s TX pin

  • Only TX is required for normal operation. RX is reserved for a future configuration/passthrough mode and has no effect with current firmware, but can be wired now so it’s ready if that feature is added later

  • Supply voltage is 5V, drawn from the autopilot’s peripheral power rail. Do not exceed the rated voltage

../_images/mechflow_v1_back.jpg

TX/RX solder pads, underside of board

Parameters

For the following we will assume the sensor is connected to Serial2 of the autopilot. Any serial port can be used, however.

Once the sensor is active you should be able to observe the optical flow and range sensor data on Mission Planner’s “Status” page. The “opt_qua” and “rangefinder1” fields should show non-zero values.

Additional Notes

  • As with all optical flow sensors, a range finder is required to use the sensor for autonomous modes including Loiter and RTL. MechFlow V1’s onboard VL53L1X rangefinder, configured via RNGFND1_TYPE above, satisfies this requirement on its own — no separate rangefinder needs to be purchased or connected

  • FlowHold does not require the use of a rangefinder but performance is generally worse than Loiter mode and is not recommended

  • Performance can be improved by setting the sensor’s position parameters. For example if the sensor is mounted 2cm forward and 5cm below the frame’s center of rotation set FLOW_POS_X to 0.02 and FLOW_POS_Z to 0.05

  • The onboard VL53L1X completes a new rangefinder measurement roughly every 55ms, while MSP telemetry is output at a fixed 100Hz; the rangefinder value is therefore repeated across several telemetry frames between updates rather than refreshed on every frame

Testing and Setup

See Optical Flow Sensor Testing and Setup