LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

AFM FPGA Auto Approach

Solved!
Go to solution

Hi All,

 

I am trying to implement a code, in order to realize an auto-approach for an AFM microscope. The program, basically has to send an analog signal which decreases from +10V to -10V and if it enters in contact stops, if not, the signal will increase from -10V to +10V and after this, the program has to send a digital signal for a certain period of time, and than from the beginning.

My first try was with Flat Sequence Structure, but I didn't manage to keep the digital signal for the desired time.

Second attempt was done trying to implement a state machine, as you can see in the attached files. This time the result is better, but my program flashes each time the digital signal is sent, and it takes a lot of time to get in contact.

 

The device used for this task is a NI PXIe - 1073 system with an NI PXI-7851r board and LabVIEW 2012 sp1.

 

I think, I am making a mistake but I don’t know were.

 

Also, if I run the program, than stop it and run it again, the FIFO elements gets scrambled, unless I increase the requested depth. I don’t understand why ?

 

Any help would be greatly appreciated. Thanks!

Download All
0 Kudos
Message 1 of 5
(2,610 Views)

Hi Alexjdr,

 

What do you mean your "program flashes each time the digital signal is sent"? When you say "it takes a lot of time to get in contact", do you mean that your microscope is not moving as fast as you'd like?

 

Have you considered using a single cycle time loop for your application?

 

I'm also noticing that your outer most while loop in the state machine approach has a false constant tied to it which means it won't stop and you'll have to abort to stop the program. Is this the functionality you intended to have?

Robert B
RF Product Support Engineer
National Instruments
0 Kudos
Message 2 of 5
(2,558 Views)

Hi USBarnes,

 

I found that the "flash" (all the panels become greyed out) is present due to the fact that, when the motor is turned on, the program has to wait a certain period of time in order to actually start the motor, and this stops the data flow with the PC. I wonder if there is another way to implement this?

 

I've decreased the period of time for entering in contact, by increasing the piezo elongation for each incrementation in the loop.

 

I’ve taken into consideration the single cycle time loop, but I don’t think it can process all this code.

 

In the end I'll have a button there, in order to stop the program, now I’m testing.

 

Do you have any other idea in order to accomplish this task?

 

Thank you very much for your input.

0 Kudos
Message 3 of 5
(2,541 Views)
Solution
Accepted by topic author Alexjdr

Alexjdr,

 

How are you initializing your microscope? Do you always initialize it to a certain position at the beginning of the program? Your program is a little hard to follow. You may benefit from using the basic state machine architecture and including all the different states (initialize, idle, run, cleanup, etc.) within a single case structure and while loop rather than all of the nested loops and sequence structures.

Robert B
RF Product Support Engineer
National Instruments
0 Kudos
Message 4 of 5
(2,498 Views)

Hi Robert,

 

Thank you for your help.

I've implemented a full state machine and now it works.

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