System designHow-to

Sensor triggered line scan start with encoder-driven capture

Start a line scan capture from a gap sensor and let the quadrature encoder clock the lines: triggered wiring, frame height, sensor delay and a 12 kHz example.

LumaSpec Vision13 min read Share on LinkedIn

On this page 13 sections
  1. 01How the two triggers divide the work
  2. 02What you need
  3. 03Wire the signals
  4. 04Set it up in order
  5. 05Worked example: sizing the divider and line rate for a 1.2 m/s web
  6. 06If the camera has no encoder input
  7. 07Handle the sensor edge
  8. 08Light for the line period
  9. 09Verify it worked
  10. 10Common mistakes
  11. 11When the usual answer is wrong
  12. 12Pick the parts
  13. 13Questions

On a line that delivers parts separated by gaps — cut sheets, spliced rolls, trays between products — a free-running line scan camera mostly photographs empty belt. The fix is a two-signal trigger chain: a gap sensor arms each capture, and a quadrature encoder clocks out the lines so every image stays square to the web at any speed. This guide is for the integrator holding a photoelectric sensor, an incremental encoder and a line scan camera, wondering which wire goes where. You will wire both signals, set the trigger configuration in the camera, size the encoder divider and the resulting line rate for a 1.2 m/s web, absorb the sensor's response time as a line delay, and confirm with a taped mark that part after part lands in the same rows.

How the two triggers divide the work

A line scan system uses two trigger types. A frame trigger starts a new image; a line trigger clocks each individual line, and on moving material it comes from an encoder. Both functions sit behind one camera parameter: the Trigger Selector selects the trigger function, with a Line Start trigger for the per-line pulses and the frame trigger function for the start of an image. The decision follows: put the gap sensor on the frame-start (arm) input, put the divided encoder signal on the line-start input, and set frame height — the number of lines per image — in software. The sensor then costs nothing until a part arrives, and the encoder keeps geometry exact even when line speed wanders.

The encoder half — differential pairs, ×4 decoding, direction — is wired in Encoder-triggered line scan capture: wiring quadrature inputs. The camera-side pacing math is in How to set the line rate of a line scan camera.

A line scan camera building an image line by line The camera images one thin line of the moving web per exposure, lit by a line light. An encoder on the conveyor triggers each line so the pixels stay square at any speed.one line per exposureLine scanline lightweb speed vencoderline rate = v / object pixelexposure < 1 / line rate
A line scan camera building an image line by line. The camera images one thin line of the moving web per exposure, lit by a line light. An encoder on the conveyor triggers each line so the pixels stay square at any speed.

What you need

  • A line scan camera whose I/O connector exposes a frame-start input and a line-start or encoder input — read the I/O pinout, not just the sensor headline
  • An incremental encoder with A/B quadrature outputs, coupled to a measuring roll that turns with the web
  • A photoelectric gap sensor with a discrete PNP or NPN output, aimed at the gap
  • A frame grabber only when the camera has no encoder input or you want a hardware pre-event buffer
  • A light controller if the light will strobe during the armed window instead of running continuously
  • Shielded I/O cable, the camera's breakout board, and a 24 V supply for sensor and encoder

Wire the signals

Signal Lands on What it does
Gap sensor output Frame-start (arm) input Rising edge starts one capture
Encoder A+ / A− Line-start input, phase A Each accepted tick advances one line
Encoder B+ / B− Phase B input, if fitted Direction sense for a reversing web
Frame-active output Strobe input of the light, optional Lights only the captured window

Encoder signals are differential pairs: land A+ with A− and B+ with B− on their own inputs, keeping the twists intact to the terminals. If the web never reverses, phase A alone clocks the lines and phase B stays spare. Match the decode setting (×1, ×2 or ×4) once, because every number downstream assumes it.

Sensor signals are single-ended 24 V logic. They belong on an opto-isolated input wired as the camera's I/O drawing shows, never on the encoder phase inputs. Route sensor and encoder cables away from motor and drive cables, and ground the shields at one end.

