Precision lens manufacturer for machine vision, medical, and industrial imaging applications.

Encoder Counts per Millimetre: The Line-Scan Trigger Record Before the Camera Is Ordered

Home - Technology Explainers - Encoder Counts per Millimetre: The Line-Scan Trigger Record Before the Camera Is Ordered
Reading Time: 8 min ( Word Count: 1,965 )

A line-scan camera does not decide when to take a line; the encoder does. The number that matters is not the encoder’s pulses per revolution but the counts that arrive per millimetre of web travel, and that number depends on the pulley, the quadrature setting and the divider. Write the whole chain into the trigger record before the camera and lens are ordered: object resolution in micrometres per pixel, maximum line speed, encoder counts per revolution, pulley circumference, quadrature multiplier, counts per millimetre, pulses per line and the resulting line rate. When those numbers are fixed in one table, the lens choice, the camera line rate and the encoder specification can be checked against each other instead of being discovered on the first production run.

Key Takeaways

  • Specify the trigger chain in counts per millimetre, not in encoder pulses alone.
  • Start from the object resolution and the maximum line speed, then work backwards.
  • Quadrature and the divider both change the line spacing; write both down.
  • Check the encoder frequency and the camera line rate against the same number.
  • A divider that does not divide cleanly leaves a periodic spacing error.
  • Prove the chain on the line with a ruler target and a marked belt.

The encoder is part of the optical specification

In an area-scan cell the exposure time and the lens decide the image. In a line-scan cell the trigger decides the image as well, because the trigger sets the spacing between lines. If the spacing varies, the image is stretched or compressed along the travel direction, and every measurement along that axis inherits the error. A lens with low distortion and a good MTF cannot recover a line spacing that was never uniform.

That is why the trigger record belongs next to the lens order. The nonwoven web inspection case at 2 m/s shows the same dependency from the application side: line rate, resolution and lens choice are one decision, not three. The machine vision lens selection guide covers the optical inputs; this guide covers the encoder inputs that sit beside them.

Start from object resolution and line speed

Object resolution is the size of the smallest feature you need to resolve, divided by the number of pixels you want across it. A 0.1 mm feature that needs three pixels across is about 33 µm per pixel. That number, not the camera datasheet, sets the line spacing.

The line rate follows directly. A line spacing of 50 µm at a web speed of 2 m/s means 40,000 lines per second, because 2,000 mm divided by 0.05 mm is 40,000. The camera has to deliver that rate with the exposure short enough to freeze the motion. The lens has to cover the sensor at that line rate with enough light, which is a separate budget covered in the binning and line-rate discussion.

Write the line speed as a range, not a single value. A line that runs at 2 m/s at full rate may crawl at 0.2 m/s during a changeover, and the encoder chain has to stay valid at both ends. A divider that works at the top speed can produce a line spacing that is too coarse at the low end if the camera cannot slow its line rate.

Counts per millimetre come from the mechanical chain

The encoder does not know about millimetres. It reports counts per revolution, and the pulley converts revolutions into travel. The chain is: encoder counts per revolution, multiplied by the quadrature factor, divided by the pulley circumference in millimetres. A 5,000 pulse-per-revolution encoder in quadrature gives 20,000 counts per revolution. On a 200 mm circumference pulley that is 100 counts per millimetre.

Use the actual pitch circumference of the pulley or the measured travel per revolution, not the nominal diameter. A timing belt pulley is specified by tooth pitch and tooth count, and the effective circumference is the pitch circumference. A roller may slip; a belt may have a different tension on the two sides. The mechanical number is the one that has to be measured or taken from the drawing, and it belongs in the record.

Item Example value Where it comes from
Object resolution 50 µm per pixel Feature size and pixels across
Maximum line speed 2.0 m/s Line specification, not average
Required line rate 40,000 lines/s Speed divided by spacing
Encoder 5,000 PPR, quadrature Encoder datasheet
Counts per revolution 20,000 PPR times four
Pulley pitch circumference 200 mm Drawing or measurement
Counts per millimetre 100 Counts per revolution divided by circumference
Counts per line 20 Counts per millimetre times spacing

The table is deliberately simple. Its value is that every entry can be checked by a different person: the mechanical engineer owns the circumference, the controls engineer owns the encoder and the divider, the vision engineer owns the spacing and the line rate. When one number changes, the effect on the others is visible in the same table.

Quadrature is a multiplier, not a detail

An encoder datasheet may quote pulses per revolution, and the controller may count four edges per pulse in quadrature. The two numbers are not interchangeable. A 5,000 PPR encoder in quadrature produces 20,000 counts per revolution; used without quadrature it produces 5,000. The difference is a factor of four in the line spacing, which is the difference between a sharp image and a stretched one.

Direction matters as well. A quadrature decoder can count up and down, so a web that reverses keeps its position. A single-channel counter cannot, and a brief reversal can shift every following line. If the line can run in reverse during threading or a stop, the trigger record should say how direction is handled, not only how pulses are counted.

