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-A11 Camera in Asynchronous Reset Mode with the IMAQ 1409

5 ratings | 4.00 out of 5
Print

Overview

This article explains how to use the JAI CV-A11 camera in asynchronous reset mode with 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 that is not blurred. Progressive scan cameras, such as the JAI CV-A11, 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 exposed separately 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 has to 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 asynchronous reset cameras receive a trigger, they reset their CCD and immediately start 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


Continuous Mode


This section explains how to set up the JAI CV-A11 to run in continuous mode. Continuous mode is the camera's factory default setting and is used for continuous-operation applications not requiring asynchronous external trigger.
    Configuration Files
    1. Launch Measurement & Automation Explorer (MAX).
    2. Expand the Devices and Interfaces branch of the tree view.
    3. Expand the IMAQ PCI/PXI-1409 branch of the tree view.
    4. Right-click Channel 0: RS-170 and select Camera>>Standard>>30Hz Progressive Scan.
    5. Click Save and exit MAX.
    6. Perform a snap and continuous video acquisition for diagnostics and verification.

Asynchronous Reset Mode


This section explains how to set up the JAI CV-A11 to run in asynchronous reset mode. The JAI CV-A11 supports the following asynchronous reset modes:
  • Edge preselect trigger mode--the exposure time is governed by the predefined shutter speed set by RS-232C. You can control the exposure time using the fixed-step shutter speed, or by the programmable shutter, which provides more accuracy in the selection of the exposure time.
  • Pulse width control trigger mode--the duration of the trigger pulse governs the exposure time of the camera.
In its default setting, the camera accepts external HD/VD signals. To use the camera in asynchronous reset mode, you must set the camera to output HD/VD signals. Power off the camera and make the following modifications to the internal camera switches:
  1. Set switches SW1-1 and SW1-2 on the PK8299 circuit board to the ON position to output HD and VD signals.
  2. Verify that switches SW2-1 and SW2-2 on the PK8299 circuit board are in the OFF position (default setting) to set the termination of HD and VD to high impedance TTL.

