12-13-2019 08:50 AM
Hello,
we are trying to do some time critical calculations in our custom build SPIM setup. The idea is that we need to react on trigger signals of a camera and give some trigger signals in order to change the voltage of a galvo-mirror (analog signal). These actions need to happen in a µs scale. Until now there is always a non-constant delay between the two actions (movement of the galvo-mirror and read-out of the camera) which changes from acquisition to acquisition. We want to synchronize these two actions.
A solution used on another setup is the use of an FPGA to achieve this µs accuracy. Due to the price of this device I am looking for another solution. Since I'm also rather new and unexperienced with the use of LabVIEW I would like to know, if there is a possibility to synchronize trigger signals in a µs accuracy.
The used devices are:
Computer: Celsius W520 + IO Interface, Windows 7 Professional
LabVIEW card: NI PCIe-6353, X Series Multifunction DAQ with 2x SCB-68A Connector Blocks
LAbView 2012, Version 12.0, 64 bit
12-13-2019 09:12 AM
For these timing requirements, it needs to be in hardware. Therefore FPGA is really the only way.
12-13-2019 09:14 AM - edited 12-13-2019 09:16 AM
There is no other option!
The accuracy and reaction time you can achieve is roughly as follows:
- Special dedicated hardware, tens of nanoseconds
- FPGA: microseconds
- realtime OS: 100 us to millisecond
- standard OS: tens of milliseconds to second
Trying to go lower than that to save money always will cost you more in the end!!
12-13-2019 09:29 AM
Just double-checking something.
Does each camera trigger signal cause you to *initiate* calculations in order to *decide* what voltage(s) to send to the galvo? And you need microsec-level turn around time to do all of the following:
- detect the trigger
- do the calcs
- generate the analog voltages
Or did you use the term "calculations" a little too casually, and you just need microsec-level timing relationships for your signals?
I ask because there have been many threads here syncing an imaging device with a galvo mirror and they *usually* just require some careful programming of DAQmx tasks under windows. The DAQ hardware takes care of the microsec-level reaction times, once programmed correctly.
So can you more fully and clearly describe the nature of your input and output signals, the required timing, and (especially) any need to make decisions about output signals on-the-fly in reaction to whatever's being observed?
-Kevin P
12-13-2019 09:45 AM
We first need to wait for the "camera is ready" signal (which is not the problem). Afterwards the galvo-mirror needs to move synchronized with the camera detection. The idea is to illuminate always the part of the camera detector that is currently read out (with the use of a rolling shutter for the camera). The profile of the galvo-mirror voltage pattern should be a step function, synchronized with the read out of the camera. The individual pixel lines of the camera detector are changed every ~10 µs, therefore the galvo-mirror needs to get the signals in the same time scale. I guess in theory the steps of the galvo-mirror could be calculated before and stored in an array which then needs to be read out by the VI at each step.
12-13-2019 10:06 AM
Yep, as I kinda suspected. This sounds *very* doable via proper DAQmx programming of an AO task on your DAQ board. As you said, you simply need to plan and calculate the step pattern ahead of time and configure a buffered hw-timed DAQmx task. (And maybe also a counter task if you need a controllable delay between the external signal from the camera and the AO output step change.)
You should be able to do all this under Windows -- the board does all the heavy lifting with respect to the timing relationships. Do some searching here with terms like "galvo", "camera", "scanning", "sync", "imaging", etc. I think you'll find lots of info and hopefully a few code examples.
-Kevin P
12-16-2019 02:55 AM
Thank you very much, i will look more deeply into the Forum.