Flight controllers
Settings for PX4, ArduPilot, Betaflight and INAV.
Flow Lite finds out what it is connected to and speaks that language. On CAN it joins a DroneCAN bus at the bit rate it hears. On the UART it recognises the flight controller and switches format by itself.
Tested with PX4 1.17, Betaflight 2026.6 and INAV 9.1.
Check the readings on the bench with propellers off. Make the first flight low, in an open area, and be ready to switch to a mode that does not use optical flow.
PX4 over CAN#
- Connect Flow Lite's CAN port to the autopilot's CAN port. The autopilot needs an SD card fitted.
- In QGroundControl, set
UAVCAN_ENABLEto 2, or 3 if you also use DroneCAN ESCs. - Reboot the autopilot.
- Set the parameters below, then reboot again.
| Parameter | Value | Why |
|---|---|---|
UAVCAN_SUB_FLOW | 1 | Use the flow from the bus |
UAVCAN_SUB_RNG | 1 | Use the range from the bus |
UAVCAN_RNG_MIN | 0.01 | PX4 takes the range limits from here, not from the module |
UAVCAN_RNG_MAX | 6 | As above, in metres |
EKF2_OF_CTRL | 1 | Fuse optical flow |
EKF2_RNG_CTRL | 1 | Use range for height at low altitude |
SENS_FLOW_MINHGT | 0.08 | Lowest height at which flow is used, in metres |
SENS_FLOW_MAXR | 7.4 | Highest flow rate, in rad/s |
These are the PX4 1.17 names. Some later versions number the flow settings, for example EKF2_OF0_CTRL and SENS_FLOW0_MAXR.
To check, open the MAVLink Inspector in QGroundControl and look for flow and distance readings. Flow arrives at 100 Hz and range at 40 Hz.
ArduPilot over CAN#
Flow Lite connects the same way as HereFlow and ARK Flow.
- Connect Flow Lite's CAN port to the autopilot's CAN port.
- Set the parameters below in Mission Planner.
- Reboot the autopilot.
| Parameter | Value | Why |
|---|---|---|
CAN_P1_DRIVER | 1 | Turn on the first CAN port |
CAN_D1_PROTOCOL | 1 | DroneCAN |
FLOW_TYPE | 6 | Optical flow over DroneCAN |
RNGFND1_TYPE | 24 | Rangefinder over DroneCAN |
RNGFND1_ADDR | 0 | Flow Lite's rangefinder id |
RNGFND1_ORIENT | 25 | Facing down |
RNGFND1_MAX | 6 | In metres. Older versions use RNGFND1_MAX_CM = 600 |
To check, open the Status tab on Mission Planner's Flight Data screen. opt_m_x, opt_m_y and opt_qua should change as you move the vehicle over a textured surface, and the rangefinder distance should follow its height.
To hold position on flow without GPS, set the EKF sources:
| Parameter | Value | Why |
|---|---|---|
EK3_SRC1_POSXY | 0 | No horizontal position source |
EK3_SRC1_VELXY | 5 | Horizontal velocity from optical flow |
EK3_SRC1_POSZ | 1 | Height from the barometer |
EK3_SRC1_VELZ | 0 | No vertical velocity source |
EK3_SRC1_YAW | 1 | Heading from the compass |
With flow as the only horizontal source, ArduPilot does not climb above RNGFND1_MAX in Loiter. ArduPilot's optical flow setup page covers the test flights.
Betaflight over UART#
For Betaflight 2026.6.
- Connect Flow Lite's UART port to a free UART.
- On the Ports tab, turn on MSP at 115200 for that UART.
- Run these in the CLI:
feature RANGEFINDER
feature OPTICALFLOW
set rangefinder_hardware = MTF01
set opticalflow_hardware = MT
saveWithout the two features, the sensors are detected but never read.
INAV over UART#
- Connect Flow Lite's UART port to a free UART.
- On the Ports tab, turn on MSP at 115200 for that UART.
- Run these in the CLI:
set opflow_hardware = MSP
set rangefinder_hardware = MSP
saveThen calibrate opflow_scale, once per installation. With propellers off, open the Calibration tab in INAV Configurator and choose Calibrate Optic Flow sensor. For the next 30 seconds, hold the model over a textured surface and tilt it from side to side without moving it horizontally. INAV works out opflow_scale from this.
ArduPilot and PX4 over UART#
CAN is the better link where a CAN port is free. Both can also read Flow Lite as MAVLink 2 at 115200, through the three-wire adapter described in Get started.
On ArduPilot, where x is the serial port:
| Parameter | Value | Why |
|---|---|---|
SERIALx_PROTOCOL | 2 | MAVLink 2 |
SERIALx_BAUD | 115 | 115200 baud |
FLOW_TYPE | 5 | Optical flow over MAVLink |
RNGFND1_TYPE | 10 | Rangefinder over MAVLink |
RNGFND1_ORIENT | 25 | Facing down |
On PX4, start a MAVLink instance on the serial port at 115200.