LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XYZ scan controller too slow

I've written code for a X-Y-Z scan controller for a Scanning Tunneling Microscope. I use three embedded While Loops with shift registers on the outer two to get the X and Y voltage levels for each scan, The third (Z) level needs to come from the output of a PID based on the current read from the tip of the scanning device. Each of the loops has a DAQmx Write function within, and the inner (Z) loop has also a Read VI and the PID feedback.

 

I first tried doing this with generated waveforms but the timing seemed to complicated, at least for my level of experience with DAQmx.

 

The method I desribed is very slow. 1.7 seconds for each Y scan, which, for a 350x350 grid comes out to almost 10 minutes per scan. If I put this in Real-Time module will I gain a lot of speed? I am having trouble coming up with the proper hardware that's compatible with RT at our lowly Institution of learning - budget cuts are rampant and I'm doing this on a Pentium 4. If I will gain a bunch of speed I will continue pursuing the aquisitions.

 

Or, am I entirely off base to approach this using embedded loops?

0 Kudos
Message 1 of 12
(4,915 Views)
I tried replacing the outer two While loops with For loops and now I get 1.53 seconds for each Y scan.
0 Kudos
Message 2 of 12
(4,905 Views)

lindope,

 

It's possible there's some memory/IO optimization that can be done.  Also it's possible throwing some things into subVI's would help a little... but it's hard to tell what's going on in that jpeg.  Could you post the actual VI?

 

Also, the timing statistics that Labview generates could be helpful - go to tools --> profile -->performance and memory; check the "Timing Statistics" box, click start, then run the VI.

 

I don't have much intuition for how fast Labview on a P4 should drive this application, but 205Hz doesn't sound terrible to me...

 

 

0 Kudos
Message 3 of 12
(4,889 Views)

Thanks, I didn't know about the timing profile thing. It seems as though the majority of time is being taken up with the DAQmx Read/Write VI's.

 

I have them set up as 1 Sample (on demand) and auto-start.  I don't know if there's a better way. I'll se if I can package the VI's to post them, I have all the channel setup's in seaparate VI's.

 

Can I put the DAQmx Write outside the loop and just call the DAQmx Start inside the loop? I'm not real clear how that works.

 

One thing that's worrying me about this scenario is right now I am not doing any PID analysis, when I kick that in it will potentially double (or worse) the execution time.

 

Here's a newer, and perhaps more viewable version of the screenshot.

Message Edited by lindope on 02-24-2010 03:59 PM
Message Edited by lindope on 02-24-2010 04:05 PM
0 Kudos
Message 4 of 12
(4,877 Views)
Here are the vi's. Any suggestions/critiques would be greatly appreciated.
Message Edited by lindope on 02-24-2010 11:22 PM
0 Kudos
Message 5 of 12
(4,855 Views)

hi

 

sorry if this is too late,.. I didn't see this message before.

I think you can use two embeded loops for XY but a parellel loop for Z (with a time mark to go back to the XY values). What is the hardware you are using ?

A DAQ can be made faster than half of a second.. with a cost of resolution/precision.

please let us know how it is working.. this seems like a nice project

regards

 

0 Kudos
Message 6 of 12
(4,745 Views)

Thank you for your interest. I am due to finish the project by May 20, so you are not entirely too late.

 

I am using 2 PCI-6251 cards, X and Y values out of one and Z coarse and fine position out of the other.

I am only using one input for the tunneling current.

 

I have trimmed my current process down to 4.25 minutes per scan. I have also changed my scan method, I am scanning both directions, back and forth, so my output to the piezo is a triangle wave at about 2 Hz.

 

What do you mean by a parallel loop with markers back to the XY? Could you please explain further?

0 Kudos
Message 7 of 12
(4,724 Views)

if i understand correctly, your procedure is as follows :

 

1. move coarse Z 

2. finely move x, then y then z 

 

Instead of sequentially moving xyz, you can move x,y and in a parallel loop acquire current and adjust Z: do you 

what is the frequency of the z tune ? (can you give more details on all your hardware ? thanks)

regards

0 Kudos
Message 8 of 12
(4,697 Views)

It's a homebrew STM head (well Schoolbrew would probably be more appropriate) using PZT-5A piezo tube.

 

I'm working on the coarse approach right now. Maybe you can help me with this.

I have a VI setup to output a 1KHz sawtooth to the nanopositioner (ANPz100 from Attocube).

But the approach is too fast to stop. I think I need to output single ramps and I can't figure out how to do that

I've been playing with the Define Arbitrary Waveform and have a set of data but I can't figure out the DAQmx Write attributes to go along with it. Am I going in the right direction? or can I simply modify my continuous sawtooth to get one ramp?

 

 

0 Kudos
Message 9 of 12
(4,676 Views)

hi

i don't understand what do you mean by "too fast".. the tip crashes into the sample ? you use the nanopositioner for coarse approach then the piezo for "regular" scanning , right? i think the only thing is that you need to do a rather fast upgrade of tip position.. tens of kHz, ? (i am not an expert on stm, just find it an interesting project)

regards

Message Edited by nitad54448 on 05-01-2010 10:56 AM
0 Kudos
Message 10 of 12
(4,668 Views)