Figure 3 shows the internal camera switches.

        Figure 3: Switches on the PK8299 Board (from the JAI CV-A11 Operation Manual)

        Cabling Requirements

    This section discusses cabling and power supply requirements.
    Note: You can use the IMAQ-A6822 breakout box to easily prototype your cable.

    Figure 4 shows cable schematics for the JAI CV-A11, the IMAQ 1409, and the computer's serial port.


    Figure 4: Cable Schematics
      Tables 1, 2, 3, and 4 outline power supply connections, connections from the IMAQ 1409 to the JAI CV-A11, external BNC connections, and serial cable connections, respectively.

      Table 1: Power Supply

      Signal 12-Pin Hirose Connector
      (Power Supply) (Male)
      Pin Number       Signal Name
      Signal
      Direction
      12-Pin Hirose Connector
      (JAI CV-A11)
      Pin Number       Signal Name
      Power Supply 1 GND 1 GND
      2 +12V 2 +12V

      Table 2: Connection from the 1409 to the JAI CV-A11 (12-Pin Hirose Connector)

      Signal 68-Pin IMAQ Connector (Male)
      Pin Number       Signal Name
      Signal
      Direction
      12-Pin Hirose Connector
      (JAI CV-A11) (Female)
      Pin Number       Signal Name
      Video 68 VIDEO(0) + 4 VIDEO OUT
      60 DGND 3 GND
      H Sync 16 HSYNC_IN + 6 Int. HD OUT
      26 DGND 5 GND
      V Sync 15 VSYNC_IN + 7 Int. VD OUT
      36 DGND 8 GND
      Pixel
      Clock
      3 PCLK_IN + 9 PCLK OUT
      2 DGND 12 GND
      Trigger
      Output to
      Camera
      5 TRIG(3) 11 Ext. Trigger IN
      39 DGND 12 GND

      Table 3: External BNCs

      Signal 68-Pin IMAQ Connector (Male)
      Pin Number       Signal Name
      Signal
      Direction
      External BNCs
      Trigger
      Input
      8 TRIG(0) BNC(0) (Female)
      42 DGND BNC(0) GND
      Strobe
      (Optional)
      7 TRIG(1) BNC(1) (Female)
      41 DGND BNC(1) GND

      Table 4: Connection from the PC Serial Port to the JAI CV-A11 (6-Pin Hirose Connector)

      Signal DSUB 9-Pin Connector
      (Female)
      Pin Number       Signal Name
      Signal
      Direction
      6-Pin Hirose Connector
      (JAI CV-A11) (Female)
      Pin Number            Signal Name
      Transmit-
      Receive
      2 RXD 1 TXD
      3 TXD 2 RXD
      GND 5 GND l 3 GND
        PC Serial Port (DSUB9) Loopback Connections
        Connect pins 1, 4, and 6 of the DSUB9 connector. Pins 1, 4, and 6 are the Data Carrier Detect, Data Terminal Ready, and Data Set Ready signals, respectively.
        Connect pins 7 and 8 of the DSUB9 connector. Pins 7 and 8 are the Request to Send and Clear to Send signals, respectively.

        Note: To preserve the quality and signal-to-noise ratio of the analog video signal, National Instruments recommends a cable length of less than 10 meters (~30 feet).

        Interfacing With the IMAQ 1409


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

        Note: Before configuring the software, remove the W1 jumper on the 1409 device.
          Configuration Files
          1. Copy the JAI CV-A11 30Hz Progressive Scan Ext HLock(1409).icd file into the <Program Files\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.
          6. Select Camera>>JAI>>JAI CV-A11 30Hz Progressive Scan Ext HLock.
          7. Click Save and exit MAX.
          8. Perform a snap and continuous video acquisition for diagnostics and verification.

        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. If you set up the camera to work in pulse width control mode, this setup allows you to specify the length of the trigger pulse in order to set the exposure time. (In pulse width control mode, specifying the length of the trigger pulse sent to the camera sets the JAI CV-A11 exposure time.)

        Because the IMAQ 1409 generates the trigger sent to the camera, you can also use the camera without providing an external trigger input to the IMAQ device. Specifying the width and frequency of the pulse signal generated by the IMAQ device determines the acquisition rate and exposure time (internal trigger mode). The camera provides both the horizontal and vertical synchronization signals to the IMAQ device

        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 that the CCD sensor can integrate. To compensate for the short exposure time and still get a well-contrasted image, provide more intense lighting or use a strobe light at the time of the image acquisition. A strobe light can also control the exposure time, in which case the sensor exposure time can be set to the maximum.

        Configuration of the A-series cameras is done via the RS-232C port. You can set up the camera using the VIs located in the LLB JAI CV-A Series RS232 Communication.llb. These VIs use NI-VISA (located on your LabVIEW CD) to communicate with the camera via the serial port.

        Note: You must install NI-VISA in order to use these VIs.

        Because the acquisition device is capable of outputting a signal that corresponds to the start of a frame (TRIG 1), it can be useful to illuminate the object by firing a strobe light when the frame is acquired. The camera also outputs an exposure enable (EEN) pulse that indicates the duration of the shutter, and can be used for controlling strobe illumination. This signal is available on pin 6 of the camera's 6-pin Hirose connector. Contact your JAI distributor for further details on how to use the EEN signal.

        Computing the Exposure Time


        This section explains how to compute the correct exposure time for your application.

        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 needed for the application corresponds to the time needed for the object to move the number of pixels specified by the blur. Figure 5 demonstrates how to compute exposure time.



        Figure 5: Computing Exposure Time

        Using the example numbers above, the exposure time needs to be less than: 1 x 100 / (640 x 150) = 0.00104 s = 1.04 ms

        Example Program


        This section includes a sample program that demonstrates an asynchronous reset acquisition.

        This example shows how to control the camera's shutter speed and how to perform an asynchronous reset acquisition with an IMAQ 1409 and a JAI CV-A11 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 board.

        The example makes calls to VIs that use NI-VISA to communicate with the camera via the serial port. Make sure NI-VISA is installed before running the example.
        1. Launch Measurement & Automation Explorer (MAX).
        2. Expand the Devices and Interfaces branch of the tree view.
        3. Make sure a Ports (Serial & Parallel) branch with a COM1 sub-item is in the tree view. If this branch is not in the tree view, reinstall NI-VISA and reboot your computer.

        This example is implemented using a state machine. In the first frame, IMAQ Create allocates the memory for the images.

        1. In the Start state, shown in Figure 6 below, IMAQ Init is called to initialize the board. Next, the subVI JAI CV-A11 Asynchronous Reset Manager generates all the signals. Inside this subVI, IMAQ Generate Pulse is called twice to create the shutter pulse (which controls the camera's shutter and asynchronous reset) and to output a strobe signal on one of the output lines. Next, IMAQ Configure List configures the buffer list, which contains one buffer. IMAQ Start starts the acquisition.

        Figure 6: Start State


        2. In the Acquire state, IMAQ Copy provides a copy of the image currently being acquired. IMAQ WindDraw displays this image in an image window.


        Figure 7: Acquire State

        3. The Stop state, shown in Figure 8 below, calls JAI CV-A11 Asynchronous Reset Manager to stop generating the pulses. IMAQ Close.vi is called to shut down the acquisition.


        Figure 8: Stop State


        To download the source code for this example and the LabVIEW driver to communication via the RS232C port to the camera, refer to the related link below.

        Related Links:
        Using the JAI CV-A11 Camera in Asynchronous Reset Mode with the IMAQ 1409
        5 ratings | 4.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/).