Industry applications in depth

Encoder-triggered line-scan capture: line count, division and pixel size

Encoder-triggered line-scan capture: line count, division and pixel size

When a line-scan camera is triggered by an encoder, the line spacing Δy = πD·K/(4N) must equal the object-side transverse pixel size, or circles become ellipses. This article derives the constraints among line count, frequency division, maximum line rate and maximum web speed, works an example with a 100 mm roller diameter and a 10 μm pixel to obtain 7854 lines with fourfold quadrature decoding, and estimates the periodic line-position error caused by encoder eccentricity.

A line-scan camera exposes only one line at a time; the “longitudinal” direction of the image is assembled line by line as the workpiece moves. If the camera is run at a fixed line rate, any fluctuation in web speed changes the line spacing and stretches a circular pattern into an ellipse. Triggering from encoder pulses instead makes each line correspond to a fixed web displacement, independent of speed. That, however, raises a configuration question: what relation must the encoder line count, the decoding factor and the frequency-division factor bear to the camera pixel size and the lens magnification, if the pixels are to be the same size in both directions? This article writes out the formulae of that chain, works them through for a roller diameter of 100 mm and an object-side pixel of 10 μm, and then estimates how much periodic error encoder eccentricity contributes to the line spacing.

A roller drives the web at constant speed and encoder pulses trigger the camera line by line; encoder eccentricity (exaggerated by about 500 times in the drawing) makes the line spacing vary periodically, so the acquired circle is distorted from line to line; the orange dashed line is the circle that would be obtained with uniform line spacing
Figure 1 – A roller drives the web at constant speed and encoder pulses trigger the camera line by line; encoder eccentricity (exaggerated by about 500 times in the drawing) makes the line spacing vary periodically, so the acquired circle is distorted from line to line; the orange dashed line is the circle that would be obtained with uniform line spacing

The line-spacing formula: how much web travel corresponds to each pulse

Let the encoder be coaxial with the roller, with line count N; after fourfold quadrature decoding there are 4N counts per revolution. The roller diameter is D and the web does not slip. The web displacement per count is πD/(4N). If the trigger module emits one line every K counts, the line spacing is

Δy = πD·K / (4N)

The object-side transverse pixel size is

Δx = p / m

where p is the sensor pixel size and m is the optical magnification. The condition for an undistorted image is Δy = Δx. In addition, the exposure should fill one line period so that the integrated width in the travel direction equals Δy; if the exposure is too short, unsampled gaps appear along that direction.

Example: D = 100 mm, roller circumference πD = 314.16 mm, required Δx = 10 μm, K = 1, then

N = πD / (4Δx) = 314.16 / (4 × 0.010) = 7853.98

Taking 7854 lines, the line spacing is 9.99998 μm, a deviation of only two parts per million. But 7854 is not a common line count. The table below lists approaches with readily available line counts (fourfold quadrature decoding, K = 1):

Line count NCounts per revolutionObject-side distance per countCount frequency at 0.4 m/sApproach
785431 41610.00 μm40.0 kHzDirect match; a custom line count is required
10 00040 0007.854 μm50.9 kHzAdjust the lens so that Δx = 7.854 μm (m = 1.273), and limit the speed or use frequency division
500020 00015.71 μm25.5 kHzLens m = 0.637, object-side pixel 15.7 μm
250010 00031.42 μm12.7 kHzLine spacing too coarse; a 10 μm pixel would undersample

In practice it is more common to fix the roller diameter and the encoder first, and then trim Δx with the lens magnification, because magnification can be adjusted continuously whereas line count cannot. When the trigger module can combine multiplication and frequency division into a rational ratio, ratios such as π/4 can also be approximated, provided the residual is smaller than the uncertainty of the roller diameter itself.

Line rate, web speed and interface frequency

The camera has a maximum line rate f_max. The line rate is f = v / Δy, so the maximum web speed is

v_max = f_max · Δy

Assume a camera maximum line rate of 40 kHz: at Δy = 10 μm, v_max = 0.4 m/s (24 m/min); at Δy = 5 μm it is only 0.2 m/s; at Δy = 20 μm it can reach 0.8 m/s, see Figure 2. To run at 1 m/s on a production line with a 40 kHz camera, the line spacing cannot be smaller than 25 μm. In engineering practice a 20% margin is recommended, so that pulses do not exceed the frequency the camera can follow and lines are not dropped.

