System designGuide

Compact line scan cameras for tight spaces: the 2 mm window

Scan both faces of a flat part through a 2 mm window: slit optics numbers, two compact camera routes, photocell trigger and encoder sync, arithmetic shown.

LumaSpec Vision9 min read Share on LinkedIn

On this page 9 sections
  1. 01The window constrains light, not the camera
  2. 02Route 1: a compact colour line scan camera behind the wall
  3. 03Route 2: a board-level area camera run in line-scan mode
  4. 04Trigger from the photocell, clock lines from the encoder
  5. 05Worked example: one station, every number
  6. 06Checks before ordering
  7. 07The decision, case by case
  8. 08When the obvious answer is wrong
  9. 09Questions

A 2 mm scanning window inside an existing machine inverts the usual design order: the window is fixed, so the optics adapt to it, not the other way around. This guide is for anyone scanning the front and back of a flat part through such a slit, with a photocell starting each part and an encoder clocking every line. It gives you the slit numbers that decide image quality, two camera routes that physically fit, the trigger and encoder wiring, and one worked example with the arithmetic on the page.

The window constrains light, not the camera

A 2 mm slot cannot pass a lens, and it does not need to: only the light cone crosses it. Mount the slit with its long axis parallel to the scan line, and three formulas decide the images:

f/#_motion ≈ WD_slit / s blur ≈ 1.22 × λ × WD_slit / s L_slit ≥ FOV × WD_slit / (WD_slit + t)

Here WD_slit is the gap from slit to part, s the slit width, t the gap from slit to lens front, and FOV the width the camera must cover. Take a 20 mm gap, a 2 mm slit and λ = 550 nm: the slit behaves as an f/10 aperture in the motion direction, diffraction blur is 1.22 × 0.55 μm × 20 mm ÷ 2 mm ≈ 6.7 μm, and a 24 mm field of view needs a slit at least 24 × 20 ÷ 30 = 16 mm long when the lens front sits 10 mm behind the wall. Order a 20 mm long window and the geometry holds.

The levers are strong. Closing the gap to half opens the aperture to f/5 and passes 4× the light; widening the slit to 3 mm at the same gap gains 2.25×. Only near a 200 mm gap does blur grow to roughly 67 μm and start to eat a 0.1 mm sampling cell — at guard-wall distances it is irrelevant. Budget for the light, though: f/10 passes about 13× less than an f/2.8 optic, close to 4 stops, and the compact lighting for tight spaces guide picks fixtures that make up the difference.

Route 1: a compact colour line scan camera behind the wall

When colour fidelity across the part matters and there is a pocket behind the wall, this is the first route. Browse the line scan cameras category by line length, pixel size and interface, or let the camera finder filter for you. A current compact colour head:

Line scan camerasHikrobot MV-CL042-91GC-V2 4k GigE line scan, Color, Isolated versionMV-CL042-91GC-V2
Lens mount
M42
Interface
GigE
Line length
4K
Pixel size
7 μm
$1,459.00View partBuild a system with it

Where light through the slit is genuinely scarce, trade colour for sensitivity: the LS-LCM-0016 is a 2K mono TDI camera with 7 μm pixels, a 58 kHz line rate, an M42 mount and a GigE interface. TDI adds signal without adding exposure time, which is exactly what a 2 mm aperture takes away.

Check the camera-plus-lens stack against the pocket depth before ordering. If the stack is deeper than the pocket, fold the path once with a 45° first-surface mirror sitting as close behind the wall as the pocket allows, sized at least 20% larger than the slit in both directions, and keep the folded path length equal to the working distance you chose the lens for.

Route 2: a board-level area camera run in line-scan mode

When the pocket will not take a lens stack at all, drop to a board-level area camera and clock it line by line, the approach in area scan camera line scan mode for moving-web inspection. Typical boards occupy roughly 29 mm × 29 mm × 10 mm, and an M12 lens head adds 15-18 mm of diameter, so the whole unit fits a pocket 40 mm deep. The board-level cameras category lists the range.

