From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Frame divided. Basler camera with FPGA

Solved!
Go to solution

Hi there!

I am using a Basler acA2000 340kc camera controlled through a PCIe-1473R FPGA.

After some trouble, I finally modified it and changed the TAP configuration by using this post.

 

http://digital.ni.com/public.nsf/allkb/EA1727D8D620B81F8625797B0072257C

 

With just the modification in the FPGA, the camera works and takes succesful images, nevertheless the frame appears divided into four images (all identical but for light intensity).

When I modify also the host code, then just one image appears in the frame, but definitely not a good image, as previously.

Anyone knows why can be this problem happening?

Thanks for your help.

0 Kudos
Message 1 of 10
(6,728 Views)

I include two pictures.

image1.png is the image I'm getting with the modifications of the link I poster. It's a single image but clearly not correct.

image2.pong is the image I'm getting when I don't modify the host code (just the FPGA code). It is a good image, but four times in the frame.

Thanks!

Download All
0 Kudos
Message 2 of 10
(6,673 Views)

It is likely that your tap configuration is incorrect. The camera is transfering the pixel information through each of the 8 bit taps. The camera doesn't necessarily send these pixels in order from left to right. You will need to find out what the tap pattern is for your camera and you will need to program the FPGA and the host to insert the pixels into their correct locations. Below is a diagram of some typical tap configurations. It could be that you are using a quadrant pattern when you need to use a two tap adjacent.

 

How many taps are you using? How many bits in each tap?

 

Tap Configuration.png

 

Jeremy P.

Applications Engineer
National Instruments
Message 3 of 10
(6,659 Views)

Hi, thanks,

I send you a picture with the pieces of code concerning the tap geometry. I'm using a 2tap 10 bit configuration. With this code I'm getting the four pictures in one frame.

 

My camera supports a 1X2-1Y tap geometry, which starts at line 1 and transmits the first two pixel in the first clock cycle and so on until first line is done, then goes to second...

I don't know which tap configuration I'm using in the FPGA code, 

What modifications can be made for a two tap configuration??

 

 

Download All
0 Kudos
Message 4 of 10
(6,656 Views)
Solution
Accepted by i.popa

I think that I figured out what is going on. I believe that the knowledgebase article that you were reading is incorrect. Let's troubleshoot the problem together and I will correct the article if necessary.

 

Let's talk for a little bit about what is going on. The two taps are 10 bits each, but they are stored in 16 bit data type. The two pixels need to be transfered from the FGPA to the host with a DMA FIFO. For convenience, the code uses only one DMA FIFO even though there are two taps. The article suggests that you should combine the 2 16-bit numbers into 1 32 bit number and then send it into the DMA FIFO. There are a few problems with this: first, the DMA FIFO has been configured for 16 bits, so half of the data is being deleted. Also, the code on the host is splitting the 16 bit data into 8 bits, which is not correct.

 

I think that it would be better to change the DMA FIFO to support 32 bit data. You can do this by opening the LabVIEW project and right-clicking on the Host DMA 16, select Properties, and then change the data type to U32. After that, you need to program the code on the host to split the number. You would then get two arrays (one for each tap). I think that it will reconstruct the image correctly if you just interleave these two arrays.

 

I attached some images. Try it out and tell me if it works. If so, I will update the documentation.

 

Jeremy P.

Applications Engineer
National Instruments
Download All
Message 5 of 10
(6,502 Views)

Thanks a lot!

I made this modifications and the it is getting a correct image!

0 Kudos
Message 6 of 10
(6,471 Views)

I am glad that it worked. I am in the process of correcting the Knowledgebase article.

 

Jeremy P.

Applications Engineer
National Instruments
0 Kudos
Message 7 of 10
(6,442 Views)

Hi Jeremy,

 

It still says Host DMA 16 in your revision.  Should it be Host DMA 32?  Also, is there any example to convert the 1-Tap Centroiding to a 10-Tap Centroiding? (Doesn't have to be 10-Tap, could be 8-Tap..etc.)

 

Thanks,

Andy

0 Kudos
Message 8 of 10
(5,011 Views)

Hi altran,

 

In the example project the FIFO is named Host DMA 16. The article is trying to show how to reconfigure the example project so it is using the name of the FIFO used in the project. You are changing the FIFO named Host DMA 16 and changing the data type to U32.

 

As for your other question about a 10-Tap centroid, I don't think there is an example for that. You should post a new forum post to see if you can boost the signal, maybe some one in the community has done it before.

 

Regards,

Michael Bilyk

Applications Engineer

National Instruments

Michael Bilyk
Former NI Software Engineer (IT)
Message 9 of 10
(4,980 Views)

Will do, thanks.

0 Kudos
Message 10 of 10
(4,973 Views)