The frequency on the encoder side must be checked as well: at 0.4 m/s the roller speed is about 76.4 r/min, the A/B frequency of a 7854-line encoder is only 10 kHz, and 40 kHz after fourfold quadrature decoding, which is no strain at all for a differential interface. The real limit is almost always on the camera side. If the encoder count frequency is higher than the camera’s upper limit, frequency division K should be used to enlarge the line spacing until it matches the adjusted Δx, rather than letting the camera drop pulses.

Line-trigger frequency versus web speed: the smaller the line spacing, the lower the web speed that the same camera line rate can sustain (the camera maximum line rate is an assumed value)
Figure 2 – Line-trigger frequency versus web speed: the smaller the line spacing, the lower the web speed that the same camera line rate can sustain (the camera maximum line rate is an assumed value)

Periodic line-spacing error caused by eccentricity

When the encoder disc has eccentricity e and the read radius is r, the measured angle exceeds the true angle by a once-per-revolution term:

θ_enc = θ + (e/r)·sin(θ + φ)

Triggering is issued at equal intervals of θ_enc, so the interval in true angle is 1/[1 + (e/r)·cos(θ + φ)], and the line spacing becomes

Δy(θ) ≈ Δy0 · [1 − (e/r)·cos(θ + φ)]

The accumulated line-position error is

δy(θ) = −R·(e/r)·sin(θ + φ)

where R is the roller radius and φ is the azimuth of the eccentricity. Note the two different magnitudes: the relative change of adjacent line spacings is only e/r; with e = 5 μm and r = 20 mm this is 0.025% (about 52″), only 2.5 nm on a 10 μm line spacing, and a circular pattern shows no visible distortion. The amplitude of the line-position error, however, is R·e/r, which reaches 12.5 μm at R = 50 mm, about 1.25 lines; two features half a revolution apart (157 mm) can differ by as much as 25 μm.

Encoder eccentricity e / read radius re/rFirst-order errorPosition-error amplitude at R = 50 mm
3 μm / 20 mm0.015%31″7.5 μm
5 μm / 20 mm0.025%52″12.5 μm
10 μm / 10 mm0.10%206″50 μm
Line-position error over one roller revolution: the amplitude equals the roller radius times e/r; the dashed lines are ±1 line (10 μm)
Figure 3 – Line-position error over one roller revolution: the amplitude equals the roller radius times e/r; the dashed lines are ±1 line (10 μm)

This error is proportional to the roller radius R, so the same encoder is worse off on a large roller than on a small measuring wheel. For inspection that is concerned only with the appearance of the pattern, it can be ignored; for inspection that must locate a defect to within 0.05 mm, it must be entered into the budget together with the roller’s radial runout (often larger: 20 μm of runout turns directly into about 20 μm of position error) and with slip.

Engineering points

  • First write the equality Δy = πD·K/(4N) = Δx = p/m, then choose the line count; if the line count does not come out to a standard value, compensate with the lens magnification.
  • The roller diameter itself has uncertainty: a diameter error of 0.1 mm is a scale error of 0.1%, and an image 100 mm long is in error by 0.1 mm. After the line is commissioned, the actual line spacing should be calibrated with a scale target.
  • Check the maximum web speed with v_max = 0.8·f_max·Δy, and at the same time check whether the encoder count frequency exceeds the camera’s maximum line rate.
  • Mount the encoder on a driven roller or on a measuring wheel that runs on the web, avoiding transmission error and slip through belts and couplings.
  • The trigger module must include direction discrimination, so that a reverse jitter of the web does not emit a line twice.
  • At a roller radius of 50 mm and a read radius of 20 mm, keeping encoder eccentricity within 5 μm keeps the position-error amplitude below 1.3 lines; tighter requirements call for diametrically opposite readheads.

In brief

The longitudinal resolution of a line-scan camera is determined entirely by encoder triggering. The core of the configuration is that Δy = πD·K/(4N) equals the object-side pixel p/m, while the line rate stays within the camera’s limit. The change in line spacing caused by eccentricity is minute, but it accumulates into a periodic position error of amplitude R·e/r; whether that matters depends on the positioning accuracy required of the inspection.


Translated from the ENC7 Chinese technical library (article 0771). Read the Chinese original. Need a disc built to your drawing? Request a quote or see our custom encoder discs.

© Langfang Jingzheng Optoelectronic Technology Co., Ltd. All rights reserved. This article was created with AI assistance.

Have a drawing? Get an engineer's review.

Send your outer diameter, bore, line count or bit count, substrate and readhead wavelength. Our engineers check manufacturability and reply with a quotation and sample lead time.

WhatsApp