Two candidates show the trade. The LS-BCM-0003 is a 3.1 MP USB3 board camera on a 1/1.8" sensor with a global shutter, 120 fps and a C-mount. The LS-BCM-0061 is a 1.3 MP GigE board camera with an M12 mount on a 1/2.7" sensor, offered in colour or mono, so several stations can share the machine's existing GigE network.

For encoder-clocked lines, demand a global shutter: a rolling shutter exposes each row over time, so rows recorded at speed smear, and no software fixes that afterwards. Also confirm in the camera's documentation that it accepts an external line trigger and line clock in line-scan mode; not every board camera exposes that.

Specification MV-CL042-91GC-V2 LS-LCM-0016 LS-BCM-0061
Sensor type CMOS CMOS –
Pixel size 7 μm 7 × 7 μm 4 μm BSI
Resolution 4096 × 2 2048 × 2 –
Max. line rate Standard mode: 28 kHz @ Bayer RG 8/Bayer RBGG 8/Mono 8, 14 kHz @ Bayer RG 10/12/Mono 10/12, 9 kHz @ RGB 8/BGR 8; High-bandwidth mode: 80 kHz @ Bayer RBGG 8, 40 kHz @ Bayer RG 8/RGB 8 58 kHz @ Mono 8, 29 kHz @ Mono 10/12; HB: 86 kHz @ Mono 8, 58 kHz @ Mono 10/12 –
Dynamic range 65.6 dB 68 dB –
SNR 40 dB 44.7 dB –
Exposure time 5 μs~10 ms 3 μs~10 ms –
Trigger mode External trigger, internal trigger Via hardware trigger, software trigger or free run mode –
Data interface Gigabit Ethernet (1000 Mbit/s), compatible with Fast Ethernet (100 Mbit/s) GigE RJ45 Gigabit Ethernet interface, downward compatible with 100M network
Digital I/O 12-pin P10 connector provides power and I/O: Configurable input/output × 4 (Line 0/1/3/4) and single-ended/differential is supported. 12-pin Hirose connector provides I/O:Configurable output and input × 4,supports single-end/differential –
Power supply 12 VDC to 24 VDC, supports PoE 12-24 V DC, Supporting PoE 12~24 V
Lens mount M42*1.0, flange back length 12 mm, applicable to F-mount, C-mount and others via lens adapter M42*1.0, BFL 12 mm M12
Price $1,459.00 $950.00 $209.00

Values as printed in each product's data sheet; open a part for its drawing and full specifications.

Trigger from the photocell, clock lines from the encoder

Two signals make the scan honest. The photocell feeds the camera's opto-isolated trigger input and starts acquisition for each part. The encoder's quadrature A and B lines feed the encoder input, and the camera advances one line per divided pulse. Choose the divider so one line equals one sampling cell of travel: at 10 pulses per mm and a 0.1 mm cell, one line per pulse is exact, and a part running at 120 mm/s produces 120 × 10 = 1,200 lines/s. The wiring, including which quadrature edges to count, is in encoder-triggered line scan capture: wiring quadrature inputs; encoder ticks per pixel for line scan keeps the scale right when the divider is not 1; and how to set the line rate of a line scan camera covers the camera-side settings. When line speed changes mid-part, making line rate follow machine speed at runtime is the pattern to copy.

For two cameras on front and back, feed both the same photocell pulse and the same encoder clock — the shared clock is what keeps both images on one geometry.

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.

Worked example: one station, every number

  • Part: 24 mm across, moving at 120 mm/s.
  • Window: 2 mm wide, 20 mm long, cut in the guard wall 20 mm above the surface; lens front behind the wall at the gap assumed above.
  • Aperture and blur: f/# = 20 ÷ 2 = f/10 in the motion direction; blur = 1.22 × 0.55 μm × 20 ÷ 2 ≈ 6.7 μm, far below the 0.1 mm cell.
  • Sampling: 0.1 mm per pixel gives 24 ÷ 0.1 = 240 pixels across the part; line rate = 120 ÷ 0.1 = 1,200 lines/s.
  • Encoder: 2,000 pulses on a 200 mm measuring wheel gives 10 pulses/mm, so divider 1 yields exactly 0.1 mm per line.
  • Exposure: one line period is 1 ÷ 1,200 = 0.83 ms; set 0.5 ms and motion smear is 120 mm/s × 0.5 ms = 0.06 mm, under one cell.
  • Data: a 4K RGB line is 4096 pixels × 3 bytes, so 1,200 lines/s moves 14.7 MB/s, comfortably inside a GigE link's roughly 100 MB/s.

