ApplicationsApplication note

Tracking a moving target with a vision camera

The exposure rule, strobe arithmetic and smart-camera-versus-PC decision for tracking a moving target with a vision camera, with a worked example at 100 mm/s.

LumaSpec Vision11 min read Share on LinkedIn

On this page 10 sections
  1. 01What tracking asks of a vision system
  2. 02The exposure rule: blur limit divided by speed
  3. 03Worked example: exposure cap for a moving part
  4. 04When 1 ms goes dark: strobe, do not stretch
  5. 05Smart camera or camera plus PC
  6. 06Field of view, lead distance and the search region
  7. 07Latency: every coordinate is already old
  8. 08Set-up sequence and five failure modes
  9. 09Parts list and the fastest start
  10. 10Questions

Tracking a part as it moves — and handing its position to a PLC or robot on every frame — is a job a standard vision camera does well. Two things must hold: motion blur stays smaller than your position tolerance, and the search finishes before the next frame is due. The sections below give the exposure rule that decides whether tracking works at all, a worked example at 0.1 m/s line speed, the strobe arithmetic that rescues a dark image, and the latency correction that keeps reported coordinates honest. It is written for engineers wiring a camera to a moving target: conveyor guidance, feeding a pick-and-place, press loading or gate sorting.

What tracking asks of a vision system

Tracking is not inspection. An inspection station can miss frames without harm; a tracking loop cannot, because a missed frame is a stale coordinate. Each cycle the system has to find a known target — a printed pattern, a machined edge, a fiducial, a code — convert its position into coordinates the controller understands, and pass them on with a valid flag before the next frame is due. Robot guidance closes that loop in milliseconds; the 2D vision-guided pick-and-place cycle shows the full handshake.

Two hardware routes cover nearly every case. A smart camera or vision sensor runs the search on the device itself and hands out coordinates over Ethernet, serial or its own digital I/O; starting routines by GPIO or serial input needs no PC at all. An area scan camera with a PC costs more engineering but scales to higher sustained rates, several cameras and custom algorithms.

The exposure rule: blur limit divided by speed

Blur is the price of time. The target moves while the sensor integrates, so smear equals speed times exposure: at 0.1 m/s, every millisecond of exposure costs 0.1 mm of smear. Set the exposure cap from the smear you accept — your position tolerance for tracking, or one pixel when the matcher works sub-pixel edges:

blur = v × t_exp t_max = d_blur / v (cap from the tolerance) s = FOV / N_px (mm per pixel on the target) t_1px = s / v (cap for a one-pixel smear)

Use the tighter of the two caps, and use a global shutter: a rolling shutter reads the sensor row by row and skews a translating target. The mechanics sit in exposure time versus shutter speed for moving parts, and the reason short exposures run out of light — and what to do about it — in why camera exposure time has a maximum limit.

Worked example: exposure cap for a moving part

The inputs: belt speed 100 mm/s and placement tolerance ±0.5 mm (the tracking case this guide is sized around), plus a 120 mm field of view along the direction of travel on a 12 MP sensor with 4,000 pixels across it (the layout assumed here). Rule in words: the exposure cap is the accepted smear divided by the speed, and the accepted smear in millimetres is the pixels you tolerate times the millimetres per pixel.

  • Image scale: 120 mm ÷ 4,000 px = 0.03 mm/px.
  • Tolerance ceiling: 0.5 mm ÷ 0.1 m/s = 0.005 s = 5 ms.
  • One-pixel ceiling: 0.03 mm ÷ 0.1 m/s = 0.0003 s = 0.3 ms.
  • At the chosen 1 ms: smear = 0.1 m/s × 0.001 s = 0.1 mm, that is 0.1 ÷ 0.03 ≈ 3.3 px.
  • The tolerance itself spans 0.5 ÷ 0.03 ≈ 17 px.

Result: a 1 ms exposure smears the target 3.3 px — five times inside the 5 ms ceiling and far inside the 17 px tolerance. Decision: set 1 ms or shorter, and treat 5 ms as the hard ceiling at this speed, because beyond it the smear alone equals the tolerance. If the 1 ms image comes out dark, keep the short exposure and strobe; do not buy brightness back with exposure time.

Sizing the sensor the other way round — a 120 mm field over a 0.1 mm resolution goal needs 120 ÷ 0.1 = 1,200 px as the floor — is what the calculator below does:

Camera resolution for the smallest feature
Units
Pixels needed
–
Sensor size
– MP
Smallest sensor that fits
–
Pixel on the part
– mm
Pixels across the feature, that sensor
–

Pixels needed = field / feature × pixels per feature on each axis (field incl. margin). The lens must resolve the pixels too: Nyquist = 1000 / (2 × pixel µm) lp/mm.

Find cameras with enough pixels Open the full calculator

When 1 ms goes dark: strobe, do not stretch

