QMAPP-mq / qudi

A modular laboratory experiment management suite.
GNU General Public License v3.0
4 stars 0 forks source link

Verify Nova Px VB Script Commands #20

Open mvbnano opened 6 years ago

mvbnano commented 6 years ago

VB Script commands have been created on branch dev_ntmdt_stage, however, some commands need to be verified by NT-MDT.

Commands to be verified include:

mvbnano commented 6 years ago

get_pos is working for x and y values (not yet z) with the below command:

command = ('{axis}Pos = GetParam(tScanner, scPosition, 0, {channel})\n\n'
           'SetSharedDataVal "shared_{axis}Pos", {axis}Pos, "F64", 8'
           .format(axis=axis, channel=channel))

To test z position (in Jupyter):

axis = 'z'
channel = 2

command = ('{axis}Pos = GetParam(tScanner, scPosition, 0, {channel})\n\n'
          'SetSharedDataVal "shared_{axis}Pos", {axis}Pos, "F64", 8'
           .format(axis=axis, channel=channel))

ntmdt_stage._run_script_text(command)

time.sleep(0.5)

ntmdt_stage._get_shared_float('shared_{axis}Pos'.format(axis=axis))

Always returns 0.0.

mvbnano commented 6 years ago

To set stage position:

command = ('SetParam tScanner, scPosition, {scanner}, {channel}, {position}\n'
           'Do\n'
           'idle\n'
           'Loop Until GetParam(tScanner, cStatus, {scanner}) = False'
           .format(channel=0, position=position, scanner=1))
mvbnano commented 6 years ago

As mentioned above, running get and set position code with scanner = 1 and channel = 2 always returns the value of 0.0.

However, it appears that running the code with scanner = 0 and channel = 0 produces a value, see below.

axis = 'z'
channel = 0
scanner = 0
position = 1.56

command = ('SetParam tScanner, scPosition, {scanner}, {channel}, {position}\n'
           'Do\n'
           'idle\n'
           'Loop Until GetParam(tScanner, cStatus, {scanner}) = False'
           .format(channel=0, position=position, scanner=1))

ntmdt_stage._run_script_text(command)

time.sleep(1)

command = ('{axis}Pos = GetParam(tScanner, scPosition, {scanner}, {channel})\n\n'  # setting argument #2 = 1 (previously 0)
           'SetSharedDataVal "shared_{axis}Pos", {axis}Pos, "F64", 8'
           .format(axis=axis, channel=channel, scanner=1))

ntmdt_stage._run_script_text(command)

time.sleep(1)

ntmdt_stage._get_shared_float('shared_{axis}Pos'.format(axis=axis))

Returns 1.5600008373963368

This might be the "tube", a separate piezo component, which will provide satisfactory control if this is true.

mvbnano commented 6 years ago

This (above comment) might not be true, as then running get_pos returned x = 1.56.

mvbnano commented 6 years ago

I have corrected the z axis control code and it is now working. Unknown travel range, possible 7 microns.

mvbnano commented 6 years ago

Movement of the tube can be implemented by changing the scanner number.

mvbnano commented 6 years ago

Confusingly, the 'tube' has 3 axes available in Nova Px. This requires clarification.

image

mvbnano commented 6 years ago

Clarification of tube axes requested. Included was for additional information about nova px thermo tab.

mvbnano commented 6 years ago

How to find the range of each axis (and for each scanner):

unnamed

Note that it also depends do you use the closed-loop control or not.