The light check decides the build: at f/10 the slit passes about 13× less light than an open f/2.8 optic, so a 0.5 ms exposure needs an LED line light driven hard through the same slit or an adjacent one. If the bench test runs out of photons, close the gap — halving it opens the aperture to f/5 and returns 4×.

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

For this station the colour line scan route wins: the field is small, the line rate is undemanding, and colour on the print face pays for the extra depth. Take the board-camera route when the pocket is shallower than about 40 mm, or when the same machine carries many stations on one GigE network.

Checks before ordering

  • Measure the three numbers everything above hangs on: slit width and length, wall-to-part gap, pocket depth behind the wall.
  • Confirm each camera has an opto-isolated trigger input and a quadrature encoder input; the board-camera route needs a documented external line clock too.
  • Global shutter on any board camera that will see moving lines.
  • Mock the window on the bench before cutting metal: a plate with the same 2 mm × 20 mm slit, the part at production speed, exposure 0.5 ms at the f/10 equivalent. The LS-MNT-0003 multi-function line-scan test platform holds that mock steady, and the camera stands range adds slide stages for setting the gap repeatably.
Camera standsMulti-function line-scan test platform (LS-MNT-0003)LS-MNT-0003
Type
Multi-function line-scan test platform (LS-MNT-S03)
$269.00View partBuild a system with it

The decision, case by case

  • Colour-critical face, pocket 60 mm or deeper behind the wall: compact colour line scan camera, one per face, slit sized by the formulas above.
  • Pocket under about 40 mm, or many stations on one machine: board-level camera in line-scan mode, global shutter, M12 head, all on the shared GigE network.
  • Monochrome defect hunt with little light: 2K TDI line scan camera and the brightest line light that fits the slit.
  • The wall-to-part gap can be cut to half of the 20 mm assumed above: do it. f/5 instead of f/10 buys 4× the light for free.

To size the head against your own pocket depth, start the camera configurator and the trigger and I/O step, or contact us with the three measured numbers.

When the obvious answer is wrong

  • Poking the lens through the slit: the window vignettes every off-axis ray. The camera sits behind the wall, always.
  • A rolling shutter board camera because it was on the shelf: encoder-clocked rows smear at speed.
  • Ordering a longer focal length to "reach through" the window: reach is geometry you set with the gap and slit size, and the formulas use distances only.

Questions

How deep does the pocket behind the wall need to be?

The slit sets the light path; the pocket sets the head. A board camera on a roughly 29 mm square board with an M12 lens needs about 35-50 mm of depth, while a line scan camera with an M42 lens stack is deeper. Under about 40 mm, fold once with a 45 degree first-surface mirror sitting as close behind the wall as the pocket allows, and size the mirror at least 20% larger than the slit.

What line rate will my encoder give me?

Lines per second equal speed in mm/s times pulses per mm, divided by the divider. At 10 pulses/mm with divider 1, a part at 120 mm/s gives 1,200 lines/s. Pick the divider so one line equals one pixel of travel; if you need more lines per mm than the encoder delivers, add a multiply (PLL) stage or a finer encoder rather than fractional dividers.

Can one photocell trigger both the front and back cameras?

Yes. Split the photocell output to both cameras' opto-isolated trigger inputs and clock both from the same encoder. Stagger the two windows 30-50 mm along the direction of travel so neither camera sees the other's shadow, then correct the travel offset between the two images in software; the shared encoder clock makes that offset a fixed distance.

Should the illumination pass through the same 2 mm slit?

For a matte or printed face, yes: a line light through the same slit keeps the window count down. For a shiny face, cut a second slit and light at a low angle so the camera sees a dark field with defects bright; sharing one slit with specular parts sends the light's own reflection straight into the lens.