Check the encoder’s maximum output frequency against the count rate. At 100 counts per millimetre and 2 m/s, the encoder delivers 200,000 counts per second. That is a real electrical limit, and it should be compared with the encoder’s specified maximum before the pulley is chosen. The encoder support and technical resources cover the output types and the quadrature principle; the frequency limit is in the datasheet.

Pulses per line and the divider

The camera does not usually take a line on every encoder count. A divider converts counts into lines. If there are 20 counts per line, the divider is set to 20. The camera then receives one trigger for every 20 counts, and the line spacing is 50 µm.

The divider is where rounding errors enter. If the counts per line is 20, the division is exact. If the pulley gives 97 counts per millimetre and the spacing needs 50 µm, the ideal counts per line is 4.85, and a divider set to 5 produces a spacing of 51.5 µm. The image is then 3 percent longer than the object, and a measurement along the travel direction is off by the same amount unless it is calibrated.

There are three honest ways to handle a non-integer ratio. Change the pulley or the encoder so the ratio becomes an integer. Run the camera in a mode where the trigger is resampled in software at the cost of latency. Or accept the ratio and calibrate the scale factor, then write the residual error into the acceptance record. The dishonest option is to set the divider to the nearest integer and describe the result as exact.

Check both frequency ceilings

A line-scan chain has two ceilings. The encoder and its input card have a maximum count frequency. The camera has a maximum line rate. The divider sits between them, and the chosen ratio has to keep both below their limits at the maximum line speed.

The camera ceiling is not only the sensor. Exposure time, readout and interface bandwidth all limit the achievable line rate, and the lens aperture affects how much light is available for a short exposure. A camera that can run 80,000 lines per second with a wide aperture may not reach that rate at the aperture needed for depth of field. The line-scan lens range is built around that trade-off, but the trade-off itself has to be written into the trigger record as the aperture and exposure that the line rate assumes.

The interface has a ceiling too. A Camera Link or CoaXPress link has a fixed payload, and a GigE link shares bandwidth with other cameras. If the trigger record says 40,000 lines per second and 4,096 pixels per line, the payload is a number that can be checked against the interface before the cable is ordered. The diagonal coverage test for line-scan lenses on area sensors is a reminder that the optical format and the sensor format have to be checked together as well.

Write the record before the purchase order

The record should be short enough to fit on one page and complete enough that a different integrator could rebuild the chain. Include the encoder model and output type, the quadrature setting, the pulley pitch circumference or measured travel per revolution, the counts per millimetre, the divider, the resulting spacing, the line rate at minimum and maximum speed, and the aperture and exposure assumed at each speed.

16K line-scan lens with a wide image circle for web inspection

Add the acceptance method. A ruler target or a printed grid on the belt, imaged at production speed, shows whether the spacing is uniform. A mark on the belt that passes the same camera twice shows whether the count is repeatable after a stop and restart. The record is not complete until those two tests have numbers in it.

Finally, state what happens at a speed change. If the line runs at half speed and the camera keeps the same line rate, the image is compressed by half. If the divider is changed, the counts per line change and the calibration changes with it. The recipe that changes the speed should change the trigger settings in the same step, and the record should name the person who owns that recipe.

Specifying a line-scan lens for a web or belt? Bring the counts-per-millimetre table and the required line rate; the lens has to cover the sensor at that rate. Compare the line-scan lens options before the camera is ordered.

FAQ

Do I need a high-resolution encoder or a high-line-rate camera?

Both limits matter, but they are checked separately. The encoder sets the finest spacing you can address; the camera sets how fast you can take lines. Raise whichever one is actually below the requirement.

Can I use the camera’s internal timer instead of an encoder?

Only if the web speed is constant and known. A timer produces a fixed line rate, so any speed change stretches or compresses the image. An encoder follows the web.

What if my counts per line is not an integer?

Change the pulley or encoder to make it integer, resample in software, or calibrate the scale and record the residual error. Do not round the divider and call the result exact.

Where should the encoder be mounted?

On the roller or belt that actually carries the web at the inspection point, with no slip between the two. An encoder on a drive motor measures the motor, not the web.

How do I prove the trigger chain after installation?

Image a ruler or grid at production speed and check the spacing across the field, then stop and restart the line and check that the count returns to the same value.

Conclusion

  • The trigger chain is part of the optical specification, not an electrical afterthought.
  • Work from object resolution and maximum speed to counts per millimetre, then to counts per line.
  • Write the quadrature setting, the divider and the pulley circumference into one table.
  • Check the encoder frequency and the camera line rate at the same maximum speed.
  • Prove the spacing with a ruler target and a restart test before acceptance.

If the record is complete, the lens and camera order becomes a check against numbers instead of a hope. If it is incomplete, the first production run will finish the specification for you, at production cost.

Baker Zhao

Baker Zhao

Founder, Lensmind Optics

Baker Zhao is the founder of Lensmind Optics, with 26 years of experience in the optical industry — including Vice President of Sales at Sunny Optical (Zhongshan) and earlier roles at Foxconn, LG and Sintai Optical. He leads Lensmind with a mission to help customers find reliable, application-specific optical solutions from development to volume production.

Leave a Comment