Short exposures starve the sensor of photons, and a 1 ms image under factory lighting is often too dim for a confident match. Two fixes exist and only one keeps the blur down: add constant high-power LED light, or fire a strobed pulse inside the exposure. With a strobe, the pulse width becomes the effective exposure — a 0.3 ms pulse at the worked speed smears the target 0.03 mm, one pixel, however long the sensor integrates. Set the sensor exposure slightly longer than the pulse and fire the pulse inside it; how strobe pulse width freezes motion blur works through the timing, and LED strobe rise time adds its own microseconds — at 0.1 m/s a 20 µs rise costs just 0.002 mm, though it grows into real smear at metres-per-second speeds.

Strobing pays twice: the target is lit only during the pulse, so most ambient light never reaches the exposure, and measuring ambient rejection tells you how much you gained. A smart camera can drive the light from its own strobe output; enabling it and wiring the light is a short job. Otherwise a strobe-capable controller such as the LS-CTL-0070 (4 channels, 200 W, RS-232 control, strobe feature) keeps pulse and camera trigger on one timing chain.

Light controllersDigital control box, 4 ch, 200 W, RS232 (LS-CTL-0070)LS-CTL-0070
Output
Constant voltage 24 V
Channels
4 channels
Control
Digital
Feature
Strobe
$549.00View partBuild a system with it

Smart camera or camera plus PC

Smart camera / vision sensor Area camera + PC
Search runs on the camera itself a PC you program
Handoff to the controller built-in Ethernet, serial, discrete I/O you write it (SDK, TCP)
Sustained rate tens of fps set by the interface: GigE, USB3, 10GigE, CoaXPress
Cameras per system one device per station many per PC
Algorithms built-in tools anything you can code
Commissioning effort days weeks

Pick the on-device route when one camera watches one target, the built-in pattern, blob and code tools find it, and your PLC wants coordinates over Ethernet, serial or discrete I/O. Pick the camera-plus-PC route for more than roughly 60 fps of sustained tracking, several cameras on one controller, a custom matcher or a robot hand-eye calibration; the PC side documents its own moving-target tools, for example configuring moving edge tracking in a machine-vision library.

