Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: Sep 6, 2006


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Using the JAI CV-M1 Camera in Asynchronous Reset Mode with the IMAQ 1409

2 ratings | 5.00 out of 5
Print

Overview

This article explains how to use the JAI CV-M1 camera in asynchronous reset mode with the National Instruments IMAQ 1409 image acquisition device to acquire clear images of moving objects.

Progressive Scan and Asynchronous Reset

Some industrial imaging and Web inspection applications involve acquiring images of fast-moving objects. In most cases, an external trigger produced by a photocell, proximity sensor, or a similar device starts the image acquisition.

Acquired images of moving objects are often blurred. However, triggered acquisition with a progressive scan camera is one way to produce an image without the blur. Progressive scan cameras, such as the JAI CV-M1, eliminate the blur that results from motion because they acquire one full frame at a time. Moving images acquired using interlaced cameras often produce a motion-induced blur because they acquire the odd and even fields separately and then interlace them. Motion-induced blur occurs when the two fields are not acquired at the same time and the object is moving between the fields.

Triggering only the acquisition device while using the camera in free-running mode creates a variable delay between the time the acquisition board receives the trigger and the time the image is acquired. The delay occurs because the board must finish acquiring the current frame before acquiring the triggered frame. Figure 1 illustrates this variable delay.

Figure 1: IMAQ 1409 Triggered Acquisition

Because the delay is variable, depending on when the trigger occurs, the object does not appear at the same location on all the triggered images. Asynchronous reset cameras offer one solution to this problem. Asynchronous reset techniques help keep the motion device (a conveyor belt, for example) moving while acquiring the images on the fly. These techniques offer a way to introduce a vision system in an assembly line with very little modification of the environment.

When an asynchronous reset camera receives a trigger, it resets the CCD and immediately begins acquiring a new image, which ensures that the image is always taken at the same time after trigger assertion. In this case, the objects imaged appear at the same location in the image, which simplifies the preprocessing of the image, including locating the object under inspection and specifying the regions of inspection within the image.

Figure 2 illustrates the asynchronous reset principle.


Figure 2: Asynchronous Reset

Camera Switches Setup

This section explains how to set up the JAI CV-M1 camera to run in asynchronous reset mode. Setting up the JAI CV-M1 to run in asynchronous reset mode requires modification of some jumpers on the PK8105 board (inside the camera). Refer to Figure 3 for an illustration of the internal camera jumpers. Tables 1, 2, 3, and 4 at the end of this section summarize the camera switch and jumper configuration for revision D of the JAI CV-M1.

Note: If you are unsure of how to modify the internal camera jumpers, contact JAI technical support for more information.

The JAI CV-M1 supports two asynchronous modes: single trigger mode and double trigger mode.

Single trigger mode—The camera resets the CCD at the assertion of external trigger signal, and then starts exposure. The 16-step fixed shutter controls the exposure, and the position of the switches on the back of the camera determines the shutter speed.

Double trigger mode—The camera resets the CCD at the assertion of external trigger signal, starts exposure, and then stops exposure at the assertion of a second signal, which is generated by the IMAQ 1409.

To set up the JAI CV-M1 for asynchronous reset, make the following modifications to the jumpers on the PK8105 board. These settings are valid for both single trigger mode and double trigger mode.

1. Verify that switches SW3-1 and SW3-2 are set to the OFF position (factory preset). This setting terminates the HD and VD signals to TTL.

2. To output the VD signal from the camera, make the following modifications to jumpers JP2, JP3, and JP4:
JP2: open
JP3: short
JP4: open
3. To output the HD signal from the camera, make the following modifications to jumpers JP5 and JP6:
JP5: open
JP6: short
4. To output the pixel clock from the camera, make the following modification to jumper JP7:
JP7: short


Figure 3: PK8105 board (from the JAI CV-M1 Operation Manual, Rev. D)

Single Trigger Mode
Power off the camera, and make the following modifications to the external camera switches. Refer to Figure 4 for an illustration of the external camera switches.

1. Modify switches SW1-1 through SW1-4 to set the shutter speed. Refer to the JAI CV-M1 Operation Manual for these switch settings.

Note: Single trigger mode does not work when the shutter speed is set to 1/12 of a second (when switches SW1-1 through SW1-4 are set to OFF).

2. Set switch SW1-5 to OFF to set the readout mode to normal. Single trigger mode is effective only in normal speed readout mode.
3. Set switch SW1-6 to OFF to set the external trigger mode to single trigger mode.
4. Set switch SW1-7 to OFF for a low-speed shutter (1/6 to 2.0 seconds). Set this switch to ON for a high-speed shutter (1/24 to 1/10,000 of a second).
5. Set switch SW1-8 to OFF to turn off the serial interface.

Double Trigger Mode
Power off the camera, and make the following modifications to the external camera switches. Refer to Figure 4 for an illustration of the external camera switches.

1. Set switches SW1-1 through SW1-3 to OFF.
2. Set switch SW1-4 to ON.
3. Set switch SW1-5 to OFF to set the readout mode to normal. Double trigger mode is effective only in normal speed readout mode.
4. Set switches SW1-6 and SW1-7 to ON to set the external trigger mode to double trigger mode.
5. Set switch SW1-8 to OFF to turn off the serial interface.

Note: For both single trigger mode and double trigger mode, do not send another trigger while the camera is integrating. The interval of trigger pulses must be longer than the value calculated from the the following formula: 160 Microseconds + Shutter Speed +1/12 Second


Figure 4: Back Pane of the JAI CV-M1 (from JAI CV-M1 Operation Manual, Rev. D)


Summary: Camera Switches
Tables 1 through 4 provide a summary of the camera settings.
Table 1: Internal Switches


