This topic contains the following sections.
This topic shows you specify the SetStepsPerLine value for line scan cameras to ensure that the pixels in your images are square and for calculating the maximum speed of your encoder.
This example uses an encoder with the following characteristics:
- Encoder resolution is 10 pulses per micrometer or 40 encoder counts per micrometer since one encoder pulse produces four encoder counts.
- The encoder is moving at 10 millimeters per second or 10 micrometers per millisecond.
- The optical magnification is such that 0.5 micrometers in object height maps to the pixel height of the sensor (one image line).
To obtain square pixels, calculate the steps per line as follows:
stepsPerLine = (pixelHeight in micrometers) * (encoderCounts per micrometer)
To obtain square pixels in this case you would use:
stepsPerLine = 0.5 * 40 = 20
A common enhancement is to speed up an application by increasing the speed of the objects passing under the line scan camera. The objective is to calculate the maximum speed that will still produce square pixels and not cause acquisition failures.
Start with the minimum steps per line formula as follows:
minStepsPerLine = (encoderCountsPerSecond * effectiveSensorScanTime) + 1
Where effectiveSensorScanTime is the greater of the sensor scan time or the exposure time. Sensor scan time and exposure time are covered in the following paragraphs.
Sensor scan time is the time required to read out the line sensor in the camera. Sensor scan time depends on the sensor width and the camera clock speed. The camera speed is MasterClockFrequency from 20 MHz to 40 MHz. The following table shows the minima and maxima of the sensor scan time range. There is a linear relationship between the camera speed settings and the sensor scan time.
| Sensor width | Minimum sensor scan time, camera speed = 40 MHz | Maximum sensor scan time, camera speed = 20 MHz |
| 1K pixels | 27 microseconds | 54 microseconds |
| 2K pixels | 54 microseconds | 108 microseconds |
For a 1K sensor, the sensor scan time can be in the range from 27 to 54 microseconds. For a 2K sensor the range is 54 to 108 microseconds.
Some line scan camera and platform combinations support adjustable exposure. For these systems exposure time can be set in a range from 0 to a maximum value depending on the camera speed setting as follows:
204.8 microseconds at 40 MHz
409.6 microseconds at 20 MHzFor line scan camera-platform combinations that do not support adjustable exposure, the exposure time is the time to move the object under the camera one line.
For this example assume an exposure time of 30 microseconds and a 27 microsecond scan time. Therefore, use an effectiveSensorScanTime = 30 microseconds and the assumptions from the previous example in the minStepsPerLine formula below. We constrain the minStepsPerLine = 20 to ensure square pixels and specify the encoder speed as an unknown:
minStepsPerLine = (encoderCountsPerSecond * effectiveSensorScanTime) + 1
20 = [(40 counts / μsec) * (X mm / sec) * 30 μsec] + 1
Solving for X you get:
X = 16 mm/ sec
The original example assumed a speed of 10 mm/sec, but you can see that for this application the speed could be increased to 16 mm/sec while still maintaining square pixels. For speeds faster than 16 mm/sec you will get CogAcqEncoderOverrunException exceptions.