Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Calculating Frames per Second/Loop Time in High Speed Acquisition (20-80kHz)

Hi everyone,

 

I want to verify if I lose frames in my high speed acquisition at >20 kHz. (Photonfocus MV1024E; Exposure Time down to 11 us; ROI down to 16x1 (= max. 77 kHz))

 

For this I tried already different things as the normal ways like the "Calculating FPS" VI and measuring each loop cycle itself didnt work properly (as far a I understood because Windows has too much "jitter" to measure cycles of ~20 us?).

So I tried with a time counter to get the us-time stamp at the first cycle and at the last cycle, substract them to get the total loop time and then divide the result by the number of cycles to obtain the time of one loop cycle. 

Then I used this to calculate the average fps. It works well up until around 20 kHz (although the value is not the exact value that is expected for the specific ROI and Exp Time). For FPS above it feels like the value hits a ceiling.

 

Is there a better way to do this? 

 

Thank you very much!


I attached my VI:

0 Kudos
Message 1 of 3
(1,541 Views)

If you want to make sure you know if you lose frames, I would recommend setting "OverwriteMode" to "Fail." If you combine this with "Every" mode for extracting buffers, the driver will return an error if it is not able to get next buffer in order after the last one you'd previously extracted. All of this functionality should be available also in NXG, even though it's not an NXG screenshot:

kensign_0-1598970960580.png

The reason there's a "Compare Buffer Number" sub VI is to account for buffer number rollover. Buffer numbers are 24 bits, so the max is 16,777,215.

 

As far as the specifics on your original question, I don't have the expertise to advise on the timing piece at those high rates. I just wanted to say that this is how I'd recommend making sure you're not dropping images if that's your intent. Understandably you may also want to understand your loop rate, so maybe someone else can weigh in on that.

0 Kudos
Message 2 of 3
(1,499 Views)

Hi Kati,

 

so I think with the answer you gave me to my other question concerning the buffer modes (https://forums.ni.com/t5/Machine-Vision/Buffer-Mode-quot-Next-quot-and-quot-Every-quot-in-IMAQdx-Ext...) I am confident that I dont lose frames with "Every".

 

Still I wanted to have some kind of fps to be sure, I think I found a way that is working okay.

I added the IMAQdx system timestamp information to each image that was acquired. It looks like this can only be as specific as 1ms (as a bundle of images have the same timestamp) but by taking a larger number of frames and substracting the first time stamp from the last and dividing by the image number, I get good agreement to the expected fps values.

Here is a screenshot: 

0 Kudos
Message 3 of 3
(1,477 Views)