Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

pci 1428 timing with pulses

hardware:
pci 1428 frame grabber
dalsa pantera tf 1m60 camera
laser
flash
usb 6008 multifunction daq

software:
labview 7.1

First, my program triggers the laser using daq assistant vi (the laser is wired to one of the dio outputs of USB 6008) then calls the time delay express vi.  After which the generate pulse vi is called to trigger the camera to start an acquisition on rtsi line 0 (single pulse).  I then trigger the flash using daq assistant vi and use grab acquire vi to get one image.

I would use the external triggers on the frame grabber to trigger the laser and flash but they unfortunately have stopped functioning.

I will attach a picture or copy of the vi (I just do not have access to the computer with labview on it at the moment).  I have a few questions.

For the pulse parameters of the generate pulse vi (pulse delay and pulse width) what are the minimum acceptable values and how accurate is it?

My issue is with the time delay vi.  It seems its smallest value is 1ms.  How accurate is it?  Is it software or hardware controlled?  My application requires that I delay the laser and the camera&flash anywhere from 0ms to 15ms.   It has to be very accurate.  If I had used the generate pulse vi to trigger the laser and simply input a longer pulse delay on the generate pulse vi for the camera to be say 5ms greater than that of the laser would that have been more reliable/accurate than using the time delay express vi set at 5ms that I am currently using?

I have the camera configured in MAX to have a 7ms exposure time (in mode 4) but if I understand correctly the pulse width parameter of the generate trigger vi would also control the exposure time.  If I have it set to 7ms exposure time in MAX but then have the pulse width set to 2ms in my program, which one takes precedence?

Also with this program, I can only capture a consistently good image when I have the exposure time set to 7ms or longer in MAX, anything less either gets a blurry image once in a while or if less than 5ms, the image is completely black.

Thanks in advance,

0 Kudos
Message 1 of 10
(5,552 Views)
Hi davie,

The time delay VI is software-based, and on a Windows system, the absolute best you can get in terms of time resolution is 1ms. However, the non-deterministic nature of a non-real-time operating system like Windows, Mac OS, or Linux  means you can never be sure that it will wait for exactly the number of milliseconds you request. That would require a real-time OS. Keep in mind that your DAQ Assistant VI is also a software-timed call. For more advanced DAQ timing you'd need to use the DAQmx VIs - however, the USB-6008 will be limited in what kind of options you have for that.

I think using the Generate Pulse VI like you mention is a better way to go. I think you can use two VIs, one to generate the trigger pulse for the laser, and one to generate the camera & flash triggers. On the latter, use the "signal type" terminal to tell it to read off the external trigger lines, and for "signal number", specify the same trigger you're sending out the laser's trigger on. Then enter a pulse delay of however many seconds you want  - the camera & flash pulse should only start when a laser trigger is detected and the waiting period has elapsed. This will be hardware-timed on the IMAQ board itself, which will give you tighter timing.

The KnowledgeBase 2MRCB58M article Triggering Limitations for IMAQ Boards provides some useful information on hardware limitations the IMAQ boards have with regards to triggering.
0 Kudos
Message 2 of 10
(5,526 Views)
Hi

thanks for the quick response.  That link sends me to an error page.

If I only use the pulse delay as my "time delay" won't the flash fire prematurely since it's being turned on by the daq assistant which has no time delay in it?  I know there is a counter terminal on the usb 6008 but not sure how I would use it to also time the flash.

