Optical flow sensor

On this page 7

An optical flow sensor is a small downward-facing camera with its own processor that measures how the texture of the ground appears to move between consecutive frames and converts that motion into an estimate of horizontal velocity. In drones, it is one of the core navigation & sensors components that keeps a multicopter holding position indoors, at low altitude or without satellite reception.

The sensor does not know where the aircraft is on a map. It reports how fast the image is sliding, and the flight controller combines that with height above the ground and gyroscope data to work out lateral speed in meters per second. Drift is then corrected by a velocity control loop rather than by absolute coordinates.

How an optical flow sensor measures motion

An optical flow sensor estimates velocity by comparing successive low-resolution images of the surface below and finding how far patterns have shifted. The classic designs descend from optical mouse chips: a tiny image array, often only 30 x 30 pixels, sampled at hundreds to several thousand frames per second, with on-chip correlation that outputs a pixel shift in X and Y for each interval.

A pixel shift alone is an angular rate, not a speed. The flight controller must apply two corrections. First, it subtracts the image motion caused by the aircraft rotating rather than translating, using the gyroscope; a pitch change of a few degrees makes the ground appear to slide even when the drone is stationary. Second, it multiplies the corrected angular rate by the distance to the ground, usually supplied by a co-located rangefinder such as a time-of-flight or ultrasonic module.

The basic relationship is simple: lateral velocity equals flow rate times height. The same 1 degree per second of flow means about 1.7 centimeters per second at 1 meter and about 17 centimeters per second at 10 meters, which is why height accuracy directly limits velocity accuracy.

The table below lists the main parts of a typical optical flow module and what each contributes to the estimate.

ComponentTypical specificationRole in the estimate
Image sensor30 x 30 to 64 x 64 pixelsCaptures ground texture for correlation
LensNarrow field of view, about 40 to 45 degreesSets angular resolution per pixel
Flow processorHundreds to thousands of frames per secondComputes pixel shift and quality value
RangefinderEffective to about 2 to 8 m indoorsScales angular flow into meters per second
Gyroscope (in the flight controller)Rotation rate at high sample rateRemoves flow caused by body rotation
Components of an optical flow module

Key parameters and operating limits

The performance of an optical flow sensor depends less on resolution than on surface texture, light level and height. Most modules report a quality metric, typically from 0 to 255, that tells the flight controller how much trust to place in each reading; navigation filters usually reject data below a configured quality threshold.

The following table summarizes the parameters that most strongly affect reliability and what values are typical for consumer and hobby hardware. Exact figures vary by chip and lens, so treat the ranges as orientation rather than guarantees.

ParameterTypical working rangeWhat happens outside it
Height above groundAbout 0.1 to 8 m, best below 3 mFlow becomes too small to resolve
IlluminationIndoor lighting or betterNoise rises and quality drops
Ground textureVisible grain, patterns or contrastCorrelation fails on blank surfaces
Maximum flow rateSeveral radians per secondFast motion causes saturation
Update rate to controllerCommonly 10 to 100 HzSlow updates weaken drift correction
Parameters that govern optical flow reliability

Some systems add infrared illumination to work in dim rooms, and some carry a separate gyroscope on the module to reduce timing mismatch. Integration with an extended Kalman filter, as in common open-source autopilots, lets the aircraft blend flow with inertial data and fall back gracefully when quality degrades.

How optical flow compares with other drone positioning methods

Optical flow is a relative velocity sensor, which separates it from systems that deliver absolute position. It complements rather than replaces GNSS, and it is simpler than full camera-based localization. Neighboring Terms in this Topic, such as the vision positioning system and visual-inertial odometry, build on the same principle with more cameras and more computation.

The comparison below places optical flow alongside the other methods a drone may use to stay where the pilot left it.

