03-19-2022 11:32 AM
Hi,
I am working on an application where I need to synchronize camera captures and a galvo mirror. The camera acquires frames at ~300 fps, and after each capture, the galvo mirror scans to a new location, and then the camera captures another frame.
The way I am doing it is, I use the GPIO exposure signal from the camera to feed as an external scan clock to PFI0 on NI USB 6343 which then outputs scan voltages through analog output to the galvo mirror.
The main problem is, sometimes the scan happens randomly, the camera output captures frames where the galvo mirror is still moving. In order to debug what's happening, I am curious as to how the scan clock work. Does the scan happen on falling/rising edge or when the clock signal is high or low. I am using MATLAB for the synchronization.
Solved! Go to Solution.
03-21-2022 06:30 AM
New analog output samples will be generated on a scan clock *edge*. (Note: the term "scan clock" was in use long ago under traditional NI-DAQ, the common term under DAQmx for almost 20 years has been "sample clock.")
You can specify whichever edge you prefer, but I think it will default to rising edge if you don't say otherwise.
Keep in mind that the DAQ timing will be very regular. The content of your AO voltages implies a distance to move between samples. It's possible 300 Hz is too fast for the galvo to complete some of the implied movements you're commanding with your AO signals.
-Kevin P