Set it up in order

  1. Arm trigger. With the Trigger Selector on the frame trigger function, enable it, source it to the sensor input, and set activation to the sensor's rising edge.
  2. Line trigger. Switch the Trigger Selector to the Line Start trigger function, enable it, source it to the encoder input, activation on rising edge.
  3. Frame height. Set lines per image in the camera or acquisition software; the worked example below uses 1500.
  4. Start delay. Add the sensor's response as a line delay — 12 lines in the example — so line 1 lands where the gap actually is.
  5. Fixed exposure. Exposure per line must fit inside the line period; at 12 kHz that is at most 83 µs. Auto exposure and auto gain off — they also let brightness drift between parts (Camera image brightness drifts over time: turn every auto mode off).
  6. Out of free-run. Leave continuous acquisition mode, or the camera grabs regardless of the arm edge (GigE camera ignores external trigger: check acquisition mode first).
  7. Slow dry run. One sensor edge must produce exactly one frame, 20 parts in a row.
  8. Line speed. Count frames against the machine's part counter; every mismatch is a wiring or decode fault, not a tuning problem.

If the sensor edge never registers, the trail usually ends in the input line settings — Hardware trigger source not detected: check GenICam line settings walks that check.

Worked example: sizing the divider and line rate for a 1.2 m/s web

Take a typical converting line and size the whole chain. The givens:

  • Web speed 1.2 m/s — the line's rated run speed
  • Encoder 2000 pulses/rev, decoded ×4 → 8000 ticks/rev — encoder nameplate
  • Measuring roll circumference 200 mm (about a 64 mm diameter roll) — measured on the machine
  • Along-web pixel pitch 0.1 mm per line — set by the smallest defect the inspection must resolve
  • Inspection window 150 mm of web per part — the process spec
  • Gap sensor response 1 ms — budget a typical photoelectric sensor's response figure
  • Camera: 2K, 7 µm pixels, 58 kHz line-rate class on GigE — catalog data

The rule in words: ticks per millimetre of web equals counts per revolution divided by roll circumference; divide by the divider to get lines per millimetre; multiply by web speed to get line rate; divide the window by the pitch to get frame height.

ticks per mm = ppr × 4 ÷ roll circumference (mm) lines per mm = ticks per mm ÷ divider line rate (Hz) = web speed (mm/s) × lines per mm frame height = window (mm) ÷ pitch (mm per line)

The arithmetic:

  • Encoder: 2000 × 4 = 8000 ticks/rev; 8000 ÷ 200 mm = 40 ticks/mm.
  • Divider: 0.1 mm per line means 10 lines per mm, so divider = 40 ÷ 10 = 4. The camera sees every fourth tick.
  • Line rate: 1200 mm/s × 10 lines/mm = 12,000 lines/s = 12 kHz. Line period: 1 ÷ 12,000 Hz = 83 µs — the exposure ceiling per line.
  • Frame height: 150 mm ÷ 0.1 mm/line = 1500 lines, inside the sensor's 2048 lines with 548 spare.
  • Link load: 2048 px × 8 bit × 12,000 lines/s ≈ 197 Mbit/s, about a fifth of a GigE link's ~950 Mbit/s payload.
  • Sensor offset: 1200 mm/s × 1 ms = 1.2 mm; 1.2 mm ÷ 0.1 mm/line = 12 lines of delay.

Decision: 12 kHz is 21% of the 58 kHz class and sits under the 29 kHz working ceiling (half the rating), so this set-up runs to 2.9 m/s at this pitch before a re-spec; the rating itself puts the hard stop at 5.8 m/s. A speed-up to 2.4 m/s lands at 24 kHz and 393 Mbit/s — still inside both limits. Past 2.9 m/s, coarsen the pitch or move to a higher-line-rate camera.

The camera class this example assumes:

Line scan cameras2K GigE line scan camera, 7 μm, 58 kHz, TDI, M42 (LS-LCM-0016)LS-LCM-0016
Lens mount
M42
Interface
GigE
Line length
2K
Pixel size
7 μm
$950.00View partBuild a system with it

