LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Parameters setting for x-y scanning

Hi all,

 

I used a dual-axis galvo mirrors to do the x-y scanning, x direction is  triangle wave generated by waveform generation vi, y direction goes up in one direction. For the waveform generation vi, I am confused about the meaning of the sampling rate, number of samples and frequency. How do these parameters relate with the scanning rate, and the scanning dimension? For example, if I want the scanning rate is 104800 pixels/second, and scanning dimension is 1024 pixels per row, 512 rows in total. How should I set the he sampling rate, number of samples and frequency?  The unit of sampling rate in waveform generation vi seems HZ, not pixels/second.

 

Another question is I want to monitor the scanning time for one image, what should I do about the program?

 

Please see the attached VI.

 

Thanks,

Mei

0 Kudos
Message 1 of 6
(2,451 Views)

A couple of points:

  • Scanning usually involves two sawtooth waves, one going slowly (as from top to bottom), then stepping back to repeat, and the other going faster (say left-to-right) before stepping back to repeat.  If you do this, all the scan lines will be parallel, but you'll need to think about "what happens at the end" (as the return motion will usually be "as quick as possible" and you don't want to be scanning during this time).
  • You can use a triangle wave (for one or both axes).  This avoids the "get ready for the next scan" fast movement, but you now have non-parallel scan lines and will still have some motion artifact at turn-around.
  • When creating a DAQ signal, "Frequency" usually refers to the (fundamental) frequency of the signal.  "Sampling Rate" refers to the frequency at which you generate the individual voltages making up the signal, always much faster than the "Frequency" of the signal.  For example, if you want to generate a 10 Hz sinusoid, you may generate 100 points per cycle of the sinusoid for a sampling rate of 10 * 100 = 1 kHz.
  • Generally, pixels/second of scanning will be related to Sampling Rate.  If we assume something that definitely is not true, that the movement is instantaneous, takes no time, and doesn't produce any "movement artifact", then this is the "scanning rate", the rate at which you must update the position of your scanner.  You already know how many samples/row you need, but might need to take into account "intermittent sampling", such as "Move X at 104800 steps/second for 1024 steps, pause long enough to return X to the start and move Y, repeat until you've moved Y 512 times, pause to reset both X and Y, and do more scans".

Bob Schor

0 Kudos
Message 2 of 6
(2,412 Views)

Hi Bob,

 

Thanks for your reply. But I still have some questions:

 

1. What do you mean by 'non-parallel scan lines' in your point two? If I use the rising edge of the triangle wave for scanning like from left to right, then use the falling edge scanning from right to left, and add one extra data at the turn-around position to equal the number. Like a snake scan(please see the attachment), is this OK? If I can use this scanning mode, do I still need to consider the intermittent sampling?

 

2.In my assumption, the sample rate should be set as 104800 S/s (including the intermittent sampling), but What is the frequency and number of samples setting? number of sample is 1024? frequency is decided by the scanning time I want? If for 1024 x512 image, I hope the scanning time 5s in total. Should the frequency be set at 1/(5/512)=102.4 HZ?

 

Thanks,

Mei

0 Kudos
Message 3 of 6
(2,407 Views)

@M.Mei wrote:

 

 

2.In my assumption, the sample rate should be set as 104800 S/s (including the intermittent sampling), but What is the frequency and number of samples setting? number of sample is 1024? frequency is decided by the scanning time I want? If for 1024 x512 image, I hope the scanning time 5s in total. Should the frequency be set at 1/(5/512)=102.4 HZ?

 


Sorry, I think this calculation for frequency is not right... If the number of sample is right, the frequency should be 104800/1024= 102.34 HZ. But how do I change the scanning time?

 

Thanks,

Mei

0 Kudos
Message 4 of 6
(2,404 Views)

Hello, Mei.

 

I think you are right about the "snake-scan" -- it is certainly simpler to reverse the motion of the mirror (and takes less time!) than to "zip" it back to the beginning.

 

I looked at your numbers again.  First, let me (for reasons that will become clear, namely "doing the math in my head") change the sampling rate from 104800 S/s to 102400 S/s.  Now we'll do 1024 samples per row, which takes ... 1024/102400 = 0.01 sec, and you want to do 512 rows, which takes 5.12 sec.  This seems too "neat" a package -- are you sure the sampling rate is 104800, not either 102400 or 204800?  [Maybe the extra 2400 samples/sec are for "end-of-row/end-of-column" extra time].

 

What do you do after a scan?  Do you do a "double-snake" and make Y's waveform also a triangle wave, or do you just do a single pass?  And, the Big Question, does it work?

 

Bob Schor

0 Kudos
Message 5 of 6
(2,398 Views)

Hi Bob,

 

Thanks, and sorry for my late reply.

 

For the sample rate 104800 S/s, it is an example, I think an example will be easier for the explanation. So, I do not need to care about the frequency, only set the sample rates and number of samples?

 

For X, I will choose the snake scan, and for Y, I intend to use half triangle wave or just some discrete linear numbers same with the scanning rows to do the x-y scanning. I only need one image per time, so single pass should be fine. I do not know whether it works now because something wrong with wave data..

 

Thanks,

Mei  

0 Kudos
Message 6 of 6
(2,388 Views)