On the on-device side, the MV-SC3050XC-16M-ATN-H vision sensor pairs a 5 MP color sensor (1/1.45", global shutter) with an M12 mount over Fast Ethernet. On the PC side, the MV-CU020-90GC gives 2.5 MP color on GigE (global shutter, 1/1.7" sensor, C-mount), and the MV-CH120-11UC raises that to 12 MP on USB3 (IMX304 sensor, 1.1" format, C-mount, global shutter, high-speed version). All three hold a global shutter, which the blur rule asked for:

Smart cameras & vision sensorsHikrobot MV-SC3050XC-16M-ATN-H 5 MP color vision sensorMV-SC3050XC-16M-ATN-H
Interface
Fast Ethernet
Resolution
5 MP
$1,809.00View part
Area scan camerasHikrobot MV-CU020-90GC 2.5 MP Area Scan Camera, GigE, GMAX4002, ColorMV-CU020-90GC
Sensor format
1/1.7"
Lens mount
C-mount
$309.00View part
Area scan camerasHikrobot MV-CH120-11UC 12 MP Area Scan Camera, USB3, IMX304, High-speed version, ColorMV-CH120-11UC
Sensor format
1.1"
Lens mount
C-mount
$2,339.00 · quotedView and quote

Browse the camera finder by pixels, interface and shutter, or configure a camera straight from your speed and tolerance.

Field of view, lead distance and the search region

The camera must hold the target from trigger to handshake, so the field of view along the travel direction needs a lead margin:

FOV_travel ≥ L_target + 2 × v × t_age

t_age is the coordinate age — exposure, readout, processing, transfer and handshake — budgeted at about 55 ms in the next section. Arithmetic at the worked numbers: 0.1 m/s × 0.055 s = 5.5 mm of travel per side, so a 40 mm part needs 40 + 11 = 51 mm at minimum; specify 60 mm. At 0.03 mm/px that is 60 ÷ 0.03 = 2,000 px across — half the worked sensor, leaving the rest for lateral drift and search margin. Choose the focal length that delivers that field at your working distance with the lens focal length calculator, then lock focus.

How sensor width, working distance and field of view set the focal length Rays from the edges of the sensor pass through the lens and spread to the edges of the field of view. The ratio of sensor width to field of view is the magnification m.CameraField of view (FOV)Working distance (WD)≈ fsensor width slensm = s / FOVf = WD × m / (1 + m)
How sensor width, working distance and field of view set the focal length. Rays from the edges of the sensor pass through the lens and spread to the edges of the field of view. The ratio of sensor width to field of view is the magnification m.

Keep the search region a band around the last found position plus the predicted motion, not the whole frame. Search time scales with the area searched, so shrinking the search to speed the update rate is the standard fix when the loop sags, and search region versus position region separates the two jobs. A target larger than the view is its own problem; template matching a part larger than the field of view shows the way around it.

Latency: every coordinate is already old

By the time the controller applies your coordinate, the part has moved on. Budget the age honestly — at 30 fps: 33 ms frame period, 1 ms exposure, about 15 ms search, 5 ms transfer and handshake, so 54 ms in round numbers — then correct before use:

x_now = x_found + v × t_age

At the worked speed the correction is 0.1 m/s × 0.054 s ≈ 5.4 mm, the same travel that sized the field of view. Skip it and a perfect camera still hands the robot a part that is already gone. Two refinements tighten it. Trigger frames from a conveyor encoder instead of the clock and the age stops growing with speed — the camera trade-offs sit in sorting conveyor camera selection: pixels, speed and blur. And know what a blurred frame reports: the centroid of a smeared target sits about half a smear behind the true edge, 0.05 mm here, small against a 0.5 mm tolerance but growing with exposure and speed. Handing a target between stations is its own protocol; conveyor target acknowledgment at tracking position rollover covers it.

Set-up sequence and five failure modes

  1. Fix the geometry: field of view from the lead calculation, working distance from the layout, focal length from the calculator above; lock focus.
  2. Set exposure from the blur rule and gain from a grey target; turn auto exposure and auto gain off.
  3. Capture the template from a stationary part or a strobed moving frame — never from a blurred image, or every later match inherits the smear.
  4. Constrain the search region to the predicted band and prove it at maximum line speed, not nominal speed.
  5. Sync trigger and strobe so the pulse lands inside the exposure window; a pulse outside it returns a black frame or an ambient-only double image.
  6. Calibrate camera coordinates into PLC or robot coordinates with a known target; setting a coordinate system to a circle center walks the transform and keeps a round fiducial usable while it moves.
  7. Verify at speed: park a reference target and log reported versus true position, then run the line and compare against the predicted-position formula.

Five failures account for most troubled installs. Rolling shutter skew leans verticals as the part crosses the view — track with a global shutter. Auto modes drift the image and the correlation with it; contour position jitter under auto exposure is the classic symptom, and the standing fix is turning every auto mode off. A strobe firing outside the exposure window wastes the pulse (step 5). A template captured under one lighting shifts when the lighting shifts; edge-based pattern matching holds up better across light changes. And a correction computed for one line speed goes stale the moment the speed changes — recompute it.

Parts list and the fastest start

  • Camera: global shutter, with at least 2,000 px across the travel-direction field in the worked case.
  • Lens: the focal length that delivers that field at your working distance.
  • Light: strobe-capable LED matched to the part size; light controllers drive it — the light controller finder filters by channels, control and strobe, and the controller configurator narrows to a model.
  • Trigger and sync: proximity sensor or encoder plus the strobe line.

If the cell is compact and one target is the whole job, an integrated smart camera closes the loop fastest. The LS-SMC-0063 carries its own white light and a 16 mm lens, runs 1.6 MP at 60 fps over GigE, and the series includes polarized and transparent-light variants.

Smart cameras & vision sensors1.6 MP smart camera, 60 fps, 16 mm lens, white light (polarized, transparent light) (LS-SMC-0063)LS-SMC-0063
Interface
GigE
Resolution
Up to 3 MP
$1,110.00View part

Send the speed, tolerance and envelope and we will shortlist camera, lens and lighting — expert support is included with every order — or start at the contact page. The rest of the tracking and guidance work sits under the applications topic.

Questions

What frame rate do I need to track a moving target?

Size it from the tolerance: frames must be close enough that the part moves less than your tolerance between updates, so fps ≥ speed ÷ tolerance. A ±2.5 mm sorting gate at 0.1 m/s needs 100 ÷ 2.5 = 40 fps. A ±0.5 mm robot pick needs 200 fps, which few searches sustain, so run 30 to 60 fps and predict position between frames, or trigger frames from an encoder instead of the clock.

Do I need a global shutter camera to track motion?

A rolling shutter reads the sensor row by row, so a target crossing the view during readout comes out skewed: vertical edges lean by the distance travelled during the read. A global shutter grabs all rows at once and avoids that. For slow lines the skew can stay under tolerance; image a ruler moving at line speed and look at the verticals before you decide.

How do I get the tracked coordinates into my PLC or robot?

Vision sensors and smart cameras hand over coordinates by Ethernet protocol, serial link or a discrete handshake — a position-valid bit plus the value in agreed units. PC systems stream results over GigE or USB3 and you write that interface. Define the contract early: which frame the value belongs to, the units, the angle convention, and what the valid bit does when the search fails.

Why does my tracker lose the target when the lighting changes?

Auto exposure and auto gain rescale the image as line lighting drifts, and correlation against a fixed template falls with them. Turn every auto mode off, set exposure from the blur limit and gain from a grey target, then control the ambient: shroud the station or strobe over it. Re-check the set-up after lamp replacement or a seasonal light change.

Can a vision camera track several targets at once?

Yes. One pattern search returns several instances per frame and a blob tool can follow many parts together. Compute time grows with the search area and the instance count, so keep the regions tight and step down to a smaller template if the update rate sags. When targets cross or occlude, identity hand-off needs extra logic, because matching alone cannot tell two identical parts apart.