Table 2: Internal Jumpers

Table 3: External Switch Settings for Single Trigger Mode


Table 4: External Switches Settings for Double Trigger Mode

Cabling Requirements

This section outlines the cabling and power supply requirements for connecting the JAI CV-M1 with the IMAQ 1409. Refer to Figure 5 for an illustration of the cabling schematics.

Note: Use the IMAQ-A6822 breakout box to easily prototype your cable.

Figure 5: Cable Schematics

The following tables outline the connections from the IMAQ 1409 to the JAI CV-M1 (Tables 5 and 6), the external BNCs (Table 7), and the power supply (Table 8).

Table 5: Connection from the IMAQ 1409 to the JAI CV-M1 (12-Pin Hirose Connector)




Table 6: Connection from the IMAQ 1409 to the JAI CV-M1 (6-Pin Hirose Connector)




Table 7: External BNCs




Table 8: Power Supply


Interfacing With the IMAQ 1409


This section explains how to configure your software for asynchronous reset acquisition.

Note: Remove the W1 jumper on the IMAQ 1409 device before configuring your software.

Configuration Files
1. Copy the JAI CV-M1(1409).icd file into the <NI-IMAQ>\Data folder.
2. Launch Measurement & Automation Explorer (MAX).
3. Expand the Devices and Interfaces branch of the tree view.
4. Expand the IMAQ PCI/PXI-1409 branch of the tree view.
5. Right-click Channel 0: RS-170, and select Camera>>JAI>>JAI CV-M1.
6. Click Save and exit MAX.

Note: Because asynchronous reset mode requires that you provide the trigger signals to the camera, image acquisition within MAX is not possible.

In order to acquire images in asynchronous reset mode, both the IMAQ 1409 and the camera must receive the trigger. The input trigger connects to the IMAQ device, which generates the trigger signal sent to the camera. This signal is synchronized with the input trigger. Double trigger mode allows you to specify the exposure time by sending another pulse on another line (SG pulse). The time difference between the first trigger sent to the camera and the SG pulse corresponds to the exposure time. The attached example demonstrates how to use the software to generate these pulses and to drive the exposure time.

To set the exposure time in single trigger mode, send the start trigger. Switches SW1-1 through SW1-4 on the back of the camera set the exposure time.

Because the IMAQ 1409 generates the triggers sent to the camera, you can also use the camera without providing an external trigger input to the IMAQ device by specifying the frequency and delay of the pulse signals generated by the IMAQ device. These pulse signals determine the acquisition rate and exposure time (internal trigger mode).

When acquiring images of moving objects, decreasing the exposure time (increasing the shutter speed) ensures that the resulting images are not blurred. Decreasing the exposure time decreases the amount of light the CCD sensor can integrate. To compensate for the short exposure time and still acquire a well-contrasted image, provide a more intense lighting or use a strobe light at the time of the image acquisition. The strobe light can also control the exposure time, in which case the sensor exposure time can be set to the maximum.

The acquisition device is capable of outputting a signal that corresponds to the start of a frame (TRIG 1). For example, it can be useful to illuminate the object by firing a strobe light when the frame is acquired.

Computing Exposure Time
To compute the exposure time needed for your application, you need to know the following parameters:

  • Horizontal resolution of your camera (example: 640 pixels)
  • Horizontal field of view (example: 100 mm)
  • Speed of the moving object (example: 150 mm/s)
  • Acceptable blur—defines the maximum blur that is acceptable in the image (example: < 1 pixel). The acceptable blur corresponds to the number of pixels the object moves during the exposure time.
The shutter speed necessary for the application corresponds to the time needed for the object to move of the number of pixels specified by the blur. Figure 6 demonstrates how to compute exposure time.

Figure 6: Computing Exposure Time

In the following example, the exposure time must be less than 1.04 ms (1 x 100 / (640 x 150) = 0.00104 s = 1.04 ms).

Example Program


This section includes an example program (JAI CV-M1 Double Trigger Mode Grab.vi) that demonstrates an asynchronous reset acquisition in double trigger mode.

This example shows how to control the camera shutter speed and how to perform an asynchronous reset acquisition with an IMAQ 1409 device and a JAI CV-M1 camera. You can either provide an external trigger to trigger the acquisition, or the IMAQ acquisition device can generate a signal to trigger the acquisition (internal trigger). The internal trigger allows you to test the example without having to provide an external trigger signal to the IMAQ device.


In frame 0, shown in Figure 7, IMAQ Init is called to initialize the IMAQ device. IMAQ Create allocates the memory for the images.

Figure 7: IMAQ Init and IMAQ Create


In the next frame, shown in Figure 9, IMAQ Generate Pulse is called twice to create the start exposure and stop exposure pulses. The stop exposure pulse is delayed by the exposure time specified by the user.

Figure 8: IMAQ Generate Pulse


Frame 2, shown in Figure 9, sets up and starts the acquisition. IMAQ Configure List configures the buffer list, which contains one buffer, and IMAQ Start starts the acquisition.

Figure 9: IMAQ Configure List and IMAQ Start


Frame 4, shown in Figure 10, contains the acquisition loop. IMAQ Copy provides a copy of the image currently being acquired, and IMAQ WindDraw displays the image in an image window. Clicking the Stop button calls IMAQ Generate Pulse twice to stop the pulse generation. IMAQ Close is called to shut down the acquisition.

Figure 10: Acquisition Loop


The last frame disposes the images.

Figure 11

Related Links:
Interfacing the JAI CV-M1 Camera with IMAQ 1409
Using the JAI CV-M1 Camera in Asynchronous Reset Mode with the IMAQ 1409
2 ratings | 5.00 out of 5
Print

Reader Comments | Submit a comment »

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).