LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D Raster Scan of a sample area

Hi,

I am trying to control a Dual axis Galvano mirrors where I need to scan a sample in raster pattern. I am using NI-DAQ 6351.

The problem which is occurring is with the scanning area. Even though the mirrors are scanning in a raster form, but while I increase the no of points of Y axis, the scan area decreases. 

For example- I want to scan a sample area by increasing the no of points(X) from 64 to 128 and no of points(Y) is also increased from 64 to 128.

In this case, Horizontal scan area(X axis) remains same but vertical area(Y axis) goes on decreasing due to which I am not able to meet the requirement. 

Can anyone please explain me why this is happening and how can I optimize this, so that on increasing the no of points for X and Y, I can scan the desired sample area which I want.

Below I am attaching the VI code which I have followed.

Thank you

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

2 quick things:

 

1. You should have used "Unbundle by Name" on your 'Sampling Info' cluster.  Then you would have seen that you mixed up the two elements.   You sent Fs where #s should have gone and vice versa.

 

2. Your AO and AI tasks are not sync'ed.  They merely start at *approximately* the same time, subject to software timing jitter, which will usually be within a couple msec but occasionally quite a bit more.

    You should either share a sample clock (and make sure the task that sources the clock is started last), or, because both tasks are on the same device, trigger both tasks after starting them with a signal you control.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 6
(2,231 Views)

Hi,

Thank you so much for pointing out my mistakes.

 

However I would like to know if there is a relation between the sampling rate and scan angle of the mirrors. If so, how are they related? I have a doubt on whether the sampling rate for the raster scanning is dependable on the step size or the scan angle of the mirrors.

 

Can you please help me in clearing this doubt?

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

@Naina87 wrote:

I would like to know if there is a relation between the sampling rate and scan angle of the mirrors. If so, how are they related? I have a doubt on whether the sampling rate for the raster scanning is dependable on the step size or the scan angle of the mirrors.


The simple answer is "Yes".  Let's say the mirrors can be moved at a rate of 100 "steps" (or "mirror units") per second.  If you ask it to move 1 step every second, in 10 seconds it will move 10 steps.  If you move 1 step at 10 Hz (or every 0.1 sec), in 1 second it will move 10 steps, and in 10 seconds it will move 100 steps.  1 ste p at 100 Hz gives 100 steps in 1 second and 1000 steps in 10 seconds.  But asking for 2 steps at 100 Hz (or anything > 1 step at 100 Hz) will give you the "plateau" value of 100 steps/sec -- the motor cannot go any faster.

 

Something to think about when using a "raster scan", where X has to "zip back from Max to Min in one step" is that X moves one "spatial step per time step" except at the end of the scan, where it has to move faster than "scan width per time step" to get back to the origin.

 

There are a few ways to fix this (there may be others than these I'm mentioning):

  • Leave time at the end of each X (and Y!) Scan to get back to the origin.
  • Scan every other line "backwards", i.e. go Left to Right on even scans, Right-to-Left on odd scans.  Note that this also means that you have to do a similar thing with X and Y -- you end up repeating the Scan order every 4 scans.

Bob Schor

 

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

Took a second look at this.  I'm not sure I totally understand what the sticking point is, but it sounds like it might be that your "Scanning parameters" determine the # of points you define in your raster pattern, but then separately your "Sampling info" determines the # of points you actually generate and capture.

 

If you change your Scanning parameters to define more points, you need to change Sampling info to define the same # of points.  Better yet, set your # samples for the finite AO and AI tasks directly from your Scanning parameters, #X * #Y.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 5 of 6
(2,198 Views)

Hello.

 

By mistake, you sent me the following Private Message:

Hi,

At first thank you so much for your reply to my previous query related to sampling rate and the no of steps of the mirror.  Although I am not able to get the idea properly regarding fixing the problem of scanning which you have said, i.e. "Leave time at the end of each X (and Y!) Scan to get back to the origin.  Scan every other line "backwards", i.e. go Left to Right on even scans, Right-to-Left on odd scans. Note that this also means that you have to do a similar thing with X and Y -- you end up repeating the Scan order every 4 scans."

But I am trying my best to understand it well.

 

However the problem which I am facing is basically related to the scan area.  Whenever I increase the no. of points for X and Y mirrors, the scan area on the sample decreases. As a result only it can able to scan only a small area.  For example: 

 

For no. of points(X)=64, no of points(Y)=64, Sampling rate=10K and No of samples=1000, I used to get the desired scan area which I want.  But when no of points(X)=512, no of points(Y)=512, Sampling rate=250K and No of samples=25000, then the previous scan area decreases horizontally due to which I am not able meet the requirement which I want.

 

Can you please explain why is this happening and if possible kindly please provide me the correct raster program.

--------------------------------

Here is my response:

     I suspect you are "over-driving" your mechanical system.  Even a sampling rate of 10 kHz sounds a bit high to me, let alone 250 kHz -- that's a quarter of a MHz, and you are trying to drive a mechanical system with that?  I'm not an Engineer, but that sounds like quite a trick!

     Here's a suggestion -- do the following experiment (it will be simple to code it).

     Create a Sawtooth waveform, one that goes from "Left" to "Center" (whatever coordinates move the X Mirror in 100 steps, 50 going from "Left" to "Center" and the other 50 going from "Center" back to Left".  Output these points at 100 Hz continuously.  Leave Y alone.  You should see your mirror going back and forth at 1 Hz (there might be a little "ringing" at the turn-arounds).

     Now double the length of the Waveform, 0 to 100 to 0 (or 200 points), but continue to deliver them at 100 Hz.  The speed of the mirror movement will be exactly the same, but it will move twice as far (a "bigger scan", which is what you want), but it will take longer to do a single scan.

 

     The issue I was raising in my previous Post had to do with the direction of movement.  The Triangle waveform I suggested here using a single "speed" (though the velocity changes sign).  If you want to "scan" like a Video scans, you need to get the Mirror back to its starting point to do the next scan, so you want to move "at maximum speed" to avoid a large "time gap".  I was suggesting that you scan with a "triangle" Waveform, as the previous paragraph suggests -- this also has some drawbacks, but tanstaafl ... (some of you will understand this).

 

Bob Schor

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