12-09-2011 04:37 PM - edited 12-09-2011 04:42 PM
I am using labview to control a piezo actuator from Polytec. I use NI PCI-6251 DAQ board, BNC 2120, Polytec P612.3 piezo stage and E-664 controller and Labview 2010. The piezo displacement is proportional to the input voltage to the piezo controller. That is if I input maximum voltage 10v to controller, the piezo would move the the max. displacement of 10um. There is also a sensor inside the piezo, which could read its displacement value. Additionally, I also installed a laser Doppler velocimeter (LDV) system, which could also read the piezo's movement. This is for verification of piezo's movement.
I used the Labview DAQmx functions to perform the read and write processes. As I wanted to control 2 directions, there were 2 output channels corresponding to x and y direction respectively. And there were 3 input channals corresponding to x, y reading from the piezo sensor and also LDV system. And I wrote a algorithm to produce a trapezia output voltage profile and connected it to the input terminal of the DAQmx write VI.
The problem is that piezo sensor and LDV reading profiles seemed do not related with the writing profile. However, the LDV reading profile matched well with the piezo sensor reading profile, except for LDV having more noise. And the second confusing part is the LDV and sensor reading values had different order of magnitude from the writing values in the front panel. And also the time magnitudes were not consistent. Finally, the third question is how to set the samples to read and samples per channel values.
I have attached the VI I used and the screenshot of front panel after running. And very sorry for the mess in block diagram.
I have got stuck in this program for couple of weeks. I would very appreciate it if anyone could throw some light on it. Any comments are very welcomed!
12-09-2011 08:59 PM
sorry for a mistake. The LDV reading and sensor reading did not match well in the attach figure. At previous time, they matched well. But I don't know what changed them.
Replies from people with LabVIEW knowledge are very welcomed!
12-13-2011 12:57 PM
Greetings, I would like to help you but the issue it is still unclear to me. When you said that "
piezo sensor and LDV reading profiles seemed do not related with the writing profile..." and "The LDV reading and sensor reading did not match well..." what do you mean? Are these signals suppose to have the same shape? What is the expected behavior?
12-14-2011 12:00 PM - edited 12-14-2011 12:09 PM
thank you very much for replying.
Yes, they are supposed to have the same shapes. The write votage profile is the votage I want to input to piezo controller. And the piezo stage should move proportional to the voltage recieved at the piezo controller. That is, if I input 10 v voltage to the piezo controller, the piezo stage will have the displacement of 10um. Similarly, if 5 v, it's 5 um displacement and no displacement for 0v. So I plan to use the output anlog voltage of the DAQ board to control the movement of the piezo stage and use the input voltage of the DAQ board from the piezo sensor and the LDV system to verify if it moves as I want. The sensor reading profile comes from the displacement sensor inside the piezo. As the displacement and the voltage are proportional to each other, the two profiles should have the same shape.
The LDV system is similar to the piezo sensor. It use a laser to detect the displacement of the piezo stage based on Doppler effect. It is also used to verify the movement of the piezo stage, as the piezo stage's movement is of micrometer level and could not be directly noticed by naked eyes.
Does this make any improvement on explaining the problem? If it's not clear, please let me know.
And currently I am confused on following several questions about the LabVIEW programing?
1, Are the analog input and anlog output need to be synchronized? Do they both need to be triggered and how could the rout the trigger?
2, Could I just write an algorithm, which produce a seris of changing value of trapezium shape and line it to the data terminal of DAQmx write.vi to make the DAQ board to output the voltage profile of trapezium shape? Or do I need a function generator of the ramp wave?
3, I found some similar examples, one of which put the DAQmx write. vi inside the while loop and some others put the write.vi in front of the while loop. Do you know which is more suitable?
If you know any of it, please kindly help me.
I modified the previous VI by moving DAQmx write.VI outside the while loop, applying the timing synchronization and using waveform as the timing source. But it produce a unanmed task error and the all reading values remain 0. I have put this VI in attachment.
Please kindly give your comments and I really appreaciate it!
12-14-2011 12:47 PM - edited 12-14-2011 12:48 PM
And I tested the NEW... .vi on hardwares. It showed the error: Generation cannot be started, because the selected buffer size is too small. selected buffer size: 1, minimum required buffer size: 2. I put a screenshot of the frontpage with error in attachment.
My question is if I select use waveform as the timing type of the analog output, where could I define the buffer size ?
Thanks a lot!
12-14-2011 06:54 PM
Thanks for the clarification. I was reading the user manual for the controller (see attachment). Make sure that you have a proper Zero-Point Adjustment! And as mentioned in the manual, avoid using the BNC inputs and I/O connector at the same time, if that's the case.
1. Synchronizing will help you to avoid common problems like drift and skew. This will definitely benefit your application however you are not handling a high channel count so, in my opinion, keep it simple and avoid complications, once you have the application running as desired you can add synchronization to your code.
2. Both approaches are valid for the analog output task. If you have an example that does all the work, simply copy the code and use it in your project.
3. The DAQmx write VI needs to be inside the loop because you are using a continuos acquisition mode, if you wish to leave it out then I recommend you to use the DAQmx Is Task Done VI. Follow the link for more reference. Both configurations will deliver the same result, using Is Task Done VI is more error handling oriented, again the choice is your to take.
12-15-2011 04:03 AM
What type of velocimeter (controller) are you using?
Some controller(decoder) have a slight high pass in the displacement/velocity output to avoid drifts.
12-19-2011 05:00 PM
Thank you so much for helping me. And sorry for late reply as I got finals recently. Actually I was so stupid that I did adjust the zero point for the controller.
And when I was adjusting the zero point at step 10 "Check the PZT output range by applying a voltage which goes from 0 V to +10 V to the CONTROL INPUT and watching the voltage at the PZT." But I applied it using the VI I provided it shown no volatge change in the voltage moniter.
And now I got another ugent work to finish from my advisor. I might get back to the Labview programming later. Thanks again!
12-19-2011 05:06 PM
Thanks for replying! I am using E-664 LVPZT position servo controller for the piezo cube and OFV-2500 for vibrometer controller for the LDV system. Actually the OFV-2500 controller often shows overflow signal when I set the displacement range under 100 um. May you kindly explain some principle under this specific phenomenon?
Thanks in advance!
12-20-2011 05:28 AM
The LDV controller OFV-2500 is the same controller I use, however the build in decoder could be different ....
I only have a simple velocity decoder (mainly used for trigger) and a custom 40MHz reference and heterodyne output I capture with a 200MHz scope card and counter 🙂
The diagram shows the numeric integral of the velocity output in red and the displacement as calculated by some sort of fringe counting (green) which is pretty close to the 'real' value (u+-320nm).
(time ~10s, displacement ~50mm) of an bouncing object. The red line show a high pass characteristic.