07-24-2024 11:08 AM
Niquist made a very good point to emphasize that you're only capturing a 10x10 grid and that you haven't laid out any requirements for particularly high speed. I kinda skimmed right by the 10x10 part without having it sink in -- I've mostly gotten into threads where the grid was more like 1024x1024 where synchronization and speed were much more vital.
The USB-6001 is still far from ideal, but it should let you at least be able to get a proof of concept working which will put you in a better position to evaluate the costs/benefits of a significant upgrade in DAQ hardware.
<time passes>
I created a simulated USB-6001 device in MAX and discovered that it showed no options related to signal routing. This seems to me to imply that you won't be able to sync up AO and AI at the hardware level in the usual manner with a shared sample clock or shared trigger. Which reinforces my impression that the USB-6001 is indeed very far from ideal. But you can still get started by using the simple but slow brute-force software timed approach outlined by Niquist.
As a recommendation, here's a small tweak to the procedure that could help you learn more about your system while you're stuck with these slow captures.
1. Start a finite AI acquisition. You'll explore and learn, but let me suggest a starting point of 500 samples at 1000 Hz.
2. Immediately update your AO output to move to the next position (as the AI continues to collect data)
3. Read & store your AI data for that grid point. Examine it well. You should be able to see things like a little lag before the response starts and a little further time before it settles to a steady value. The initial lag will vary some due to your use of unreliable software timing, but the time from start of response to settling time should be pretty consistent. This can help you choose better timing parameters for step #1 above. For example, maybe you'll find that you can simply wait 100 msec after updating AO, then capture & average 100 samples (to reduce noise) before repeating this sequence for the next grid point.
4. Stop the AI task
5. Repeat 1-4 for all needed grid points
-Kevin P
07-25-2024 08:31 AM
Hi again,
First of all thank you for the time dedicated helping me.
Yes, Niquist made a good point there, however I put 10x10 just to try, but I actually need a lot more points and a fast scan. Therefore, this is not working.
Meanwhile I have tried what you said, with my program, and as you said I can see a delay in the image that I get. I here attatch the code in .18 version and also an image of what I get with 25x25 samples at a rate of 1000Hz (Image 1). If I change the rate to 200 Hz, the image is better, as the delay is lower (image 2).
With all this known, which DAQ would you reccomend me to synchronize the galvos with the APD knowing all the equipment that I have? Maybe it is not for you to say, but as you have a lot of experience on different times that this happened, this is why I am asking. Thank you a lot for the support.
Carla
07-25-2024 01:58 PM
There are many ways to do this task and how you intend to do it make a big difference on what hardware you will need. I worked for Novanta for 20 years and we had an advantage you don't seem to have with Thorlabs galvos. We had dedicated Scan Controllers that were designed to do explicit tasks like writing characters, pattern drilling and 2-D raster scanning like you want. These devices used FPGAs to store a scanning pattern and then provided a pulse train synced to the POSITION signal to trigger a DAQ making your task easy. This is the fastest, most synchronized AND easiest way, but it requires dedicated hardware.
To use a just a DAQ card you will still have choices:
1) Step-based, like we have described above where you move a known distance in the X-axis, stop and read the sensor, repeat...
2) Synchronized scan, where you use analog OUTs to drive the X-axis smoothly across your field while simultaneously using analog INs reading the POSition signal from your galvo driver, and the output from your detector. You don't even need to move in a constant VELocity during the scan since you will have two synchronized arrays of X-POSition and optical power data to reconstruct your field.
3) Triggered scan, where you use an analog out to drive the X motion AND a synchronized digital output pulse train to trigger an analog input that is reading your optical detector. Some DAQs will allow you to make this connection internally through software.
Of course, you will still have to handle the Y-axis, repeating the X motion until you fill your 2-D array.
The good news is that most of the Multi-Purpose DAQs can handle most of these possibilities. For the best synchronization (option 2) it would be nice to use a DAQ that can do simultaneous sampling. That way you don't have to time correct the X-POSition and optical power signals. They are more expensive as you might expect.
A good general-purpose multiplexing (NOT simultaneous) DAQ is the X-Series 6351 - USB-6351 - NI
If you provide more specific details, we can certainly try to help you build your system, but I would still definitely suggest you write down all your needs and desires and then contact NI sales for advice on their latest hardware. There are also NI Alliance partners out there who will help you design or provide a complete scanning solution for a price if you feel you are in over your head.
07-29-2024 08:28 AM
Figured I'd reply too since I've been involved in the thread...
Basically, I don't have anything new to add b/c Niquist covered it quite well, and also has real-life experience dealing with some of this stuff.
I'd agree that the USB-6351 sounds like a fine choice of device for this. From what you've described so far, I don't think you'd really need a more expensive simultaneous sampling device, certainly not if you only need to capture 1 AI channel.
-Kevin P
07-31-2024 03:55 AM
Hello Niquist, and thank you for the help. We will proceed on buying a new DAQ, and we will also contact NI to be sure on the DAQ that we are buying.
Anyway, meanwhile we are trying to use the analog signal, converted to digital signal, to use it as a start digital edge, as this DAQ accepts digital input as triggers. However it still doesn't work, but I am working on the .vi that I send to get it to work and see what happens, until we don't have the new DAQ. Just to keep going with the work, as the program will have to work, could you have a look at it and see if it should be different the program? (attatch in later messages)
Thank you a lot for all the help.
Carla