Run your own speed, roll and pitch through the same three divisions, or through the line rate calculator:

Line-scan camera line rate
Units
Pixel on the part
– mm
Line rate needed
– kHz
Longest exposure
– µs
Data rate
– MB/s
Lines per metre
–
Encoder setting
–

Square pixels: line rate = speed / pixel on the part; the exposure must end within one line period. Encoder: lines per pulse = (π × roller diameter / pulses per revolution) / pixel on the part.

Find line scan cameras Open the full calculator

The tick-to-pixel scale behind the divider is worked through in Encoder ticks per pixel for line scan: set the scale right.

If the camera has no encoder input

Some camera heads keep the I/O minimal and expect a ready-made pulse train. Keep the hardware chain; just move the gating.

A frame grabber with encoder inputs takes phase A/B directly, divides in the card, and hands the camera one clean pulse per accepted line; the camera sees nothing but a line trigger. The same job fits a counter or data-acquisition card: clock the counter from phase A and use the sensor edge as the arm or gate — the pattern behind configuring triggered encoder capture on an industrial I/O module.

A software arm is a last resort, not a fallback: software start can land tens of milliseconds late, and 10 ms of jitter at 1.2 m/s is 12 mm of placement error — 120 lines at this pitch. Keep the arm in hardware.

The link side stays simple for one camera: 197 Mbit/s needs a single clean GigE port. A dual-port PoE NIC powers the camera over the same cable and keeps the second port for a second camera:

Frame grabbersHikrobot MV-GE2002P Dual-port PoE NIC, full height V2.0MV-GE2002P
Interface
GigE
Ports
2 ports
$249.00View partBuild a system with it

Handle the sensor edge

Mount the sensor upstream of the lens line by the response distance — 1.2 mm here — or feed the same distance in as the line delay. Measure it with a taped mark rather than trusting the sensor's headline response, because the effective delay includes the light spot and the output stage. Run ten parts: the mark must land on the same pixel row within ±2 lines.

Edges can chatter on shiny or fluttering web. Use the sensor's built-in hysteresis, or require the armed frame to continue only while the input stays in the gap state; a single spurious edge then produces nothing.

A camera cannot run backwards. If the inspection needs material that passed before the edge — the tail of the previous part, say — arming earlier is not an option; freeze a rolling buffer instead: continuous acquisition in PC or frame grabber memory, snapshot on the sensor edge, then crop to the window. That is the same pre-event buffering used for video capture around PLC faults.

Many cameras can also re-task a spare trigger line as an output, so the frame-active state drives the strobe input directly — see Use camera trigger lines as digital outputs when space is short.

Light for the line period

At 12 kHz each line owns 83 µs, so the light must deliver its photons inside that window. Line lights built for line scan do this continuously; a broad panel light reads dim at the same exposure. Strobing only during the armed window cuts heat and lengthens LED life, and freezes motion harder than exposure alone. The continuous-versus-strobe trade for this camera class is laid out in Lighting controllers for line scan cameras: what they fix.

For a 24 V line light, a 4-channel digital controller with a strobe input is the class of part that fits this station:

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

Verify it worked

  1. One edge, one frame. At slow speed over 20 parts, frame count equals part count.
  2. Row repeatability. Tape a mark upstream of a gap; its pixel row must repeat within ±2 lines. Drift points at the delay or a slipping roll coupling.
  3. Geometry. Image a round feature: it must stay round in both directions.
  4. Stop test. Halt the web mid-window and confirm the frame does what your software decided — abort and flag, or complete later.
  5. Brightness. Histogram the same mark on 20 parts; identical height means the auto modes really are off.

If edges smear along the web, exposure is too long for the speed — the shutter math in Camera fps and shutter speed for moving web inspection applies unchanged here.