Are there any usb devices that can generate pulses using daqmx that you would recommend?
0 Kudos
Message 3 of 10
(5,521 Views)
Just adding a picture of the block diagram for the vi that I am using.
0 Kudos
Message 4 of 10
(5,503 Views)
Hi davie,
The method I recommended actually didn't use the USB-6008 at all. It would have you generating the trigger for the laser from the 1428 card using the IMAQ Trigger Drive2 VI, and then activating the camera & flash trigger based off of that one (through IMAQ Generate Pulse) - when the 1428 sends out the trigger for the laser, this would also internally trigger camera & flash pulse. But rather than trigger the camera & flash immediately when the laser trigger started, the pulse delay parameter would cause it to wait for X milliseconds before it sent out its signal.
0 Kudos
Message 5 of 10
(5,493 Views)
I had been doing something like previously but the external triggers on my frame grabber failed which is why I ended up purchasing a usb 6008 not fully understanding the necessity of pulses.  The external triggers can detect incoming pulses but can't generate them so thus I can't use them to trigger my laser or flash.  I was trying to find a suitable work around since I can't afford to buy another pci 1428 card.
0 Kudos
Message 6 of 10
(5,486 Views)
forgot to ask, could you repost that link to triggering limitations of imaq boards?  Every time I click on the link it says error, you do not have access to this file.

Also do you have any answers to some of my other questions posted in the original message?

"For the pulse parameters of the generate pulse vi (pulse delay and pulse width) [using pci 1428] what are the minimum acceptable values?"

"I have the camera configured in MAX to have a 7ms exposure time (in mode 4) but if I understand correctly the pulse width parameter of the generate trigger vi would also control the exposure time.  If I have it set to 7ms exposure time in MAX but then have the pulse width set to 2ms in my program, which one takes precedence?"

"Also with this program, I can only capture a consistently good image when I have the exposure time set to 7ms or longer in MAX, anything less either gets a blurry image which is displaced towards the bottom once in a while or if less than 5ms, the image is completely black.  
Any explanation as to why?"

thanks


Message Edited by davie on 04-22-2008 11:13 PM
0 Kudos
Message 7 of 10
(5,480 Views)
Hi davie,
Unfortunately I only realized after I posted that the document is internal-only and cannot be accessed outside the company. Since you cannot generate triggers on your board anymore, it wouldn't really matter, as it primarily deals with limitations in simultaneously generated triggers.

With your 1428's triggering lines - you said you can receive triggers but cannot generate them. I don't know if you've looked into it, but depending on how your triggering circuitry has failed, it might still be possible to generate the trigger signals and use them internally to the 1428 without sending them out over external triggering lines. Have you tried this before?

As for the minimum pulse width of a triggering signal, TTL switching takes place in the <100 ns range and the sampling of the trigger line is fairly high. I don't have specific numbers for you, but pulses as short as 1ms should easily be detected by the frame grabber.

It looks to me like setting the camera into mode 4 will disable the MAX setting of exposure time since the camera will only look to the external trigger signal EXSYNC to control both exposure and  framerate. Then your pulse would need to be as long as the necessary exposure time.

The camera is probably giving you bad images below 5ms exposure because that's essentially equivalent (if you were in mode 4) of trying to operate it at 200 fps. I can't say for sure, but it sounds like the lower bound of the camera's sensitivity requires a longer exposure time than that.  Even just 7ms would equate to 142 fps.
0 Kudos
Message 8 of 10
(5,460 Views)
I have not tried generating trigger signals internally with the 1428...how would I do this?
0 Kudos
Message 9 of 10
(5,293 Views)
You can use the IMAQ Generate Pulse3 VI to create signals on a 1428. The detailed help for the VI will be very helpful, but the basics are that you can generate a pulse train (for pulse mode), and choose the Trigger Type as External, where the Line number specifies which line to send it on (0-3, I believe, for the 1428). You can base this generated pulse on either an external trigger signal coming in, a signal coming in via RTSI, or an internal status signal.

Status signals you can place onto the trigger line using this VI are
  • Acquisition in progress—Asserts when the acquisition begins.
  • Acquisition done—Asserts when the entire acquisition is finished.
  • Frame start—Asserts at the begining of each frame that is captured.
  • Frame done—Asserts at the end of each frame that is captured.
  • Immediate—Asserts immediately.
Check out the detailed help for more info on how to use the VI.


Or, you can manually assert/unassert/export some signals (such as pixel clock and VSYNC pulses) using the Trigger Drive2 VI instead. The detailed help on that VI will come in handy there too.
0 Kudos
Message 10 of 10
(5,265 Views)