MethodOutputStrengthMain weakness
Optical flow sensorRelative velocityLow cost, works without satellitesNeeds texture and low altitude
GNSS receiverAbsolute positionGlobal coverage outdoorsFails indoors and near structures
RTK GNSSAbsolute position to centimetersSurvey-grade accuracyNeeds correction data link
Vision positioning systemVelocity and heightStereo depth adds robustnessStill depends on light and texture
Visual-inertial odometryFull pose estimateWorks at greater heightsHigher processing load and drift over time
Optical flow versus related positioning methods

In practice, many consumer aircraft package a downward flow camera with a time-of-flight or ultrasonic rangefinder and market the combination under a single positioning label. The physics underneath remains the flow-times-height calculation described above.

Installing and tuning an optical flow sensor

Correct installation determines whether an optical flow sensor helps or harms flight stability. The module must face straight down with a clear view, sit away from propeller wash that throws dust, and be oriented to match the axes the firmware expects; a rotated or mirrored mounting produces velocity estimates with the wrong sign, which turns position hold into an accelerating drift.

On open autopilots, setup usually involves a few steps that confirm the data before trusting it in flight.

  1. Mount the module and rangefinder rigidly, with minimal vibration and no obstruction from landing gear.
  2. Set the sensor orientation and enable it as a velocity source in the navigation filter.
  3. Rock the aircraft by hand and confirm that gyro compensation cancels rotation-induced flow.
  4. Run a short calibration flight and adjust the flow scaling factor until estimated and actual movement agree.
  5. Set the minimum quality threshold so that poor readings are rejected rather than used.

The decision table below helps choose when to rely on flow and when to prefer another source.

SituationRecommended sourceReason
Indoor warehouse inspectionOptical flow with rangefinderNo satellite signal, textured floor
Hover over calm waterGNSS or manual controlMoving surface gives false flow
Mapping flight at 100 mGNSS or RTKFlow cannot resolve at that height
Low pass under a bridgeOptical flow as backupGNSS multipath and signal loss
Night flight over dark grassAvoid flow-based holdToo little light and contrast
When optical flow is the right choice

Failure modes and common misconceptions

Most optical flow problems come from the surface or the light, not from the electronics. Pilots who understand the failure modes can predict when position hold will become unreliable and take manual control early.

  • Featureless surfaces such as polished floors, snow or uniform carpet give the correlator nothing to track, so the drone slowly wanders.
  • Water and moving grass create apparent motion that is not the aircraft moving, which can push the drone in the wrong direction.
  • Reflections and flicker from mains-powered lighting may produce noisy flow values on some sensors.
  • Climbing too high shrinks the flow signal below the noise floor; height hold may still work while lateral hold fails.
  • A common misconception is that optical flow gives absolute position. It integrates velocity, so position error accumulates over long hovers.
  • Another misconception is that more pixels always help. Texture and frame rate matter far more than resolution for this task.

When a drone switches unexpectedly from flow-based hold to an attitude-only mode, the cause is usually a quality drop below threshold. Recognizing that warning and keeping distance from obstacles is the safest response.

The short version

An optical flow sensor is a tiny camera under the drone that watches the floor. If the floor seems to slide to the left, the drone knows it is drifting to the right and pushes back. This is the same idea a computer mouse uses to follow your hand across a desk.

The key takeaway is that it measures movement, not location. It works best close to the ground, in decent light and over a surface with some pattern. Over plain white tiles, water or in the dark, it loses its grip, and the drone may start to wander.

Where it makes a difference

A facility manager uses a small quadcopter to inspect high shelving inside a steel-roofed warehouse, where no satellite signal reaches the aircraft. The drone carries an optical flow camera and a time-of-flight rangefinder and flies at about 2 meters above a concrete floor marked with painted lines and tire scuffs, which gives the sensor plenty of texture.

With flow-based hold enabled, the pilot can stop beside a rack, release the sticks and photograph labels while the aircraft drifts by only a few centimeters. When the route crosses a freshly sealed, glossy section of floor, the quality value drops and the drone begins to slide; the pilot recognizes the warning and moves back over the textured area. The outcome is a complete inspection in about 15 minutes without ladders or a lift, and the team adds the glossy zone to its pre-flight briefing.