Common mistakes

  • Continuous mode left on. The arm edge arrives; the camera is already grabbing and ignores it.
  • Roll swapped for a different circumference. A 250 mm roll where the math assumed 200 mm gives 8000 ÷ 250 = 32 ticks/mm; with divider 4 the pitch becomes 0.125 mm per line and every image stretches 25% along the web. Re-run the divisions after any roll change.
  • Decode changed after sizing. Moving ×4 to ×1 multiplies the pitch by 4 and squashes images to a quarter.
  • Auto exposure on. Brightness varies part to part and the inspection threshold follows it.
  • Unshielded sensor cable beside a drive cable. The arm input fires on switching noise and you capture belt between parts.
  • Speed upgrade without re-sizing. 3 m/s at this pitch is 30 kHz — past the 29 kHz working ceiling. The rating allows it (58 kHz tops out at 5.8 m/s) but leaves no margin for speed ripple.

When the usual answer is wrong

  • Endless web, no gaps. There is nothing to arm. Free-run the camera with the encoder as line clock — the pattern in Make line scan line rate follow machine speed at runtime.
  • Windows closer than the frame length. Parts spaced 100 mm with a 1500-line (150 mm) window overlap: one capture is still open when the next edge fires. You need burst buffering between camera and link — see Camera burst capture faster than link bandwidth: use the buffer — or a shorter window.
  • Register marks, not gaps. The chain is identical; a contrast or colour mark sensor replaces the gap sensor and nothing else moves.
  • Multiple lanes under one sensor. A sensor seeing lane 1 only fires while lane 3 is mid-part. Use per-lane sensors, or one wide sensor plus software segmentation.

Pick the parts

The chain in one line: sensor to the frame-start input, encoder divided to the pixel pitch on the Line Start trigger, frame height and delay set in lines, exposure under the line period. Shortlist cameras in the camera finder, gating hardware in the accessories finder, and strobe-capable dimming in the light-controller finder; or start at the camera step of the configurator and work forward. More trigger and timing patterns sit on the systems topic page, and the guides hub indexes the rest. If a chain fights back during commissioning, bring the wiring diagram to us through the contact page.

Questions

Can one camera input take both the gap sensor and the encoder?

No — keep them separate. The Trigger Selector exposes the frame and line trigger functions independently, each mapped to its own input line, so the sensor arms on one terminal and the encoder clocks on another. If a camera head offers only one hardware input, generate the line pulses outside it: a frame grabber or counter card combines both signals and hands the camera one synchronized trigger stream, with the gating living in the card.

What happens to the frame if the web stops mid-inspection?

It waits, half-written. Lines arrive only with encoder ticks, so nothing corrupts, but the frame also never completes on its own. Decide the policy before commissioning: abort the partial frame in software and flag the part, or let it sit and finish when the web moves again. On piece-goods lines a stop usually means a jam, so abort-and-flag is the cleaner choice; on a slow roll feed, letting the frame complete is often harmless.

Do I need a TDI camera for sensor-started capture?

Only when light is the limit, not the triggering. TDI — time delay integration — accumulates charge from several lines as the image sweeps across the sensor, buying sensitivity at line rates where a single-line exposure gets too short to gather enough photons. If your line rate stays below roughly 20 kHz and the light fills the 50–80 µs exposures comfortably, a standard line scan sensor is the simpler integration.

How do I pick the encoder divider without trial and error?

Arithmetic, not iteration. Ticks per roll revolution ÷ roll circumference gives ticks per mm; ticks per mm ÷ pixel pitch in mm gives the divider; then check the result is close to a whole number — 40 ticks per mm with a 0.1 mm pitch lands exactly on 4. If it lands on 3.2 or 4.7, change the roll circumference or the optics pitch until it lands whole, because a rounded divider makes line spacing uneven.

Why is my captured image stretched or squashed along the web?

The two pixel pitches disagree. Optics fix the cross-web pitch; the encoder divider fixes the along-web pitch; a round mark is the test piece. If the mark reads 25% too long along the web, the along-web pitch is a quarter larger than the optical one, so raise lines per mm by a quarter — smaller divider, finer optics or a smaller measuring roll — and re-test until the mark is round in both directions.