From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I make MG17Piezo ActiveX automated without using jog to move the Nanomax stage

Thank you.

 

When I run the code it gives me an error saying an invalid parameter has been set for the step size? Could you please explain a little? That would be most helpful!

 

Tania

0 Kudos
Message 11 of 39
(3,304 Views)

Sorry , missed out a word there, I meant could you please explain the code a little?

 

Thanks

 

Tania

0 Kudos
Message 12 of 39
(3,302 Views)

Can you send me error message snapshot please ?

 

Mahendar

0 Kudos
Message 13 of 39
(3,296 Views)

I have attached the files.

 

Many thanks,

 

Tania

0 Kudos
Message 14 of 39
(3,288 Views)

Sorry it didn't get attached in the previous post! Here it is!

 

Tania

0 Kudos
Message 15 of 39
(3,284 Views)

Hi Tania, 

 

As per your snapshots, you have not given control mode value as input. You have to set 1 for open loop mode and 2 for closed loop mode. When you are writing code, I think you might not have connected to hardware. If so, you have set simulation mode in APT configure( addition set up) program. See attached files.

 

mahendar

Download All
0 Kudos
Message 16 of 39
(3,274 Views)

regarding open loop mode, you can't work with setposition in this mode. I think you could try with setvolatge command in code as attached. There is a specific relation between volatage and positions and it is linear. If you go through manual, you can relaize this. the use setvolate as attached code.

 

Mahendar

0 Kudos
Message 17 of 39
(3,272 Views)

Hi Mahendar,

 

I understand.

 

In my experiment, light from the sample falls onto the surface of a photo detector which is connected to a DAQ card, I now want to add the code for this to the driver's code so that the final result is a graph of voltage versus position. I have attached the combined code for you to have a look at. Currently there is a slight difference between the time the code takes to record the position and the voltage. The end result is that I am getting four sets of results: position and its time, voltage and its time. Then I plot the data in microsoft excel and eventually get rid of the time columns.

 

Thanks,

 

Tania

 

0 Kudos
Message 18 of 39
(3,262 Views)

Hi Mahendar,

 

I think that code works fine.

 

Could you just help me understand what the part in your code at the top right does? So you enter a stepsize, it's divided by 20, then 1 is added to it then it truncates to the lowest integer? If your stepsize is 0.1 for example this comes up to a very big number? And then in the code you multiply the number of iteration by the stepsize and that gives you your position? Could you please explain these two? Why has it been set this way?

 

Many thanks!

 

Thanks

0 Kudos
Message 19 of 39
(3,246 Views)

Hi Tania

 

There are two types of inputs that can be given to piezo. if you give position, at calculates the voltage required for moving that position and initates. usually this is preferred in closed loop mode, which i am using now. Since, you asked about openloop mode, I wrote code with setvolatege command. I meant to menton the stpesize not in microns but in volts (equalent voltege of the stpe size) if you are working in openloop mode.if you work in closed loop, change setvolage to setposition. what loopmode you are working in?

 

Mahendar

0 Kudos
Message 20 of 39
(3,240 Views)